Skip to content

Commit 9fde77e

Browse files
committed
Add explanatory prose to examples in JSON-LD lists section.
1 parent f2ccd24 commit 9fde77e

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

index.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,9 +4340,9 @@ <h3>Restrictions on JSON-LD</h3>
43404340
<section class="notoc">
43414341
<h3>Lists and Arrays</h3>
43424342
<p>
4343-
Lists, arrays, and even lists of lists, are possible when using [[JSON-LD11]] 1.1.
4344-
We encourage those who want RDF semantics in use
4345-
cases requiring lists and arrays to follow the guidance on
4343+
Lists, arrays, and even lists of lists, are possible when using [[[JSON-LD11]]].
4344+
We encourage those who want RDF semantics in use cases requiring lists and
4345+
arrays to follow the guidance on
43464346
<a href="https://www.w3.org/TR/json-ld11/#lists">lists in JSON-LD 1.1</a>.
43474347
</p>
43484348
<p>
@@ -4351,14 +4351,15 @@ <h3>Lists and Arrays</h3>
43514351
</p>
43524352
<p class="note"
43534353
title="Array order might not matter">
4354-
While it is possible to use this data model without any JSON-LD processing,
4355-
those who do so and make use of arrays need to be aware that unless the above
4356-
guidance is followed, the order of items in an array cannot be guaranteed in
4357-
JSON-LD. This might lead to unexpected behavior.
4354+
While it is possible to use this data model by performing [=type-specific
4355+
credential processing=], those who do so and make use of arrays need to be aware
4356+
that unless the above guidance is followed, the order of items in an array
4357+
are not guaranteed in JSON-LD. This might lead to unexpected behavior.
43584358
</p>
43594359
<p>
4360-
If JSON structure or ordering is important to your application,
4361-
we recommend you mark such elements as `@json` via an `@context`.
4360+
If JSON structure or ordering is important to your application, we recommend you
4361+
mark such elements as `@json` via an `@context` that is specific to your
4362+
use case. An example of such a declaration is shown below.
43624363
</p>
43634364
<pre class="example" title="A @context file that defines a matrix as an embedded JSON data structure">
43644365
{
@@ -4371,6 +4372,14 @@ <h3>Lists and Arrays</h3>
43714372
}
43724373
}
43734374
</pre>
4375+
4376+
<p>
4377+
When the context shown above is used in the example below, by including the
4378+
`https://website.example/matrix/v1` context in the `@context` property, the
4379+
value in `credentialSubject.matrix` retains its JSON semantics; the exact order
4380+
of all elements in the two dimensional matrix is preserved.
4381+
</p>
4382+
43744383
<pre class="example" title="A verifiable credential with an embedded JSON data structure">
43754384
{
43764385
"@context": [

0 commit comments

Comments
 (0)