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 appended to forwarded request. #1586

Open jason-fox opened 3 months ago

jason-fox commented 3 months ago

I have a context source (Partial Broker) which includes this Entity urn:ngsi-ld:Shelf:unit001 of type:Shelf

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

I register the following inclusive registration 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://contextSource"
}'

When I query urn:ngsi-ld:Shelf:unit001 on the context broker, an Entity of type:Shelf is returned (even though I have only registered type:Building.

Specifically, the forwarded request is: /ngsi-ld/v1/entities/urn:ngsi-ld:Store:001?options=sysAttrs when it should be /ngsi-ld/v1/entities/urn:ngsi-ld:Store:001?options=sysAttrs&type=Building

or rather:

Therefore the correct compacted type should be type=Store in the forwarded request.