Skip to content

Keyword space #204

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 3 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,8 @@ <h3>Algorithm</h3>
<var>term</var> MUST NOT be a <a>keyword</a> and a
<a data-link-for="JsonLdErrorCode">keyword redefinition</a>
error has been detected and processing is aborted.
If <var>term</var> has the form of a keyword (i.e., it begins with `"@"`),
If <var>term</var> has the form of a keyword
(i.e., it matches the ABNF rule `"@"1*ALPHA` from [[RFC5234]]),
return; processors SHOULD generate a warning.</li>
<li class="changed">Set <var>previous definition</var> to any existing
<a>term definition</a> for <var>term</var> in <var>active context</var>,
Expand Down Expand Up @@ -1516,7 +1517,8 @@ <h3>Algorithm</h3>
<a data-link-for="JsonLdErrorCode">invalid IRI mapping</a>
error has been detected and processing is aborted.</li>
<li>If the value associated with the `@reverse` <a>entry</a> is a string
having the form of a keyword (i.e., it begins with `"@"`),
having the form of a keyword
(i.e., it matches the ABNF rule `"@"1*ALPHA` from [[RFC5234]]),
return; processors SHOULD generate a warning.</li>
<li>Otherwise, set the <a>IRI mapping</a> of <var>definition</var> to the
result of using the <a href="#iri-expansion">IRI Expansion algorithm</a>,
Expand Down Expand Up @@ -1557,7 +1559,8 @@ <h3>Algorithm</h3>
error has been detected and processing is aborted.</li>
<li>If the value associated with the `@id` <a>entry</a>
is not a <a>keyword</a>, but
has the form of a <a>keyword</a> (i.e., it begins with `"@"`),
has the form of a <a>keyword</a>
(i.e., it matches the ABNF rule `"@"1*ALPHA` from [[RFC5234]]),
return; processors SHOULD generate a warning.</li>
<li>Otherwise, set the <a>IRI mapping</a> of <var>definition</var> to the
result of using the <a href="#iri-expansion">IRI Expansion algorithm</a>, passing
Expand Down Expand Up @@ -3004,7 +3007,8 @@ <h3>Algorithm</h3>
<li>If <var>value</var> is a <a>keyword</a> or <code>null</code>,
return <var>value</var> as is.</li>
<li class="changed">
If <var>value</var> has the form of a keyword (i.e., it begins with `"@"`),
If <var>value</var> has the form of a keyword
(i.e., it matches the ABNF rule `"@"1*ALPHA` from [[RFC5234]]),
a processor SHOULD generate a warning and return `null`.</li>
<li>If <var>local context</var> is not <code>null</code>, it contains
an <a>entry</a> with a key that equals <var>value</var>, and the value of the <a>entry</a>
Expand Down Expand Up @@ -6782,6 +6786,7 @@ <h4>JsonLdErrorCode</h4>
<li>The <a>processing mode</a> is now implicitly `json-ld-1.1`, unless set
explicitly to `json-ld-1.0`.</li>
<li>Improve notation using <a>IRI</a>, <a>IRI reference</a>, and <a>relative IRI reference</a>.</li>
<li>Ignore terms and IRIs that have the form of a keyword (`"@"1*ALPHA`).</li>
</ul>
</section>

Expand Down
112 changes: 112 additions & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -2876,6 +2876,118 @@ <h2>
</dd>
</dl>
</dd>
<dt id='t0119'>
Test t0119 Ignore some terms with @, allow others.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0119</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Processors SHOULD generate a warning and MUST ignore terms having the form of a keyword.</dd>
<dt>input</dt>
<dd>
<a href='expand/0119-in.jsonld'>expand/0119-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0119-out.jsonld'>expand/0119-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='t0120'>
Test t0120 Ignore some values of @id with @, allow others.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0120</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Processors SHOULD generate a warning and MUST ignore values of @id having the form of a keyword.</dd>
<dt>input</dt>
<dd>
<a href='expand/0120-in.jsonld'>expand/0120-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0120-out.jsonld'>expand/0120-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='t0121'>
Test t0121 Ignore some values of @reverse with @, allow others.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0121</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Processors SHOULD generate a warning and MUST ignore values of @reverse having the form of a keyword.</dd>
<dt>input</dt>
<dd>
<a href='expand/0121-in.jsonld'>expand/0121-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0121-out.jsonld'>expand/0121-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='t0122'>
Test t0122 Ignore some IRIs when that start with @ when expanding.
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0122</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Processors SHOULD generate a warning and MUST ignore IRIs having the form of a keyword.</dd>
<dt>input</dt>
<dd>
<a href='expand/0122-in.jsonld'>expand/0122-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0122-out.jsonld'>expand/0122-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='tc001'>
Test tc001 adding new term
</dt>
Expand Down
32 changes: 32 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,38 @@
"input": "expand/0118-in.jsonld",
"expect": "expand/0118-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0119",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Ignore some terms with @, allow others.",
"purpose": "Processors SHOULD generate a warning and MUST ignore terms having the form of a keyword.",
"input": "expand/0119-in.jsonld",
"expect": "expand/0119-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0120",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Ignore some values of @id with @, allow others.",
"purpose": "Processors SHOULD generate a warning and MUST ignore values of @id having the form of a keyword.",
"input": "expand/0120-in.jsonld",
"expect": "expand/0120-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0121",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Ignore some values of @reverse with @, allow others.",
"purpose": "Processors SHOULD generate a warning and MUST ignore values of @reverse having the form of a keyword.",
"input": "expand/0121-in.jsonld",
"expect": "expand/0121-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0122",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Ignore some IRIs when that start with @ when expanding.",
"purpose": "Processors SHOULD generate a warning and MUST ignore IRIs having the form of a keyword.",
"input": "expand/0122-in.jsonld",
"expect": "expand/0122-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
10 changes: 10 additions & 0 deletions tests/expand/0119-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": {
"@": "http://example.org/vocab/at",
"@foo.bar": "http://example.org/vocab/foo.bar",
"@ignoreMe": "http://example.org/vocab/ignoreMe"
},
"@": "allowed",
"@foo.bar": "allowed",
"@ignoreMe": "ignored"
}
4 changes: 4 additions & 0 deletions tests/expand/0119-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[{
"http://example.org/vocab/at": [{"@value": "allowed"}],
"http://example.org/vocab/foo.bar": [{"@value": "allowed"}]
}]
11 changes: 11 additions & 0 deletions tests/expand/0120-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": {
"@vocab": "http://example.orb/vocab/",
"at": {"@id": "@"},
"foo.bar": {"@id": "@foo.bar"},
"ignoreMe": {"@id": "@ignoreMe"}
},
"at": "allowed",
"foo.bar": "allowed",
"ignoreMe": "resolves to @vocab"
}
5 changes: 5 additions & 0 deletions tests/expand/0120-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[{
"http://example.orb/vocab/@": [{"@value": "allowed"}],
"http://example.orb/vocab/@foo.bar": [{"@value": "allowed"}],
"http://example.orb/vocab/ignoreMe": [{"@value": "resolves to @vocab"}]
}]
11 changes: 11 additions & 0 deletions tests/expand/0121-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/vocab/",
"at": {"@reverse": "@"},
"foo.bar": {"@reverse": "@foo.bar"}
},
"@id": "foo",
"at": {"@id": "allowed"},
"foo.bar": {"@id": "allowed"}
}
7 changes: 7 additions & 0 deletions tests/expand/0121-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[{
"@id": "http://example.org/foo",
"@reverse": {
"http://example.org/vocab/@": [{"@id": "http://example.org/allowed"}],
"http://example.org/vocab/@foo.bar": [{"@id": "http://example.org/allowed"}]
}
}]
8 changes: 8 additions & 0 deletions tests/expand/0122-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": {
"@base": "http://example.org/"
},
"http://example.org/vocab/at": {"@id": "@"},
"http://example.org/vocab/foo.bar": {"@id": "@foo.bar"},
"http://example.org/vocab/ignoreme": {"@id": "@ignoreMe"}
}
5 changes: 5 additions & 0 deletions tests/expand/0122-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[{
"http://example.org/vocab/at": [{"@id": "http://example.org/@"}],
"http://example.org/vocab/foo.bar": [{"@id": "http://example.org/@foo.bar"}],
"http://example.org/vocab/ignoreme": [{"@id": ""}]
}]
Loading