Read digital twins and their aspects

Now that you have some digital twins registered, let’s learn more about how to retrieve this valuable data from the registry.

The Postman collection prepared to achieve the demo scenario is already prepared and ready-to-use.

  • Reuse the prepared environment file from the previous section.

  • Import and run all requests prepared in B3-get-twins.json.

GET all twins

This request will return all twins with all data accessible for the authenticated client.

Example: You need to know the number of total twins registered for your tenant.

Expected response: itemCount should be 6 as long as you work with the demo scenario.

GET twins by local identifier - VIN

Requesting a twin by its local identifier returns the complete structure and all latest values known for the twin.

Example: You need to know more details about a specific twin.

Note that the request URL is now followed by a filter:
filter=eq(localIdentifiers.localIdentifierKeyPairs.vin, "JA4DB1A40PS000X84")

Expected response: the full twin of the one specific car with the VIN number requested.

GET twins by aspect - Movement

This request will return all twins using the Movement 1.0.0 aspect. If you follow the demo setup, the request should reveal that 4 twins use it, namely Car 1, Car 2, AGV 1 and AGV 2.

Example: You need to know the number of all mobile twins registered for your tenant.

Note that the filter uses the like operator which also allows star * .

filter=like(aspects.modelReference.urn,"urn:samm:org.eclipse.esmf.examples.movement:*")

This supports you to query for all twins with movement, regardless of the Movement Aspect Model’s version number.

Expected response: four twins have the Movement aspect.

The aspect’s httpEndpoint holds the link to the "implementation", which is the data source for the property values.

get twins movement

Summary

In this section you have learned how to use the Digital Twin Registry by API.