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

option -t doesn't work #19

Open
VladimirAlexiev opened this issue Sep 23, 2021 · 1 comment
Open

option -t doesn't work #19

VladimirAlexiev opened this issue Sep 23, 2021 · 1 comment

Comments

@VladimirAlexiev
Copy link

VladimirAlexiev commented Sep 23, 2021

I've tried many different ways to specify the format of input and couldn't.
As a result, jsonld 0.3.0 cannot convert RDF to JSONLD, only the opposite direction.

This is a MAJOR bug.

>jsonld format EPCIS.nq
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.nq"
}

>jsonld format -t application/n-quads EPCIS.nq
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.nq"
}

>jsonld format -t application/nquads EPCIS.nq
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.nq"
}

>jsonld format -t nquads EPCIS.nq
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.nq"
}

>jsonld format -t nq EPCIS.nq
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.nq"
}

And similar for a Turtle file:

>jsonld format EPCIS.ttl
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.ttl"
}

>jsonld format -t text/turtle EPCIS.ttl
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.ttl"
}

>jsonld format -t ttl EPCIS.ttl
[object Object]
Error: {
  "message": "Unable to auto-detect format.",
  "url": "EPCIS.ttl"
}

So I use riot for RDF->JSONLD.

  • cons: you can't specify a context
  • pro: it infers a rich context, eg
    "rangeIncludes" : {
      "@id" : "http://schema.org/rangeIncludes",
      "@type" : "@id"
    },
  • cons: it renders lists with rdf:first, rdf:rest

See gs1/EPCIS#238 for discussion

@VladimirAlexiev
Copy link
Author

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