@@ -1071,6 +1071,7 @@ <h2>RDF Serialization/Deserialization</h2>
1071
1071
keys and values have to be interpreted (< a > array</ a > of < a > term definitions</ a > ),</ li >
1072
1072
< li > the current < dfn data-lt ="context-base-iri " data-lt-noDefault > base IRI</ dfn > (< a > IRI</ a > ),</ li >
1073
1073
< li class ="changed "> the < dfn > original base URL</ dfn > (< a > IRI</ a > ),</ li >
1074
+ < li class ="changed "> an < dfn data-lt ="context-inverse " data-lt-noDefault > inverse context</ dfn > (< a > inverse context</ a > ),</ li >
1074
1075
< li > an optional < a > vocabulary mapping</ a > (< a > IRI</ a > ),</ li >
1075
1076
< li > an optional < a > default language</ a > (< a > string</ a > ),</ li >
1076
1077
< li class ="changed "> an optional < a > default base direction</ a > (`"ltr"` or `"rtl"`),</ li >
@@ -1099,6 +1100,7 @@ <h2>RDF Serialization/Deserialization</h2>
1099
1100
in which case it is referred to as a < dfn > keyword alias</ dfn > .</ p >
1100
1101
1101
1102
< p > When processing, < var > active context</ var > is initialized
1103
+ < span class ="changed "> with a `null` < a data-lt ="context-inverse "> inverse context</ a > ,</ span >
1102
1104
without any < a > term definitions</ a > ,
1103
1105
< a > vocabulary mapping</ a > , < a class ="changed "> default base direction</ a > , or < a > default language</ a > .
1104
1106
If a < a > local context</ a > is encountered during processing, a new
@@ -1165,6 +1167,12 @@ <h3>Overview</h3>
1165
1167
by setting it to `null`
1166
1168
to retain the original default < a class ="changed " data-lt ="context-base-iri "> base IRI</ a > .</ p >
1167
1169
1170
+ < p class ="changed "> When initialized, or when any entry of
1171
+ an < a > active context</ a > is changed,
1172
+ or any associated < a > term definition</ a > is added, changed, or removed,
1173
+ the < a data-lt ="context-inverse "> inverse context</ a > field
1174
+ in < a > active context</ a > is set to `null`.</ p >
1175
+
1168
1176
< p > Then, for every other < a > entry</ a > in < a > local context</ a > , we update
1169
1177
the < a > term definition</ a > in < var > result</ var > . Since
1170
1178
< a > term definitions</ a > in a < a > local context</ a >
@@ -1202,7 +1210,8 @@ <h3>Algorithm</h3>
1202
1210
1203
1211
< ol >
1204
1212
< li > Initialize < var > result</ var > to the result of cloning
1205
- < var > active context</ var > .</ li >
1213
+ < var > active context</ var > ,
1214
+ < span class ="changed "> with < a data-lt ="context-inverse "> inverse context</ a > set to `null`.</ span > .</ li >
1206
1215
< li class ="changed "> If < var > local context</ var > is an object containing the member < code > @propagate</ code > ,
1207
1216
its value MUST be < a > boolean</ a > < code > true</ code > or < code > false</ code > ,
1208
1217
set < var > propagate</ var > to that value.
@@ -2151,16 +2160,25 @@ <h3>Overview</h3>
2151
2160
< h3 > Algorithm</ h3 >
2152
2161
2153
2162
< p > This algorithm has five required inputs. They are:
2154
- an < var > inverse context</ var > , a < a > keyword</ a > or < a > IRI</ a >
2155
- < var > var</ var > , an < a > array</ a > < var > containers</ var > that represents an
2163
+ an < var class ="changed "> active context</ var > ,
2164
+ a < a > keyword</ a > or < a > IRI</ a > < var > var</ var > ,
2165
+ an < a > array</ a > < var > containers</ var > that represents an
2156
2166
ordered list of preferred < a > container mapping</ a > ,
2157
2167
a < a > string</ a > < var > type/language</ var > that indicates whether
2158
2168
to look for a < a > term</ a > with a matching < a > type mapping</ a >
2159
- or < a > language mapping</ a > , and an < a > array </ a > representing
2160
- an ordered list of < var > preferred values</ var > for the < a > type mapping </ a >
2161
- or < a > language mapping</ a > to look for.</ p >
2169
+ or < a > language mapping</ a > ,
2170
+ and an < a > array </ a > representing an ordered list of < var > preferred values</ var >
2171
+ for the < a > type mapping </ a > or < a > language mapping</ a > to look for.</ p >
2162
2172
2163
2173
< ol >
2174
+ < li class ="changed "> If the < var > active context</ var > has a `null`
2175
+ < a data-lt ='context-inverse '> inverse context</ a > ,
2176
+ set < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var >
2177
+ to the result of calling the
2178
+ < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a >
2179
+ using < var > active context</ var > .</ li >
2180
+ < li > Initialize < var > inverse context</ var > to the value of
2181
+ < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var > .</ li >
2164
2182
< li > Initialize < var > container map</ var > to the value associated with
2165
2183
< var > var</ var > in the < var > inverse context</ var > .</ li >
2166
2184
< li > For each item < var > container</ var > in < var > containers</ var > :
@@ -3377,9 +3395,9 @@ <h3>Overview</h3>
3377
3395
< section class ="algorithm ">
3378
3396
< h3 > Algorithm</ h3 >
3379
3397
3380
- < p > The algorithm takes < span class ="changed "> four required and two optional</ span > input variables.
3398
+ < p > The algorithm takes < span class ="changed "> three required and two optional</ span > input variables.
3381
3399
The required inputs are an < var > active context</ var > ,
3382
- an < var > inverse context </ var > , an < var > active property</ var > ,
3400
+ an < var > active property</ var > ,
3383
3401
and an < var > element</ var > to be compacted.
3384
3402
< span class ="changed "> The optional inputs are the
3385
3403
{{JsonLdOptions/compactArrays}} flag
@@ -3400,7 +3418,7 @@ <h3>Algorithm</h3>
3400
3418
< ol >
3401
3419
< li > Initialize < var > compacted item</ var > to the result of using this
3402
3420
algorithm recursively, passing < var > active context</ var > ,
3403
- < var > inverse context </ var > , < var > active property</ var > ,
3421
+ < var > active property</ var > ,
3404
3422
< var > item</ var > for < var > element</ var > ,
3405
3423
< span class ="changed "> and the {{JsonLdOptions/compactArrays}}
3406
3424
and {{JsonLdOptions/ordered}} flags</ span > .</ li >
@@ -3435,15 +3453,12 @@ <h3>Algorithm</h3>
3435
3453
< var > base URL</ var > from the < a > term definition</ a > for < var > active property</ var >
3436
3454
in < var > active context</ var > ,
3437
3455
and < code > true</ code > for < var > override protected</ var > </ span > .</ li >
3438
- < li > Set < var > inverse context</ var > using the
3439
- < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a >
3440
- using < var > active context</ var > .</ li >
3441
3456
</ ol >
3442
3457
</ li >
3443
3458
< li > If < var > element</ var > has an < code > @value</ code > or < code > @id</ code >
3444
3459
< a > entry</ a > and the result of using the
3445
3460
< a href ="#value-compaction "> Value Compaction algorithm</ a > ,
3446
- passing < var > active context</ var > , < var > inverse context </ var > ,
3461
+ passing < var > active context</ var > ,
3447
3462
< var > active property</ var > , and < var > element</ var > as < var > value</ var > is
3448
3463
a < a > scalar</ a > ,
3449
3464
< span class ="changed "> or the < a > term definition</ a > for < var > active property</ var >
@@ -3453,7 +3468,7 @@ <h3>Algorithm</h3>
3453
3468
< a > list object</ a > , and the < a > container mapping</ a > for
3454
3469
< var > active property</ var > in < var > active context</ var > < span class ="changed "> includes</ span > < code > @list</ code > ,
3455
3470
return the result of using this algorithm recursively, passing
3456
- < var > active context</ var > , < var > inverse context </ var > ,
3471
+ < var > active context</ var > ,
3457
3472
< var > active property</ var > , value of < code > @list</ code >
3458
3473
in < var > element</ var > for < var > element</ var > ,
3459
3474
< span class ="changed "> and the {{JsonLdOptions/compactArrays}}
@@ -3471,19 +3486,14 @@ <h3>Algorithm</h3>
3471
3486
in < var > compacted types</ var > ordered lexicographically:
3472
3487
< ol >
3473
3488
< li > If the < a > term definition</ a > for < var > term</ var > in < var > type-scoped context</ var > has a
3474
- < a > local context</ a > :
3475
- < ol >
3476
- < li > Set < var > active context</ var > to the result of the
3477
- < a href ="#context-processing-algorithm "> Context Processing algorithm</ a > ,
3478
- passing < var > active context</ var > and the value of < var > term</ var > 's
3479
- < a > local context</ a > in < var > type-scoped context</ var > as < var > local context</ var >
3480
- < span class ="changed ">
3481
- < var > base URL</ var > from the < a > term definition</ a > for < var > term</ var >
3482
- in < var > type-scoped context</ var > </ span > .</ li >
3483
- < li > Set < var > inverse context</ var > using the
3484
- < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a >
3485
- using < var > active context</ var > .</ li >
3486
- </ ol >
3489
+ < a > local context</ a >
3490
+ set < var > active context</ var > to the result of the
3491
+ < a href ="#context-processing-algorithm "> Context Processing algorithm</ a > ,
3492
+ passing < var > active context</ var > and the value of < var > term</ var > 's
3493
+ < a > local context</ a > in < var > type-scoped context</ var > as < var > local context</ var >
3494
+ < span class ="changed ">
3495
+ < var > base URL</ var > from the < a > term definition</ a > for < var > term</ var >
3496
+ in < var > type-scoped context</ var > </ span > .
3487
3497
</ li >
3488
3498
</ ol >
3489
3499
</ li >
@@ -3542,7 +3552,7 @@ <h3>Algorithm</h3>
3542
3552
< ol >
3543
3553
< li > Initialize < var > compacted value</ var > to the result of using this
3544
3554
algorithm recursively, passing < var > active context</ var > ,
3545
- < var > inverse context </ var > , < code > @reverse</ code > for
3555
+ < code > @reverse</ code > for
3546
3556
< var > active property</ var > , < var > expanded value</ var >
3547
3557
for < var > element</ var > ,
3548
3558
< span class ="changed "> and the {{JsonLdOptions/compactArrays}}
@@ -3584,7 +3594,6 @@ <h3>Algorithm</h3>
3584
3594
< li > Initialize < var > compacted value</ var > to the result of using this
3585
3595
algorithm recursively, passing
3586
3596
< var > active context</ var > ,
3587
- < var > inverse context</ var > ,
3588
3597
< var > active property</ var > ,
3589
3598
< var > expanded value</ var > for < var > element</ var > ,
3590
3599
< span class ="changed "> and the {{JsonLdOptions/compactArrays}}
@@ -3670,7 +3679,7 @@ <h3>Algorithm</h3>
3670
3679
otherwise the negation of {{JsonLdOptions/compactArrays}}.</ li >
3671
3680
< li > Initialize < var > compacted item</ var > to the result of using
3672
3681
this algorithm recursively, passing
3673
- < var > active context</ var > , < var > inverse context </ var > ,
3682
+ < var > active context</ var > ,
3674
3683
< var > item active property</ var > for < var > active property</ var > ,
3675
3684
< var > expanded item</ var > for < var > element</ var > if it does
3676
3685
not contain the < a > entry</ a > < code > @list</ code >
@@ -3827,7 +3836,7 @@ <h3>Algorithm</h3>
3827
3836
to `@id`, set < var > compacted item</ var >
3828
3837
to the result of using
3829
3838
this algorithm recursively, passing
3830
- < var > active context</ var > , < var > inverse context </ var > ,
3839
+ < var > active context</ var > ,
3831
3840
< var > item active property</ var > for < var > active property</ var > ,
3832
3841
and a < a > map</ a > composed of the single < a > entry</ a > for `@id` from < var > expanded item</ var > for < var > element</ var > .
3833
3842
<!-- Note: This will result in a string value, rather than a node object,
@@ -3913,8 +3922,8 @@ <h3>Overview</h3>
3913
3922
< section class ="algorithm ">
3914
3923
< h3 > Algorithm</ h3 >
3915
3924
3916
- < p > This algorithm takes three required inputs and three optional inputs.
3917
- The required inputs are an < var > active context</ var > , an < var > inverse context </ var > ,
3925
+ < p > This algorithm takes < span class =" changed " > two </ span > required inputs and three optional inputs.
3926
+ The required inputs are an < var > active context</ var > ,
3918
3927
and the < var > var</ var > to be compacted.
3919
3928
The optional inputs are a < var > value</ var > associated with the < var > var</ var > ,
3920
3929
a < var > vocab</ var > flag which specifies whether the passed < var > var</ var >
@@ -3925,6 +3934,14 @@ <h3>Algorithm</h3>
3925
3934
3926
3935
< ol >
3927
3936
< li > If < var > var</ var > is < code > null</ code > , return < code > null</ code > .</ li >
3937
+ < li class ="changed "> If the < var > active context</ var > has a `null`
3938
+ < a data-lt ='context-inverse '> inverse context</ a > ,
3939
+ set < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var >
3940
+ to the result of calling the
3941
+ < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a >
3942
+ using < var > active context</ var > .</ li >
3943
+ < li > Initialize < var > inverse context</ var > to the value of
3944
+ < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var > .</ li >
3928
3945
< li > If < var > vocab</ var > is < code > true</ code > and < var > var</ var > is an
3929
3946
< a > entry</ a > of < var > inverse context</ var > :
3930
3947
< ol >
@@ -4134,7 +4151,7 @@ <h3>Algorithm</h3>
4134
4151
to < var > preferred values</ var > .</ li >
4135
4152
< li > Initialize < var > term</ var > to the result of the
4136
4153
< a href ="#term-selection "> Term Selection algorithm</ a > , passing
4137
- < var > inverse context </ var > , < var > var</ var > , < var > containers</ var > ,
4154
+ < var > var</ var > , < var > containers</ var > ,
4138
4155
< var > type/language</ var > , and < var > preferred values</ var > .</ li >
4139
4156
< li > If < var > term</ var > is not < code > null</ code > , return < var > term</ var > .</ li >
4140
4157
</ ol >
@@ -4238,12 +4255,20 @@ <h3>Overview</h3>
4238
4255
< section class ="algorithm ">
4239
4256
< h3 > Algorithm</ h3 >
4240
4257
4241
- < p > This algorithm has four required inputs: an < var > active context</ var > , an
4242
- < var > inverse context </ var > , an < var > active property</ var > , and a < var > value</ var >
4258
+ < p > This algorithm has < span class =" changed " > three </ span > required inputs: an < var > active context</ var > , an
4259
+ an < var > active property</ var > , and a < var > value</ var >
4243
4260
to be compacted.</ p >
4244
4261
4245
4262
< ol >
4246
4263
< li > Initialize < var > result</ var > to a copy of < var > value</ var > .</ li >
4264
+ < li class ="changed "> If the < var > active context</ var > has a `null`
4265
+ < a data-lt ='context-inverse '> inverse context</ a > ,
4266
+ set < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var >
4267
+ to the result of calling the
4268
+ < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a >
4269
+ using < var > active context</ var > .</ li >
4270
+ < li > Initialize < var > inverse context</ var > to the value of
4271
+ < a data-lt ='context-inverse '> inverse context</ a > in < var > active context</ var > .</ li >
4247
4272
< li > Initialize < var > language</ var > to the < a > language mapping</ a > for < var > active property</ var >
4248
4273
in < var > active context</ var > , if any, otherwise to the < a > default language</ a >
4249
4274
of < var > active context</ var > .</ li >
@@ -5695,15 +5720,12 @@ <h3>Algorithm</h3>
5695
5720
passing a new empty < a > context</ a > as < var > active context</ var >
5696
5721
< var > context</ var > as < var > local context</ var > ,
5697
5722
and < var > context base</ var > as < var > base URL</ var > .</ li >
5698
- < li > Initialize < var > inverse context</ var > to the result of performing the
5699
- < a href ="#inverse-context-creation "> Inverse Context Creation algorithm</ a > .</ li >
5700
5723
< li > Initialize < a > base IRI</ a > to the {{JsonLdOptions/base}} option from < a data-lt ="jsonldprocessor-compact-options "> options</ a > , if set;
5701
5724
otherwise, if the < a data-link-for ="JsonLdOptions "> compactToRelative</ a > option is < strong > true</ strong > ,
5702
5725
to the IRI of the currently being processed document, if available;
5703
5726
otherwise to < code > null</ code > .</ li >
5704
5727
< li > Set < var > compacted output</ var > to the result of using the < a href ="#compaction-algorithm "> Compaction algorithm</ a > ,
5705
5728
using < a > active context</ a > ,
5706
- < var > inverse context</ var > ,
5707
5729
< code > null</ code > for < var > active property</ var > ,
5708
5730
< var > expanded input</ var > as < var > element</ var > ,
5709
5731
and the {{JsonLdOptions/compactArrays}}
@@ -6943,7 +6965,20 @@ <h2>Changes since Candidate Release of 12 December 2019</h2>
6943
6965
as a direct input, which resolves a {{Promise}} boundary issue.</ li >
6944
6966
</ ul >
6945
6967
</ section >
6946
-
6968
+ < section class ="appendix informative " id ="changes-from-cr ">
6969
+ < h2 > Changes since Candidate Release of 05 March 2020</ h2 >
6970
+ < p class ="note "> All changes are editorial and do not affect the observable
6971
+ behavior of the API nor the expected test results.</ p >
6972
+ < ul >
6973
+ < li > The < a > inverse context</ a > is not passed explicitly as a parameter
6974
+ to the < a href ="#term-selection "> Term Selection</ a > ,
6975
+ < a href ="#iri-compaction "> IRI compaction</ a > ,
6976
+ and < a href ="#value-compaction "> Value Compaction</ a > algorithms,
6977
+ but is retrieved from the < a data-lt ="context-inverse "> inverse context</ a > field
6978
+ within an < a > active context</ a > , and initialized as necessary.
6979
+ This simplifies calling sequences and better represents actual implementation experience.
6980
+ </ ul >
6981
+ </ section >
6947
6982
< section id ="ack "
6948
6983
class ="appendix informative "
6949
6984
data-include ="ack-script/acknowledgements.html "
0 commit comments