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

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

Open
anatoly-scherbakov opened this issue Jan 2, 2021 · 2 comments
Open

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

anatoly-scherbakov opened this issue Jan 2, 2021 · 2 comments

Comments

@anatoly-scherbakov
Copy link

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

Problem

  • When, while importing a source JSON-LD document, the importer encounters a local:foo IRI (where local is meant to be IRI scheme), the IRI is imported as is into RDFLib graph;
  • But if to use local://foo IRI instead, trailing slash is appened: in the graph, this term is represented as local://foo/. That is unexpected.

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

@ajnelson-nist
Copy link
Contributor

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
Copy link
Contributor

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.

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

No branches or pull requests

2 participants