Closed azaroth42 closed 4 years ago
Works as expected:
{
"@context": [{
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": {"@id" : "@type", "@container": "@set"},
"@type": {"@container": "@set"}
},
... context here that tries to modify id, type or @type and cannot ...
],
"id": "http://example.com/1",
"type": ["http://example.org/ns/Foo"]
}
Does not work, as @protected
is ignored for aliases of keywords:
{
"@context": [{
"@version": 1.1,
"id": {"@id": "@id", "@protected": true},
"type": {"@id" : "@type", "@container": "@set", "@protected" : true},
"@type": {"@container": "@set", "@protected": true}
},
... context here that tries to modify id, type or @type ... and succeeds! ...
],
"id": "http://example.com/1",
"type": ["http://example.org/ns/Foo"]
}
Also, the syntax is inconsistent with the API definition.
Syntax says that the definitions will be ignored, whereas API says "Any other value means that a keyword redefinition error has been detected and processing is aborted."
The API is the correct intention, and the syntax document should be updated to this effect.
Changing to editorial as the algorithm is in -api, not -syntax
@gkellogg to look through other normative sections to ensure consistency
Resolution: Allow the use of @protected
as a valid keyword in term definitions which are aliases of keywords or where the term is @type
.
This issue was discussed in a meeting.
RESOLVED: Allow the use of <code>@protected</code> as a valid keyword in term definitions which are aliases of keywords or where the term is <code>@type</code>
@id
and @type
cannot be singly @protected
@type
to type it can still be a set@protected
on an object-based term definition will not protect the id aliasing@protected
to be a legal keyword for keyword aliases@protected
protect the @type
based aliasing?@protected
@protected
text in this API section@protected
as a valid keyword in term definitions which are aliases of keywords or where the term is @type.
(Rob Sanderson)@protected
as a valid keyword in term definitions which are aliases of keywords or where the term is @type
I added the syntax change in cfd32c665fd728ed5198bdf9c3ad606723074a27, but intended to do a PR. Can't easily undo that, so please check it out and see if the change is reasonable.
In section 4.1.5 (and equivalent in the algorithm) it says that aliases applied to keywords are ignored, other than (per 4.3.3) the use of
@container:@set
applied to@type
.However, the
@protected
keyword can be applied to keyword aliases by setting it in the context overall. This is at odds with the text, and prevents protecting ONLY the (very common, and important) aliases for@id
and@type
.Propose (I know, 11th hour) that
@protected
be allowed as an entry for keyword aliases (unless we already discussed this and decided against it, and I'm just forgetting). We can already protect them, just by the syntactic sugar form of setting it at the context level.