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

keyword aliases for @id and @type cannot be singly @protected? #246

Closed
azaroth42 opened this issue Sep 16, 2019 · 8 comments
Closed

keyword aliases for @id and @type cannot be singly @protected? #246

azaroth42 opened this issue Sep 16, 2019 · 8 comments
Labels
satisfied Requirement Satisfied spec:editorial

Comments

@azaroth42
Copy link
Contributor

azaroth42 commented Sep 16, 2019

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.

@azaroth42
Copy link
Contributor Author

azaroth42 commented Sep 19, 2019

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"]
}

@azaroth42
Copy link
Contributor Author

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.

@azaroth42
Copy link
Contributor Author

Changing to editorial as the algorithm is in -api, not -syntax

@azaroth42
Copy link
Contributor Author

@gkellogg to look through other normative sections to ensure consistency

@azaroth42
Copy link
Contributor Author

Resolution: Allow the use of @protected as a valid keyword in term definitions which are aliases of keywords or where the term is @type.

@iherman
Copy link
Member

iherman commented Sep 19, 2019

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>
View the transcript keyword alias for @id and @type cannot be singly @protected
Benjamin Young: See Syntax issue 246
Rob Sanderson: if you alias @type to type it can still be a set
… however, using @protected on an object-based term definition will not protect the id aliasing
… so my proposal is that we change @protected to be a legal keyword for keyword aliases
Gregg Kellogg: does @protected protect the @type based aliasing?
Rob Sanderson: [adds more examples to 246]
Ivan Herman: the examples don’t show any reason for the @protected
Rob Sanderson: [fixes examples]
… [reads text from 4.1.5]
… [reads text from 4.3.3]
Gregg Kellogg: looks like the API is correct
Rob Sanderson: ah, so they’re out of sync
Gregg Kellogg: we do need more @protected text in this API section
Rob Sanderson: so the syntax fix is editorial
Proposed resolution: Allow the use of @protected as a valid keyword in term definitions which are aliases of keywords or where the term is @type. (Rob Sanderson)
Rob Sanderson: +1
Gregg Kellogg: +1
Benjamin Young: +1
Pierre-Antoine Champin: +1
Ivan Herman: +1
Resolution #2: Allow the use of @protected as a valid keyword in term definitions which are aliases of keywords or where the term is @type

gkellogg added a commit that referenced this issue Sep 27, 2019
…d`, and indicate that other use results in an error, rather than being ignored.

For #246.
@gkellogg
Copy link
Member

I added the syntax change in cfd32c6, but intended to do a PR. Can't easily undo that, so please check it out and see if the change is reasonable.

@gkellogg
Copy link
Member

@azaroth42 azaroth42 added the satisfied Requirement Satisfied label Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
satisfied Requirement Satisfied spec:editorial
Projects
None yet
Development

No branches or pull requests

3 participants