IndustryFusion / DigitalTwin

This repository contains the ingredients for the Digital Twin Concept of Industry Fusion.
Apache License 2.0
33 stars 20 forks source link

Scorpio not fully resolving JSON-LD context #532

Closed wagmarcel closed 7 months ago

wagmarcel commented 7 months ago

{ "@context": "https://industryfusion.github.io/contexts/staging/example/v0.1/context.jsonld", "id": "urn:cutter:1", "type": "iffBaseEntities:Machine", "iffBaseEntities:hasState": [ { "type": "Property", "value": { "@id": "base:state_ON" }}] }

Scorpio v3 does not resolve "base:state_ON" but JSON-LD playground does resolve it (according to JSON-LD specification). Q. How about Scorpio v4? If it is not resolving correctly we need to file an issue.

MericFeyz commented 7 months ago

Tested on the upstream development branch and inserted the given object. Afterwards queried it through a GET request:

{
  "id":"urn:cutter:1",
  "type":"https://industryfusion.github.io/contexts/example/v0/base_entities/Machine",
  "https://industryfusion.github.io/contexts/example/v0/base_entities/hasState":{
    "type":"Property",
    "value":{
      "type":"Property",
      "value":{
        "id":"base:state_ON"
      }
    }
  },
  "@context":[
    "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld"
  ]
}

The context in the @id has not been resolved. It is also the same way in the dataset, only with more metadata:

{
  "@id":"urn:cutter:1",
  "@type":[
    "https://industryfusion.github.io/contexts/example/v0/base_entities/Machine"
  ],
  "https://uri.etsi.org/ngsi-ld/createdAt":[
    {
      "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
      "@value":"2024-04-19T12:49:49.223000Z"
    }
  ],
  "https://uri.etsi.org/ngsi-ld/modifiedAt":[
    {
      "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
      "@value":"2024-04-19T12:49:49.223000Z"
    }
  ],
  "https://industryfusion.github.io/contexts/example/v0/base_entities/hasState":[
    {
      "@type":[
        "https://uri.etsi.org/ngsi-ld/Property"
      ],
      "https://uri.etsi.org/ngsi-ld/hasValue":[
        {
          "@type":[
            "https://uri.etsi.org/ngsi-ld/Property"
          ],
          "https://uri.etsi.org/ngsi-ld/hasValue":[
            {
              "@id":"base:state_ON"
            }
          ],
          "https://uri.etsi.org/ngsi-ld/createdAt":[
            {
              "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
              "@value":"2024-04-19T12:49:49.223000Z"
            }
          ],
          "https://uri.etsi.org/ngsi-ld/modifiedAt":[
            {
              "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
              "@value":"2024-04-19T12:49:49.223000Z"
            }
          ]
        }
      ],
      "https://uri.etsi.org/ngsi-ld/createdAt":[
        {
          "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
          "@value":"2024-04-19T12:49:49.223000Z"
        }
      ],
      "https://uri.etsi.org/ngsi-ld/modifiedAt":[
        {
          "@type":"https://uri.etsi.org/ngsi-ld/DateTime",
          "@value":"2024-04-19T12:49:49.223000Z"
        }
      ]
    }
  ]
}
MericFeyz commented 7 months ago

Created an issue on the ScorpioBroker repository:

MericFeyz commented 7 months ago

Fixed with https://github.com/ScorpioBroker/ScorpioBroker/pull/552