Open pajoma opened 2 years ago
I'm rusty on my JSON-LD but is it possible that this is because you're using a JDON-LD 1.1 feature? I think our current support (which relies on jsonld-java) only covers 1.0.
The relevant part in the spec about node identifiers didn't change, as far as I can see. The @ID must be a valid URI/IRI, either fully qualified or resolvable through the default namespace (base).
Current Behavior
Parsing invalid "@id" values in a JSON-LD document like in the following example just resulted in no statements. (via RIO and ContextStatementCollector)
Result:
{statements=[], namespaces={}}
(from ContextStatementCollector)The following example is valid and works
Result
{statements=[ (http://example.org#cal124121323, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://www.w3.org/2002/12/cal/ical#Vevent), (http://example.org#cal124121323, http://www.w3.org/2002/12/cal/ical#summary, "Lady Gaga Concert")], namespaces={}}
The following example is also valid and works
Expected Behavior
I am not exactly sure about the expected behaviour. According to the spec, the "@id" has to be an IRI. Leaving the prefix should require at least "@base" definition in the "@context" (even though the json-ld playground considers it to be valid and injects its own "@base")
results in
<https://json-ld.org/playground/1234> <http://www.w3.org/2002/12/cal/ical#summary> "Lady Gaga Concert" .
This might work (e.g. have a default namespace set when a base namespace is missing), but I think an exception makes most sense here.
Steps To Reproduce
Here's my code