Open rubensworks opened 5 years ago
From Context Definitions:
If the expanded term definition contains the
@type
keyword, its value MUST be an absolute IRI, a compact IRI, a term,null
, or one of the keywords@id
or@vocab
.
In the first case "bla" does not expand to any of those, thus the error is raised.
If I understand that definition correctly, then the following should also produce an error, right? (As it includes a relative IRI, but this time with a valid vocabulary)
{
"@context": {
"@base": "http://base.org/",
"@vocab": "http://vocab.org/"
},
"@id": "",
"http://ex.org/p": { "@value": "val", "@type": "bla" }
}
Instead, it outputs:
<http://base.org/> <http://ex.org/p> "val"^^<http://vocab.org/bla> .
From a developers-perspective, this feels like an inconsistency in the spec. So I'm wondering if it would make sense to discuss this over at https://github.com/w3c/json-ld-syntax/ and move the issue?
Ecause of @vocab
, “bla” does expand to an absolute IRI, so is correct. In any case, it’s not an error, but the resulting triple would be dropped if it contains a relative IRI.
Parsing the following throws an error:
Error:
As far as I understand, this should however not throw an error, and instead expand the @type based on the @base value.
If I'm correct, this document is equivalent to the following: (which does not produce an error)
Output: