@@ -1500,6 +1500,7 @@ <h3>Framing Algorithm</h3>
1500
1500
< p > The recursive algorithm operates with a < a > framing state</ a > (< var > state</ var > ),
1501
1501
created initially using
1502
1502
the < a > object embed flag</ a > set to < code > @once</ code > ,
1503
+ < span class ="changed "> the < dfn > embedded flag</ dfn > , set to `false`,</ span >
1503
1504
the < a > explicit inclusion flag</ a > set to < code > false</ code > ,
1504
1505
the < a > require all flag</ a > set to < code > true</ code > ,
1505
1506
the < a > omit default flag</ a > set to < code > false</ code > ,
@@ -1542,12 +1543,19 @@ <h3>Framing Algorithm</h3>
1542
1543
< span class ="changed "> if the optional < a data-link-for ="JsonLdOptions "> ordered</ a > flag is < code > true</ code > </ span > :
1543
1544
< ol >
1544
1545
< li > Initialize < var > output</ var > to a new < a > map</ a > with < code > @id</ code > and < var > id</ var > .</ li >
1545
- < li > Otherwise, if < var > embed</ var > is < code > @never</ code > or if a
1546
+ < li class ="changed "> If the < a > embedded flag</ a > in < var > state</ var > is `false`
1547
+ and there is an existing embedded node in < var > parent</ var > associated with
1548
+ < var > graph name</ var > and < var > id</ var > in < var > state</ var > ,
1549
+ do not perform additional processing for this < var > node</ var > .
1550
+ </ li >
1551
+ < li class ="changed "> Otherwise, if the < a > embedded flag</ a > in < var > state</ var > is `true`
1552
+ and either < var > embed</ var > is < code > @never</ code > or if a
1546
1553
circular reference would be created by an embed,
1547
1554
add < var > output</ var > to < var > parent</ var >
1548
1555
and do not perform additional processing for this < var > node</ var > .</ li >
1549
- < li class ="changed "> Otherwise, if < var > embed</ var > is < code > @once</ code >
1550
- and parent has an existing embedded node in < var > parent</ var > associated with
1556
+ < li class ="changed "> Otherwise, if the < a > embedded flag</ a > in < var > state</ var > is `true`,
1557
+ < var > embed</ var > is < code > @once</ code > ,
1558
+ and there is an existing embedded node in < var > parent</ var > associated with
1551
1559
< var > graph name</ var > and < var > id</ var > in < var > state</ var > ,
1552
1560
add < var > output</ var > to < var > parent</ var >
1553
1561
and do not perform additional processing for this < var > node</ var > .</ li >
@@ -1565,19 +1573,24 @@ <h3>Framing Algorithm</h3>
1565
1573
< li > Push < var > graph name</ var > from < var > state</ var > onto < var > graph stack</ var >
1566
1574
in < var > state</ var > .</ li >
1567
1575
< li > Set the value of < var > graph name</ var > in < var > state</ var > to < var > id</ var > .</ li >
1568
- < li > Invoke the recursive algorithm using < var > state</ var > ,
1576
+ < li > Set the value of < a > embedded flag</ a > in < var > state</ var > to `false`.</ li >
1577
+ < li > Invoke the recursive algorithm
1578
+ using a copy of < var > state</ var >
1579
+ with the value of < var > graph name</ var > set to < var > id</ var >
1580
+ and the value of < a > embedded flag</ a > set to `false`,
1569
1581
the keys from the < var > graph map</ var > in < var > state</ var > associated with id as < var > subjects</ var > ,
1570
1582
< var > subframe</ var > as < var > frame</ var > ,
1571
1583
< var > output</ var > as < var > parent</ var > , and < code > @graph</ code > as < var > active property</ var > .
1572
- < li > Pop the value from < var > graph stack</ var > in < var > state</ var > and set < var > graph name</ var > in < var > state</ var >
1573
- back to that value.</ li >
1584
+ < li > Pop the value from < var > graph stack</ var > in < var > state</ var > .</ li >
1574
1585
</ ol >
1575
1586
</ li >
1576
1587
</ ol >
1577
1588
</ li >
1578
1589
< li class ="changed ">
1579
1590
If < var > frame</ var > has an `@included` < a > entry</ a > ,
1580
- invoke the recursive algorithm using < var > state</ var > , < var > subjects</ var > , < var > frame</ var > ,
1591
+ invoke the recursive algorithm
1592
+ using a copy of < var > state</ var > with the value of < a > embedded flag</ a > set to `true`,
1593
+ < var > subjects</ var > , < var > frame</ var > ,
1581
1594
< var > output</ var > as < var > parent</ var > , and `@included` as < var > active property</ var > .
1582
1595
</ li >
1583
1596
< li > For each < var > property</ var > and < var > objects</ var > in < var > node</ var > , ordered lexicographically by < var > property</ var >
@@ -1595,7 +1608,8 @@ <h3>Framing Algorithm</h3>
1595
1608
in output:
1596
1609
< ol >
1597
1610
< li > If < var > listitem</ var > is a < a > node reference</ a > ,
1598
- invoke the recursive algorithm using < var > state</ var > ,
1611
+ invoke the recursive algorithm
1612
+ < span class ="changed "> using a copy of < var > state</ var > with the value of < a > embedded flag</ a > set to `true`</ span > ,
1599
1613
the value of < code > @id</ code > from < var > listitem</ var >
1600
1614
as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1601
1615
the first value from < code > @list</ code > in < var > frame</ var > as < var > frame</ var > ,
@@ -1608,7 +1622,8 @@ <h3>Framing Algorithm</h3>
1608
1622
</ ol >
1609
1623
</ li >
1610
1624
< li > If < var > item</ var > is a < a > node reference</ a > ,
1611
- invoke the recursive algorithm using < var > state</ var > ,
1625
+ invoke the recursive algorithm
1626
+ < span class ="changed "> using a copy of < var > state</ var > with the value of < a > embedded flag</ a > set to `true`</ span > ,
1612
1627
the value of < code > @id</ code > from < var > item</ var >
1613
1628
as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1614
1629
the first value from < var > property</ var > in < var > frame</ var > as < var > frame</ var > ,
@@ -1646,7 +1661,8 @@ <h3>Framing Algorithm</h3>
1646
1661
< var > reverse property</ var > containing a < a > node reference</ a > with an < code > @id</ code > of < var > id</ var > :
1647
1662
< ol >
1648
1663
< li > Add < var > reverse property</ var > to < var > reverse dict</ var > with a new empty < a > array</ a > as its value.</ li >
1649
- < li > Invoke the recursive algorithm using < var > state</ var > ,
1664
+ < li > Invoke the recursive algorithm
1665
+ < span class ="changed "> using a copy of < var > state</ var > with the value of < a > embedded flag</ a > set to `true`</ span > ,
1650
1666
the < var > reverse id</ var >
1651
1667
as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1652
1668
< var > sub frame</ var > as < var > frame</ var > ,
0 commit comments