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

namespace_create.png

  1. 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.
  2. To add nodes to the tree 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. Note that nodes are saved as they are added.
  3. Continue to add and name nodes, either at the root of the tree or by building hierarchy.
  4. To add a source of data to the namespace you can either add a source to an existing node or drag & drop a new node.
    • To add a source to an existing node, select the node and enable Reference field option. Select the source type, and then select the source. Currently, Inputs and Instances are supported.
    • To create a new node that’s linked to a source, expand the reference panel on the right and navigate to the source. Drag and Drop the source from the reference panel to the tree. A new node is created that’s linked to the source that was dragged.

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.

namespace_import.png

CSV Example

js
path
site1/area1/line1
site/area1/line2

JSON Format

js
[
    {
        "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.