Query the Digital Twin Registry

To only work with those digital twins that are relevant for your current use case, you can define filters.

Filtering reduces the amount of results by given filter criteria and returns a subset of the digital twins. The Digital Twin Registry supports RQL filters.

For more information about using RQL filters when querying the Digital Twin Registry, refer to Find digital twins.

Hands on

Let’s query the Digital Twin Registry using filters. In case you have skipped trying out the Postman collection B3, now is the time do so.

  • Reuse the prepared environment file

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

You can, for example, duplicate the example "Get by Movement Aspect" and create a request which queries for all digital twins with a Temperature aspect.

As you will see, only the filter will need to be changed, namely to

like(aspects.modelReference.urn,"urn:samm:com.bosch.nexeed.digitaltwin:1.0.0#Temperature")

(The full urn can be copied from the result of "Get all existing Twins".)

Expected response: 2 twins, namely Machine 1 and Machine 2.

D1 filter on url
In case you run into an error, consider that the filter will be part of the request URL and will therefore need to be URL-encoded. In fact, you will need to set the filter parameter as follows:
like(aspects.modelReference.urn,"urn:samm:com.bosch.nexeed.digitaltwin:1.0.0%23Temperature")