Skip to content

Commit 4000686

Browse files
pchampinpfps
authored andcommitted
apply @pfps' suggestion
#229 (comment)
1 parent 5595e46 commit 4000686

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

spec/index.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,14 +1843,14 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
18431843
<dd>is the smallest set containing
18441844
<a>strings</a>,
18451845
numbers (<a data-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a>),
1846-
<a data-cite="INFRA#ordered-map">maps</a>
1847-
mapping <a>strings</a> to values in the <a href="#JSON-value-space">value space</a> where the key-value pairs are ordered by key (using <a data-cite="I18N-GLOSSARY#dfn-code-point" class="lint-ignore">Unicode code point</a> order),
1846+
finite unordered maps
1847+
mapping <a>strings</a> to values in the <a href="#JSON-value-space">value space</a>,
18481848
<a data-cite="INFRA#list">lists</a>
18491849
of values in the <a href="#JSON-value-space">value space</a>, and
18501850
literal values (<a data-cite="INFRA#boolean">`true`, `false`</a>, and <a data-cite="INFRA#nulls">`null`</a>)
18511851
from [[[INFRA]]] [[INFRA]] and [[[XMLSCHEMA11-2]]] [[XMLSCHEMA11-2]].
18521852

1853-
<p class="note">The value space of <a data-cite="INFRA#ordered-map">maps</a>
1853+
<p class="note">The value space of finite unordered maps
18541854
and <a data-cite="INFRA#list">lists</a> does not include values having themselves as members,
18551855
which cannot be represented in JSON.</p>
18561856

@@ -1861,18 +1861,16 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
18611861
<dd>maps every element of the lexical space to the result of parsing it into a
18621862
<a>string</a>,
18631863
number (<a data-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a>),
1864-
<a data-cite="INFRA#ordered-map">map</a>,
1864+
finite unordered map,
18651865
<a data-cite="INFRA#list">list</a>, or
18661866
literal value (<a data-cite="INFRA#boolean">`true`, `false`</a>, and <a data-cite="INFRA#nulls">`null`</a>).
18671867

18681868
<ul>
1869-
<li>A <a data-cite="RFC8259#section-4">JSON Object</a> is mapped to a <a data-cite="INFRA#ordered-map">map</a>
1869+
<li>A <a data-cite="RFC8259#section-4">JSON Object</a> is mapped to a finite unordered map
18701870
by transforming each object member into a <a data-cite="INFRA#map-entry">map entry</a>
18711871
with the <a data-cite="INFRA#map-key">key</a> taken from the member name and
18721872
<a data-cite="INFRA#map-value">value</a> taken by performing this mapping
1873-
to the member value,
1874-
and sorting the entries by key ()
1875-
(using <a data-cite="I18N-GLOSSARY#dfn-code-point" class="lint-ignore">Unicode code points</a> order).
1873+
to the member value.
18761874
</li>
18771875
<li>A <a data-cite="RFC8259#section-5">JSON Array</a> is mapped to a <a data-cite="INFRA#list">list</a>
18781876
such that this <a data-cite="INFRA#list">list</a> contains as many
@@ -1904,12 +1902,11 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
19041902
</dd>
19051903
</dl>
19061904
<p class="note">
1907-
The constraint to order map entries in the value space is only meant to make the order of object-member the lexical space irrelevant. In other word, it ensures that both lexical values <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code> are mapped to the same element of the value space. Implementations may omit to sort the entries, as long as they treat the maps in the value space as unordered.
1905+
The finite unordered maps can be implemented with <a data-cite="INFRA#ordered-map">ordered maps</a> [[INFRA]]
1906+
by systematically sorting key-value pairs by key (using <a data-cite="I18N-GLOSSARY#dfn-code-point" class="lint-ignore">Unicode code point</a> order).
1907+
This ensures that lexical forms that differ only in the order of object members are mapped to the same element of the value space
1908+
(e.g. <code>{"a": "b", "c": "d"}</code> and <code>{"c": "d", "a": "b"}</code>).
19081909
</p>
1909-
<p class="issue" data-number="116">The issue refers to the use
1910-
of <a data-cite="INFRA#ordered-map">ordered map</a>
1911-
from [[INFRA]] for describing the value space of <a data-cite="RFC8259#section-4">JSON Objects</a>
1912-
and suggests defining a new datatype for unordered maps.</p>
19131910
</section>
19141911

19151912
</section>

0 commit comments

Comments
 (0)