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

Ability to set baseIRI on individual import call #41

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

Ability to set baseIRI on individual import call #41

tpluscode opened this issue Jul 30, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@tpluscode
Copy link
Contributor

tpluscode commented Jul 30, 2020

I think related to #20 but maybe not exactly the same, I found out that the parser fails to handle some relative named nodes and throws. For example I failed to parse https://www.w3.org/ns/earl# and it fails right off the bat on owl:Ontology as seen below

<rdf:RDF xml:base=""
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
        xmlns:owl="http://www.w3.org/2002/07/owl"
        xmlns:dc="http://purl.org/dc/terms/">

<owl:Ontology rdf:about=""></owl:Ontology>

I am running this from @rdfjs/fetch which sets a baseIRI parameter when calling like parser.import({ baseIRI: res.url }).

The parser however does not take a second parameter and the base test ignores. I think it would be worth adding, similarly to how most other RDF/JS parser out there do

@rubensworks
Copy link
Member

Seems like the same problem as in #32. But this should've been fixed in 1.3.5. Are you sure you're using the latest version?

@tpluscode
Copy link
Contributor Author

In fact I was not and yes, the parsing is fixed when a baseIRI is passed to the constructor. Would still be nice to add a parameter to import though

@tpluscode tpluscode changed the title Fails to parse relative URIs Ability to set baseIRI on individual import call Jul 30, 2020
@rubensworks
Copy link
Member

Makes sense, but we may want to define this as spec-level first, as it does not seem to allow parameters to be passed: http://rdf.js.org/stream-spec/#sink-interface

@rubensworks rubensworks added the enhancement New feature or request label Jul 30, 2020
@tpluscode
Copy link
Contributor Author

Not a bad idea, at least for baseIRI to be standardised like the ctor parameter.

On the other hand, since we're talking about JS, any superfluous parameters are also not forbidden implicitly.

Are you going to create an issue?

@rubensworks
Copy link
Member

Are you going to create an issue?

I don't have the available bandwidth to pull this myself, so feel free to create an issue! :-)

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

No branches or pull requests

2 participants