$metadata.$model missing from query response

Ismael Ibuan 136 Reputation points
2021-09-14T13:37:40.22+00:00

When I use this query to pull the twins of specific models, the return does not include the $metadata.$model property. This happened all of a sudden, the $model property used to be included on the result.

QUERY:

SELECT space FROM DIGITALTWINS space JOIN level RELATED space.isPartOf WHERE space.$metadata.$model IN [ {list of models here} ] AND level.$dtId = 'levelId'

SAMPLE SPACE OBJECT returned:

{
    "space": {
        "$metadata": {
            "name": {
                "lastUpdateTime": ""
            },
            "externalIds": {
                "lastUpdateTime": ""
            }
        },
        "$dtId": "",
        "$etag": "",
        "name": "",
    }
}

Also, I tried using simple queries like
SELECT * FROM DIGITALTWINS T WHERE T.$dtId = 'id'
and $metadata.$model property was there. It seems like the issue is happening only when using JOIN.

UPDATE:
I have a similar branch deployed on 2 different environments. The ADT on the environment deployed on West Europe has this issue, but the one on East US works just fine.

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.
219 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ismael Ibuan 136 Reputation points
    2021-09-16T08:49:00.323+00:00

    Updating the query to this worked.

    SELECT space FROM DIGITALTWINS space JOIN level RELATED space.isPartOf WHERE level.$dtId = 'levelId' AND ( IS_OF_MODEL(space, 'dtmi:example:space:room;1') OR IS_OF_MODEL(space, 'dtmi:example:space:room;2'))
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points
    2021-09-15T20:31:04.39+00:00

    Hello @Ismael Ibuan Thanks for reaching out on this forum,

    Have you seen any error messages in the output console window? I tried few queries in ADT-WestEurope and I can see the results, please let me know if you have tried the below queries?

    SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$dtId = 'Floor1'  
    SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$metadata.$model ='dtmi:example:Floor;1' AND Floor.$dtId = 'Floor0'  
    SELECT Floor, Room FROM DIGITALTWINS Floor JOIN Room RELATED Floor.contains WHERE Floor.$metadata.$model IN ['dtmi:example:Floor;1','dtmi:example:Floor;0'] AND Floor.$dtId = 'Floor0'  
    

    132447-image.png

    0 comments No comments