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
49 stars 40 forks source link

`type` not recompacted for federated entity. #1587

Open jason-fox opened 3 months ago

jason-fox commented 3 months ago

I have a partial context broker which is returning a fixed context:

{
    "@context": [
        "http://context/fixed-context.jsonld",
        "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld"
    ],
    "id": "urn:ngsi-ld:Store:001",
    "type": "Store",
...
}

Where according to fixed-context.jsonld Store expands to https://uri.fiware.org/ns/data-models#Building .

I register buildings on the context broker:

curl -L 'http://localhost:1026/ngsi-ld/v1/csourceRegistrations/' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json' \
-H 'Content-Type: application/json' \
-d '{
    "type": "ContextSourceRegistration",
    "information": [
        {
            "entities": [
                {
                    "type": "Building"
                }
            ]
        }
    ],
    "contextSourceInfo": [
        {
            "key": "jsonldContext",
            "value": "http://context/fixed-context.jsonld"
        }
    ],
    "mode": "inclusive",
    "operations": [
        "federationOps"
    ],
    "endpoint": "http://adapter:3000"
}'

And retrieve via the context broker:

curl -L 'http://localhost:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001' \
-H 'Link: <http://context/ngsi-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json' \
-H 'Accept: application/ld+json'

The retrieved entity DOES NOT COMPACT the type:

{
    "@context": "http://context/ngsi-context.jsonld",
    "id": "urn:ngsi-ld:Store:001",
    "type": "https://uri.fiware.org/ns/data-models#Building",
 ...
}