Skip to content

Commit a1e1e30

Browse files
committed
Update based on F2F discussion to simply lock terms, and not allow unlocking other than to clear the active context.
1 parent e17c814 commit a1e1e30

8 files changed

+38
-96
lines changed

index.html

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ <h2>Context Processing Algorithm</h2>
926926
<span class="changed">an optional <a>context</a></span>,
927927
<span class="changed">an optional <dfn>nest value</dfn>,</span>
928928
<span class="changed">an optional <dfn>prefix flag</dfn>,</span>
929-
<span class="changed">an optional <dfn>context id</dfn>, used to flag this as a sealed term,</span>
929+
<span class="changed">a <dfn>sealed</dfn>, used to mark this as a sealed term,</span>
930930
and an optional <dfn>container mapping</dfn>.
931931
A <a>term definition</a> can not only be used to map a <a>term</a>
932932
to an IRI, but also to map a <a>term</a> to a <a>keyword</a>,
@@ -994,35 +994,24 @@ <h3>Algorithm</h3>
994994

995995
<p>This algorithm specifies how a new <a>active context</a> is updated
996996
with a <a>local context</a>. The algorithm takes two required
997-
<span class="changed">and two optional</span>
997+
<span class="changed">and one optional</span>
998998
input variables.
999999
The required inputs inputs are an <var>active context</var> and a <var>local context</var>.
1000-
<span class="changed">The optional inputs are <var>from term</var></span>, which defaults to <code>null</code>,
1001-
and an <a>array</a> <var>remote contexts</var> which is used to detect cyclical context inclusions,
1002-
which defaults to a new empty <a>array</a>.</p>
1000+
The optional input is an <a>array</a> <var>remote contexts</var>,
1001+
defaulting to a new empty <a>array</a>, which is used to detect cyclical context inclusions.</p>
10031002

10041003
<ol>
10051004
<li>Initialize <var>result</var> to the result of cloning
10061005
<var>active context</var>.</li>
1007-
<li>Initialize <var>current seal</var> to the value of <a>context id</a>
1008-
from the term definition for <var>from term</var>,
1009-
if such a term definition exists.</li>
10101006
<li>If <var>local context</var> is not an <a>array</a>,
10111007
set it to an <a>array</a> containing only
10121008
<var>local context</var>.</li>
10131009
<li>
10141010
For each item <var>context</var> in <var>local context</var>:
10151011
<ol>
1016-
<li class="changed">Initialize <var>context id</var> to a unique identifier.
1017-
<span class="note"><var>context id</var> is used to identify sealed terms
1018-
created from the same context.</span></li>
1019-
<li>If <var>context</var> is <code>null</code>
1020-
<span class="changed">and <var>current seal</var> is <code>null</code></span>,
1021-
set <var>result</var> to a
1012+
<li>If <var>context</var> is <code>null</code>, set <var>result</var> to a
10221013
newly-initialized <var>active context</var> and continue with the
10231014
next <var>context</var>.
1024-
<span class="changed">If <var>current seal</var> is not <code>null</code>,
1025-
processors SHOULD issue a warning that an attempt was made to clear a sealed context.</span>
10261015
<span class="note">In JSON-LD 1.0, the <a>base IRI</a> was given
10271016
a default value here; this is now described conditionally
10281017
in <a href="#the-application-programming-interface" class="sectionRef"></a>.</span></li>
@@ -1146,9 +1135,8 @@ <h3>Algorithm</h3>
11461135
passing <var>result</var> for <var>active context</var>,
11471136
<var>context</var> for <var>local context</var>, <var>key</var>,
11481137
<var>defined</var>,
1149-
<span class="changed">the value of the <code>@sealed</code>
1150-
member from <var>context</var>, if any, for <var>sealed</var></span>,
1151-
<var>current seal</var>, and <var>context id</var>.</li>
1138+
<span class="changed">and the value of the <code>@sealed</code>
1139+
member from <var>context</var>, if any, for <var>sealed</var></span>.</li>
11521140
</ol>
11531141
</li>
11541142
<li>Return <var>result</var>.</li>
@@ -1193,14 +1181,12 @@ <h3>Overview</h3>
11931181
<section class="algorithm">
11941182
<h3>Algorithm</h3>
11951183

1196-
<p>The algorithm has four required <span class="changed">and three optional</span> inputs.
1184+
<p>The algorithm has four required <span class="changed">and one optional</span> inputs.
11971185
The required inputs are
11981186
an <var>active context</var>, a <var>local context</var>,
11991187
a <var>term</var>, and a map <var>defined</var>.
1200-
<span class="changed">The optional inputs are
1201-
<var>sealed</var> which defaults to <code>false</code>,
1202-
<var>current seal</var>, which defaults to <code>null</code>,
1203-
and <var>context id</var>, which defaults to <code>null</code>.</span></p>
1188+
<span class="changed">The optional input is
1189+
<var>sealed</var> which defaults to <code>false</code>.</span></p>
12041190
<ol>
12051191
<li>If <var>defined</var> contains the <a>member</a> <var>term</var> and the associated
12061192
value is <code>true</code> (indicating that the
@@ -1225,8 +1211,7 @@ <h3>Algorithm</h3>
12251211
<a data-link-for="JsonLdErrorCode">keyword redefinition</a>
12261212
error has been detected and processing is aborted.</li>
12271213
<li class="changed">If the <var>active context</var> has an existing
1228-
<a>term definition</a> for <var>term</var> with a non-null <a>context id</a>,
1229-
and <var>current seal</var> is not <code>null</code>, processing is aborted;
1214+
<a>term definition</a> for <var>term</var> which is sealed, processing is aborted;
12301215
processors SHOULD issue a warning that an attempt was made to redefine a sealed term.</li>
12311216
<li>Otherwise, remove any existing <a>term definition</a> for <var>term</var> in
12321217
<var>active context</var>.</li>
@@ -1248,8 +1233,7 @@ <h3>Algorithm</h3>
12481233
<li class="changed">If the <code>@sealed</code> member in <var>value</var>
12491234
is <code>true</code>, or there is no <code>@sealed</code> member in <var>value</var>
12501235
and the <var>sealed</var> parameter is <code>true</code>,
1251-
set the <a>context id</a> in <var>definition</var>
1252-
to the value of the <var>context id</var> parameter.</li>
1236+
set the <a>sealed</a> in <var>definition</var> to true.</li>
12531237
<li>If <var>value</var> contains the <a>member</a> <code>@type</code>:
12541238
<ol>
12551239
<li>Initialize <var>type</var> to the value associated with the
@@ -1710,9 +1694,8 @@ <h3>Algorithm</h3>
17101694
<li>If <var>element</var> contains the <a>member</a> <code>@context</code>, set
17111695
<var>active context</var> to the result of the
17121696
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
1713-
passing <var>active context</var>, the value of the
1714-
<code>@context</code> <a>member</a> as <var>local context</var>,
1715-
<span class="changed">and <var>active property</var> as <var>from term</var></span>.</li>
1697+
passing <var>active context</var> and the value of the
1698+
<code>@context</code> <a>member</a> as <var>local context</var>.</li>
17161699
<li class="changed">For each <var>key</var>/<var>value</var> pair in <var>element</var>
17171700
where <var>key</var> expands to <code>@type</code> using the
17181701
<a href="#iri-expansion">IRI Expansion algorithm</a>,
@@ -1724,9 +1707,8 @@ <h3>Algorithm</h3>
17241707
has a <a>local context</a>, set <var>active context</var> to the result
17251708
to the result of the
17261709
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
1727-
passing <var>active context</var>, the value of the
1728-
<var>term</var>'s <a>local context</a> as <var>local context</var>,
1729-
<span class="changed">and <var>active property</var> as <var>from term</var></span>.</li>
1710+
passing <var>active context</var> and the value of the
1711+
<var>term</var>'s <a>local context</a> as <var>local context</var>.</li>
17301712
</ol>
17311713
</li>
17321714
<li>Initialize an empty <a class="changed">dictionary</a>, <var>result</var>.</li>
@@ -1914,10 +1896,8 @@ <h3>Algorithm</h3>
19141896
has a <a>local context</a>, set <var>term context</var> to the result of the
19151897
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
19161898
passing <var>active context</var> and the value of the
1917-
<var>key</var>'s <a>local context</a> as <var>local context</var>.
1918-
<span class="changed note">The <var>from term</var> is not passed,
1919-
as scoped contexts may redefine sealed terms.</span>
1920-
Otherwise, set <var>term context</var> to <var>active context</var>.</li>
1899+
<var>key</var>'s <a>local context</a> as <var>local context</var>. Otherwise,
1900+
set <var>term context</var> to <var>active context</var>.</li>
19211901
<li>Set <var>container mapping</var> to <var>key</var>'s <a>container mapping</a> in
19221902
<var class="changed">term context</var>.</li>
19231903
<li>If <var>container mapping</var> <span class="changed">includes</span> <code>@language</code> and
@@ -1971,11 +1951,9 @@ <h3>Algorithm</h3>
19711951
<var>term context</var> has a <a>local context</a>, set
19721952
<var>map context</var> to the result of the <a
19731953
href="#context-processing-algorithm">Context Processing
1974-
algorithm</a>, passing <var>term context</var> as <var>active context</var>, the
1954+
algorithm</a>, passing <var>term context</var> as <var>active context</var> and the
19751955
value of the <var>index</var>'s <a>local context</a> as
1976-
<var>local context</var>,
1977-
<span class="changed">and <var>active property</var> as <var>from term</var></span>.
1978-
Otherwise, set <var>map context</var>
1956+
<var>local context</var>. Otherwise, set <var>map context</var>
19791957
to <var>term context</var>.</li>
19801958
<li>Set <var>expanded index</var> to the result of using the
19811959
<a href="#iri-expansion">IRI Expansion algorithm</a>,
@@ -2349,9 +2327,8 @@ <h3>Algorithm</h3>
23492327
<ol>
23502328
<li>Set <var>active context</var> to the result of the
23512329
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
2352-
passing <var>active context</var>, the value of the
2353-
<var>active property</var>'s <a>local context</a> as <var>local context</var>,
2354-
<span class="changed">and <var>active property</var> as <var>from term</var></span>.</li>
2330+
passing <var>active context</var> and the value of the
2331+
<var>active property</var>'s <a>local context</a> as <var>local context</var>.</li>
23552332
<li>Set <var>inverse context</var> using the
23562333
<a href="#inverse-context-creation">Inverse Context Creation algorithm</a>
23572334
using <var>active context</var>.</li>
@@ -2420,9 +2397,8 @@ <h3>Algorithm</h3>
24202397
<ol>
24212398
<li>Set <var>active context</var> to the result of the
24222399
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
2423-
passing <var>active context</var>, the value of <var>term</var>'s
2424-
<a>local context</a> as <var>local context</var>
2425-
<span class="changed">and <var>active property</var> as <var>from term</var></span>.</li>
2400+
passing <var>active context</var> and the value of <var>term</var>'s
2401+
<a>local context</a> as <var>local context</var>.</li>
24262402
<li>Set <var>inverse context</var> using the
24272403
<a href="#inverse-context-creation">Inverse Context Creation algorithm</a>
24282404
using <var>active context</var>.</li>

tests/expand-manifest.jsonld

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,27 +1819,19 @@
18191819
}, {
18201820
"@id": "#tse05",
18211821
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1822-
"name": "Do not clear active context with sealed terms from a sealed term",
1823-
"purpose": "The Active context may not be set to null if there are sealed terms when expanding a sealed term from the same context.",
1822+
"name": "Clear active context with sealed terms from an embedded context",
1823+
"purpose": "The Active context be set to null from an embedded context.",
18241824
"option": {"specVersion": "json-ld-1.1"},
18251825
"input": "expand/se05-in.jsonld",
18261826
"expect": "expand/se05-out.jsonld"
18271827
}, {
18281828
"@id": "#tse06",
18291829
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1830-
"name": "Clear active context of sealed terms from an unsealed term.",
1831-
"purpose": "The Active context may be set to null from a scoped context of an unsealed term.",
1830+
"name": "Clear active context of sealed terms from a term.",
1831+
"purpose": "The Active context may be set to null from a scoped context of a term.",
18321832
"option": {"specVersion": "json-ld-1.1"},
18331833
"input": "expand/se06-in.jsonld",
18341834
"expect": "expand/se06-out.jsonld"
1835-
}, {
1836-
"@id": "#tse07",
1837-
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1838-
"name": "Clear sealed context from scoped term that is sealed.",
1839-
"purpose": "The Active context may be set to null from a scoped context of a sealed term.",
1840-
"option": {"specVersion": "json-ld-1.1"},
1841-
"input": "expand/se07-in.jsonld",
1842-
"expect": "expand/se07-out.jsonld"
18431835
}, {
18441836
"@id": "#tse08",
18451837
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
@@ -1851,8 +1843,8 @@
18511843
}, {
18521844
"@id": "#tse09",
18531845
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1854-
"name": "Redefine term in other sealed context.",
1855-
"purpose": "A sealed term can redefine a sealed term in another context.",
1846+
"name": "Attempt to redefine term in other sealed context.",
1847+
"purpose": "A sealed term cannot redefine another sealed term.",
18561848
"option": {"specVersion": "json-ld-1.1"},
18571849
"input": "expand/se09-in.jsonld",
18581850
"expect": "expand/se09-out.jsonld"

tests/expand/se05-in.jsonld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"sealed": {"@language": null}
77
},
88
"sealed": {
9-
"@context": null,
10-
"sealed": "this should have the property http://example.com/sealed"
9+
"@context": [null, {"@vocab": "http://something-else/"}],
10+
"sealed": "this should have the property http://something-else/sealed"
1111
}
1212
}

tests/expand/se05-out.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"http://example.com/sealed": [{
4-
"http://example.com/sealed": [{"@value": "this should have the property http://example.com/sealed"}]
4+
"http://something-else/sealed": [{"@value": "this should have the property http://something-else/sealed"}]
55
}]
66
}
77
]

tests/expand/se07-in.jsonld

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/expand/se07-out.jsonld

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/expand/se09-in.jsonld

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
{
2-
"@context": [{
3-
"@version": 1.1,
4-
"@sealed": true,
5-
"sealed1": "http://example.org/sealed1"
6-
}, {
2+
"@context": {
73
"@version": 1.1,
84
"@sealed": true,
5+
"sealed1": "http://example.org/sealed1",
96
"sealed2": "http://example.org/sealed2"
10-
}],
7+
},
118
"sealed2": {
129
"@context": {"sealed1": "http://example.com/something-else"},
13-
"sealed1": "this should have the property http://example.com/something-else"
10+
"sealed1": "this should have the property http://example.org/sealed1"
1411
}
1512
}

tests/expand/se09-out.jsonld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[{
22
"http://example.org/sealed2": [{
33
"http://example.org/sealed1": [{
4-
"@value": "this should have the property http://example.com/something-else"
4+
"@value": "this should have the property http://example.org/sealed1"
55
}]
66
}]
77
}]

0 commit comments

Comments
 (0)