Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type not appended to forwarded request. #1586

Open
jason-fox opened this issue Mar 18, 2024 · 0 comments
Open

type not appended to forwarded request. #1586

jason-fox opened this issue Mar 18, 2024 · 0 comments
Assignees

Comments

@jason-fox
Copy link
Member

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:

  • type=Building expands to https://uri.fiware.org/ns/data-models#Building using this context

  • https://uri.fiware.org/ns/data-models#Building compacts to Store using this context which has been defined in the jcontextSourceInfo.sonldContext

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

@kzangeli kzangeli self-assigned this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants