@@ -628,13 +628,13 @@ <h4>Object Embed Flag</h4>
628
628
The initial value for the < a > object embed flag</ a > is set using the
629
629
< a data-link-for ="JsonLdOptions "> embed</ a > option.
630
630
Consider the following frame
631
- based on the default < code > @last </ code > value of the < a > object embed flag</ a > :</ p >
631
+ based on the default < code > @first </ code > value of the < a > object embed flag</ a > :</ p >
632
632
633
- < pre id ="sample-library-frame-with-explicit-embed-set-to-last "
633
+ < pre id ="sample-library-frame-with-explicit-embed-set-to-first "
634
634
class ="example frame " data-transform ="updateExample "
635
635
data-content-type ="application/ld+json;profile=http://www.w3.org/ns/json-ld#framed "
636
636
data-frame-for ="Flattened library objects "
637
- title ="Sample library frame with implicit @embed set to @last ">
637
+ title ="Sample library frame with implicit @embed set to @first ">
638
638
<!--
639
639
{
640
640
"@context": {"@vocab": "http://example.org/"},
@@ -644,15 +644,15 @@ <h4>Object Embed Flag</h4>
644
644
</ pre >
645
645
646
646
< aside class ="example ds-selector-tabs "
647
- title ="Framed library objects with @embed set to @last ">
647
+ title ="Framed library objects with @embed set to @first ">
648
648
< div class ="selectors ">
649
649
< a class ="playground "
650
650
data-result-for ="#flattened-library-objects "
651
- data-frame ="#sample-library-frame-with-explicit-embed-set-to-last "
651
+ data-frame ="#sample-library-frame-with-explicit-embed-set-to-first "
652
652
target ="_blank "> </ a >
653
653
</ div >
654
654
< pre class ="selected original nohighlight " data-transform ="updateExample "
655
- data-frame ="Sample library frame with implicit @embed set to @last "
655
+ data-frame ="Sample library frame with implicit @embed set to @first "
656
656
data-result-for ="Flattened library objects ">
657
657
<!--
658
658
{
@@ -678,7 +678,7 @@ <h4>Object Embed Flag</h4>
678
678
</ pre >
679
679
</ aside >
680
680
681
- < p > Because, the default for the < a > object embed flag</ a > is < code > @last </ code >
681
+ < p > Because, the default for the < a > object embed flag</ a > is < code > @first </ code >
682
682
(in addition to the < a > explicit inclusion flag</ a > being < code > false</ code > ),
683
683
non-listed properties are added to the output, and implicitly embedded
684
684
using a default empty frame. As a result, the same output used in the
@@ -1293,12 +1293,16 @@ <h2>Syntax Tokens and Keywords</h2>
1293
1293
Always embed < a > node objects</ a > as property values, unless this would
1294
1294
cause a circular reference.
1295
1295
</ dd >
1296
- < dt > < code > @last </ code > </ dt > < dd >
1297
- Only the last value within a given < a > node object</ a > should be embedded,
1298
- previous values of other properties use a < a > node reference</ a > . This is the
1296
+ < dt class =" changed " > < code > @first </ code > </ dt > < dd class =" changed " >
1297
+ Only the first value within a given < a > node object</ a > should be embedded,
1298
+ subsequent values of other properties use a < a > node reference</ a > . This is the
1299
1299
default value if neither < code > @embed</ code > nor < a > object embed flag</ a >
1300
1300
is not specified.
1301
1301
</ dd >
1302
+ < dt > < code > @last</ code > </ dt > < dd >
1303
+ Only the last value within a given < a > node object</ a > should be embedded,
1304
+ previous values of other properties use a < a > node reference</ a > .
1305
+ </ dd >
1302
1306
< dt > < code > @never</ code > </ dt > < dd >
1303
1307
Always use a < a > node reference</ a > when serializing matching values.
1304
1308
</ dd >
@@ -1441,77 +1445,79 @@ <h3>Framing Algorithm</h3>
1441
1445
circular reference would be created by an embed,
1442
1446
add < var > output</ var > to < var > parent</ var >
1443
1447
and do not perform additional processing for this < var > node</ var > .</ li >
1448
+ < li class ="changed "> Otherwise, if < var > embed</ var > is < code > @first</ code >
1449
+ and parent has an existing embedded node in < var > parent</ var > associated with
1450
+ < var > graph name</ var > and < var > id</ var > in < var > state</ var > ,
1451
+ add < var > output</ var > to < var > parent</ var >
1452
+ and do not perform additional processing for this < var > node</ var > .
1453
+ < span class ="ednote "> Requires sorting of subjects.</ span > </ li >
1444
1454
< li > Otherwise, if < var > embed</ var > is < code > @last</ code > ,
1445
- remove any existing embedded node from < var > parent</ var > associate with
1446
- < var > graph name</ var > in < var > state</ var > .
1455
+ remove any existing embedded node from < var > parent</ var > associated with
1456
+ < var > graph name</ var > and < var > id </ var > in < var > state</ var > .
1447
1457
< span class ="ednote "> Requires sorting of subjects. We could consider < code > @sample</ code > , to embed
1448
1458
just the first matched node. With sorting, we could also consider < code > @first</ code > .</ span > </ li >
1449
- < li > If < var > embed </ var > is < code > @last </ code > or < code > @always </ code >
1459
+ < li class =" changed " > If < var > graph map </ var > in < var > state </ var > has an entry for < var > id </ var > :
1450
1460
< ol >
1451
- < li class ="changed "> If < var > graph map</ var > in < var > state</ var > has an entry for < var > id</ var > :
1461
+ < li > If < var > frame</ var > does not have a < code > @graph</ code > < a > member</ a > ,
1462
+ set < var > recurse</ var > to < code > true</ code > , unless < var > graph name</ var > in < var > state</ var > is < code > @merged</ code >
1463
+ and set < var > subframe</ var > to a new empty < a > dictionary</ a > .</ li >
1464
+ < li > Otherwise, set < var > subframe</ var > to the first entry for < code > @graph</ code > in < var > frame</ var > ,
1465
+ or a new empty < a > dictionary</ a > , if it does not exist, and
1466
+ set < var > recurse</ var > to < code > true</ code > , unless < var > id</ var >
1467
+ is < code > @merged</ code > or < code > @default</ code > .</ li >
1468
+ < li > If < var > recurse</ var > is < code > true</ code > :
1452
1469
< ol >
1453
- < li > If < var > frame</ var > does not have a < code > @graph</ code > < a > member</ a > ,
1454
- set < var > recurse</ var > to < code > true</ code > , unless < var > graph name</ var > in < var > state</ var > is < code > @merged</ code >
1455
- and set < var > subframe</ var > to a new empty < a > dictionary</ a > .</ li >
1456
- < li > Otherwise, set < var > subframe</ var > to the first entry for < code > @graph</ code > in < var > frame</ var > ,
1457
- or a new empty < a > dictionary</ a > , if it does not exist, and
1458
- set < var > recurse</ var > to < code > true</ code > , unless < var > id</ var >
1459
- is < code > @merged</ code > or < code > @default</ code > .</ li >
1460
- < li > If < var > recurse</ var > is < code > true</ code > :
1461
- < ol >
1462
- < li > Push < var > graph name</ var > from < var > state</ var > onto < var > graph stack</ var >
1463
- in < var > state</ var > .</ li >
1464
- < li > Set the value of < var > graph name</ var > in < var > state</ var > to < var > id</ var > .</ li >
1465
- < li > Invoke the recursive algorithm using < var > state</ var > ,
1466
- the keys from the < var > graph map</ var > in < var > state</ var > associated with id as < var > subjects</ var > ,
1467
- < var > subframe</ var > as < var > frame</ var > ,
1468
- < var > output</ var > as < var > parent</ var > , and < code > @graph</ code > as < var > active property</ var > .
1469
- < li > Pop the value from < var > graph stack</ var > in < var > state</ var > and set < var > graph name</ var > in < var > state</ var >
1470
- back to that value.</ li >
1471
- </ ol >
1472
- </ li >
1470
+ < li > Push < var > graph name</ var > from < var > state</ var > onto < var > graph stack</ var >
1471
+ in < var > state</ var > .</ li >
1472
+ < li > Set the value of < var > graph name</ var > in < var > state</ var > to < var > id</ var > .</ li >
1473
+ < li > Invoke the recursive algorithm using < var > state</ var > ,
1474
+ the keys from the < var > graph map</ var > in < var > state</ var > associated with id as < var > subjects</ var > ,
1475
+ < var > subframe</ var > as < var > frame</ var > ,
1476
+ < var > output</ var > as < var > parent</ var > , and < code > @graph</ code > as < var > active property</ var > .
1477
+ < li > Pop the value from < var > graph stack</ var > in < var > state</ var > and set < var > graph name</ var > in < var > state</ var >
1478
+ back to that value.</ li >
1473
1479
</ ol >
1474
1480
</ li >
1475
- < li > For each < var > property</ var > and < var > objects</ var > in < var > node</ var > , ordered lexicographically by < var > property</ var >
1476
- < span class ="changed "> if the optional < a data-link-for ="JsonLdOptions "> ordered</ a > flag is < code > true</ code > </ span > :
1481
+ </ ol >
1482
+ </ li >
1483
+ < li > For each < var > property</ var > and < var > objects</ var > in < var > node</ var > , ordered lexicographically by < var > property</ var >
1484
+ < span class ="changed "> if the optional < a data-link-for ="JsonLdOptions "> ordered</ a > flag is < code > true</ code > </ span > :
1485
+ < ol >
1486
+ < li > If < var > property</ var > is a < a > keyword</ a > , add < var > property</ var > and < var > objects</ var >
1487
+ to < var > output</ var > .</ li >
1488
+ < li > Otherwise, if < var > property</ var > is not in < var > frame</ var > , and < var > explicit</ var > is < code > true</ code > ,
1489
+ < a > processors</ a > MUST NOT add any values for < var > property</ var > to < var > output</ var > , and the following
1490
+ steps are skipped.</ li >
1491
+ < li > For each < var > item</ var > in < var > objects</ var > :
1477
1492
< ol >
1478
- < li > If < var > property</ var > is a < a > keyword</ a > , add < var > property</ var > and < var > objects</ var >
1479
- to < var > output</ var > .</ li >
1480
- < li > Otherwise, if < var > property</ var > is not in < var > frame</ var > , and < var > explicit</ var > is < code > true</ code > ,
1481
- < a > processors</ a > MUST NOT add any values for < var > property</ var > to < var > output</ var > , and the following
1482
- steps are skipped.</ li >
1483
- < li > For each < var > item</ var > in < var > objects</ var > :
1493
+ < li > If < var > item</ var > is a < a > dictionary</ a > with the property < code > @list</ code > , then each
1494
+ < var > listitem</ var > in the list is processed in sequence and added to a new list < a > dictionary</ a >
1495
+ in output:
1484
1496
< ol >
1485
- < li > If < var > item</ var > is a < a > dictionary</ a > with the property < code > @list</ code > , then each
1486
- < var > listitem</ var > in the list is processed in sequence and added to a new list < a > dictionary</ a >
1487
- in output:
1488
- < ol >
1489
- < li > If < var > listitem</ var > is a < a > node reference</ a > ,
1490
- invoke the recursive algorithm using < var > state</ var > ,
1491
- the value of < code > @id</ code > from < var > listitem</ var >
1492
- as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1493
- the first value from < code > @list</ code > in < var > frame</ var > as < var > frame</ var > ,
1494
- < var > list</ var > as < var > parent</ var > , and < code > @list</ code > as < var > active property</ var > .
1495
- If < var > frame</ var > does not exist, create a new < var > frame</ var > using a new < a > dictionary</ a >
1496
- with properties for < code > @embed</ code > , < code > @explicit</ code > and < code > @requireAll</ code >
1497
- taken from < var > embed</ var > , < var > explicit</ var > and < var > requireAll</ var > .
1498
- < span class ="ednote "> Could this use the < var > list</ var > < a > array</ a > , and < code > null</ code > for < var > active property</ var > ?</ span > </ li >
1499
- < li > Otherwise, append a copy of < var > listitem</ var > to < code > @list</ code > in < var > list</ var > .</ li >
1500
- </ ol >
1501
- </ li >
1502
- < li > If < var > item</ var > is a < a > node reference</ a > ,
1497
+ < li > If < var > listitem</ var > is a < a > node reference</ a > ,
1503
1498
invoke the recursive algorithm using < var > state</ var > ,
1504
- the value of < code > @id</ code > from < var > item </ var >
1499
+ the value of < code > @id</ code > from < var > listitem </ var >
1505
1500
as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1506
- the first value from < var > property </ var > in < var > frame</ var > as < var > frame</ var > ,
1507
- < var > output </ var > as < var > parent</ var > , and < var > property </ var > as < var > active property</ var > .
1501
+ the first value from < code > @list </ code > in < var > frame</ var > as < var > frame</ var > ,
1502
+ < var > list </ var > as < var > parent</ var > , and < code > @list </ code > as < var > active property</ var > .
1508
1503
If < var > frame</ var > does not exist, create a new < var > frame</ var > using a new < a > dictionary</ a >
1509
1504
with properties for < code > @embed</ code > , < code > @explicit</ code > and < code > @requireAll</ code >
1510
- taken from < var > embed</ var > , < var > explicit</ var > and < var > requireAll</ var > .</ li >
1511
- < li > Otherwise, append a copy of < var > item </ var > to < a > active property</ a > in
1512
- < var > output </ var > .</ li >
1505
+ taken from < var > embed</ var > , < var > explicit</ var > and < var > requireAll</ var > .
1506
+ < span class =" ednote " > Could this use the < var > list </ var > < a > array </ a > , and < code > null </ code > for < var > active property</ var > ? </ span > </ li >
1507
+ < li > Otherwise, append a copy of < var > listitem </ var > to < code > @list </ code > in < var > list </ var > .</ li >
1513
1508
</ ol >
1514
1509
</ li >
1510
+ < li > If < var > item</ var > is a < a > node reference</ a > ,
1511
+ invoke the recursive algorithm using < var > state</ var > ,
1512
+ the value of < code > @id</ code > from < var > item</ var >
1513
+ as the sole item in a new < var > subjects</ var > < a > array</ a > ,
1514
+ the first value from < var > property</ var > in < var > frame</ var > as < var > frame</ var > ,
1515
+ < var > output</ var > as < var > parent</ var > , and < var > property</ var > as < var > active property</ var > .
1516
+ If < var > frame</ var > does not exist, create a new < var > frame</ var > using a new < a > dictionary</ a >
1517
+ with properties for < code > @embed</ code > , < code > @explicit</ code > and < code > @requireAll</ code >
1518
+ taken from < var > embed</ var > , < var > explicit</ var > and < var > requireAll</ var > .</ li >
1519
+ < li > Otherwise, append a copy of < var > item</ var > to < a > active property</ a > in
1520
+ < var > output</ var > .</ li >
1515
1521
</ ol >
1516
1522
</ li >
1517
1523
@@ -1844,7 +1850,7 @@ <h3>JsonLdOptions</h3>
1844
1850
1845
1851
< pre class ="idl " data-transform ="unComment "> <!--
1846
1852
dictionary JsonLdOptions {
1847
- (JsonLdEmbed or boolean) embed = "@last ";
1853
+ (JsonLdEmbed or boolean) embed = "@first ";
1848
1854
boolean explicit = false;
1849
1855
boolean omitDefault = false;
1850
1856
boolean omitGraph;
@@ -1855,6 +1861,7 @@ <h3>JsonLdOptions</h3>
1855
1861
1856
1862
enum JsonLdEmbed {
1857
1863
"@always",
1864
+ "@first",
1858
1865
"@last",
1859
1866
"@never"
1860
1867
};
@@ -1899,11 +1906,14 @@ <h3>JsonLdOptions</h3>
1899
1906
< dt > < dfn data-dfn-for ="JsonLdEmbed "> @always</ dfn > </ dt > < dd >
1900
1907
Always embed < a > node objects</ a > as property values, unless this would
1901
1908
cause a circular reference.</ dd >
1902
- < dt > < dfn data-dfn-for ="JsonLdEmbed "> @last </ dfn > </ dt > < dd >
1903
- Only the last value within a given < a > node object</ a > should be embedded,
1904
- previous values of other properties use a < a > node reference</ a > . This is the
1909
+ < dt > < dfn data-dfn-for ="JsonLdEmbed "> @first </ dfn > </ dt > < dd >
1910
+ Only the first value within a given < a > node object</ a > should be embedded,
1911
+ subsequent values of other properties use a < a > node reference</ a > . This is the
1905
1912
default value if neither < code > @embed</ code > nor < a > object embed flag</ a >
1906
1913
is not specified.</ dd >
1914
+ < dt > < dfn data-dfn-for ="JsonLdEmbed "> @last</ dfn > </ dt > < dd >
1915
+ Only the last value within a given < a > node object</ a > should be embedded,
1916
+ previous values of other properties use a < a > node reference</ a > .</ dd >
1907
1917
< dt class ="changed "> < dfn data-dfn-for ="JsonLdEmbed "> @never</ dfn > </ dt > < dd class ="changed ">
1908
1918
Always use a < a > node reference</ a > when serializing matching values.</ dd >
1909
1919
</ dl >
0 commit comments