Consider the following JSON-LD
{
"@context": {
"p": {
"@id": "x:p",
"@type": "x:datatype",
"@language": "en"
}
},
"p": "foo"
}
It expands to
[
{
"x:p": [
{
"@type": "x:datatype",
"@value": "foo"
}
]
}
]
The @language is simply ignored.
This is the correct behaviour w.r.t. to the spec. Step 22 of the "Create Term Definition" algorithm explicitly instructs to ignore @language if @type is present.
I consider this as a bug in the spec. The context above makes no sense, and should be rejected with an invalid term definition error (at least, as of JSON-LD 1.2 -- we could preserve the current behaviour if mode is 1.0 or 1.1).
Consider the following JSON-LD
{ "@context": { "p": { "@id": "x:p", "@type": "x:datatype", "@language": "en" } }, "p": "foo" }It expands to
[ { "x:p": [ { "@type": "x:datatype", "@value": "foo" } ] } ]The
@languageis simply ignored.This is the correct behaviour w.r.t. to the spec. Step 22 of the "Create Term Definition" algorithm explicitly instructs to ignore
@languageif@typeis present.I consider this as a bug in the spec. The context above makes no sense, and should be rejected with an
invalid term definitionerror (at least, as of JSON-LD 1.2 -- we could preserve the current behaviour if mode is 1.0 or 1.1).