Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardise a baseIRI parameter on import #18

Open
tpluscode opened this issue Jul 30, 2020 · 4 comments
Open

Standardise a baseIRI parameter on import #18

tpluscode opened this issue Jul 30, 2020 · 4 comments

Comments

@tpluscode
Copy link

As discussed in rdfjs/rdfxml-streaming-parser.js#41, @rubensworks proposed to add a parameter to the import method so that it's a standard feature of all parsers to accept a baseIRI

const parser = new MyParser()

parser.import(stream, { baseIRI: 'http://example.com' })

This is already implemented by a most and would nicely complement the analogous param on the constructor

@rubensworks
Copy link
Member

Just to note, several parsers (N3, RDF/XML, JSON-LD, RDFa) have this parameter on the constructor, instead of the import method.
It might make sense to have a standard for what as well/instead.

@tpluscode
Copy link
Author

That is already there: https://github.com/rdfjs/stream-spec/blob/master/index.html#L155

And not "instead of". Those are separate features

@rubensworks
Copy link
Member

That is already there: https://github.com/rdfjs/stream-spec/blob/master/index.html#L155

Oh, I completely missed that, then my implementations adhere to it by coincidence 😄

And not "instead of". Those are separate features

Just wondering if this will not be too confusing for people, as there would be two places to set a baseIRI.

@tpluscode
Copy link
Author

Just wondering if this will not be too confusing for people, as there would be two places to set a baseIRI.

I mostly use the Sink returned by a sink map, typically constructed by @rdf-esm/formats-common or even @rdfjs/fetch. This way I never call the constructor myself and thus have no opportunity for setting the base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants