@@ -1067,11 +1067,18 @@ <h3>Algorithm</h3>
1067
1067
< code > @container</ code > key, which must be either
1068
1068
< code > @list</ code > , < code > @set</ code > , < code > @index</ code > ,
1069
1069
< span class ="changed "> < code > @id</ code > , < code > @type</ code > </ span >
1070
- or < code > @language</ code > . Otherwise, an
1070
+ or < code > @language</ code > ,
1071
+ < span class ="changed ">
1072
+ or an < a > array</ a > containing exactly any one of those keyswords,
1073
+ or a combination of < code > @set</ code > and any of < code > @index</ code > ,
1074
+ < code > @id</ code > , < code > @type</ code > , < code > @language</ code >
1075
+ in any order
1076
+ </ span > .
1077
+ Otherwise, an
1071
1078
< a data-link-for ="JsonLdErrorCode "> invalid container mapping</ a >
1072
1079
has been detected and processing is aborted.</ li >
1073
1080
< li class ="changed "> If processingMode is < code > json-ld-1.0</ code > and the container value
1074
- is < code > @id</ code > or < code > @type</ code > , an
1081
+ is < code > @id</ code > or < code > @type</ code > , or is otherwise not a < a > string </ a > , an
1075
1082
< a data-link-for ="JsonLdErrorCode "> invalid container mapping</ a >
1076
1083
has been detected and processing is aborted.</ li >
1077
1084
< li > Set the < a > container mapping</ a > of < em > definition</ em > to
@@ -1961,9 +1968,13 @@ <h3>Algorithm</h3>
1961
1968
</ ol >
1962
1969
</ li >
1963
1970
< li > If < em > result</ em > contains only one item (it has a length of
1964
- < code > 1</ code > ), < a > active property</ a > has no
1965
- < a > container mapping</ a > in < a > active context</ a > , and
1966
- < a data-link-for ="JsonLdOptions "> compactArrays</ a >
1971
+ < code > 1</ code > ),
1972
+ < span class ="changed ">
1973
+ < a > active property</ a > is not < code > @graph</ code > or < code > @set</ code > ,
1974
+ or the < a > container mapping</ a > for < a > active property</ a > in
1975
+ < a > active context</ a > does not include < code > @list</ code > or < code > @set</ code > ,
1976
+ </ span >
1977
+ and < a data-link-for ="JsonLdOptions "> compactArrays</ a >
1967
1978
is < code > true</ code > , set < em > result</ em > to its only item.</ li >
1968
1979
< li > Return < em > result</ em > .</ li >
1969
1980
</ ol >
@@ -2161,7 +2172,13 @@ <h3>Algorithm</h3>
2161
2172
< li > Initialize < em > container</ em > to < code > null</ code > . If there
2162
2173
is a < a > container mapping</ a > for
2163
2174
< em > item active property</ em > in < a > active context</ a > ,
2164
- set < em > container</ em > to its value.</ li >
2175
+ set < em > container</ em > to < span class ="changed "> the first</ span >
2176
+ such value < span class ="changed "> other than < code > @set</ code > </ span > .</ li >
2177
+ < li class ="changed "> Initialize < em > as array</ em > to
2178
+ < code > true</ code > or < code > false</ code > depending on if the < a > container mapping</ a > for
2179
+ < em > item active property</ em > in < a > active context</ a >
2180
+ includes < code > @set</ code > or if < em > item active property</ em >
2181
+ is < code > @graph</ code > or < code > @list</ code > .</ li >
2165
2182
< li > Initialize < em > compacted item</ em > to the result of using
2166
2183
this algorithm recursively, passing
2167
2184
< a > active context</ a > , < a > inverse context</ a > ,
@@ -2204,7 +2221,7 @@ <h3>Algorithm</h3>
2204
2221
</ ol >
2205
2222
</ li >
2206
2223
< li >
2207
- If < em > container</ em > is < code > @language</ code > ,
2224
+ If < em > container</ em > < span class =" changed " > includes </ span > < code > @language</ code > ,
2208
2225
< code > @index</ code > , < span class ="changed "> < code > @id</ code > ,
2209
2226
or < code > @type</ code > </ span > :
2210
2227
< ol class ="algorithm ">
@@ -2242,6 +2259,9 @@ <h3>Algorithm</h3>
2242
2259
< em > compacted container</ em > in < em > compacted value</ em >
2243
2260
to those remaining values. Otherwise, remove that
2244
2261
key-value pair from < em > compacted item</ em > .</ li >
2262
+ < li class ="changed "> If < em > compacted item</ em > is not an
2263
+ < a > array</ a > and < em > as array</ em > is < code > true</ code > ,
2264
+ set < em > compacted item</ em > to an < a > array</ a > containing that value.</ li >
2245
2265
< li > If < em > map key</ em > is not a key in < em > map object</ em > ,
2246
2266
then set this key's value in < em > map object</ em >
2247
2267
to < em > compacted item</ em > . Otherwise, if the value
@@ -2255,9 +2275,7 @@ <h3>Algorithm</h3>
2255
2275
< ol class ="algorithm ">
2256
2276
< li > If
2257
2277
< a data-link-for ="JsonLdOptions "> compactArrays</ a >
2258
- is < code > false</ code > , < em > container</ em > is < code > @set</ code > or
2259
- < code > @list</ code > , or < em > expanded property</ em > is
2260
- < code > @list</ code > or < code > @graph</ code > and
2278
+ is < code > false</ code > , < em > as array</ em > is < code > true</ code > and
2261
2279
< em > compacted item</ em > is not an < a > array</ a > ,
2262
2280
set it to a new < a > array</ a >
2263
2281
containing only < em > compacted item</ em > .</ li >
@@ -2362,10 +2380,14 @@ <h3>Algorithm</h3>
2362
2380
< li > If the < a > term definition</ a > is < code > null</ code > ,
2363
2381
< a > term</ a > cannot be selected during < a > compaction</ a > ,
2364
2382
so continue to the next < a > term</ a > .</ li >
2365
- < li > Initialize < em > container</ em > to < code > @none</ code > . If there
2366
- is a < a > container mapping</ a > in
2367
- < a > term definition</ a > , set < em > container</ em > to
2368
- its associated value.</ li >
2383
+ < li > Initialize < em > container</ em > to < code > @none</ code > . If
2384
+ < span class ="changed ">
2385
+ the < a > container mapping</ a > in < a > term definition</ a >
2386
+ includes < code > @id</ code > , < code > @index</ code > ,
2387
+ < code > @language</ code > , < code > @list</ code > , < code > @type</ code > , or
2388
+ < code > @set</ code > in that order</ span >
2389
+ set < em > container</ em > to
2390
+ < span class ="changed "> the first such value found</ span > .</ li >
2369
2391
< li > Initialize < em > iri</ em > to the value of the < a > IRI mapping</ a >
2370
2392
for the < a > term definition</ a > .</ li >
2371
2393
< li > If < em > iri</ em > is not a key in < em > result</ em > , add
@@ -4507,6 +4529,11 @@ <h2>Changes since 1.0 Recommendation of 16 January 2014</h2>
4507
4529
< li > The JSON syntax has been abstracted into an < a > internal representation</ a >
4508
4530
to allow for other seriazation formats that are functionally equivalent
4509
4531
to JSON.</ li >
4532
+ < li > The value for < code > @container</ code > in an < a > expanded term definition</ a >
4533
+ can also be an < a > array</ a > containing any appropriate container
4534
+ keyword along with < code > @set</ code > (other than < code > @list</ code > ).
4535
+ This allows a way to ensure that such property values will always
4536
+ be expressed in < a > array</ a > form.</ li >
4510
4537
</ ul >
4511
4538
</ section >
4512
4539
0 commit comments