OpenPipeline provides dedicated stages for Smartscape ID enrichment and topology definition. This tutorial shows how to use them together with processing stages in a single pipeline for the metric configuration scope to enrich records, update nodes, and record relationships between nodes.
This tutorial uses a logistics fleet example. The fleet is described by the following metrics:
truck.fuel.total,trucknr=0123456789ABCDEF,model=company-model_1 10234truck.fuel.usage,trucknr=0123456789ABCDEF,model=company-model_1 17truck.operation.hours,trucknr=0123456789ABCDEF,model=company-model_1 23766truck.fuel.total,trucknr=9876543210XYZWMN,model=company-model_2 234truck.fuel.usage,trucknr=9876543210XYZWMN,model=company-model_2 10truck.operation.hours,trucknr=9876543210XYZWMN,model=company-model_2 13766container.temperature,containernr=865412,trucknr=0123456789ABCDEF 40container.temperature.dev,containernr=865412,trucknr=0123456789ABCDEF 0container.temperature,containernr=791590,trucknr=9876543210XYZWMN 39container.temperature.dev,containernr=791590,trucknr=9876543210XYZWMN 2.5
Each truck is an instance of a model and contains one or more containers. In this tutorial, you'll configure processors to define:
This tutorial is intended for pipeline configuration users who want to define custom topology from ingested records.
In this tutorial, you'll learn how to:
settings:objects:read and settings:objects:write with builtin:openpipeline.metrics.pipelines scope.storage:smartscape:readRequires administrator permissions (settings:objects:admin). Only administrators can enable or disable dynamic routes.
The entire configuration for trucks and containers resides in a single pipeline. Both truck and container metrics must reach the pipeline. Configure a single dynamic route for both truck.* and container.* metrics .
Create a pipeline.
Truck example.Create a dynamic route.
Truck example routematchesValue(metric.key, "truck.*") OR matchesValue(metric.key, "container.*")Truck exampleGive read and edit access to the team.
All truck and container metrics are routed to the pipeline. The team has access to the pipeline and can start configuring processing.
Before node extraction, add processed display names as new fields to the records. These names will be used later as node names.
Truck name enrichmentmatchesValue(metric.key, "truck.*")fieldsAdd truckName = concat("Truck ", trucknr)Container name enrichmentmatchesValue(metric.key, "container.*")fieldsAdd containerName = concat("Container ", containernr)Truck metrics carry a truckName field with values such as Truck 0123456789ABCDEF or Truck 9876543210XYZWMN while container metrics carry a containerName field.
Container metrics carry a trucknr metric dimension, which identifies the truck each container belongs to. In later steps, you'll extract nodes for trucks and containers and record the truck-container relationship as a static edge on the container node. To do so, the container metric needs to carry a truck Smartscape ID—without updating the truck node.
Truck for relationshipmatchesValue(metric.key, "container.*")CUSTOM_TRUCK. The Node ID field name is automatically created (dt.smartscape.custom_truck).nrtrucknrContainer metrics now carry dt.smartscape.custom_truck, ready to be referenced as a static edge in the next step.
Extract a container node from every container metric, using the containerName field derived in the Processing stage as the display name, and link it to its truck via a static edge using the dt.smartscape.custom_truck ID calculated in the previous step.
Container fullmatchesValue(metric.key, "container.*")CUSTOM_CONTAINER. The Node ID field name is automatically created (dt.smartscape.custom_container).nrcontainernrcontainerNamenrcontainernrbelongs_to.CUSTOM_TRUCK in the CUSTOM_NodeType field. The Referenced field name is automatically created (dt.smartscape.custom_truck).Each container node is extracted and linked to its truck via a static belongs_to.CUSTOM_TRUCK edge.
Truck metrics include a model dimension. Extract each unique model as a CUSTOM_TRUCK_MODEL node. This step also makes dt.smartscape.custom_truck_model available on truck metrics, which the next step references as a static edge.
Truck model for relationshipmatchesValue(metric.key, "truck.*")CUSTOM_TRUCK_MODEL. The Node ID field name is automatically created (dt.smartscape.custom_truck_model).modelmodelmodel in the Node name field.A CUSTOM_TRUCK_MODEL node is created for each distinct model value, for example, company-model_1 and company-model_2.
Extract a truck node from every truck metric, holding the truck number and name, and link it to its model via a static edge using the dt.smartscape.custom_truck_model ID calculated in the previous step.
Truck fullmatchesValue(metric.key, "truck.*")CUSTOM_TRUCK. The Node ID field name is automatically created (dt.smartscape.custom_truck).nrtrucknrtruckName in the Node name field.model and the referenced field name model.nr and the referenced field name trucknr.CUSTOM_TRUCK_MODEL in the CUSTOM_NodeType field. The Referenced field name is automatically created (dt.smartscape.custom_truck_model).Each truck node is extracted with its display name and custom fields, and linked to its model via a static instance_of.CUSTOM_TRUCK_MODEL edge.
The previous processors calculated the Smartscape IDs, dt.smartscape.custom_truck and dt.smartscape.custom_container, and added them to all container records. Container metrics carry both container and truck information and so, both Smartscape IDs are present on the same record, allowing the edge processor to extract a dynamic edge between the two nodes.
Truck and container from container metricmatchesValue(metric.key, "container.*")CUSTOM_TRUCK. The Source ID field name is automatically created (dt.smartscape.custom_truck).contains.CUSTOM_CONTAINER in the Target type field. The Target ID field name is automatically created (dt.smartscape.custom_container).For every container metric, OpenPipeline records a dynamic CUSTOM_TRUCK contains CUSTOM_CONTAINER edge.
Query nodes and relationships in Notebooks.
Go to
Notebooks and open a new notebook.
Select > DQL.
Query all extracted truck nodes:
smartscapeNodes CUSTOM_TRUCK| fields id, name, model
Query truck model nodes:
smartscapeNodes CUSTOM_TRUCK_MODEL| fields id, name
Traverse from trucks to the containers they carry (dynamic edge):
smartscapeNodes CUSTOM_TRUCK| traverse contains, CUSTOM_CONTAINER| fields truck = sourceName, container = targetName
Smartscape edges can't be filtered or listed independently. You can only access them in the context of a source or target node using traverse.
You can see your custom nodes and traverse both static and dynamic relationships.
Explore topology in Smartscape.
CUSTOM_TRUCK to view the truck instances and their connected containers and models.You've defined custom topology using a single pipeline. Here's what you accomplished:
CUSTOM_TRUCK, CUSTOM_TRUCK_MODEL, and CUSTOM_CONTAINER nodes in the Smartscape node stage.instance_of, belongs_to) directly from the node extraction processors.contains edge between trucks and containers in the Smartscape edge stage.