FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
51 stars 43 forks source link

location attribute not expanding like other core context attributes (for example status) #1670

Closed dimitriskranias closed 2 months ago

dimitriskranias commented 2 months ago

Hello everyone,

I face this rather peculiar issue of location attribute not expanding according to the core context, which I am not 100% sure it really is an issue or if it should be working like that (in the NGSI-LD specification and Orion-LD's Quick Start Guide I didn't find something that states that it shouldn't expand). I provide the data point that describes this:

{
  "_id": {
    "id": "urn:Demo3Temp:HydroPlant:002",
    "type": "https://dummyontology/v1.5/HydroPlant",
    "servicePath": "/"
  },
  "attrNames": [
    "location",
    "https://uri.etsi.org/ngsi-ld/status"
  ],
  "attrs": {
    "location": {
      "type": "GeoProperty",
      "creDate": 1726750264.2335553,
      "modDate": 1726750264.2335553,
      "value": {
        "type": "Point",
        "coordinates": [
          -3.8975999999999997,
          37.0154
        ]
      },
      "mdNames": []
    },
    "https://uri=etsi=org/ngsi-ld/status": {
      "type": "Property",
      "creDate": 1726750264.2335553,
      "modDate": 1726750264.2335553,
      "value": "OK",
      "mdNames": []
    }
  },
  "creDate": 1726750264.2335553,
  "modDate": 1726750264.2335553,
  "lastCorrelator": ""
}

As you see the type and status expands correctly using the context I provided via the link header: https://dummyontology/v1.5/orionld-context-v1.5.jsonld; rel="http://www.w3.org/ns/json-ld#context" which includes this:

{
    "@context": [
        "https://dummyontology/v1.5/dummy-context-v1.5.jsonld",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
    ]
}

The first is the URL pointing to my custom context and the second is the core context (which as stated in the NGSI-LD Specification is good practice to include in the @context Array).

So is this an omission in the Orion-LD's implementation of NGSI-LD or is it me that i haven't understood something correctly?

kzangeli commented 2 months ago

Hi, your observation is correct. The "location" attribute isn't expanded. As it is part of the core context, it will always be expanded and compacted the exact same way.

It's a design decision in Orion-LD to not expand this attribute. To save some time ...

You will see the same is valid for "observedAt" and many more names. All of them with a special mention in the ngsi-ld spec and part of the core context.

Don't worry about it. All is good :)

dimitriskranias commented 2 months ago

Thank you very much for the clarification. I was partly misled by the quick start guide which showed the status attribute that is expanded using the core context (unlike the others that you mention). Keep up the good work!