Question regarding DTDL and eTag [SOLVED]

Argianto Rahartomo 31 Reputation points
2022-10-12T06:07:00.333+00:00

Dear all,
I want to ask two questions that a little bit in conceptual level (perhaps).

1) In DTDL, we notice that there is "@" (without quote) in front of id, context, and type. However, not in front of displayName, name, etc. Are there any reasons behind it? What was the idea? what it represents? and what makes it different with others (for those which is not having) and so on.

2) In our 3D explorer, we notice there is an etag (Entity Tag) that (CMIIW) represents an id to identifier versioning of the entity with respect to its activities that happens. How this eTag is generated? Where we (as a developer or end user) can see the eTag collection or database? and if there is any, how one can interpret it?

Best Regards,
AR

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
220 questions
0 comments No comments
{count} vote

Accepted answer
  1. QuantumCache 20,031 Reputation points
    2022-10-12T18:44:51.673+00:00

    Hello @Argianto Rahartomo , this is a great question!

    Could you please add the use case or scenario for which you are looking to access the eTag collection?

    1) Metadata or system information that isn't part of the DTDL definition is returned with a $ prefix. You can learn more here: Manage digital twins - Azure Digital Twins | Microsoft Learn

    2) Have you tried running query "SELECT * FROM DIGITALTWINS"? This to get the list of digital twins, including their etags. If you want to project twin properties, say dtId and etags, you can run sthg like "SELECT T.$dtId, T.$etag FROM DIGITALTWINS T". Have a look here: Azure Digital Twins query language reference - SELECT clause - Azure Digital Twins | Microsoft Learn

    ADT Explorer only surfaces data from the web server, it doesn't generate this field.

    You can learn more how to leverage the appropriate APIs/SDKs to do so here: Manage digital twins - Azure Digital Twins | Microsoft Learn

    Azure Digital Twins APIs and SDKs - Azure Digital Twins | Microsoft Learn

    {  
      "$dtId": "myMoon-001",  
      "$etag": "W/\"e59ce8f5-03c0-4356-aea9-249ecbdc07f9\"",  
      "radius": 1737.1,  
      "mass": 0.0734,  
      "$metadata": {  
        "$model": "dtmi:example:Moon;1",  
        "radius": {  
          "desiredValue": 1737.1,  
          "desiredVersion": 5,  
          "ackVersion": 4,  
          "ackCode": 200,  
          "ackDescription": "OK"  
        },  
        "mass": {  
          "desiredValue": 0.0734,  
          "desiredVersion": 8,  
          "ackVersion": 8,  
          "ackCode": 200,  
          "ackDescription": "OK"  
        }  
      }  
    }  
    

    The defined properties of the digital twin are returned as top-level properties on the digital twin. Metadata or system information that isn't part of the DTDL definition is returned
    with a $ prefix. Metadata properties include the following values:

    $dtId: The ID of the digital twin in this Azure Digital Twins instance
    $etag: A standard HTTP field assigned by the web server. This is updated to a new value every time the twin is updated

    BasicDigitalTwin.ETag Property

    A string representing a weak ETag for the entity that this request performs an operation against, as per RFC7232.

    249835-image.png

    Updated:
    Azure Digital Twins data history (with Azure Data Explorer)
    If configured you can see the history all twin properties here...!

    251692-image.png

    If the response is helpful, please click "Accept Answer" and upvote it.


0 additional answers

Sort by: Most helpful