Closed bergos closed 5 years ago
additional options parameter as you suggested in #44 makes sense to me
https://github.com/rdfjs/representation-task-force/issues/79#issuecomment-255759148
@RubenVerborgh: In any case, make
baseIRI
andfactory
properties of an options object, not individual parameters.
rdf-ext already seems to use baseIRI
https://github.com/rdf-ext/rdf-fetch-lite/blob/develop/lib/patch-response.js#L15
@bergos would you like to propose adding it to spec in PR?
I will make a PR for baseIRI
, but I'm on the road and can't do it before end of next week. If someone want's to do it in the meantime, feel free.
Since #113 makes parsers rely on Sink#import()
I understand it will get additional options
object which will have baseIRI
as one of its properties. Which seems like step towards suggestion from #44
The current Stream interface has prefix:
interface Stream : EventEmitter {
Quad read();
...
attribute Event data;
attribute Event prefix;
};
This is usually sufficient because whatever created a Store could be passed a baseIRI. If your RDF has a BASE declaration, the API has no way to retrieve it. While both prefixed as base are outside of the RDF model, they're pretty handy for making tools user-friendly and when they aren't available, people resort to heuristic hacks.
PROPOSE: add attribute Event prefix
to Stream with this defn:
base `base(NamedNode base)` This event is emitted every time a document base is set to some IRI.
It's not super precise, but it seems compatible with the defn for prefix
.
resolved in #10
We should define a standard way to forward the base IRI to the parser and serializer.