Using the Digital Twin Registry#

This walkthrough registers a motor AAS Descriptor, verifies automatic Discovery synchronization, resolves the AAS from asset information, retrieves its descriptor, and exercises the DTR-specific AssetLink and filtering behavior.

Note

For a secured DTR walkthrough with asset lookup and BPN-based visibility, see the BaSyx Digital Twin Registry Example.

The examples use the unsecured Docker Compose setup at http://localhost:5004 with an empty context path. Run them in order against an example database and save the JSON files in your working directory. The curl commands are single-line commands usable in Bash. In Windows PowerShell, invoke curl.exe instead of curl.

For generic descriptor CRUD, nested Submodel Descriptors, structured queries, pagination, and bulk operations, see Using the AAS Registry. For the standalone Discovery replacement workflow, see Using Basic Discovery.

Register an AAS Descriptor#

Save this as dtr-descriptor.json:

{
  "id": "urn:example:aas:dtr:1",
  "idShort": "MotorDTR",
  "assetKind": "Instance",
  "assetType": "Motor",
  "globalAssetId": "urn:example:asset:dtr:1",
  "specificAssetIds": [
    {
      "name": "serialNumber",
      "value": "SN-DTR-001",
      "externalSubjectId": {
        "type": "ExternalReference",
        "keys": [
          { "type": "GlobalReference", "value": "PUBLIC_READABLE" }
        ]
      }
    }
  ],
  "endpoints": [
    {
      "interface": "AAS-3.2",
      "protocolInformation": {
        "href": "https://example.com/shells/dXJuOmV4YW1wbGU6YWFzOmR0cjox",
        "endpointProtocol": "https"
      }
    }
  ]
}

Register the descriptor:

curl -i -X POST http://localhost:5004/shell-descriptors -H 'Content-Type: application/json' --data-binary '@dtr-descriptor.json'

Expect 201 Created. Because the request omits the DTR-specific top-level createdAt, the database assigns it. Retrieve the descriptor afterward to obtain the stored createdAt value. The DTR also makes the descriptor’s specificAssetIds available through Discovery and generates a globalAssetId AssetLink. No separate Discovery registration is required.

The example marks the serial-number link PUBLIC_READABLE. This affects AssetLink matching when a restricted ABAC read policy is active. It does not by itself authorize access to an endpoint. See Security and Visibility Semantics.

Discover and Retrieve the Descriptor#

Save this as lookup.json:

[
  { "name": "serialNumber", "value": "SN-DTR-001" }
]

Resolve the asset identity to an AAS identifier:

curl -i -X POST 'http://localhost:5004/lookup/shellsByAssetLink?limit=10' -H 'Content-Type: application/json' --data-binary '@lookup.json'

Expect 200 OK. In a database containing only this example, the response contains the unencoded AAS identifier:

{
  "paging_metadata": {},
  "result": ["urn:example:aas:dtr:1"]
}

Use its encoded form to retrieve the descriptor from the AAS Registry API:

curl -i http://localhost:5004/shell-descriptors/dXJuOmV4YW1wbGU6YWFzOmR0cjox

This completes the combined DTR flow: register a descriptor, discover its AAS identifier from asset information, and retrieve its endpoint metadata. An unmatched lookup returns 200 OK. A DTR empty page can omit result, so treat an absent result as an empty array.

To discover by the global asset identifier instead, use {"name":"globalAssetId","value":"urn:example:asset:dtr:1"} in lookup.json. Knowing that value can reveal the associated AAS identifier, but it does not grant permission to read the descriptor.

Filter by DTR Creation Time#

Copy the top-level createdAt from the retrieved descriptor and use it as RETURNED_CREATED_AT below:

curl -i -G http://localhost:5004/shell-descriptors --data-urlencode 'createdAfter=RETURNED_CREATED_AT'

The RFC 3339 comparison is inclusive, so the example descriptor is eligible when the filter equals its stored DTR createdAt. POST /lookup/shellsByAssetLink accepts the same query parameter. This timestamp is separate from the descriptor’s administration timestamps. A client can supply top-level createdAt on creation, so it is not necessarily the wall-clock registration time. See createdAt and createdAfter.

Remove the Example Registration#

Delete the descriptor:

curl -i -X DELETE http://localhost:5004/shell-descriptors/dXJuOmV4YW1wbGU6YWFzOmR0cjox

Expect 204 No Content. The descriptor and its synchronized AssetLinks are removed. Subsequent lookups by the example asset identities no longer find the AAS. This does not delete AAS or Submodel content from a Repository.

Calling DELETE /lookup/shells/{aasIdentifier} has a different lifecycle: it removes the AAS identifier’s AssetLinks but leaves the AAS Descriptor itself. The descriptor’s dedicated globalAssetId field remains, while its Discovery mapping and returned specificAssetIds are removed until a later descriptor write synchronizes them again.