question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context DOI redirect is failing in JSON-LD playground, JSON-LD libraries

See original GitHub issue

When the JSON-LD playground and other JSON-LD libraries (ruby) see the remote context in one of our CodeMeta documents, i.e.:

"@context":"https://doi.org/10.5063/SCHEMA/CODEMETA-1.0",

They send a HTTP GET request with “Accept: application/ld+json” to read the remote context. This returns the Datacite ‘metadata’ page

http://data.datacite.org/10.5063%2FSCHEMA%2FCODEMETA-1.0

and not the DOI resolution of

https://raw.githubusercontent.com/codemeta/codemeta/1.0/codemeta.jsonld

The DOI entry is typed as ‘text/json’ at http://ezid.cdlib.org/id/doi:10.5063/SCHEMA/CODEMETA-1.0

I’m wondering if adding the type application/ld+json to the DOI entry will resolve this problem.

For more details, see https://github.com/json-ld/json-ld.org/issues/447

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:54 (20 by maintainers)

github_iconTop GitHub Comments

3reactions
mfennercommented, May 10, 2017

We launched our rewritten DataCte DOI content negotiation service yesterday, and the following finally works as expected:

curl -LH "Accept: application/ld+json" https://doi.org/10.5063/SCHEMA/CODEMETA-1.0

This does not require registration of the media type with EZID, but works with it. You could for example have the DOI by default redirect to https://github.com/codemeta/codemeta, and for content type application/ld+json to the json-ld file. Which would be best practice, as you don’t want to resolve DOIs directly to content by default.

You can also do these requests to have the DataCite metadata returned as codemeta or schema.org/JSON-LD:

curl -LH "Accept: application/vnd.codemeta.ld+json" https://doi.org/10.5063/SCHEMA/CODEMETA-1.0
curl -LH "Accept: application/vnd.schemaorg.ld+json" https://doi.org/10.5063/SCHEMA/CODEMETA-1.0
0reactions
mbjonescommented, May 10, 2017

@mfenner Awesome, and thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON-LD 1.1 Processing Algorithms and API - W3C
A JSON-LD Processor is a system which can perform the algorithms defined in JSON-LD 1.1 Processing Algorithms and API. See the Conformance ...
Read more >
JSON-LD External Context Redirect - Stack Overflow
When defining external documents in a JSON-LD context there may be situations where offline processing is desired or just for speed of ...
Read more >
JSON-LD API Failground - Dr. Chuck
This web site is designed to show the fatal flaw of JSON-LD usage for API ... We use the "library" example JSON-LD from...
Read more >
jsonld-java / jsonld-java Download - JitPack
JSONLD -Java is looking for a maintainer. JSONLD-JAVA. This is a Java implementation of the JSON-LD 1.0 specification and the JSON-LD-API 1.0 specification....
Read more >
Using custom remote contexts - Blockcerts Forum
1 blockcerts context from the blockcerts url (https://www.blockcerts.org/schema/2.1/context.json) I get json-ld parsing errors, BUT if I use the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found