Skip to content

Context overflow. #416

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 6 commits into from
Mar 17, 2020
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
47 changes: 35 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ <h3>Algorithm</h3>

<p>This algorithm specifies how a new <a>active context</a> is updated
with a <a>local context</a>. The algorithm takes three required
<span class="changed">and three optional</span>
<span class="changed">and four optional</span>
input variables.
The required inputs are
an <var>active context</var>,
Expand All @@ -1204,8 +1204,10 @@ <h3>Algorithm</h3>
<span class="changed">
<var>override protected</var>, defaulting to <code>false</code>,
which is used to allow changes to protected terms,
and <var>propagate</var>, defaulting to <code>true</code>
to mark <a>term definitions</a> associated with non-propagated <a>contexts</a>.</span>.
<var>propagate</var>, defaulting to <code>true</code>
to mark <a>term definitions</a> associated with non-propagated <a>contexts</a>,
and <var>validate scoped context</var> defaulting to <code>true</code>,
which is used to limit recursion when validating possibly recusive <a>scoped contexts</a>.</span>.
</p>

<ol>
Expand Down Expand Up @@ -1259,6 +1261,10 @@ <h3>Algorithm</h3>
<a data-link-for="JsonLdErrorCode">context overflow</a>
error has been detected and processing is aborted;
otherwise, add <var>context</var> to <var>remote contexts</var>.</li>
<li id="alg-context-validate-scoped" class="changed">If <var>validate scoped context</var> is <code>false</code>,
and <var>remote contexts</var> already includes <var>context</var>
do not process <var>context</var> further and continue to any next
<var>context</var> in <var>local context</var>.</li>
<li class="changed">If <var>context</var> was previously dereferenced,
then the processor MUST NOT do a further dereference, and
<a>context</a> is set to the
Expand Down Expand Up @@ -1296,7 +1302,8 @@ <h3>Algorithm</h3>
<span class="changed">
the {{RemoteDocument/documentUrl}} of <var>context document</var> for <var>base URL</var>,
</span>
and <span class="changed">a copy of</span> <var>remote contexts</var>.
<span class="changed">a copy of</span> <var>remote contexts</var>,
<span class="changed">and <var>validate scoped context</var></span>.
<div class="note">If <var>context</var> was previously dereferenced,
<a>processors</a> MUST make provisions for retaining the <var>base URL</var>
of that <a>context</a> for this step to enable the resolution of any
Expand Down Expand Up @@ -1470,9 +1477,11 @@ <h3>Algorithm</h3>
<var>defined</var>,
<span class="changed">
<var>base URL</var>,
and the value of the <code>@protected</code>
entry from <var>context</var>, if any, for <var>protected</var>
</span>.
the value of the <code>@protected</code>
entry from <var>context</var>, if any, for <var>protected</var>,
<span class="changed">a copy of</span> <var>remote contexts</var>,
and <var>validate scoped context</var>.
</span>
</li>
</ol>
</li>
Expand Down Expand Up @@ -1519,7 +1528,7 @@ <h3>Overview</h3>
<section class="algorithm">
<h3>Algorithm</h3>

<p>The algorithm has four required <span class="changed">and three optional</span> inputs.
<p>The algorithm has four required <span class="changed">and five optional</span> inputs.
The required inputs are
an <var>active context</var>,
a <var>local context</var>,
Expand All @@ -1529,7 +1538,11 @@ <h3>Algorithm</h3>
<var>base URL</var> defaulting to <code>null</code>,
<var>protected</var> which defaults to <code>false</code>,
and <var>override protected</var>, defaulting to <code>false</code>,
which is used to allow changes to protected terms.</span>.
which is used to allow changes to protected terms,
an <a>array</a> <var>remote contexts</var>,
defaulting to a new empty <a>array</a>, which is used to detect cyclical context inclusions,
and <var>validate scoped context</var> defaulting to <code>true</code>,
which is used to limit recursion when validating possibly recusive <a>scoped contexts</a>.</span>.
</p>
<ol>
<li>If <var>defined</var> contains the <a>entry</a> <var>term</var> and the associated
Expand Down Expand Up @@ -1805,7 +1818,9 @@ <h3>Algorithm</h3>
<li>Invoke the <a href="#context-processing-algorithm">Context Processing algorithm</a>
using the <var>active context</var>, <var>context</var> as <var>local context</var>,
<var>base URL</var>,
and <code>true</code> for <var>override protected</var>.
<code>true</code> for <var>override protected</var>,
<span class="changed">a copy of</span> <var>remote contexts</var>,
and <code>false</code> for <var>validate scoped context</var>.
If any error is detected, an
<a data-link-for="JsonLdErrorCode">invalid scoped context</a> error
has been detected and processing is aborted.
Expand Down Expand Up @@ -6641,7 +6656,7 @@ <h4>JsonLdErrorCode</h4>
<dt><dfn>conflicting indexes</dfn></dt>
<dd>Multiple conflicting indexes have been found for the same node.</dd>
<dt><dfn>context overflow</dfn></dt>
<dd>maximum number of <code>@context</code> URLs exceeded.</dd>
<dd>Maximum number of <code>@context</code> URLs exceeded.</dd>
<dt><dfn>cyclic IRI mapping</dfn></dt>
<dd>A cycle in <a>IRI mappings</a> has been detected.</dd>
<dt><dfn>invalid @id value</dfn></dt>
Expand Down Expand Up @@ -6985,14 +7000,22 @@ <h2>Changes since Candidate Release of 05 March 2020</h2>
within an <a>active context</a>, and initialized as necessary.
This simplifies calling sequences and better represents actual implementation experience.</li>
<li>Update step <a href="#alg-compact-12_8_9_6">12.8.9.6</a></li>
<li>Update step <a href="#alg-compact-12_8_10">12.8.1</a> of the
<li>Update step <a href="#alg-compact-12_8_10">12.8.10</a> of the
<a href="#compaction-algorithm">Compaction Algorithm</a>
to add values to <var>nest result</var> instead of <var>result</var>
as was originally intended.</li>
<li>Update step <a href="#alg-merge-node-maps-2_2_1">2.2.1</a>
of <a href="#merge-node-maps" class="sectionRef"></a> to
exclude `@type`, leaving it to the next step.
This could cause type values from a node to be left out of the merge.</li>
<li>Added step <a href="#alg-context-validate-scoped">5.2.3</a>
to the <a href="#context-processing-algorithm">Context Processing algorithm</a>,
which is added <var>validate scoped context</var> as a new
optional argument, and passed to the
<a href="#create-term-definition">Create Term Definition algorithm</a>,
which in turn uses it with the value `false` when recursively calling
the <a href="#context-processing-algorithm">Context Processing algorithm</a>
when validating a <a>scoped context</a>.</li>
</ul>
</section>
<section id="ack"
Expand Down
84 changes: 84 additions & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,90 @@ <h2>
</dd>
</dl>
</dd>
<dt id='t0126'>
Test t0126 A scoped context may include itself recursively (direct)
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0126</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Verifies that no exception is raised on expansion when processing a scoped context referencing itself directly</dd>
<dt>input</dt>
<dd>
<a href='expand/0126-in.jsonld'>expand/0126-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0126-out.jsonld'>expand/0126-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='t0127'>
Test t0127 A scoped context may include itself recursively (indirect)
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0127</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Verifies that no exception is raised on expansion when processing a scoped context referencing itself indirectly</dd>
<dt>input</dt>
<dd>
<a href='expand/0127-in.jsonld'>expand/0127-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0127-out.jsonld'>expand/0127-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='t0128'>
Test t0128 Two scoped context may include a shared context
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0128</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Verifies that no exception is raised on expansion when processing two scoped contexts referencing a shared context</dd>
<dt>input</dt>
<dd>
<a href='expand/0128-in.jsonld'>expand/0128-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0128-out.jsonld'>expand/0128-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
24 changes: 24 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,30 @@
"input": "expand/0125-in.jsonld",
"expect": "expand/0125-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0126",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "A scoped context may include itself recursively (direct)",
"purpose": "Verifies that no exception is raised on expansion when processing a scoped context referencing itself directly",
"input": "expand/0126-in.jsonld",
"expect": "expand/0126-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0127",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "A scoped context may include itself recursively (indirect)",
"purpose": "Verifies that no exception is raised on expansion when processing a scoped context referencing itself indirectly",
"input": "expand/0127-in.jsonld",
"expect": "expand/0127-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0128",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Two scoped context may include a shared context",
"purpose": "Verifies that no exception is raised on expansion when processing two scoped contexts referencing a shared context",
"input": "expand/0128-in.jsonld",
"expect": "expand/0128-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
12 changes: 12 additions & 0 deletions tests/expand/0126-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@version": 1.1,
"prop": {
"@id": "ex:prop",
"@context": "0126-context.jsonld"
},
"value": {
"@id": "ex:value"
}
}
}
7 changes: 7 additions & 0 deletions tests/expand/0126-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@context": "0126-context.jsonld",
"@id": "ex:id",
"prop": {
"value": "v"
}
}
14 changes: 14 additions & 0 deletions tests/expand/0126-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"@id": "ex:id",
"ex:prop": [
{
"ex:value": [
{
"@value": "v"
}
]
}
]
}
]
12 changes: 12 additions & 0 deletions tests/expand/0127-context-1.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@version": 1.1,
"prop": {
"@id": "ex:prop",
"@context": "0127-context-2.jsonld"
},
"value": {
"@id": "ex:value"
}
}
}
3 changes: 3 additions & 0 deletions tests/expand/0127-context-2.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "0127-context-1.jsonld"
}
7 changes: 7 additions & 0 deletions tests/expand/0127-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@context": "0127-context-1.jsonld",
"@id": "ex:id",
"prop": {
"value": "v"
}
}
14 changes: 14 additions & 0 deletions tests/expand/0127-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"@id": "ex:id",
"ex:prop": [
{
"ex:value": [
{
"@value": "v"
}
]
}
]
}
]
3 changes: 3 additions & 0 deletions tests/expand/0128-context-1.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "0128-context-3.jsonld"
}
3 changes: 3 additions & 0 deletions tests/expand/0128-context-2.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "0128-context-3.jsonld"
}
12 changes: 12 additions & 0 deletions tests/expand/0128-context-3.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@version": 1.1,
"prop": {
"@id": "ex:prop",
"@context": "0128-context-3.jsonld"
},
"value": {
"@id": "ex:value"
}
}
}
10 changes: 10 additions & 0 deletions tests/expand/0128-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": [
"0128-context-1.jsonld",
"0128-context-2.jsonld"
],
"@id": "ex:id",
"prop": {
"value": "v"
}
}
14 changes: 14 additions & 0 deletions tests/expand/0128-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"@id": "ex:id",
"ex:prop": [
{
"ex:value": [
{
"@value": "v"
}
]
}
]
}
]
3 changes: 3 additions & 0 deletions tests/expand/e003-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "e003-in.jsonld"
}
4 changes: 4 additions & 0 deletions tests/expand/e052-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"@context": "e052-in.jsonld",
"@id": "http://example/test#example"
}
3 changes: 3 additions & 0 deletions tests/expand/e053-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "e053-in.jsonld"
}
4 changes: 4 additions & 0 deletions tests/expand/e053-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"@context": "e053-context.jsonld",
"@id": "http://example/test#example"
}
3 changes: 3 additions & 0 deletions tests/expand/e054-context-1.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "e054-context-2.jsonld"
}
3 changes: 3 additions & 0 deletions tests/expand/e054-context-2.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"@context": "e054-context-1.jsonld"
}
Loading