@@ -376,8 +376,9 @@ <h2>Syntax Tokens and Keywords</h2>
376
376
< dd > Used to express an ordered set of data.
377
377
This keyword is described in the section titled < a href ="#sets-and-lists "> </ a > .</ dd >
378
378
< dt > < code > @set</ code > </ dt >
379
- < dd > Used to express an unordered set of data.
380
- This keyword is described in the section titled < a href ="#sets-and-lists "> </ a > .</ dd >
379
+ < dd > Used to express an unordered set of data and to ensure that values are always
380
+ represented as arrays. This keyword is described in the section titled
381
+ < a href ="#sets-and-lists "> </ a > .</ dd >
381
382
< dt > < code > @vocab</ code > </ dt >
382
383
< dd > Used to expand properties and values in < code > @type</ code > with a common prefix
383
384
< tref > IRI</ tref > . This keyword is described in section < a href ="#iris "> </ a > .</ dd >
@@ -2778,10 +2779,15 @@ <h2>List and Set Values</h2>
2778
2779
< p > A < tref > list</ tref > represents an < em > ordered</ em > set of values.
2779
2780
A < tdef > set</ tdef > represents an < em > unordered</ em > set of values.
2780
2781
Unless otherwise specified (typically through the use of a < tref > list</ tref > ),
2781
- < tref title ="array "> arrays</ tref > are unordered in JSON-LD.
2782
- As such, the < code > @set</ code > keyword is not stricto senso necessary.
2783
- It is defined for symmetry with the < code > @list</ code > keyword.</ p >
2784
- </ p >
2782
+ < tref title ="array "> arrays</ tref > are unordered in JSON-LD. As such, the
2783
+ < code > @set</ code > keyword, when used in the body of a JSON-LD document,
2784
+ represents just syntactic sugar which is optimized away when processing the document.
2785
+ However, it is very helpful when used within the context of a document. Values
2786
+ of terms associated with a < code > @set</ code > or < code > @list</ code > container
2787
+ will always be represented in the form of an array when a document is processed -
2788
+ even if there is just a single value that would otherwise be optimized to
2789
+ a non-array form in < a href ="#compact-document-form "> compact document form</ a > .
2790
+ This simplifies post-processing of the data as the data is always in array form.</ p >
2785
2791
2786
2792
< p > A < tref > list</ tref > MUST be a < tref > JSON object</ tref > that contains a single key-value pair where the key is < code > @list</ code > .</ p >
2787
2793
0 commit comments