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

fix for issue1429 #1507

Closed
wants to merge 7 commits into from
Closed

fix for issue1429 #1507

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 15, 2021

Fixes #1429

Proposed Changes

  • add an internal iri-to-uri conversion utility

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 for parse()

I was both unclear and pedantic - I meant that the specific dbpedia example URL provided (which actually pointed to a text/html resource) is parsed without issue with the implementation coded therein and pyRfda enabled.

Providing a generic fix for parse() proved (as ever, with RDFLib) more tricky ....

Tactics:

  1. The encoding of query param content "=" as "%3D" causes the failure of
    GraphTestCase::testGuessFormatForParse in that
    https://linked.data.gov.au/def/agrif?_format=text/turtle
    is converted to:
    https://linked.data.gov.au/def/agrif?_format%3dtext/turtle
    which returns a resource of text/html mimetype, triggering a "no plugin found" Exception.
    So, either decode the encoded "%3D" and friends or skip the conversion of query params altogether - I chose the former.

  2. urllib omits the empty fragment identifier and the reassembled uri is stripped of any trailing "#" that the iri might have had, which causes the failure of
    NamedGraphWithFragmentTest::test_named_graph_with_fragment
    so it has to be explicitly restored to the end of the uri.

@ghost
Copy link
Author

ghost commented Dec 15, 2021

And, of course, Windows blows up:
OSError: [Errno 22] Invalid argument: '\\D:\\a\\rdflib\\rdflib\\test\\DAWG\\data-r2\\manifest-evaluation.ttl'

I'll need to check this out on a Windows VM.

@ghost
Copy link
Author

ghost commented Dec 15, 2021

Broken PR, consign to git hell.

@ghost ghost closed this Dec 15, 2021
This pull request was closed.
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

Successfully merging this pull request may close these issues.

Graph parse module does not handle URI / IRI with non-ascii characters
0 participants