Open anatoly-scherbakov opened 3 years ago
I just stumbled across this same issue. A test written in docstrings of the rdflib compare module fails if transcribed to JSON-LD, because the main subject IRI http://example.org
is converted to http://example.org/
with a trailing slash.
The docstring example is here: https://rdflib.readthedocs.io/en/stable/apidocs/rdflib.html#module-rdflib.compare
RFC 3987, Section 2.2 shows the IRI http://example.org
follows the parsing of scheme ":" ihier-part
, with ihier-part
following "//" iauthority ipath-abempty
, ipath-abempty
being the empty string. The rdflib-jsonld behavior here changes a syntactically valid input IRI to a distinct-by-a-character IRI.
Full code of this example is published at: https://gist.github.com/anatoly-scherbakov/95b035b5352ee3ec8ba6b37495b33edd
Problem
local:foo
IRI (wherelocal
is meant to be IRI scheme), the IRI is imported as is into RDFLib graph;local://foo
IRI instead, trailing slash is appened: in the graph, this term is represented aslocal://foo/
. That is unexpected.I believe both these values are valid IRIs, thus this issue seems to be a bug.