@@ -1001,7 +1001,7 @@ <h2>Context Processing Algorithm</h2>
1001
1001
keys and values have to be interpreted as well as the current < a > base IRI</ a > ,
1002
1002
the < a > vocabulary mapping</ a > , the < a > default language</ a > ,
1003
1003
< span class ="changed "> and an optional < dfn > previous context</ dfn > ,
1004
- used when a type-scoped < a > context</ a > is defined</ span > .
1004
+ used when a non-propagated < a > context</ a > is defined</ span > .
1005
1005
Each < a > term definition</ a > consists of:</ p >
1006
1006
< ul >
1007
1007
< li > an < dfn > IRI mapping</ dfn > ,</ li >
@@ -1012,7 +1012,7 @@ <h2>Context Processing Algorithm</h2>
1012
1012
< li class ="changed "> an optional < dfn > prefix flag</ dfn > ,</ li >
1013
1013
< li class ="changed "> an optional < dfn > index mapping</ dfn > ,</ li >
1014
1014
< li class ="changed "> a < dfn > protected</ dfn > , used to mark this as a protected term,</ li >
1015
- < li > and an optional < dfn > container mapping</ dfn > </ li > .
1015
+ < li > and an optional < dfn > container mapping</ dfn > . </ li >
1016
1016
</ ul >
1017
1017
1018
1018
< p > A < a > term definition</ a > can not only be used to map a < a > term</ a >
@@ -1067,6 +1067,11 @@ <h3>Overview</h3>
1067
1067
they affect how the other < a > members</ a > are processed. Please note that < code > @base</ code > is
1068
1068
ignored when processing remote contexts.</ p >
1069
1069
1070
+ < p class ="changed "> If < a > context</ a > is not to be propagated,
1071
+ a reference to the < var > previous context</ var > is retained so that
1072
+ it may be rolled back when a new < a > node object</ a > is entered.
1073
+ By default, all contexts are propagated, other than type-scoped contexts.</ p >
1074
+
1070
1075
< p > Then, for every other < a > member</ a > in < a > local context</ a > , we update
1071
1076
the < a > term definition</ a > in < var > result</ var > . Since
1072
1077
< a > term definitions</ a > in a < a > local context</ a >
@@ -1094,19 +1099,23 @@ <h3>Algorithm</h3>
1094
1099
< span class ="changed "> , < var > from property</ var > , defaulting to < code > false</ code > ,
1095
1100
which is used to allow changes to protected terms,
1096
1101
and < var > from type</ var > , defaulting to < code > false</ code > ,
1097
- which is used to mark < a > term definitions</ a > associated with a type-scoped < a > context</ a > .</ span > .
1102
+ which is used to set the default for < var > propagated</ var >
1103
+ to mark < a > term definitions</ a > associated with non-propagated < a > contexts</ a > .</ span > .
1098
1104
</ p >
1099
1105
1100
1106
< ol >
1101
1107
< li > Initialize < var > result</ var > to the result of cloning
1102
1108
< var > active context</ var > .</ li >
1109
+ < li class ="changed "> If < var > local context</ var > is an object containing the member < code > @propagate</ code > ,
1110
+ its value MUST be < a > boolean</ a > < code > true</ code > or < code > false</ code > ,
1111
+ set < var > propagate</ var > to that value.</ li >
1112
+ < li class ="changed "> Otherwise, set < var > propagate</ var > to < var > from type</ var > .</ li >
1113
+ < li class ="changed "> If < var > propagate</ var > is < code > false</ code > , and < var > result</ var >
1114
+ does not have a < a > previous context</ a > , set < a > previous context</ a >
1115
+ in < var > result</ var > to < var > active context</ var > .</ li >
1103
1116
< li > If < var > local context</ var > is not an < a > array</ a > ,
1104
1117
set it to an < a > array</ a > containing only
1105
1118
< var > local context</ var > .</ li >
1106
- < li class ="changed ">
1107
- If < var > from type</ var > is < code > true</ code > , and < var > result</ var >
1108
- does not have a < a > previous context</ a > , set < a > previous context</ a >
1109
- in < var > result</ var > to < var > active context</ var > .</ li >
1110
1119
< li >
1111
1120
For each item < var > context</ var > in < var > local context</ var > :
1112
1121
< ol >
@@ -1240,12 +1249,24 @@ <h3>Algorithm</h3>
1240
1249
error has been detected and processing is aborted.</ li >
1241
1250
</ ol >
1242
1251
</ li >
1252
+ < li > If < var > context</ var > has a < code > @propagate</ code > < a > member</ a >
1253
+ and its value is not < a > boolean</ a > < code > true</ code > or < code > false</ code > ,
1254
+ or < a > processing mode</ a > is < code > json-ld-1.0</ code > ,
1255
+ an < a data-link-for ="JsonLdErrorCode "> invalid local context</ a >
1256
+ error has been detected and processing is aborted.
1257
+ < span class ="note "> < var > previous context</ var > was determined before.</ span > </ li >
1243
1258
< li > Create a < a class ="changed "> dictionary</ a > < var > defined</ var > to use to keep
1244
1259
track of whether or not a < a > term</ a > has already been defined
1245
1260
or currently being defined during recursion.</ li >
1246
1261
< li > For each < var > key</ var > -< var > value</ var > pair in < var > context</ var > where
1247
- < var > key</ var > is not < code > @base</ code > , < code > @vocab</ code > ,
1248
- < code > @language</ code > , < code > @protected</ code > , or < code > @version</ code > , invoke the
1262
+ < var > key</ var > is not
1263
+ < code > @base</ code > ,
1264
+ < code > @vocab</ code > ,
1265
+ < code > @language</ code > ,
1266
+ < code class ="changed "> @propagate</ code > ,
1267
+ < code class ="changed "> @protected</ code > , or
1268
+ < code > @version</ code > ,
1269
+ invoke the
1249
1270
< a href ="#create-term-definition "> Create Term Definition algorithm</ a > ,
1250
1271
passing < var > result</ var > for < var > active context</ var > ,
1251
1272
< var > context</ var > for < var > local context</ var > , < var > key</ var > ,
@@ -1789,7 +1810,7 @@ <h3>Algorithm</h3>
1789
1810
the < a data-link-for ="JsonLdOptions "> ordered</ a > flag, used to order
1790
1811
< a > dictionary member</ a > keys lexicographically, where noted,
1791
1812
and the < var > from map</ var > flag, used to control reverting
1792
- previous < a > term definitions</ a > in the < a > active context</ a > associated with a type-scoped < a > context </ a > .</ span >
1813
+ previous < a > term definitions</ a > in the < a > active context</ a > associated with non-propagated < a > contexts </ a > .</ span >
1793
1814
To begin, the < var > active property</ var > is set to < code > null</ code > ,
1794
1815
and < var > element</ var > is set to the < a > JSON-LD input</ a > .
1795
1816
< span class ="changed "> If not passed, the both flags are set to < code > false</ code > </ span > .</ p >
@@ -1864,7 +1885,7 @@ <h3>Algorithm</h3>
1864
1885
</ li >
1865
1886
< li > Otherwise < var > element</ var > is a < a class ="changed "> dictionary</ a > .</ li >
1866
1887
< li class ="changed "> If < var > active context</ var > has a < a > previous context</ a > ,
1867
- the < var > active context</ var > is type-scoped .
1888
+ the < var > active context</ var > is not propagated .
1868
1889
If < var > from map</ var > is undefined or < code > false</ code > ,
1869
1890
and < var > element</ var > does not contain a < a > member</ a > expanding to < code > @value</ code > ,
1870
1891
and < var > element</ var > does not consist of a single member expanding to < code > @id</ code > ,
@@ -2568,7 +2589,7 @@ <h3>Algorithm</h3>
2568
2589
</ li >
2569
2590
< li > Otherwise < var > element</ var > is a < a class ="changed "> dictionary</ a > .</ li >
2570
2591
< li class ="changed "> If < var > active context</ var > has a < a > previous context</ a > ,
2571
- the < var > active context</ var > is type-scoped .
2592
+ the < var > active context</ var > is not propagated .
2572
2593
If < var > element</ var > does not contain an < code > @value</ code > < a > member</ a > ,
2573
2594
and < var > element</ var > does not consist of a single < code > @id</ code > member,
2574
2595
set < var > active context</ var > to < a > previous context</ a > from < var > active context</ var > ,
@@ -6216,6 +6237,9 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
6216
6237
< li > The < a href ="#iri-compaction "> IRI compaction algorithm</ a > may generate an error if the result is an
6217
6238
< a > absolute IRI</ a > which could be confused with a compact IRI in the
6218
6239
< a > active context</ a > .</ li >
6240
+ < li > By default, all contexts are propagated when traversing < a > node objects</ a > , other than
6241
+ type-scoped contexts. This can be controlled using the < code > @preserve</ code >
6242
+ < a > member</ a > in a < a > local context</ a > .</ li >
6219
6243
</ ul >
6220
6244
</ section >
6221
6245
0 commit comments