digitalbazaar / jsonld-cli

JSON-LD command line interface tool
Other
48 stars 7 forks source link

CURIE not handled in `@vocab` #18

Closed VladimirAlexiev closed 8 months ago

VladimirAlexiev commented 3 years ago

https://www.w3.org/TR/json-ld11/#context-definitions says @vocab can be a CURIE.

The playground handles this:

{
  "@context": {
    "@version": 1.1,
    "@vocab" : "https://ns.gs1.org/epcis/",
    "cbv": "https://ns.gs1.org/cbv/",
    "bizStep": {"@type":"@vocab", "@context":{"@vocab":"cbv:BizStep-"}}
  },
  "@graph":{
    "@id":"https://exmaple.org/event/1",
    "bizStep": "installing"
  }
}

results in

<https://exmaple.org/event/1> <https://ns.gs1.org/epcis/bizStep> <https://ns.gs1.org/cbv/BizStep-installing> .

But if you save to a file and try with jsonld-cli, the prefix is not expanded:

jsonld format -q jsonld-cli-issue-18.jsonld
<https://exmaple.org/event/1> <https://ns.gs1.org/epcis/bizStep> <cbv:BizStep-installing> .

Related to #1, #6 ? Many other 1.1 features are handled fine.

jindrichmynarz commented 3 years ago

jsonld-cli uses the version 1.0.2 of jsonld.js released on May 23, 2018, while its latest release is 5.2.0 from April 2021, so I would not be surprised that some parts of JSON-LD 1.1 are not yet supported by jsonld-cli. However, looking at the source code of JSON-LD Playground, it seems to have a copy of the same old release of jsonld.js.

VladimirAlexiev commented 3 years ago

I wonder what'd happen if we change the dependency to "jsonld": "^5.2.0". I've never built a nodejs module so I don't dare.

@jindrichmynarz I guess that stale copy is not used because the playground produces different results? Maybe post a bug against the playground about that stale copy?

jindrichmynarz commented 3 years ago

I've tried that before, but upgrading the jsonld dependency of jsonld-cli is not that straightforward.

BigBlueHat commented 8 months ago

@VladimirAlexiev v2.0.0 of jsonld-cli supports jsonld.js v8.3.2+.

Is this still an issue in the current version?

VladimirAlexiev commented 8 months ago

It's now fine:

<https://exmaple.org/event/1> <https://ns.gs1.org/epcis/bizStep> <https://ns.gs1.org/cbv/BizStep-installing> .

Thanks!