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

how to handle the "@coerce" key? #413

Closed
lisp opened this issue Mar 16, 2016 · 8 comments
Closed

how to handle the "@coerce" key? #413

lisp opened this issue Mar 16, 2016 · 8 comments
Assignees
Labels

Comments

@lisp
Copy link

lisp commented Mar 16, 2016

the @coerce key is present among the example contexts.
what is the proper way to handle that situation: warn and ignore or reject?

@gkellogg
Copy link
Member

The section on Node Objects says that all keywords other than, @context, @id, @graph, @type, @reverse and @index are to be ignored. There may be language about issuing a warning, but I don't recall anything specific. Note that JSON-LD Framing uses other keywords that are not ignored, but these are part of the framing model.

I would say that processors would ignore @Coerce, and may issue an warning, but should not fail with an error, as this is a reasonable target for future standards work.

@lisp
Copy link
Author

lisp commented Mar 16, 2016

the general node case is less a cause for concern that the situation where "unknown" keywords appear in a context, as is the in several of those still in the repository.

@gkellogg
Copy link
Member

If used as a term definition, a JSON-LD processor will happily create a term starting with @. Otherwise, if used as part of a term definition, it will be ignored.

If used as the value of @container it would be an error, unless one of @list @set @language @index.

@lisp
Copy link
Author

lisp commented Mar 17, 2016

that reads like a recipe for inexplicably incomplete results and unnecessary confusion.

the particular motivating case is

https://github.com/json-ld/json-ld.org/blob/master/contexts/event.jsonld#L30

a sort of anomaly which brings up the question, how a step which intends to construct a context should handle something like
{
"@content":
{
... } ... }

@gkellogg
Copy link
Member

gkellogg commented Mar 17, 2016

A 1.0 processor will ignore it, as the object value isn't a valid term definition.

@gkellogg
Copy link
Member

Also, note that https://github.com/json-ld/json-ld.org/blob/master/contexts/event.jsonld#L30 is certainly an invalid context, and may be part of an experiment in how geo data might be handled. I think the action is to clean up this example and make sure it's valid. Perhaps as part of support for #397.

@niklasl
Copy link
Member

niklasl commented Sep 20, 2016

@coerce was an old design (long before 1.0) for @type corecion. I'd say its legacy noise to be removed from the examples.

@gkellogg gkellogg self-assigned this Sep 20, 2016
@gkellogg
Copy link
Member

Looks like the context files are referenced from old drafts still available within the Previous Drafts section; removing and/or modifying them would be re-writing history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants