Skip to content

Commit d607bc0

Browse files
committed
Use type-scoped and property-scoped terms, and take advantage of "context definition" as the shape of a map used as a context.
1 parent 816151c commit d607bc0

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

common/terms.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,25 @@
105105
<dt><dfn>default object</dfn></dt><dd>
106106
A <a>default object</a> is a <a>map</a> that has a <code>@default</code> key.</dd>
107107
<dt><dfn>embedded context</dfn></dt><dd>
108+
An embedded <a>context</a> is a context which appears as part of a
109+
<a>node object</a>, <a>value object</a>, <a>graph object</a>, <a>list object</a>,
110+
<a>set object</a>, <span class="changed">or as part of <a>nested properties</a>,
111+
or in an <a>expanded term definition</a></span>
112+
using the <code>@context</code> <a>entry</a>.
113+
Its value may be a <a>map</a> for a <a data-cite="JSON-LD11#dfn-context-definition">,
114+
as an <a>IRI</a>, or as an <a>array</a> combining either of the above.</a>
115+
</dd>
116+
<dt><dfn>context map</dfn></dt><dd>
108117
An embedded <a>context</a> is a <a>map</a> composed of a combintation of
109118
<a>term definitions</a>, a <a>vocabulary mapping</a>, a <a>base IRI</a> and <a>default language</a>.
110119
An <a>embedded context</a> may appear as part of a <a>node object</a> or <a>value object</a> using the
111120
<code>@context</code> <a>entry</a>.
112121
</dd>
113-
<dt><dfn>scoped context</dfn></dt><dd>
122+
<dt><dfn class="preserve">scoped context</dfn></dt><dd>
114123
A <a>scoped context</a> is part of an <a>expanded term definition</a> using the
115124
<code>@context</code> <a>entry</a>. It has the same form as an <a>embedded context</a>.
125+
When the term is used as a type, it is a <dfn class="preserve">type-scoped context</dfn>,
126+
when used as a property it is a <dfn class="preserve">property-scoped context</dfn>.
116127
</dd>
117128
<dt><dfn>expanded term definition</dfn></dt><dd>
118129
An expanded term definition is a <a>term definition</a>

index.html

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,9 @@ <h3>Overview</h3>
10611061
has been detected. Otherwise, we process <a>context</a> by recursively using
10621062
this algorithm ensuring that there is no cyclical reference.</p>
10631063

1064-
<p>If <a>context</a> is a <a class="changed">map</a>, we first update the
1064+
<p>If <a>context</a> is a <a class="changed">map</a>,
1065+
it is a <a data-cite="JSON-LD11#dfn-context-definition">context definition</a>.
1066+
We first update the
10651067
<a>base IRI</a>, the <a>vocabulary mapping</a>, <a>processing mode</a>, and the
10661068
<a>default language</a> by processing three specific keywords:
10671069
<code>@base</code>, <code>@vocab</code>, <code>@version</code>, and <code>@language</code>.
@@ -1074,7 +1076,7 @@ <h3>Overview</h3>
10741076
<p class="changed">If <a>context</a> is not to be propagated,
10751077
a reference to the <var>previous context</var> is retained so that
10761078
it may be rolled back when a new <a>node object</a> is entered.
1077-
By default, all contexts are propagated, other than type-scoped contexts.</p>
1079+
By default, all contexts are propagated, other than <a>type-scoped contexts</a>.</p>
10781080

10791081
<p>Then, for every other <a>entry</a> in <a>local context</a>, we update
10801082
the <a>term definition</a> in <var>result</var>. Since
@@ -1183,6 +1185,7 @@ <h3>Algorithm</h3>
11831185
<li>If <var>context</var> is not a <a class="changed">map</a>, an
11841186
<a data-link-for="JsonLdErrorCode">invalid local context</a>
11851187
error has been detected and processing is aborted.</li>
1188+
<li>Otherwise, <var>context</var> is a <a data-cite="JSON-LD11#dfn-context-definition">context definition</a>.</li>
11861189
<li class="changed">If <var>context</var> has an <code>@version</code> <a>entry</a>:
11871190
<ol>
11881191
<li>If the associated value is not <code>1.1</code>,
@@ -1217,7 +1220,7 @@ <h3>Algorithm</h3>
12171220
characters are treated in URI references, per
12181221
<a data-cite="RFC3987#section-6.5">section 6.5</a>
12191222
of [[RFC3987]].</li>
1220-
<li>Otherwise, dereference <var>import</var> using
1223+
<li>Dereference <var>import</var> using
12211224
the <a>LoadDocumentCallback</a>, passing <var>import</var>
12221225
for <a data-link-for="LoadDocumentCallback">url</a>,
12231226
and <code>http://www.w3.org/ns/json-ld#context</code> for <a data-link-for="LoadDocumentOptions">profile</a></li>
@@ -1227,7 +1230,8 @@ <h3>Algorithm</h3>
12271230
error has been detected and processing is aborted.</li>
12281231
<li>If the dereferenced document has no
12291232
top-level <a>map</a> with an <code>@context</code> <a>entry</a>,
1230-
or if the value of <code>@context</code> is not an <a>map</a>,
1233+
or if the value of <code>@context</code> is not a <a data-cite="JSON-LD11#dfn-context-definition">context definition</a>
1234+
(i.e., it is not an <a>map</a>),
12311235
an <a data-link-for="JsonLdErrorCode">invalid remote context</a>
12321236
has been detected and processing is aborted; otherwise,
12331237
set <var>import context</var> to the value of that <a>entry</a>.</li>
@@ -1897,15 +1901,15 @@ <h3>Algorithm</h3>
18971901
<li class="changed">If <var>active property</var> is <code>@default</code>,
18981902
set the <a data-link-for="JsonLdOptions">frameExpansion</a> flag to <code>false</code>.</li>
18991903
<li class="changed">If <var>active property</var> has a <a>term definition</a> in <var>active context</var>
1900-
has a <a>local context</a>, set <var>property scoped context</var> to the that <a>local context</a>.</li>
1904+
has a <a>local context</a>, set <var>property-scoped context</var> to the that <a>local context</a>.</li>
19011905
<li>If <var>element</var> is a <a>scalar</a>,
19021906
<ol>
19031907
<li>If <var>active property</var> is <code>null</code> or <code>@graph</code>,
19041908
drop the free-floating <a>scalar</a> by returning <code>null</code>.</li>
1905-
<li class="changed">If <var>property scoped context</var> is defined,
1909+
<li class="changed">If <var>property-scoped context</var> is defined,
19061910
set <var>active context</var> to the result of the
19071911
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
1908-
passing <var>active context</var> and <var>property scoped context</var> as <var>local context</var>.</li>
1912+
passing <var>active context</var> and <var>property-scoped context</var> as <var>local context</var>.</li>
19091913
<li>Return the result of the
19101914
<a href="#value-expansion">Value Expansion algorithm</a>, passing the
19111915
<var>active context</var>, <var>active property</var>, and
@@ -1946,18 +1950,18 @@ <h3>Algorithm</h3>
19461950
and <var>element</var> does not consist of a single entry expanding to <code>@id</code>,
19471951
set <var>active context</var> to <a>previous context</a> from <var>active context</var>,
19481952
as the scope of a term-scoped <a>context</a> does not apply when processing new <a>node objects</a>.</li>
1949-
<li class="changed">If <var>property scoped context</var> is defined,
1953+
<li class="changed">If <var>property-scoped context</var> is defined,
19501954
set <var>active context</var> to the result of the
19511955
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
1952-
passing <var>active context</var> and <var>property scoped context</var> as <var>local context</var>.</li>
1956+
passing <var>active context</var> and <var>property-scoped context</var> as <var>local context</var>.</li>
19531957
<li>If <var>element</var> contains the <a>entry</a> <code>@context</code>, set
19541958
<var>active context</var> to the result of the
19551959
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
19561960
passing <var>active context</var> and the value of the
19571961
<code>@context</code> <a>entry</a> as <var>local context</var>.</li>
1958-
<li class="changed">Set <var>type scoped context</var> to <var>active context</var>.
1962+
<li class="changed">Set <var>type-scoped context</var> to <var>active context</var>.
19591963
This is used for expanding values that may be relevant to any previous
1960-
type-scoped <a>context</a>.</li>
1964+
<a>type-scoped context</a>.</li>
19611965
<li class="changed">For each <var>key</var>/<var>value</var> pair in <var>element</var>
19621966
where <var>key</var> expands to <code>@type</code> using the
19631967
<a href="#iri-expansion">IRI Expansion algorithm</a>,
@@ -2024,7 +2028,7 @@ <h3>Algorithm</h3>
20242028
error has been detected and processing is aborted. Otherwise,
20252029
set <var>expanded value</var> to the result of using the
20262030
<a href="#iri-expansion">IRI Expansion algorithm</a>, passing
2027-
<var class="changed">type scoped context</var> for <var>active context</var>,
2031+
<var class="changed">type-scoped context</var> for <var>active context</var>,
20282032
<code>true</code> for <var>vocab</var>,
20292033
and <code>true</code> for <var>document relative</var> to expand the <var>value</var>
20302034
or each of its items.
@@ -2610,9 +2614,9 @@ <h3>Algorithm</h3>
26102614
<span class="changed">If not passed, the both flags are set to <code>false</code></span>.</p>
26112615

26122616
<ol>
2613-
<li class="changed">Set <var>type scoped context</var> to <var>active context</var>.
2617+
<li class="changed">Set <var>type-scoped context</var> to <var>active context</var>.
26142618
This is used for compacting values that may be relevant to any previous
2615-
type-scoped <a>context</a>.</li>
2619+
<a>type-scoped context</a>.</li>
26162620
<li>If <var>element</var> is a <a>scalar</a>, it is already in its most
26172621
compact form, so simply return <var>element</var>.</li>
26182622
<li>If <var>element</var> is an <a>array</a>:
@@ -2694,13 +2698,13 @@ <h3>Algorithm</h3>
26942698
Then, for each <var>term</var>
26952699
in <var>compacted types</var> ordered lexicographically:
26962700
<ol>
2697-
<li>If the <a>term definition</a> for <var>term</var> in <var>type scoped context</var> has a
2701+
<li>If the <a>term definition</a> for <var>term</var> in <var>type-scoped context</var> has a
26982702
<a>local context</a>:
26992703
<ol>
27002704
<li>Set <var>active context</var> to the result of the
27012705
<a href="#context-processing-algorithm">Context Processing algorithm</a>,
27022706
passing <var>active context</var> and the value of <var>term</var>'s
2703-
<a>local context</a> in <var>type scoped context</var> as <var>local context</var>.</li>
2707+
<a>local context</a> in <var>type-scoped context</var> as <var>local context</var>.</li>
27042708
<li>Set <var>inverse context</var> using the
27052709
<a href="#inverse-context-creation">Inverse Context Creation algorithm</a>
27062710
using <var>active context</var>.</li>
@@ -2734,7 +2738,7 @@ <h3>Algorithm</h3>
27342738
<li>If <var>expanded value</var> is a <a>string</a>,
27352739
then initialize <var>compacted value</var> to the result
27362740
of using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
2737-
passing <var>type scoped context</var> for <var>active context</var>, <var>inverse context</var>,
2741+
passing <var>type-scoped context</var> for <var>active context</var>, <var>inverse context</var>,
27382742
<var>expanded value</var> for <var>var</var>,
27392743
and <code>true</code> for <var>vocab</var>.</li>
27402744
<li>Otherwise, <var>expanded value</var> must be a
@@ -2747,7 +2751,7 @@ <h3>Algorithm</h3>
27472751
<ol>
27482752
<li>Set <var>term</var> to the result of
27492753
of using the <a href="#iri-compaction">IRI Compaction algorithm</a>,
2750-
passing <var>type scoped context</var> for <var>active context</var>, <var>inverse context</var>,
2754+
passing <var>type-scoped context</var> for <var>active context</var>, <var>inverse context</var>,
27512755
<var>expanded type</var> for <var>var</var>, and
27522756
<code>true</code> for <var>vocab</var>.</li>
27532757
<li>Append <var>term</var>, to <var>compacted value</var>.</li>
@@ -6299,7 +6303,7 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
62996303
<a>absolute IRI</a> which could be confused with a compact IRI in the
63006304
<a>active context</a>.</li>
63016305
<li>By default, all contexts are propagated when traversing <a>node objects</a>, other than
6302-
type-scoped contexts. This can be controlled using the <code>@propagate</code>
6306+
<a>type-scoped contexts</a>. This can be controlled using the <code>@propagate</code>
63036307
<a>entry</a> in a <a>local context</a>.</li>
63046308
<li>A context may contain a <code>@import</code> <a>entry</a> used to reference a remote context
63056309
within a context, allowing <code>JSON-LD 1.1</code> features to be added to contexts originally

0 commit comments

Comments
 (0)