rdfjs / N3.js

Lightning fast, spec-compatible, streaming RDF for JavaScript
http://rdf.js.org/N3.js/
Other
676 stars 127 forks source link

feature/add handle quads #339

Open jeswr opened 1 year ago

jeswr commented 1 year ago

Supercedes #319

RubenVerborgh commented 1 year ago

Given #330, maybe this could become:

const writer3 = new N3.Writer({ syntax: 'flexible' }); // Also output quads that cannot be expressed in the chosen syntax (default)
const writer4 = new N3.Writer({ syntax: 'drop' });     // Drop components or quads that cannot be expressed in the chosen syntax
const writer5 = new N3.Writer({ graphs: 'strict' });   // Throws an error when a quad cannot be expressed in the chosen syntax
jeswr commented 1 year ago

Should we add proper validation to writer at the same time (e.g. for the cases in #330)?

RubenVerborgh commented 1 year ago

Yes, that's the direction. But we don't need to have that right now; i.e., this can be the meaning of the strict option, and not validating everything can be a bug until fixed.