Open anatoly-scherbakov opened 3 years ago
Just ran into this issue trying to parse an example from https://www.researchobject.org/ro-crate/1.1/appendix/relative-uris.html#establishing-a-base-uri-inside-a-zip-file.
It appears to be caused by use of urllib.parse.urljoin
which only supports a specific set of schemes. There is a documented workaround (https://bugs.python.org/issue18828#msg196794):
import urllib.parse
urllib.parse.uses_relative.append('<scheme>')
urllib.parse.uses_netloc.append('<scheme>')
Problem
Full code of the example is here: https://gist.github.com/anatoly-scherbakov/9410aba3af518e1a3301b32b693f2579
I am trying to import a JSON-LD document into an RDFLib in-memory graph instance. Versions of the software:
The document I am working with contains a
@base
IRI in its@context
.Expected result
I expect the import to work correctly if the
@base
value is a correct IRI regardless of its protocol. But it seems that the import works with these:but does not work with these:
In the latter case, I just get an empty graph.
I tried to find a hardcoded list of allowed schemas in
rdflib
,rdflib-jsonld
, andpyld
repositories, but did not succeed. Maybe you could point me to the right direction? Thank you!