Stellio Types
The node queries the data model endpoints of the Stellio context broker: all entity types, the details of one type, all attributes or the details of one attribute. It changes no data and serves as a reference while building flows. A Browser tab shows the data model overview directly in the editor.
- Node type
- stellio-types
- Package
- @htag/node-red-contrib-hypertegrity-ngsi-ld
- Inputs / outputs
- 1 / 1
- Target
- Stellio context broker (NGSI-LD)
When to use this node
Before you query entities or create subscriptions, you need to know which types and attributes a tenant actually contains. Stellio Types delivers this overview from the broker itself, so you do not have to rely on documentation or guesswork.
Typical use cases are:
- Explore a data space: list all entity types of a tenant with attribute names and instance counts.
- Prepare flows: look up the exact attribute names of a type to write q-filters or watched attributes correctly.
- Monitoring: regularly check whether expected types exist and how many instances there are.
How the node works
Determine operation
msg.operation or the configured action chooses between List Types, Get Type, List Attributes and Get Attribute.
Send request
The node calls /ngsi-ld/v1/types, /types/<type>, /attributes or /attributes/<attribute> with tenant and Link headers.
Emit response
Response body, status code and headers are written into the message.
Result: A type or attribute list, or the details of one type or attribute, in msg.payload.
The node is message-driven and triggers exactly one read request per incoming message. The Browser tab loads the data model overview through the admin endpoints of the Node-RED server; clicking a row shows the details of the type.
Configuration
The dialog has the tabs Aktion (action) and Browser. All stored fields are on the action tab.
Action tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Name | Text | empty | Display name of the node in the flow. Without a name the node shows Types: <action>. |
| API URL | Text | ${STELLIO_API_URL} | Base URL of the broker. Placeholders ${VAR} are replaced at runtime; empty means fallback to the environment variable STELLIO_API_URL. |
| Tenant | Text | empty | Value of the NGSILD-Tenant header. Empty: default tenant of the broker. |
| Context | Text | see below | JSON-LD context for the Link header. Determines whether type and attribute names come back short or as full URIs. |
| Aktion (action) | Select | List Types | List Types (all entity types), Get Type (details of one type), List Attributes (all attributes), Get Attribute (details of one attribute). |
| Type | Text | empty | Type name for Get Type, for example Device. |
| Attribut (attribute) | Text | empty | Attribute name for Get Attribute, for example temperature. |
| Include details | Checkbox | on | Sends details=true. List Types and List Attributes only: returns an object per entry with attribute names or type names instead of a plain name list. |
Default values of the URL fields:
Context: https://context.${DOMAIN}/main-context.jsonld
Browser tab
The Laden (load) button queries /types?details=true and shows the attribute names and the number of instances per type. Clicking a row loads /types/<type> and shows the response as JSON. The tab uses the connection from the action tab and stores nothing.
Input
Values from the message take precedence over the configuration.
| Property | Type | Meaning |
|---|---|---|
msg.operation | string | listTypes, getType, listAttributes or getAttribute. Unknown values are treated as listTypes. |
msg.apiUrl | string | Overrides the API URL. |
msg.tenant | string | Overrides the tenant. |
msg.contextUrl | string | Overrides the context (Link header). |
msg.typeName | string | Type name for getType. |
msg.attrName | string | Attribute name for getAttribute. |
msg.details | boolean | Overrides the Details checkbox for listTypes and listAttributes. |
msg.payload | any | Not evaluated; the message only acts as trigger. |
Output
The message is extended with the broker response. For listTypes with details enabled, msg.payload contains for example:
[
{
"id": "https://smartdatamodels.org/dataModel.Weather/WeatherObserved",
"type": "EntityType",
"typeName": "WeatherObserved",
"attributeNames": ["dateObserved", "location", "temperature", "relativeHumidity"]
},
{
"id": "https://smartdatamodels.org/dataModel.Device/Device",
"type": "EntityType",
"typeName": "Device",
"attributeNames": ["controlledProperty", "location", "serialNumber"]
}
]
For getType the broker returns an EntityTypeInformation object with typeName, entityCount and attributeDetails; for listAttributes and getAttribute it returns Attribute objects with attributeName, attributeCount and typeNames accordingly. The exact structure follows the NGSI-LD specification.
| Field | Meaning |
|---|---|
msg.payload | Broker response body: array of type or attribute objects (with details), object with typeList or attributeList (without details), or the detail object of one type or attribute. |
msg.statusCode | HTTP status code of the response. |
msg.headers | Response headers of the broker. |
Example flow
The package ships with a shared example flow for several Stellio nodes. You can import it in Node-RED via Menu → Import → Examples → @htag/node-red-contrib-hypertegrity-ngsi-ld → stellio-helper-nodes. The Stellio Types node is currently not included in this shared example; the following excerpt therefore shows a minimal wiring of this node.
Inject
An Inject node triggers the query manually or at a fixed interval.
Stellio Types
The node lists all entity types of the tenant with details using the List Types action.
Debug
A Debug node shows the type list in the sidebar.
Show example flow as JSON
[
{"id": "tab1", "type": "tab", "label": "Stellio Helper Nodes", "disabled": false, "info": ""},
{"id": "inject1", "type": "inject", "z": "tab1", "name": "", "props": [{"p": "payload"}], "repeat": "", "once": false, "payload": "", "payloadType": "date", "x": 160, "y": 100, "wires": [["types1"]]},
{"id": "types1", "type": "stellio-types", "z": "tab1", "name": "", "apiUrl": "${STELLIO_API_URL}", "tenant": "default_dataspace", "contextUrl": "https://context.${DOMAIN}/main-context.jsonld", "operation": "listTypes", "typeName": "", "attrName": "", "details": true, "x": 400, "y": 100, "wires": [["debug1"]]},
{"id": "debug1", "type": "debug", "z": "tab1", "name": "Types", "active": true, "tosidebar": true, "complete": "payload", "targetType": "msg", "x": 640, "y": 100, "wires": []}
]
Status and errors
| Indicator | Meaning |
|---|---|
| Blue dot "listTypes…" (or name of the operation) | The request is running. |
| Green dot "status 200" | Operation successful with status 2xx. |
| Yellow ring "status 404" (or another status code) | The broker answered with an error status, for example because the type or attribute does not exist. The message is still sent. |
| Red ring "error" with error "operation "getType" requires a typeName" | The type name is missing for Get Type. |
| Red ring "error" with error "operation "getAttribute" requires an attrName" | The attribute name is missing for Get Attribute. |
| Red ring "error" with error "Stellio API URL is required (config, msg.apiUrl or STELLIO_API_URL)" | No API URL could be determined. |
| Red ring "error" with network message or "timeout of 30000ms exceeded" | Broker unreachable or no answer within 30 seconds. |
Errors are reported via node.error and can be handled with a Catch node.
Notes
- Read-only: The node performs GET requests only and changes no data in the broker.
- Authentication: The node sends no authentication headers; access to the broker is protected by the network or an upstream gateway.
- Context: Without a matching context the broker returns type and attribute names as full URIs. For short names use the same context the entities were written with.
- Admin endpoints: The Browser tab uses
/stellio-helper/browseof the Node-RED server (permissionstellio.read). - Personal data: Type and attribute lists usually contain no personal data. Attribute names may however hint at sensitive content; treat the output accordingly.