@@ -624,13 +624,13 @@ <h4>Object Embed Flag</h4>
624
624
The initial value for the < a > object embed flag</ a > is set using the
625
625
< a data-link-for ="JsonLdOptions "> embed</ a > option.
626
626
Consider the following frame
627
- based on the default < code > @first </ code > value of the < a > object embed flag</ a > :</ p >
627
+ based on the default < code > @once </ code > value of the < a > object embed flag</ a > :</ p >
628
628
629
- < pre id ="sample-library-frame-with-implicit-embed-set-to-first "
629
+ < pre id ="sample-library-frame-with-implicit-embed-set-to-once "
630
630
class ="example frame " data-transform ="updateExample "
631
631
data-content-type ="application/ld+json;profile=http://www.w3.org/ns/json-ld#framed "
632
632
data-frame-for ="Flattened library objects "
633
- title ="Sample library frame with implicit @embed set to @first ">
633
+ title ="Sample library frame with implicit @embed set to @once ">
634
634
<!--
635
635
{
636
636
"@context": {"@vocab": "http://example.org/"},
@@ -640,15 +640,15 @@ <h4>Object Embed Flag</h4>
640
640
</ pre >
641
641
642
642
< aside class ="example ds-selector-tabs "
643
- title ="Framed library objects with @embed set to @first ">
643
+ title ="Framed library objects with @embed set to @once ">
644
644
< div class ="selectors ">
645
645
< a class ="playground "
646
646
data-result-for ="#flattened-library-objects "
647
- data-frame ="#sample-library-frame-with-implicit-embed-set-to-first "
647
+ data-frame ="#sample-library-frame-with-implicit-embed-set-to-once "
648
648
target ="_blank "> </ a >
649
649
</ div >
650
650
< pre class ="selected original nohighlight " data-transform ="updateExample "
651
- data-frame ="Sample library frame with implicit @embed set to @first "
651
+ data-frame ="Sample library frame with implicit @embed set to @once "
652
652
data-result-for ="Flattened library objects ">
653
653
<!--
654
654
{
@@ -674,11 +674,12 @@ <h4>Object Embed Flag</h4>
674
674
</ pre >
675
675
</ aside >
676
676
677
- < p > Because, the default for the < a > object embed flag</ a > is < code > @first </ code >
677
+ < p > Because, the default for the < a > object embed flag</ a > is < code > @once </ code >
678
678
(in addition to the < a > explicit inclusion flag</ a > being < code > false</ code > ),
679
679
non-listed properties are added to the output, and implicitly embedded
680
680
using a default empty frame. As a result, the same output used in the
681
- < a href ="#lib-example-output "> Framed library objects</ a > above is generated.</ p >
681
+ < a href ="#lib-example-output "> Framed library objects</ a > above is generated,
682
+ assuming that the < a data-link-for ="JsonLdOptions "> ordered</ a > flag is < code > true</ code > .</ p >
682
683
683
684
< p > However, if the < code > @embed</ code > property is added explicitly with a
684
685
value of < code > @never</ code > , the values for < em > Book</ em > and < em > Chapter</ em > will be excluded.</ p >
@@ -726,7 +727,7 @@ <h4>Object Embed Flag</h4>
726
727
</ pre >
727
728
</ aside >
728
729
729
- < p > To illustrate the case where < code > @first </ code > does not expand values,
730
+ < p > To illustrate the case where < code > @once </ code > does not expand values,
730
731
consider an alternate library example where books are doubly indexed.</ p >
731
732
732
733
< pre id ="flattened-library-objects-with-double-index "
@@ -765,11 +766,11 @@ <h4>Object Embed Flag</h4>
765
766
< div class ="selectors ">
766
767
< a class ="playground "
767
768
data-result-for ="#flattened-library-objects-with-double-index "
768
- data-frame ="#sample-library-frame-with-implicit-embed-set-to-first "
769
+ data-frame ="#sample-library-frame-with-implicit-embed-set-to-once "
769
770
target ="_blank "> </ a >
770
771
</ div >
771
772
< pre class ="selected original nohighlight " data-transform ="updateExample "
772
- data-frame ="Sample library frame with implicit @embed set to @first "
773
+ data-frame ="Sample library frame with implicit @embed set to @once "
773
774
data-result-for ="Flattened library objects with double index ">
774
775
<!--
775
776
{
@@ -796,60 +797,10 @@ <h4>Object Embed Flag</h4>
796
797
</ pre >
797
798
</ aside >
798
799
799
- < p > When framed using the same frame with the default < code > @embed</ code > of < code > @first</ code > ,
800
- only the < em > "books"</ em > property will have content, and the < em > "contains"</ em > property will use a reference.</ p >
801
-
802
- < p > If we use a frame using < code > "@embed": "@last"</ code > ,
803
- only the "contains" property will use a reference.</ p >
804
-
805
- < pre id ="sample-library-frame-with-explicit-embed-set-to-last "
806
- class ="example frame nohighlight " data-transform ="updateExample "
807
- data-content-type ="application/ld+json;profile=http://www.w3.org/ns/json-ld#framed "
808
- data-frame-for ="Flattened library objects with double index "
809
- title ="Sample library frame with explicit @embed set to @last ">
810
- <!--
811
- {
812
- "@context": {"@vocab": "http://example.org/"},
813
- "@type": "Library",
814
- ****"@embed": "@last"****
815
- }
816
- -->
817
- </ pre >
818
- < aside class ="example ds-selector-tabs "
819
- title ="Framed library objects with double index and @last ">
820
- < div class ="selectors ">
821
- < a class ="playground "
822
- data-result-for ="#flattened-library-objects-with-double-index "
823
- data-frame ="#sample-library-frame-with-explicit-embed-set-to-last "
824
- target ="_blank "> </ a >
825
- </ div >
826
- < pre class ="selected original nohighlight " data-transform ="updateExample "
827
- data-frame ="Sample library frame with explicit @embed set to @last "
828
- data-result-for ="Flattened library objects with double index ">
829
- <!--
830
- {
831
- "@context": {"@vocab": "http://example.org/"},
832
- "@graph": [{
833
- "@id": "http://example.org/library",
834
- "@type": "Library",
835
- ****"books": {"@id": "http://example.org/library/the-republic"},****
836
- ****"contains": {
837
- "@id": "http://example.org/library/the-republic",
838
- "@type": "Book",
839
- "contains": {
840
- "@id": "http://example.org/library/the-republic#introduction",
841
- "@type": "Chapter",
842
- "description": "An introductory chapter on The Republic.",
843
- "title": "The Introduction"
844
- },
845
- "creator": "Plato",
846
- "title": "The Republic"
847
- }****
848
- }]
849
- }
850
- -->
851
- </ pre >
852
- </ aside >
800
+ < p > When framed using the same frame with the default < code > @embed</ code > of < code > @once</ code > ,
801
+ only the < em > "books"</ em > property will have content,
802
+ if the < a data-link-for ="JsonLdOptions "> ordered</ a > flag is < code > true</ code > ,
803
+ and the < em > "contains"</ em > property will use a reference.</ p >
853
804
854
805
< p > If we use a frame using < code > "@embed": "@always"</ code > ,
855
806
both properties will include expanded values.</ p >
@@ -1431,15 +1382,15 @@ <h2>Syntax Tokens and Keywords</h2>
1431
1382
Always embed < a > node objects</ a > as property values, unless this would
1432
1383
cause a circular reference.
1433
1384
</ dd >
1434
- < dt class ="changed "> < code > @first </ code > </ dt > < dd class ="changed ">
1435
- Only the first value within a given < a > node object</ a > should be embedded,
1436
- subsequent values of other properties use a < a > node reference</ a > . This is the
1385
+ < dt class ="changed "> < code > @once </ code > </ dt > < dd class ="changed ">
1386
+ Juse a single value within a given < a > node object</ a > should be embedded,
1387
+ other values of other properties use a < a > node reference</ a > . This is the
1437
1388
default value if neither < code > @embed</ code > nor < a > object embed flag</ a >
1438
1389
is not specified.
1439
- </ dd >
1440
- < dt > < code > @last </ code > </ dt > < dd >
1441
- Only the last value within a given < a > node object</ a > should be embedded ,
1442
- previous values of other properties use a < a > node reference </ a > .
1390
+ < div class =" note " > The specific < a > node object </ a > chosen to embed depends on
1391
+ ordering. if the < a data-link-for =" JsonLdOptions " > ordered </ a > flag is < code > true </ code > ,
1392
+ this will be the first < a > node object</ a > encountered ,
1393
+ otherwise, it may be any node object. </ div >
1443
1394
</ dd >
1444
1395
< dt > < code > @never</ code > </ dt > < dd >
1445
1396
Always use a < a > node reference</ a > when serializing matching values.
@@ -1536,7 +1487,7 @@ <h3>Framing Algorithm</h3>
1536
1487
1537
1488
< p > The recursive algorithm operates with a < a > framing state</ a > (< var > state</ var > ),
1538
1489
created initially using
1539
- the < a > object embed flag</ a > set to < code > @first </ code > ,
1490
+ the < a > object embed flag</ a > set to < code > @once </ code > ,
1540
1491
the < a > explicit inclusion flag</ a > set to < code > false</ code > ,
1541
1492
the < a > require all flag</ a > set to < code > true</ code > ,
1542
1493
the < a > omit default flag</ a > set to < code > false</ code > ,
@@ -1583,18 +1534,11 @@ <h3>Framing Algorithm</h3>
1583
1534
circular reference would be created by an embed,
1584
1535
add < var > output</ var > to < var > parent</ var >
1585
1536
and do not perform additional processing for this < var > node</ var > .</ li >
1586
- < li class ="changed "> Otherwise, if < var > embed</ var > is < code > @first </ code >
1537
+ < li class ="changed "> Otherwise, if < var > embed</ var > is < code > @once </ code >
1587
1538
and parent has an existing embedded node in < var > parent</ var > associated with
1588
1539
< var > graph name</ var > and < var > id</ var > in < var > state</ var > ,
1589
1540
add < var > output</ var > to < var > parent</ var >
1590
- and do not perform additional processing for this < var > node</ var > .
1591
- < span class ="ednote "> Requires sorting of subjects.
1592
- We could consider < code > @sample</ code > , to embed in a property, rather than the lexicographically first.</ span > </ li >
1593
- < li > Otherwise, if < var > embed</ var > is < code > @last</ code > ,
1594
- remove any existing embedded node from < var > parent</ var > associated with
1595
- < var > graph name</ var > and < var > id</ var > in < var > state</ var > .
1596
- < span class ="ednote "> Requires sorting of subjects.
1597
- We could consider < code > @sample</ code > , to embed in a property, rather than the lexicographically last.</ span > </ li >
1541
+ and do not perform additional processing for this < var > node</ var > .</ li >
1598
1542
< li class ="changed "> If < var > graph map</ var > in < var > state</ var > has an entry for < var > id</ var > :
1599
1543
< ol >
1600
1544
< li > If < var > frame</ var > does not have a < code > @graph</ code > < a > member</ a > ,
@@ -1989,19 +1933,18 @@ <h3>JsonLdOptions</h3>
1989
1933
1990
1934
< pre class ="idl " data-transform ="unComment "> <!--
1991
1935
dictionary JsonLdOptions {
1992
- (JsonLdEmbed or boolean) embed = "@first ";
1993
- boolean explicit = false;
1994
- boolean omitDefault = false;
1936
+ (JsonLdEmbed or boolean) embed = "@once ";
1937
+ boolean explicit = false;
1938
+ boolean omitDefault = false;
1995
1939
boolean omitGraph;
1996
- boolean requireAll = false;
1940
+ boolean requireAll = false;
1997
1941
boolean frameDefault = false;
1998
- boolean ordered = false;
1942
+ boolean ordered = false;
1999
1943
};
2000
1944
2001
1945
enum JsonLdEmbed {
2002
1946
"@always",
2003
- "@first",
2004
- "@last",
1947
+ "@once",
2005
1948
"@never"
2006
1949
};
2007
1950
-->
@@ -2015,7 +1958,7 @@ <h3>JsonLdOptions</h3>
2015
1958
< dd > Sets the value < a > object embed flag</ a > used in the
2016
1959
< a href ="#framing-algorithm "> Framing Algorithm</ a > .
2017
1960
A boolean value of < code > true</ code > sets the flag to
2018
- < code > @last </ code > , while an value of < code > false</ code > sets the flag
1961
+ < code > @once </ code > , while an value of < code > false</ code > sets the flag
2019
1962
to < code > @never</ code > .</ dd >
2020
1963
< dt > < dfn data-dfn-for ="JsonLdOptions "> explicit</ dfn > </ dt >
2021
1964
< dd > Sets the value < a > explicit inclusion flag</ a > used in the
@@ -2045,14 +1988,11 @@ <h3>JsonLdOptions</h3>
2045
1988
< dt > < dfn data-dfn-for ="JsonLdEmbed "> @always</ dfn > </ dt > < dd >
2046
1989
Always embed < a > node objects</ a > as property values, unless this would
2047
1990
cause a circular reference.</ dd >
2048
- < dt > < dfn data-dfn-for ="JsonLdEmbed "> @first </ dfn > </ dt > < dd >
2049
- Only the first value within a given < a > node object</ a > should be embedded,
2050
- subsequent values of other properties use a < a > node reference</ a > . This is the
1991
+ < dt > < dfn data-dfn-for ="JsonLdEmbed "> @once </ dfn > </ dt > < dd >
1992
+ Only a single value within a given < a > node object</ a > should be embedded,
1993
+ other values of other properties use a < a > node reference</ a > . This is the
2051
1994
default value if neither < code > @embed</ code > nor < a > object embed flag</ a >
2052
1995
is not specified.</ dd >
2053
- < dt > < dfn data-dfn-for ="JsonLdEmbed "> @last</ dfn > </ dt > < dd >
2054
- Only the last value within a given < a > node object</ a > should be embedded,
2055
- previous values of other properties use a < a > node reference</ a > .</ dd >
2056
1996
< dt class ="changed "> < dfn data-dfn-for ="JsonLdEmbed "> @never</ dfn > </ dt > < dd class ="changed ">
2057
1997
Always use a < a > node reference</ a > when serializing matching values.</ dd >
2058
1998
</ dl >
@@ -2241,6 +2181,8 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
2241
2181
evaluating test results have been updated accordingly.</ li >
2242
2182
< li > The IANA registration is changed from < code > application/ld-frame+json</ code > to
2243
2183
< code > application/ld+json</ code > with a required < code > profile</ code > parameter.</ li >
2184
+ < li > Removed < code > @first</ code > and < code > @last</ code > values for the
2185
+ < a > object embed flag</ a > in favor of < code > @once</ code > .</ li >
2244
2186
</ ul >
2245
2187
</ section >
2246
2188
0 commit comments