Dan Benitah

Azure Digital Twins new Multi join query feature

Microsoft's Azure Digital Twins Preview v2 team has released a new feature. It allows to query the twin graph with up to 5 joins.

Concretely, what that has meant for me is that I can surface some aggregates a lot more easily. In my case, I have a list of buildings, that have floors, that have zones, that have desks and rooms (aka Spaces), and finally that have sensors.

I needed to be able to run quick aggregate from the building or floor perspective. For example, using occupancy sensors, this allows me to quickly find out occupancy per floor.

The following would return all the nodes (all sensors in my case) contained in my spaces (i.e. desks and rooms):

SELECT Sensor
FROM DIGITALTWINS Building
JOIN Floor RELATED Building.contains
JOIN Zone RELATED Floor.contains
JOIN Space RELATED Zone.contains
JOIN Sensor RELATED Space.contains
WHERE Building.$dtId = 'myBuildingId'

See github issue for references.

What challenge did that solve for you? Use Twitter (#AdtMultiJoin?) to let me know... :)


Dan Benitah

Written by Dan Benitah, London, UK.