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

Let baseIRI option take precedence over empty base IRI in data #32

Closed
ekulno opened this issue Apr 14, 2020 · 3 comments
Closed

Let baseIRI option take precedence over empty base IRI in data #32

ekulno opened this issue Apr 14, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@ekulno
Copy link

ekulno commented Apr 14, 2020

I have a rdf-xml file with an empty base IRI and a resource with rdf:about="foo". When trying to parse this file with rdfxml-stream-parser, I get an error:

ParseError: Invalid URI: foo

I was hoping I'd be able to work around this by supplying a baseIRI in the options of the RdfXmlParser class. But the empty base IRI in the data takes precedence over my supplied baseIRI. This is different from the N3 stream parser, which will prioritize the baseIRI given in the options if the base IRI in the data is an empty string. If this approach could be applied to rdfxml-streaming-parser this would be helpful for me as it would allow me to parse http://www.w3.org/ns/earl# , which has an empty base IRI and a resource with the empty string as a relative IRI.

@rubensworks
Copy link
Member

That actually seems to indicate a bug in this parser (here).
xml:base can actually be relative to the current document IRI, which is the case when setting it to an empty string.

Thanks for reporting!

@rubensworks rubensworks added the bug Something isn't working label Apr 14, 2020
@rubensworks
Copy link
Member

Fixed in 1.3.5.

@ekulno
Copy link
Author

ekulno commented Apr 15, 2020

Thank you for the quick response and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants