@@ -903,7 +903,7 @@ <h3>Algorithm</h3>
903
903
</ li >
904
904
< li > If < em > value</ em > contains the key < code > @reverse</ code > :
905
905
< ol class ="algorithm ">
906
- < li > If < em > value</ em > contains an < code > @id</ code > , member , an
906
+ < li > If < em > value</ em > contains < code > @id</ code > or < code > @nest </ code > , members , an
907
907
< a data-link-for ="JsonLdErrorCode "> invalid reverse property</ a >
908
908
error has been detected and processing is aborted.</ li >
909
909
< li > If the value associated with the < code > @reverse</ code > key
@@ -1019,9 +1019,18 @@ <h3>Algorithm</h3>
1019
1019
of < em > definition</ em > to < em > language</ em > .</ li >
1020
1020
</ ol >
1021
1021
</ li >
1022
+ < li class ="changed "> If < em > value</ em > contains the key < code > @nest</ code > :
1023
+ < ol class ="algorithm ">
1024
+ < li > Initialize < em > nest</ em > to the value associated with the
1025
+ < code > @nest</ code > key, which must be a < a > string</ a > and
1026
+ must not be a keyword other than < code > @nest</ code > . Otherwise, an
1027
+ < a data-link-for ="JsonLdErrorCode "> invalid @nest value</ a >
1028
+ error has been detected and processing is aborted.</ li >
1029
+ </ ol >
1030
+ </ li >
1022
1031
< li > If the value contains any key other than < code > @id</ code > ,
1023
1032
< code > @reverse</ code > , < code > @container</ code > ,
1024
- < code > @context</ code > , or < code > @type</ code > , an
1033
+ < code > @context</ code > , < code class =" changed " > @nest </ code > , or < code > @type</ code > , an
1025
1034
< a data-link-for ="JsonLdErrorCode "> invalid term definition</ a > error has
1026
1035
been detected and processing is aborted.</ li >
1027
1036
< li > Set the < a > term definition</ a > of < em > term</ em > in
@@ -1269,7 +1278,7 @@ <h3>Algorithm</h3>
1269
1278
passing < a > active context</ a > and the value of the
1270
1279
< code > @context</ code > key as < a > local context</ a > .</ li >
1271
1280
< li > Initialize an empty < a > JSON object</ a > , < em > result</ em > .</ li >
1272
- < li > For each < em > key</ em > and < em > value</ em > in < em > element</ em > ,
1281
+ < li id =" alg-expand-each-key-value " > For each < em > key</ em > and < em > value</ em > in < em > element</ em > ,
1273
1282
ordered lexicographically by < em > key</ em > :
1274
1283
< ol class ="algorithm ">
1275
1284
< li > If < em > key</ em > is < code > @context</ code > , continue to
@@ -1417,6 +1426,10 @@ <h3>Algorithm</h3>
1417
1426
< li > Continue with the next < em > key</ em > from < em > element</ em > .</ li >
1418
1427
</ ol >
1419
1428
</ li >
1429
+ < li class ="changed "> If < em > expanded property</ em > is < code > @nest</ code > ,
1430
+ add < em > key</ em > to < em > nests</ em > , initializing it to an empty < a > array</ a > ,
1431
+ if necessary.
1432
+ Continue with the next < em > key</ em > from < em > element</ em > .</ li >
1420
1433
< li class ="changed "> When the < code > frame expansion</ code > flag is set,
1421
1434
if < em > expanded property</ em > is any other
1422
1435
framing keyword (< code > @explicit</ code > , < code > @default</ code > ,
@@ -1545,6 +1558,22 @@ <h3>Algorithm</h3>
1545
1558
member of < em > result</ em > .</ li >
1546
1559
</ ol >
1547
1560
</ li >
1561
+ < li class ="changed "> For each key < em > nesting-key</ em > in < em > nests</ em >
1562
+ < ol class ="algorithm ">
1563
+ < li > Set < em > nested values</ em > to the value of < em > nesting-key</ em >
1564
+ in < em > element</ em > , ensuring that it is an < a > array</ a > .</ li >
1565
+ < li > For each < em > nested value</ em > in < em > nested values</ em > :
1566
+ < ol class ="algorithm ">
1567
+ < li > If < em > nested value</ em > is not a < a > JSON object</ a > , or any key within
1568
+ < em > nested value</ em > expands to < code > @value</ code > , an
1569
+ < a data-link-for ="JsonLdErrorCode "> invalid @nest value</ a > error
1570
+ has been detected and processing is aborted.</ li >
1571
+ < li > Recursively repeat < a href ="#alg-expand-each-key-value "> step 7</ a >
1572
+ using < em > nested value</ em > for < em > element</ em > .</ li >
1573
+ </ ol >
1574
+ </ li >
1575
+ </ ol >
1576
+ </ li >
1548
1577
</ ol >
1549
1578
</ li >
1550
1579
< li > If < em > result</ em > contains the key < code > @value</ code > :
@@ -1928,7 +1957,22 @@ <h3>Algorithm</h3>
1928
1957
< em > expanded value</ em > for < em > value</ em > ,
1929
1958
< code > true</ code > for < em > vocab</ em > , and
1930
1959
< em > inside reverse</ em > .</ li >
1931
- < li > If < em > result</ em > does not have the key that equals
1960
+ < li class ="changed "> If the < a > term definition</ a > for < em > item active property</ em >
1961
+ in the < em > active context</ em > has a < code > @nest</ code >
1962
+ member, that value (< em > nest term</ em > ) must be
1963
+ < code > @nest</ code > , or a < a > term definition</ a > in the
1964
+ < em > active context</ em > that expands to < code > @nest</ code > ,
1965
+ otherwise an < a data-link-for ="JsonLdErrorCode "> invalid @nest
1966
+ value</ a > error has been detected, and processing is aborted.
1967
+ If < em > result</ em > does not have the key that equals < em > nest
1968
+ term</ em > , initialize it to an empty JSON object (< em > nest
1969
+ object</ em > ). If < em > nest object</ em > does not have the key
1970
+ that equals < em > item active property</ em > , set this key's
1971
+ value in < em > nest object</ em > to an empty
1972
+ < a > array</ a > .Otherwise, if the key's value is not an
1973
+ < a > array</ a > , then set it to one containing only the
1974
+ value.</ li >
1975
+ < li > Otherwise, if < em > result</ em > does not have the key that equals
1932
1976
< em > item active property</ em > , set this key's value in
1933
1977
< em > result</ em > to an empty < a > array</ a > . Otherwise, if
1934
1978
the key's value is not an < a > array</ a > , then set it
@@ -1948,6 +1992,16 @@ <h3>Algorithm</h3>
1948
1992
< em > expanded item</ em > for < em > value</ em > ,
1949
1993
< code > true</ code > for < em > vocab</ em > , and
1950
1994
< em > inside reverse</ em > .</ li >
1995
+ < li class ="changed "> If the < a > term definition</ a > for < em > item active property</ em >
1996
+ in the < em > active context</ em > has a < code > @nest</ code >
1997
+ member, that value (< em > nest term</ em > ) must be
1998
+ < code > @nest</ code > , or a < a > term definition</ a > in the
1999
+ < em > active context</ em > that expands to < code > @nest</ code > ,
2000
+ otherwise an < a data-link-for ="JsonLdErrorCode "> invalid @nest
2001
+ value</ a > error has been detected, and processing is aborted.
2002
+ Set < em > nest result</ em > to the value of < em > nest term</ em > in < em > result</ em > ,
2003
+ initializing it to a new < a > JSON object</ a > , if necessary; otherwise
2004
+ set < em > nest result</ em > to < em > result</ em > .</ li >
1951
2005
< li > Initialize < em > container</ em > to < code > null</ code > . If there
1952
2006
is a < a > container mapping</ a > for
1953
2007
< em > item active property</ em > in < a > active context</ a > ,
@@ -1985,7 +2039,7 @@ <h3>Algorithm</h3>
1985
2039
</ ol >
1986
2040
</ li >
1987
2041
< li > Otherwise, < em > item active property</ em > must not be a key
1988
- in < em > result</ em > because there cannot be two
2042
+ in < em class =" changed " > nest result</ em > because there cannot be two
1989
2043
< a > list objects</ a > associated
1990
2044
with an < a > active property</ a > that has a
1991
2045
< a > container mapping</ a > ; a
@@ -1998,9 +2052,9 @@ <h3>Algorithm</h3>
1998
2052
< code > @index</ code > :
1999
2053
< ol class ="algorithm ">
2000
2054
< li > If < em > item active property</ em > is not a key in
2001
- < em > result</ em > , initialize it to an empty < a > JSON object</ a > .
2055
+ < em class =" changed " > nest result</ em > , initialize it to an empty < a > JSON object</ a > .
2002
2056
Initialize < em > map object</ em > to the value of < em > item active property</ em >
2003
- in < em > result</ em > .</ li >
2057
+ in < em class =" changed " > nest result</ em > .</ li >
2004
2058
< li > If < em > container</ em > is < code > @language</ code > and
2005
2059
< em > compacted item</ em > contains the key
2006
2060
< code > @value</ code > , then set < em > compacted item</ em >
@@ -2030,9 +2084,9 @@ <h3>Algorithm</h3>
2030
2084
< li > If < em > item active property</ em > is not a key in
2031
2085
< em > result</ em > then add the key-value pair,
2032
2086
(< em > item active property</ em > -< em > compacted item</ em > ),
2033
- to < em > result</ em > .</ li >
2087
+ to < em class =" changed " > nest result</ em > .</ li >
2034
2088
< li > Otherwise, if the value associated with the key that
2035
- equals < em > item active property</ em > in < em > result</ em >
2089
+ equals < em > item active property</ em > in < em class =" changed " > nest result</ em >
2036
2090
is not an < a > array</ a > , set it to a new
2037
2091
< a > array</ a > containing only the value. Then
2038
2092
append < em > compacted item</ em > to the value if
@@ -4058,6 +4112,7 @@ <h4>JsonLdErrorCode</h4>
4058
4112
"invalid language mapping",
4059
4113
"invalid language-tagged string",
4060
4114
"invalid language-tagged value",
4115
+ "invalid @nest value",
4061
4116
"invalid local context",
4062
4117
"invalid remote context",
4063
4118
"invalid reverse property",
@@ -4134,6 +4189,8 @@ <h4>JsonLdErrorCode</h4>
4134
4189
associated language tag was detected.</ dd >
4135
4190
< dt > < dfn > invalid local context</ dfn > </ dt >
4136
4191
< dd > In invalid < a > local context</ a > was detected.</ dd >
4192
+ < dt class ="changed "> < dfn > invalid @nest value</ dfn > </ dt >
4193
+ < dd class ="changed "> An invalid value for < code > @nest</ code > has been found.</ dd >
4137
4194
< dt > < dfn > invalid remote context</ dfn > </ dt >
4138
4195
< dd > No valid context document has been found for a referenced,
4139
4196
remote context.</ dd >
@@ -4208,6 +4265,12 @@ <h2>Changes since 1.0 Recommendation of 16 January 2014</h2>
4208
4265
< li > A new < a href ="#merge-node-maps " class ="sectionRef "> </ a > is required
4209
4266
for framing, to create a single graph from the < a data-lt ="default graph "> default</ a >
4210
4267
and < a > named graphs</ a > .</ li >
4268
+ < li > An < a > expanded term definition</ a > can now have an
4269
+ < code > @nest</ code > property, which identifies a term expanding to
4270
+ < code > @nest</ code > which is used for containing properties using the same
4271
+ < code > @nest</ code > mapping. When expanding, the values of a property
4272
+ expanding to < code > @nest</ code > are treated as if they were contained
4273
+ within the enclosing < a > node object</ a > directly.</ li >
4211
4274
</ ul >
4212
4275
</ section >
4213
4276
0 commit comments