@@ -903,7 +903,7 @@ <h3>Algorithm</h3>
903903 </ li >
904904 < li > If < em > value</ em > contains the key < code > @reverse</ code > :
905905 < 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
907907 < a data-link-for ="JsonLdErrorCode "> invalid reverse property</ a >
908908 error has been detected and processing is aborted.</ li >
909909 < li > If the value associated with the < code > @reverse</ code > key
@@ -1020,9 +1020,18 @@ <h3>Algorithm</h3>
10201020 of < em > definition</ em > to < em > language</ em > .</ li >
10211021 </ ol >
10221022 </ li >
1023+ < li class ="changed "> If < em > value</ em > contains the key < code > @nest</ code > :
1024+ < ol class ="algorithm ">
1025+ < li > Initialize < em > nest</ em > to the value associated with the
1026+ < code > @nest</ code > key, which must be a < a > string</ a > and
1027+ must not be a keyword other than < code > @nest</ code > . Otherwise, an
1028+ < a data-link-for ="JsonLdErrorCode "> invalid @nest value</ a >
1029+ error has been detected and processing is aborted.</ li >
1030+ </ ol >
1031+ </ li >
10231032 < li > If the value contains any key other than < code > @id</ code > ,
10241033 < code > @reverse</ code > , < code > @container</ code > ,
1025- < code > @context</ code > , or < code > @type</ code > , an
1034+ < code > @context</ code > , < code class =" changed " > @nest </ code > , or < code > @type</ code > , an
10261035 < a data-link-for ="JsonLdErrorCode "> invalid term definition</ a > error has
10271036 been detected and processing is aborted.</ li >
10281037 < li > Set the < a > term definition</ a > of < em > term</ em > in
@@ -1270,7 +1279,7 @@ <h3>Algorithm</h3>
12701279 passing < a > active context</ a > and the value of the
12711280 < code > @context</ code > key as < a > local context</ a > .</ li >
12721281 < li > Initialize an empty < a > JSON object</ a > , < em > result</ em > .</ li >
1273- < li > For each < em > key</ em > and < em > value</ em > in < em > element</ em > ,
1282+ < li id =" alg-expand-each-key-value " > For each < em > key</ em > and < em > value</ em > in < em > element</ em > ,
12741283 ordered lexicographically by < em > key</ em > :
12751284 < ol class ="algorithm ">
12761285 < li > If < em > key</ em > is < code > @context</ code > , continue to
@@ -1418,6 +1427,10 @@ <h3>Algorithm</h3>
14181427 < li > Continue with the next < em > key</ em > from < em > element</ em > .</ li >
14191428 </ ol >
14201429 </ li >
1430+ < li class ="changed "> If < em > expanded property</ em > is < code > @nest</ code > ,
1431+ add < em > key</ em > to < em > nests</ em > , initializing it to an empty < a > array</ a > ,
1432+ if necessary.
1433+ Continue with the next < em > key</ em > from < em > element</ em > .</ li >
14211434 < li class ="changed "> When the < code > frame expansion</ code > flag is set,
14221435 if < em > expanded property</ em > is any other
14231436 framing keyword (< code > @explicit</ code > , < code > @default</ code > ,
@@ -1559,6 +1572,22 @@ <h3>Algorithm</h3>
15591572 member of < em > result</ em > .</ li >
15601573 </ ol >
15611574 </ li >
1575+ < li class ="changed "> For each key < em > nesting-key</ em > in < em > nests</ em >
1576+ < ol class ="algorithm ">
1577+ < li > Set < em > nested values</ em > to the value of < em > nesting-key</ em >
1578+ in < em > element</ em > , ensuring that it is an < a > array</ a > .</ li >
1579+ < li > For each < em > nested value</ em > in < em > nested values</ em > :
1580+ < ol class ="algorithm ">
1581+ < li > If < em > nested value</ em > is not a < a > JSON object</ a > , or any key within
1582+ < em > nested value</ em > expands to < code > @value</ code > , an
1583+ < a data-link-for ="JsonLdErrorCode "> invalid @nest value</ a > error
1584+ has been detected and processing is aborted.</ li >
1585+ < li > Recursively repeat < a href ="#alg-expand-each-key-value "> step 7</ a >
1586+ using < em > nested value</ em > for < em > element</ em > .</ li >
1587+ </ ol >
1588+ </ li >
1589+ </ ol >
1590+ </ li >
15621591 </ ol >
15631592 </ li >
15641593 < li > If < em > result</ em > contains the key < code > @value</ code > :
@@ -1942,7 +1971,22 @@ <h3>Algorithm</h3>
19421971 < em > expanded value</ em > for < em > value</ em > ,
19431972 < code > true</ code > for < em > vocab</ em > , and
19441973 < em > inside reverse</ em > .</ li >
1945- < li > If < em > result</ em > does not have the key that equals
1974+ < li class ="changed "> If the < a > term definition</ a > for < em > item active property</ em >
1975+ in the < em > active context</ em > has a < code > @nest</ code >
1976+ member, that value (< em > nest term</ em > ) must be
1977+ < code > @nest</ code > , or a < a > term definition</ a > in the
1978+ < em > active context</ em > that expands to < code > @nest</ code > ,
1979+ otherwise an < a data-link-for ="JsonLdErrorCode "> invalid @nest
1980+ value</ a > error has been detected, and processing is aborted.
1981+ If < em > result</ em > does not have the key that equals < em > nest
1982+ term</ em > , initialize it to an empty JSON object (< em > nest
1983+ object</ em > ). If < em > nest object</ em > does not have the key
1984+ that equals < em > item active property</ em > , set this key's
1985+ value in < em > nest object</ em > to an empty
1986+ < a > array</ a > .Otherwise, if the key's value is not an
1987+ < a > array</ a > , then set it to one containing only the
1988+ value.</ li >
1989+ < li > Otherwise, if < em > result</ em > does not have the key that equals
19461990 < em > item active property</ em > , set this key's value in
19471991 < em > result</ em > to an empty < a > array</ a > . Otherwise, if
19481992 the key's value is not an < a > array</ a > , then set it
@@ -1962,6 +2006,16 @@ <h3>Algorithm</h3>
19622006 < em > expanded item</ em > for < em > value</ em > ,
19632007 < code > true</ code > for < em > vocab</ em > , and
19642008 < em > inside reverse</ em > .</ li >
2009+ < li class ="changed "> If the < a > term definition</ a > for < em > item active property</ em >
2010+ in the < em > active context</ em > has a < code > @nest</ code >
2011+ member, that value (< em > nest term</ em > ) must be
2012+ < code > @nest</ code > , or a < a > term definition</ a > in the
2013+ < em > active context</ em > that expands to < code > @nest</ code > ,
2014+ otherwise an < a data-link-for ="JsonLdErrorCode "> invalid @nest
2015+ value</ a > error has been detected, and processing is aborted.
2016+ Set < em > nest result</ em > to the value of < em > nest term</ em > in < em > result</ em > ,
2017+ initializing it to a new < a > JSON object</ a > , if necessary; otherwise
2018+ set < em > nest result</ em > to < em > result</ em > .</ li >
19652019 < li > Initialize < em > container</ em > to < code > null</ code > . If there
19662020 is a < a > container mapping</ a > for
19672021 < em > item active property</ em > in < a > active context</ a > ,
@@ -1999,7 +2053,7 @@ <h3>Algorithm</h3>
19992053 </ ol >
20002054 </ li >
20012055 < li > Otherwise, < em > item active property</ em > must not be a key
2002- in < em > result</ em > because there cannot be two
2056+ in < em class =" changed " > nest result</ em > because there cannot be two
20032057 < a > list objects</ a > associated
20042058 with an < a > active property</ a > that has a
20052059 < a > container mapping</ a > ; a
@@ -2013,14 +2067,17 @@ <h3>Algorithm</h3>
20132067 or < code > @type</ code > </ span > :
20142068 < ol class ="algorithm ">
20152069 < li > If < em > item active property</ em > is not a key in
2016- < em > result</ em > , initialize it to an empty < a > JSON object</ a > .
2070+ < em class =" changed " > nest result</ em > , initialize it to an empty < a > JSON object</ a > .
20172071 Initialize < em > map object</ em > to the value of < em > item active property</ em >
2018- in < em > result</ em > .</ li >
2072+ in < em class =" changed " > nest result</ em > .</ li >
20192073 < li > Set < em > compacted container</ em > to the result of calling the
20202074 < a href ="#iri-compaction "> IRI Compaction algorithm</ a >
20212075 passing < a > active context</ a > ,
20222076 < em > container</ em > as < em > iri</ em > , and < code > true</ code >
20232077 for < em > vocab</ em > .</ li >
2078+ < li > Initialize < em > map key</ em > to the value associated with
2079+ with the key that equals < em > container</ em > in
2080+ < em > expanded item</ em > .</ li >
20242081 < li > If < em > container</ em > is < code > @language</ code > and
20252082 < em > compacted item</ em > contains the key
20262083 < code > @value</ code > , then set < em > compacted item</ em >
@@ -2063,9 +2120,9 @@ <h3>Algorithm</h3>
20632120 < li > If < em > item active property</ em > is not a key in
20642121 < em > result</ em > then add the key-value pair,
20652122 (< em > item active property</ em > -< em > compacted item</ em > ),
2066- to < em > result</ em > .</ li >
2123+ to < em class =" changed " > nest result</ em > .</ li >
20672124 < li > Otherwise, if the value associated with the key that
2068- equals < em > item active property</ em > in < em > result</ em >
2125+ equals < em > item active property</ em > in < em class =" changed " > nest result</ em >
20692126 is not an < a > array</ a > , set it to a new
20702127 < a > array</ a > containing only the value. Then
20712128 append < em > compacted item</ em > to the value if
@@ -4082,6 +4139,7 @@ <h4>JsonLdErrorCode</h4>
40824139 "cyclic IRI mapping",
40834140 "invalid @id value",
40844141 "invalid @index value",
4142+ "invalid @nest value",
40854143 "invalid @reverse value",
40864144 "invalid base IRI",
40874145 "invalid container mapping",
@@ -4133,6 +4191,8 @@ <h4>JsonLdErrorCode</h4>
41334191 < dt > < dfn > invalid @index value</ dfn > </ dt >
41344192 < dd > An < code > @index</ code > member was encountered whose value was
41354193 not a < a > string</ a > .</ dd >
4194+ < dt class ="changed "> < dfn > invalid @nest value</ dfn > </ dt >
4195+ < dd class ="changed "> An invalid value for < code > @nest</ code > has been found.</ dd >
41364196 < dt > < dfn > invalid @reverse value</ dfn > </ dt >
41374197 < dd > An invalid value for an < code > @reverse</ code > member has been detected,
41384198 i.e., the value was not a < a > JSON object</ a > .</ dd >
@@ -4242,6 +4302,12 @@ <h2>Changes since 1.0 Recommendation of 16 January 2014</h2>
42424302 < li > A new < a href ="#merge-node-maps " class ="sectionRef "> </ a > is required
42434303 for framing, to create a single graph from the < a data-lt ="default graph "> default</ a >
42444304 and < a > named graphs</ a > .</ li >
4305+ < li > An < a > expanded term definition</ a > can now have an
4306+ < code > @nest</ code > property, which identifies a term expanding to
4307+ < code > @nest</ code > which is used for containing properties using the same
4308+ < code > @nest</ code > mapping. When expanding, the values of a property
4309+ expanding to < code > @nest</ code > are treated as if they were contained
4310+ within the enclosing < a > node object</ a > directly.</ li >
42454311 < li > < code > @container</ code > values within an < a > expanded term definition</ a > may now
42464312 include < code > @id</ code > and < code > @type</ code > , corresponding to < a > id maps</ a > and < a > type maps</ a > .</ li >
42474313 </ ul >
0 commit comments