rdfjs / N3.js

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

@base set by baseIRI is not shown in the prefixes part of the document #375

Open LadyMalande opened 5 months ago

LadyMalande commented 5 months ago

After setting baseIRI in the Writer constructor, the @base does not show up among the prefixes at the beginning of the generated turtle format, as the actions for it to display the @base are missing from the file.

Example: Having this in my code:

new N3.Writer({ prefixes: { sh: 'http://www.w3.org/ns/shacl#', rdfs: "http://www.w3.org/2000/01/rdf-schema#"}, baseIRI: this.baseURL })

and the resulting file shows only this at the beginning, missing @base:

@prefix sh: http://www.w3.org/ns/shacl#. @prefix rdfs: http://www.w3.org/2000/01/rdf-schema#.