-
Notifications
You must be signed in to change notification settings - Fork 23
@type as @container:@set? #34
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
Comments
Seems like a useful feature to allow |
We should consider allowing any keyword that can take multiple values, such as {
"@context": {
"dataset": {"@id": "@graph", "@container": ["@graph", "@id"]}
}, It should allow the following as well: {
"@context": {
"@graph": {"@container": ["@graph", "@id"]}
}, This may need some extra sanity checking, as |
Resolution on WG call of 2018-08-17: And secondly, that we will not change @context as the processing would be extremely convoluted for minimal value. |
Interestingly, someone proposed this be allowed back in 2012: json-ld/json-ld.org#80 (comment) 😀 |
…n alias in 1.1. Remains an error to redefine `@type` in 1.0. For w3c/json-ld-syntax#34.
…n alias in 1.1. Remains an error to redefine `@type` in 1.0. For w3c/json-ld-syntax#34.
- add test compact-105 See w3c/json-ld-syntax#34.
- add test compact-104 See w3c/json-ld-syntax#34.
- add test compact-106 See w3c/json-ld-syntax#34.
- add test expand-e042 See w3c/json-ld-syntax#34.
This change addresses w3c/json-ld-syntax#34
The purpose of the
@container:@set
functionality (AFAIU) is to ensure that the output is consistent in shape. Thus if there can ever be multiple values, the structure is always an array.There are two situations in which this functionality could be desirable but is currently not possible:
@type
As it's a keyword, we can only alias it (e.g. astype
) but not define it to have@container:@set
functionality. Meaning that there's a gotcha waiting to happen for ontologies that require or use multiple classes for a single resource instance. See playground@context
Less useful, but@context
will also compact to a single string/object when there might be multiple contexts. See playground@context
modifying itself seems particularly strange, but the inconsistency for@type
seems solvable if the restrictions in its definition were loosened?Original issue @type as @container:@set? #512.
(Edit: Note that the playground links demonstrate that these do not work as one might expect, due to the keyword definitions of @type and @context)
The text was updated successfully, but these errors were encountered: