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