Skip to content

Prevent keyword alias to be declared as prefix #154

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

Merged
merged 9 commits into from
Sep 30, 2019

Conversation

pchampin
Copy link
Contributor

@pchampin pchampin commented Sep 23, 2019

addresses #153


Preview | Diff

Copy link
Member

@gkellogg gkellogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the discussion, we should also have a test without @prefix: true that would not flag an error, but also not expand.

Resolution #4: When encountering a term in the form of a compact IRI for which the prefix would expand to a keyword, do not expand the term.

<li>If the <a>prefix flag</a> of <var>definition</var>is set to <code>true</code>,
and its <a>IRI mapping</a> is a <a>keyword</a>,
an <a data-link-for="JsonLdErrorCode">invalid term definition</a>
has been detected and processing is aborted.</li>
</ol>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to say "has the form of a keyword", so that @the-next-keyword would be rejected too. This is related to another discussion from the F2F, for which we don't yet have an open issue: we want to discourage the use of things that may be keywords in the future (should => must).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per w3c/json-ld-syntax#16, keyword-like strings MUST be ignored and SHOULD result in a processor warning. I'll add text and tests to ensure they're ignored (with and without @vocab), but we can't test for warnings.

@gkellogg
Copy link
Member

Also, after changing the test manifest, please run rake in the tests directory to re-build the HTML versions of the manifests. If not, no big deal, we can re-run later.

@gkellogg
Copy link
Member

I have more tests coming on variations of using keyword patterns, to satisfy w3c/json-ld-syntax#16 as well.

@gkellogg gkellogg self-assigned this Sep 29, 2019
@gkellogg gkellogg force-pushed the prevent-keyword-prefix branch from 84cf81e to c9e9d90 Compare September 30, 2019 18:25
@gkellogg gkellogg merged commit 565f239 into master Sep 30, 2019
@gkellogg gkellogg deleted the prevent-keyword-prefix branch September 30, 2019 18:34
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

Successfully merging this pull request may close these issues.

2 participants