Skip to content

soferreira/ADT-query-relationship-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

ADT - Query the Properties of a Relationship

This sample demonstrates how to query a specific property of a relationship.

Similarly to the way digital twins have properties described, relationships can also have properties. You can query twins based on the properties of their relationships. The Azure Digital Twins query language allows filtering and projection of relationships, by assigning an alias to the relationship within the JOIN clause.

For the purpose of this sample we will query the following ADT Model: Example of a simplified Azure Digital Twins Model.

Twin Graph

Consider the assignedProductionLine relationship that was defined with two properties, productionManager and inProduction. Ensure that the properties are set.

Finally, query the Twin Graph using the query bellow.

SELECT T, CT 
FROM DIGITALTWINS T 
JOIN CT RELATED T.assignedProductionLine R 
WHERE T.$dtId = 'ord_Muc_01' 
AND R.inProduction = True

The result will be relationships of type assignedProductionLine, associated with the twin ord_Muc_01 where the property inProduction = True.

Twin Graph Result

About

Query twins based on the properties of their relationships

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published