@@ -596,9 +596,19 @@ <h2>Syntax Tokens and Keywords</h2>
596
596
Used as the <code>@type</code> value of a <a>JSON literal</a>.
597
597
This keyword is described in <a href="#json-literals" class="sectionRef"></a>.
598
598
</dd>
599
- <dt><code>:</code></dt>
600
- <dd>The separator for JSON keys and values that use
601
- <a>compact IRIs</a>.</dd>
599
+ <dt class="changed"><code>:</code></dt><dd class="changed">
600
+ The separator for JSON keys and values that use <a>compact IRIs</a>.</dd>
601
+ <dt class="changed">`@propagate`</dt><dd class="changed">
602
+ Used in a <a>context definition</a> to change the sccope of that context.
603
+ By default, it is `true`,
604
+ meaning that contexts propagate across <a>node objects</a>
605
+ (other than for type-<a>scoped contexts</a>, which default to `false`).
606
+ Setting this to `false` causes term definitions created within that context
607
+ to be removed when entering a new <a>node object</a>.</dd>
608
+ <dt class="changed">`@source`</dt><dd class="changed">
609
+ Used in a <a>context definition</a> to load an external context
610
+ within which the containing <a>context definition</a> is merged.
611
+ This can be useful to add JSON-LD 1.1 features to JSON-LD 1.0 contexts.</dd>
602
612
</dl>
603
613
604
614
<p>All keys, <a>keywords</a>, and values in JSON-LD are case-sensitive.</p>
@@ -3413,7 +3423,9 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3413
3423
different things depending on the context.
3414
3424
A <a>context</a> scoped on <code>@type</code> is only in effect for the <a>node object</a> on which
3415
3425
the type is used; the previous in-scope <a>contexts</a> are placed back into
3416
- effect when traversing into another <a>node object</a>.</p>
3426
+ effect when traversing into another <a>node object</a>.
3427
+ As described further in <a href="#context-propagation" class="sectionRef"></a>,
3428
+ this may be controlled using the `@propagate` keyword.</p>
3417
3429
3418
3430
<p class="note">Any property-scoped or local contexts that were introduced in the <a>node object</a>
3419
3431
would still be in effect when traversing into another <a>node object</a>.</p>
@@ -3525,6 +3537,103 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
3525
3537
<a>processing mode</a> set to <code>json-ld-1.1</code>.</p>
3526
3538
</section>
3527
3539
3540
+ <section class="informative changed"><h2>Context Propagation</h2>
3541
+ <p>Once introduced, <a>contexts</a> remain in effect until a subsequent
3542
+ <a>context</a> removes it by setting `@context` to `null`,
3543
+ or by redefining terms,
3544
+ with the exception of type-<a>scoped contexts</a>,
3545
+ which limits the affect of that context until the next <a>node object</a> is entered.
3546
+ This behavior can be changed using the `@propagate` keyword.</p>
3547
+
3548
+ <p>The following example illustrates how terms defined in a context with `@propagate` set to `false`
3549
+ are effectively removed when descending into new <a>node object</a>.</p>
3550
+
3551
+ <aside class="example ds-selector-tabs"
3552
+ title="Marking a context to not propagate">
3553
+ <div class="selectors">
3554
+ <button class="selected" data-selects="compacted">Compacted (Input)</button>
3555
+ <button data-selects="expanded">Expanded (Result)</button>
3556
+ <button data-selects="statements">Statements</button>
3557
+ <button data-selects="turtle">Turtle</button>
3558
+ <a class="playground" target="_blank"></a>
3559
+ </div>
3560
+ <pre class="compacted input selected nohighlight" data-transform="updateExample">
3561
+ <!--
3562
+ {
3563
+ "@context": {
3564
+ "@version": 1.1,
3565
+ "term": {
3566
+ "@id": "http://example.org/original",
3567
+ "@context": {
3568
+ "@propagate": false,
3569
+ #### ↑ Scoped context only lasts in one node-object####
3570
+ "term": "http://example.org/non-propagated-term"
3571
+ }
3572
+ }
3573
+ },
3574
+ "term": {
3575
+ #### ↑ This term is the original####
3576
+ "term": {
3577
+ #### ↑ This term is from the scoped context####
3578
+ "term": "This term is from the first context"
3579
+ #### ↑ This term is the original again####
3580
+ }
3581
+ }
3582
+ }
3583
+ -->
3584
+ </pre>
3585
+ <pre class="expanded result result nohighlight"
3586
+ data-transform="updateExample"
3587
+ data-result-for="Marking a context to not propagate-compacted">
3588
+ <!--
3589
+ [{
3590
+ "http://example.org/original": [{
3591
+ "http://example.org/non-propagated-term": [{
3592
+ "http://example.org/original": [
3593
+ {"@value": "This term is from the first context"}
3594
+ ]
3595
+ }]
3596
+ }]
3597
+ }]
3598
+ -->
3599
+ </pre>
3600
+ <table class="statements"
3601
+ data-result-for="Marking a context to not propagate-expanded"
3602
+ data-to-rdf
3603
+ data-no-lint>
3604
+ <thead><tr><th>Subject</th><th>Property</th><th>Value</th></tr></thead>
3605
+ <tbody>
3606
+ <tr><td>_:b2</td><td>http://example.org/original</td><td>This term is from the first context</td></tr>
3607
+ <tr><td>_:b1</td><td>http://example.org/non-propagated-term</td><td>_:b2</td></tr>
3608
+ <tr><td>_:b0</td><td>http://example.org/original</td><td>_:b1</td></tr>
3609
+ </tbody>
3610
+ </table>
3611
+ <pre class="turtle"
3612
+ data-content-type="text/turtle"
3613
+ data-result-for="Marking a context to not propagate-expanded"
3614
+ data-transform="updateExample"
3615
+ data-to-rdf
3616
+ data-no-lint>
3617
+ <!--
3618
+ @prefix ex: <http://example.org/> .
3619
+ [
3620
+ ex:original [
3621
+ ex:non-propagated-term [
3622
+ ex:original "This term is from the first context"
3623
+ ]
3624
+ ]
3625
+ ] .
3626
+ -->
3627
+ </pre>
3628
+ </aside>
3629
+
3630
+ <p class="note">Contexts included within an array must all have the same value for `@propagate`
3631
+ due to the way that rollback is defined in [[[JSON-LD11-API]]].</p>
3632
+ </section>
3633
+
3634
+ <section class="informative changed"><h2>Sourced Contexts</h2>
3635
+ </section>
3636
+
3528
3637
<section class="informative changed"><h2>Protected Term Definitions</h2>
3529
3638
<p>JSON-LD is used in many specifications as the specified data format.
3530
3639
However, there is also a desire to allow some JSON-LD contents to be processed as plain JSON,
@@ -11718,10 +11827,12 @@ <h2>Context Definitions</h2>
11718
11827
<code>@reverse</code>,
11719
11828
<code>@type</code>,
11720
11829
<code>@language</code>,
11830
+ <code>@container</code>,
11721
11831
<code class="changed">@context</code>,
11722
- <code class="changed">@prefix</code>, or
11723
- <code>@container</code>. An
11724
- <a>expanded term definition</a> SHOULD NOT contain any other keys.</p>
11832
+ <code class="changed">@prefix</code>,
11833
+ <code class="changed">@propagate</code>, or
11834
+ <code class="changed">@source</code>.
11835
+ An <a>expanded term definition</a> SHOULD NOT contain any other keys.</p>
11725
11836
11726
11837
<p>If the term being defined is not a <a>compact IRI</a> or
11727
11838
<a>absolute IRI</a> and the <a>active context</a> does not have an
@@ -11787,14 +11898,20 @@ <h2>Context Definitions</h2>
11787
11898
<p class="changed">If the <a>expanded term definition</a> contains the <code>@prefix</code>
11788
11899
<a>keyword</a>, its value MUST be <code>true</code> or <code>false</code>.</p>
11789
11900
11901
+ <p class="changed">If the <a>expanded term definition</a> contains the <code>@propagate</code>
11902
+ <a>keyword</a>, its value MUST be <code>true</code> or <code>false</code>.</p>
11903
+
11904
+ <p class="changed">If the <a>expanded term definition</a> contains the <code>@source</code>
11905
+ <a>keyword</a>, its value MUST be an <a>absolute IRI</a> or <a>relative IRI</a>.</p>
11906
+
11790
11907
<p><a>Terms</a> MUST NOT be used in a circular manner. That is,
11791
11908
the definition of a term cannot depend on the definition of another term if that other
11792
11909
term also depends on the first term.</p>
11793
11910
11794
11911
<p>See <a class="sectionRef" href="#the-context"></a> for further discussion on contexts.</p>
11795
11912
</section>
11796
11913
11797
- <section class="normative changed ">
11914
+ <section class="normative">
11798
11915
<h2>Keywords</h2>
11799
11916
<p>JSON-LD <a>keywords</a> are described in <a class="sectionRef" href="#syntax-tokens-and-keywords"></a>,
11800
11917
this section describes where each <a>keyword</a> may appear within different JSON-LD structures.</p>
@@ -11811,17 +11928,17 @@ <h2>Keywords</h2>
11811
11928
<code>@set</code>,
11812
11929
<code>@language</code>,
11813
11930
<code>@index</code>,
11814
- <span>< code>@id</code></span >,
11815
- <span>< code>@graph</code></span >,
11816
- <span>< code>@type</code></span >, or be
11931
+ <code class="changed" >@id</code>,
11932
+ <code class="changed" >@graph</code>,
11933
+ <code class="changed" >@type</code>, or be
11817
11934
<a>null</a>,
11818
- or an <a>array</a> containing exactly any one of those keywords, or a
11819
- combination of <code>@set</code> and any of <code>@index</code>,
11820
- <code>@id</code>, <code>@graph</code>, <code>@type</code>,
11821
- <code>@language</code> in any order.
11822
- The value may also be an array
11823
- containing <code>@graph</code> along with either <code>@id</code> or
11824
- <code>@index</code> and also optionally including <code>@set</code>.
11935
+ <span class="changed"> or an <a>array</a> containing exactly any one of those keywords, or a
11936
+ combination of <code>@set</code> and any of <code>@index</code>,
11937
+ <code>@id</code>, <code>@graph</code>, <code>@type</code>,
11938
+ <code>@language</code> in any order.
11939
+ The value may also be an array
11940
+ containing <code>@graph</code> along with either <code>@id</code> or
11941
+ <code>@index</code> and also optionally including <code>@set</code></span >.
11825
11942
</dd>
11826
11943
<dt><code>@context</code></dt><dd>
11827
11944
The <code>@context</code> keyword MUST NOT be aliased, and MAY be used as a key in the following objects:
@@ -11841,6 +11958,12 @@ <h2>Keywords</h2>
11841
11958
a <a>context definition</a>, or
11842
11959
an <a>array</a> composed of any of these.
11843
11960
</dd>
11961
+ <dt>`@graph`</dt><dd>
11962
+ The `@graph` keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>graph object</a>.
11963
+ The unaliased `@graph` MAY be used as the value of the <code>@container</code> key within an <a>expanded term definition</a>.
11964
+ The value of the `@graph` key MUST be a <a>value object</a>, <a>node object</a>, or an array of either <a>value objects</a> or <a>node objects</a>.
11965
+ See <a class="sectionRef" href="#named-graphs"></a>.
11966
+ </dd>
11844
11967
<dt><code>@id</code></dt><dd>
11845
11968
The <code>@id</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>graph object</a>.
11846
11969
The unaliased <code>@id</code> MAY be used as a key in an <a>expanded term definition</a>,
@@ -11883,7 +12006,7 @@ <h2>Keywords</h2>
11883
12006
11884
12007
<p>See <a class="sectionRef" href="#sets-and-lists"></a> for further discussion on sets and lists.</p>
11885
12008
</dd>
11886
- <dt><code>@nest</code></dt><dd>
12009
+ <dt class="changed" ><code>@nest</code></dt><dd class="changed" >
11887
12010
The <code>@nest</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a>.
11888
12011
The unaliased <code>@nest</code> MAY be used as the value of a <a>simple term definition</a>,
11889
12012
or as a key in an <a>expanded term definition</a>.
@@ -11892,7 +12015,7 @@ <h2>Keywords</h2>
11892
12015
Its value MUST be a <a>string</a>.
11893
12016
See <a class="sectionRef" href="#property-nesting"></a> for a further discussion.
11894
12017
</dd>
11895
- <dt><code>@none</code></dt><dd>
12018
+ <dt class="changed" ><code>@none</code></dt><dd class="changed" >
11896
12019
The <code>@none</code> keyword MAY be aliased and MAY be used as a key in an
11897
12020
<a>index map</a>, <a>id map</a>, <a>language map</a>, <a>type map</a>.
11898
12021
See <a class="sectionRef" href="#data-indexing"></a>,
@@ -11902,13 +12025,18 @@ <h2>Keywords</h2>
11902
12025
<a class="sectionRef" href="#named-graph-indexing"></a>, or
11903
12026
<a class="sectionRef" href="#named-graph-data-indexing"></a>
11904
12027
for a further discussion.</dd>
11905
- <dt><code>@prefix</code></dt><dd>
12028
+ <dt class="changed" ><code>@prefix</code></dt><dd class="changed" >
11906
12029
The <code>@prefix</code> keyword MUST NOT be aliased, and MAY be used as a key in an <a>expanded term definition</a>.
11907
12030
Its value MUST be <code>true</code> or <code>false</code>.
11908
12031
See <a class="sectionRef" href="#compact-iris"></a>
11909
12032
and <a class="sectionRef" href="#context-definitions"></a>
11910
12033
for a further discussion.
11911
12034
</dd>
12035
+ <dt class="changed">`@propagate`</dt><dd class="changed">
12036
+ The `@propagate` keyword MUST NOT be aliased, and MAY be used in a <a>context definition</a>.
12037
+ Its value MUST be <code>true</code> or <code>false</code>.
12038
+ See <a class="sectionRef" href="#context-propagation"></a> for a further discussion.
12039
+ </dd>
11912
12040
<dt><code>@reverse</code></dt><dd>
11913
12041
The <code>@reverse</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a>.
11914
12042
The unaliased <code>@reverse</code> MAY be used as a key in an <a>expanded term definition</a>.
@@ -11934,6 +12062,11 @@ <h2>Keywords</h2>
11934
12062
11935
12063
<p>See <a class="sectionRef" href="#sets-and-lists"></a> for further discussion on sets and lists.</p>
11936
12064
</dd>
12065
+ <dt class="changed">`@source`</dt><dd class="changed">
12066
+ The `@source` keyword MUST NOT be aliased, and MAY be used in a <a>context definition</a>.
12067
+ Its value MUST be an <a>absolute IRI</a> or <a>relative IRI</a>.
12068
+ See <a class="sectionRef" href="#sourced-contexts"></a> for a further discussion.
12069
+ </dd>
11937
12070
<dt><code>@type</code></dt><dd>
11938
12071
The <code>@type</code> keyword MAY be aliased and MAY be used as a key in a <a>node object</a> or a <a>value object</a>.
11939
12072
The unaliased <code>@type</code> MAY be used as a key in an <a>expanded term definition</a>,
@@ -11949,7 +12082,7 @@ <h2>Keywords</h2>
11949
12082
Its value key MUST be either a <a>string</a>, a <a>number</a>, <code>true</code>, <code>false</code> or <a>null</a>.
11950
12083
This keyword is described further in <a class="sectionRef" href="#value-objects"></a>.
11951
12084
</dd>
11952
- <dt><code>@version</code></dt><dd>
12085
+ <dt class="changed" ><code>@version</code></dt><dd class="changed" >
11953
12086
The <code>@version</code> keyword MUST NOT be aliased and MAY be used as a key in a <a>context definition</a>.
11954
12087
Its value MUST be a <a>number</a> with the value <code>1.1</code>.
11955
12088
This keyword is described further in <a class="sectionRef" href="#context-definitions"></a>.
@@ -12880,6 +13013,12 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
12880
13013
to limit the ability of other contexts to override them.</li>
12881
13014
<li>A <a>context</a> defined in an <a>expanded term definition</a> may also be used for values
12882
13015
of <code>@type</code>, which defines a <a>context</a> to use for <a>node objects</a> including the associated type.</li>
13016
+ <li>By default, all contexts are propagated when traversing <a>node objects</a>, other than
13017
+ type-scoped contexts. This can be controlled using the <code>@propagate</code>
13018
+ <a>entry</a> in a <a>local context</a>.</li>
13019
+ <li>A context may contain a <code>@source</code> <a>entry</a> used to reference a remote context
13020
+ within a context, allowing <code>JSON-LD 1.1</code> features to be added to contexts originally
13021
+ authored for <code>JSON-LD 1.0</code>.</li>
12883
13022
</ul>
12884
13023
</section>
12885
13024
0 commit comments