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

@none not supported by LanguageProperty #1314

Open
jason-fox opened this issue Jan 13, 2025 · 0 comments
Open

@none not supported by LanguageProperty #1314

jason-fox opened this issue Jan 13, 2025 · 0 comments

Comments

@jason-fox
Copy link
Contributor

Stellio 2.18.1

Creating an Entity with a language property and the index value @none . According to JSON-LD @none is the equivalent of "default" language, since it isn't "en" or "de" or "jp"

From the JSON-LD Spec

@none

Used as an index value in an index map, id map, language map, type map, or elsewhere where a map is used to index into other values, when the indexed node does not have the feature being indexed.

curl -L 'http://localhost:8080/ngsi-ld/v1/entities/' \
-H 'Content-Type: application/json' \
-H 'Link: <http://context/user-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \
--data-raw '{
    "id": "urn:ngsi-ld:Building:barn002",
    "type": "Building",
    "name": {
        "type": "LanguageProperty",
        "languageMap": {
            "@none": "The Big Red Barn",
            "en": "Big Red Barn",
            "de": "Große Rote Scheune",
            "ja": "大きな赤い納屋"
        }
    }
}'

Attribute is not created ❌

{
    "type": "https://uri.etsi.org/ngsi-ld/errors/BadRequestData",
    "title": "The JSON-LD object contains a member with invalid characters (4.6.2): @none",
    "status": 400,
    "detail": "If you have difficulty identifying the exact cause of the error, please check the list of some usual causes on https://stellio.readthedocs.io/en/latest/TROUBLESHOOT.html . If the error is still not clear or if you think it is a bug, feel free to open an issue on https://github.com/stellio-hub/stellio-context-broker",
    "instance": "/ngsi-ld/v1/entities"
}

Removing the @none and the LanguageProperty is created just fine.

Also note that since @none is "default", if I make a subsequent GET request with ?lang=fr I would expect to get the @none value as the property value with:

 "name": {
        "type": "Property",
        "value": "The Big Red Barn",
         "lang":   "@none"
    }

In other words "You asked for French, but I don't have a specific French key, so here is the default language".

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

1 participant