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

command line argument [filename|URL|-] should set base (if possible) #24

Open
pchampin opened this issue Oct 1, 2023 · 0 comments
Open

Comments

@pchampin
Copy link

pchampin commented Oct 1, 2023

Consider the following file served from http://localhost:8000/test.jsonld:

{
  "@id": "#myid",
  "http://example.org/ns/prop": "value"
}

Running jsonld expand http://localhost:8000/test.jsonld returns:

[
  {
    "@id": "#myid",  # <-- NOTE THE RELATIVE IRI HERE
    "http://example.org/ns/prop": [
      {
        "@value": "value"
      }
    ]
  }
]

and jsonld toRdf http://localhost:8000/test.jsonld returns no triples (because the relative IRI in the subject position can't be resolved).
In order to get the expected result, one has to use the following command line:

   jsonld expand -b http://localhost:8000/test.jsonld http://localhost:8000/test.jsonld

This is needlessly redundant, and this requirement is therefore counterintuitive.

I would expect that, whenever the [filename|URL|-] argument is an absolute URL (and possibly a filename), it automatically sets the base to the appropriate IRI (unless, of course, overridden with an explicit --base argument).

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

1 participant