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

Playground is choking on http://schema.org (no trailing slash) #798

Closed
BigBlueHat opened this issue Sep 30, 2022 · 4 comments · Fixed by #812
Closed

Playground is choking on http://schema.org (no trailing slash) #798

BigBlueHat opened this issue Sep 30, 2022 · 4 comments · Fixed by #812
Assignees

Comments

@BigBlueHat
Copy link
Member

Throws this error:

jsonld.InvalidUrl: Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.

Looks like maybe it's just not following the 301 response's Location header to https://schema.org/.

@BigBlueHat BigBlueHat changed the title Playground is chocking on http://schema.org (no trailing slash) Playground is choking on http://schema.org (no trailing slash) Sep 30, 2022
@gkellogg
Copy link
Member

This would be something for @davidlehn to look at, I think. But, that said, our advice is that contexts be cached, and given how slowly schema.org actually changes, we should have a built-in version of that context so we're not irking DanBri more than necessary.

@gkellogg gkellogg assigned davidlehn and unassigned gkellogg Sep 30, 2022
@davidlehn
Copy link
Member

I can look later, but maybe a quick fix for the common schema.org case is to just add a no trailing slash check here:
https://github.com/json-ld/json-ld.org/blob/main/playground/playground.js#L1599-L1601

Maybe the real reason is the proxy hack needs work to handle redirects, but I'd rather just see this entirely go away:
https://github.com/json-ld/json-ld.org/blob/main/playground/proxy.php

@rlzijdeman
Copy link

Hi, could I please nudge this issue? https://dataverse.org provides "http://schema.org" in their Linked Data representation (e.g. see the header in the source code of: https://datasets.iisg.amsterdam/dataset.xhtml?persistentId=hdl:10622/XZAHCX ).

However, since the playground doesn't accept the json-ld as valid, our national heritage network argues that the Linked Data doesn't comply with json-ld standards.

@davidlehn
Copy link
Member

I covered up the problem by also rewriting schema.org URL without the trailing slash. A proper fix is a bit more involved: #813.

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

Successfully merging a pull request may close this issue.

4 participants