Namespace
A namespace organizes sources of data into a logical hierarchy. A common use of namespaces is to organize an ISA-95 hierarchy of sites, areas, and lines and then populate this with modeled data like motors, machines, and other assets.
Once a namespace is built the Smart Query Stage in pipelines is used to query the namespace, either in logical parts or as a whole. For example, a smart query can read all the motors in the namespace and publish the data to MQTT using the namespace hierarchy as the topic path.
Creating a namespace
- Navigate to Namespaces
- Click Namespaces in the configuration’s Main Menu to open up the namespace
- There is only one namespace but the namespace can have multiple root nodes
- Add Namespace Nodes
- Click the + icon at the top of the tree.
- Enter the name of the node in the tree and hit Enter to add the node.
- Continue to add and name nodes, either at the root of the tree or by building hierarchy
- Note: that nodes are saved as they are added
- Add a source of data to the namespace (Currently Inputs, Instances, and Callable Pipelines are supported)
- Manual - Select an existing node, and enable the
Reference
field. Then, select a type and source. - Drag and Drop - Sources can be dragged from the reference panel on the right
- Drag a source on to the
Reference
area of an existing node to update it’s source - Drag a source in to the tree to create a new node with that source at that position
- Drag a source on to the
- Manual - Select an existing node, and enable the
- Reorder the namespace
- Nodes can be reordered within the namespace by dragging the node to a new position
Passing Parameters
Inputs and Instances
Parameters passed to Inputs and Instances must be valid JSON objects.
Parameter values can be accessed using the {{this.myParameter}}
syntax. (For more information see Templating)
Pipelines
Parameters are passed to Callable Pipelines in event.value.
Supported values:
- Primitive values: String, number, boolean
- Objects
- Arrays
Unsupported values
- Expressions
- JavaScript
- null
- undefined
Note: Leaving parameters empty will default to an empty object {}
Test reading a namespace
To test read the namespace, select the Read Node at the bottom. This reads the full namespace and returns the result as JSON.
Importing a Namespace
To quickly build a namespace, select the Import
icon above the Namespace tree. Supported import formats include CSV and JSON. Merge makes the import additive, and Replace deletes the existing
namespace and replaces it with the imported one.
Note imports do not support linking sources to a node. If Merge is used, and the node already exists, the reference/source configuration is left as is.
CSV Example
path
site1/area1/line1
site/area1/line2
JSON Format
[
{
"path": "site1/area1/line1"
},
{
"path": "site1/area1/line2"
}
]
Smart Query
Smart queries allow you to dynamically query the namespace to read only the data you need. See the Smart Query Stage for details on the smart query stage.