RDFLib / rdflib-jsonld

JSON-LD parser and serializer plugins for RDFLib
Other
280 stars 71 forks source link

JSON-LD data import adds trailing slashes to IRIs #101

Open anatoly-scherbakov opened 3 years ago

anatoly-scherbakov commented 3 years ago

Full code of this example is published at: https://gist.github.com/anatoly-scherbakov/95b035b5352ee3ec8ba6b37495b33edd

Problem

I believe both these values are valid IRIs, thus this issue seems to be a bug.

ajnelson-nist commented 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

ajnelson-nist commented 3 years ago

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.