Querying the Graph
Overview
AgeDigitalTwins supports two query languages:
- Azure Digital Twins Query Language: Refer to the official documentation.
- Cypher: Built on Apache AGE, Cypher queries provide powerful graph querying capabilities.
The used query language is automatically detected based on the query syntax.
Cypher Query Language for Digital Twins
Basic Queries
- Find all twins:
- Find relationships:
Using digitaltwins.is_of_model
- Find twins of a specific model:
ADT Query Functions and Cypher Equivalents
ADT Query Function | Cypher Equivalent |
---|---|
IS_OF_MODEL | digitaltwins.is_of_model |
STARTSWITH | STARTS WITH |
ENDSWITH | ENDS WITH |
CONTAINS | CONTAINS |
IS_NULL | IS NULL |
IS_DEFINED | IS NOT NULL |
For more examples, refer to the AdtQueryToCypherTests.cs.