Open mrkvon opened 3 months ago
Working as intended (writer always expects valid input), but we can indeed accept a PR along the lines of #165 to perform optional input sanitization.
Indeed relevant only if a feature like https://github.com/rdfjs/N3.js/pull/339#issuecomment-1482645969 is included.
May I throw in one of my recent blog posts RDF/JS for Data Processing. Summary of the blog post: Validation is a spectrum, and what is valid RDF depends on the context. That's why I like a modular approach, and rdf-validation could be one building block. Nevertheless, if a media type is given, it's legit that a serializer validates that the output is according to the spec. But I would recommend using flags, as mentioned in #339, to control the behavior, and ideally there is no performance impact.
When creating a triple with
Variable
s in it, and then writing it astext/turtle
, the outcome is invalid turtle.This yields
which is invalid turtle.
Along the argumentation in #165, this could rather throw error or gracefully drop the triples containing
Variable
.