Filtering results
This section will explain how to filter your results more specifically by including relationships and single properties into the result of digital twins. The first example returns not only the digital twins, but also the relationships between the digital twins, by using something we call projection.
Projection means that we define a name for the relationship, and in case of the query, the JOIN
operation. A small example will explain this more clearly. Normally, a JOIN
operation would be specified as follows:
SELECT BU,FL FROM DIGITALTWINS BU JOIN FL RELATED BU.has WHERE BU.$dtId='centralbuilding'
Now, we use projection to also return the relationship. Enter this query in the Query field, and click the Run Query button in Azure Digital Twins Explorer:
SELECT BU,FL,BF FROM DIGITALTWINS BU JOIN FL RELATED BU.has BF WHERE BU.$dtId='centralbuilding'
The result is shown in Figure 7.17: