Fixes #1429, add iri2uri
· Pull Request #1902 · RDFLib/rdflib (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation14 Commits11 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Fixes #1429
why park this in the "restore-pyrdfa" branch? This fix will work for non-HTML sources with non-ASCII chars in the IRI, perhaps something like
http://example.com/thing/Almería.ttl
for instance. So this is a generic fix forparse()
Summary of changes
Add an iri-to-uri conversion utility to encode IRIs to URIs for Graph.parse()
sources. Added a couple of tests because feeding it with a suite of IRIs to check seems overkill (not that I could find one).
Checklist
- Checked that there aren't other open pull requests for the same change.
- Added tests for any changes that have a runtime impact.
- Checked that all tests and type checking passes.
- For changes that have a potential impact on users of this project:
- Updated relevant documentation to avoid inaccuracies.
- Considered adding additional documentation.
- Considered adding an example in
./examples
for new features. - Considered updating our changelog (
CHANGELOG.md
).
- Considered granting push permissions to the PR branch,
so maintainers can fix minor issues and keep your PR up to date.
Coverage increased (+0.009%) to 88.431% when pulling 72f5b59 on gjhiggins:fix-for-issue1429 into ccb9c4a on RDFLib:master.
ghost self-requested a review
Move
rdflib.parser.iri2uri
tordflib.util._iri2uri
In part this is because iri2uri does not operate on all IRIs, just http and https IRIs, but furthermore it is because this is not something essential to working with RDF.
Expanded tests for
iri2uri
to cover each part of the URI.Convert the test that connects to dbpedia to using httpmock.
This is so we have more control over response and can explicitly verify the request path.
Some changes to imports to reduce the probability of circular imports.
Made some changes now to your branch, in brief:
- Move
rdflib.parser.iri2uri
tordflib.util._iri2uri
In part this is because iri2uri does not operate on all IRIs, just
http and https IRIs, but furthermore it is because this is not
something essential to working with RDF.- Expanded tests for
iri2uri
to cover each part of the URI.- Convert the test that connects to dbpedia to using httpmock.
This is so we have more control over response and can explicitly
verify the request path.- Some changes to imports to reduce the probability of circular imports.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks good.
ghost removed the review wanted
This indicates that the PR is ready for review
label