Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rdf4j-dev] JSON-LD option to ignore datatypes from context ?

Hi Bart,

The fact that the context can provide a datatype for the JSON-LD file is intended, as far as I know.

It is possible to specify your own DocumentLoader: https://github.com/eclipse-rdf4j/rdf4j/blob/b33d91485502d2f5266916c0581960e41b8f28b5/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDSettings.java#L49

There is also a toggle for making parser warnings throw exceptions, since the standard says to just ignore anything that is incorrect. https://github.com/eclipse-rdf4j/rdf4j/blob/b33d91485502d2f5266916c0581960e41b8f28b5/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDSettings.java#L72 

Håvard


On 8 May 2025, at 11:46, Bart Hanssens (BOSA) via rdf4j-dev <rdf4j-dev@xxxxxxxxxxx> wrote:

Hi,
 
as I’m working on a CSVW parser, which uses JSON-LD metadata (default values, URI templates…) to convert CSV to RDF,
it seems that the new JSON-LD parser is pretty smart in converting slightly incorrect JSON values, when a context declares the datatype.
E.g.  string value “5” becomes integer 5 when the context says the datatype is xsd:integer
 
Now, the W3C CSVW spec (and conformance test suite) has some rules on what to do when the JSON-LD metadata contains invalid values.
So my question is, is there an option on the JSON-LD parser to not correct the datatypes based on context, or to remove incorrect values altogether ?
Or should I e.g. create a custom DocumentLoader ?
 
Thanks
 
Best regards
 
Bart
_______________________________________________
rdf4j-dev mailing list
rdf4j-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/rdf4j-dev


Back to the top