Closed jakubklimek closed 2 years ago
This may be an issue in jsonld.js, which runs the playground. Running on my distiller, I get the following:
[
{
"@type": [
"http://www.w3.org/2006/time#ProperInterval"
],
"http://www.w3.org/2006/time#hasEnd": [
{
"@type": [
"http://www.w3.org/2006/time#Instant"
],
"http://www.w3.org/2006/time#inXSDDateTimeStamp": [
{
"@type": "http://www.w3.org/2001/XMLSchema#dateTimeStamp",
"@value": "2019-01-14T09:30:00+02:00"
}
]
}
]
}
]
which seems correct to me.
The outer type "Časový interval" establishes a type-scoped context at that level, but it is removed inside of "konec", which establishes it's own property-scoped context. Then, within that "Časový okamžik" layers on a type-scoped context, so that the term "datum_a_čas" should be in scope.
cc/@davidlehn
Added a detailed comment at https://github.com/digitalbazaar/jsonld.js/issues/409 showing a reproducible effect for a much simpler scoped @context
definition with just two triples.
It looks like processing of scoped @context
is order dependent, where it shouldn't be.
Let's keep the discussion at https://github.com/digitalbazaar/jsonld.js/issues/409 rather than in three places.
There is probably a bug in handling scoped contexts. In the snippet below,
začátek
andkonec
(beginning and end in Czech) have equivalent contexts. However, when used in data, they behave differently. Namely the context inkonec
is ignored, while whenzačátek
is used, the context is applied. When thezačátek
definition is removed from the context,konec
starts working. This can be tested in json-ld playground.