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

The playground silently ignores bugged contexts #842

Open
pchampin opened this issue Jun 13, 2024 · 1 comment
Open

The playground silently ignores bugged contexts #842

pchampin opened this issue Jun 13, 2024 · 1 comment

Comments

@pchampin
Copy link
Contributor

An easy mistake for context publisher is to forget to wrap their context in { "@context": ... }.
See for example https://openprovenance.org/prov-jsonld/2020-03-23/context.json
(yes, this context has other issue, but that's not relevant to my point here).

Unfortunately, the JSON-LD Playground does not report any error when asked to use that context. It just silently ignores it.

I guess the rationale was that the absence of @context was equivalent to an empty @context, but I would argue that the absence of @context in a resource that is explicitly used as a context is very likely to be an error instead, and should be reported.

By the way, that's other JSON-LD implementations (@gkellogg's or @timothee-haudebourg's) do.

Example in the playground where the invalid context is silently ignored.

@pchampin
Copy link
Contributor Author

In fact, this behavior does not conform to the spec.
See the Context Processing Algorithm:

5.2.5.2) If the document has no top-level map with an @context entry, an invalid remote context has been detected and processing is aborted.

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