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