Skip to content

Commit 159aab5

Browse files
committed
changed definition of the rdf:JSON datatype
addressing #323
1 parent 597a8c4 commit 159aab5

File tree

1 file changed

+26
-42
lines changed

1 file changed

+26
-42
lines changed

index.html

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -12858,48 +12858,15 @@ <h3>Serializing/Deserializing RDF</h3>
1285812858
<dd>is the set of UNICODE [[UNICODE]] strings which conform to the <a data-cite="JSON#section-2">JSON Grammar</a>
1285912859
as described in <a data-cite="RFC8259#section-2">Section 2 JSON Grammar</a> of [[RFC8259]].</dd>
1286012860
<dt>The value space</dt>
12861-
<dd class="algorithm">is the union of the four primitive types (<a>strings</a>, <a>numbers</a>, <a>booleans</a>,
12862-
and <a>null</a>) and two structured types (<a>objects</a> and <a>arrays</a>)
12863-
from [[ECMASCRIPT]].
12864-
Two JSON values <var>A</var> and <var>B</var> are considered equal if and only if the following is true:
12865-
<ol>
12866-
<li>If <var>A</var> and <var>B</var> are both <a>objects</a>,
12867-
both <var>A</var> and <var>B</var> have the same number of <a>entries</a>,
12868-
and each <a>entry</a> in <var>A</var> is equal to a corresponding <a>entry</a> in <var>B</var>
12869-
where <ul>
12870-
<li>the keys are equal (as defined in <a data-cite="ECMASCRIPT#sec-samevaluenonnumber">Section 7.2.13, step 5.a</a>
12871-
in [[ECMASCRIPT]]), and</li>
12872-
<li>the values are considered equal through
12873-
applying this comparison recursively.</li>
12874-
</ul>
12875-
<li>Otherwise, if <var>A</var> and <var>B</var> are both <a>arrays</a>,
12876-
both <var>A</var> and <var>B</var> have the same number of elements,
12877-
and each element <var>A<sub>i</sub></var> is considered
12878-
equal to the corresponding element <var>B<sub>i</sub></var>
12879-
through applying this comparison recursively.</li>
12880-
<li>Otherwise, if <var>A</var> and <var>B</var> satisfy the
12881-
<a data-cite="ECMASCRIPT#sec-strict-equality-comparison">Strict Equality Comparison</a>
12882-
defined in <a data-cite="ECMASCRIPT#sec-strict-equality-comparison">Section 7.2.16</a> in [[ECMASCRIPT]].</li>
12883-
<li>Otherwise, <var>A</var> and <var>B</var> are not equal.</li>
12884-
</ol>
12885-
</dd>
12886-
<dt>The lexical-to-value mapping</dt>
12887-
<dd>is the result of parsing the lexical representation into
12888-
an internal representation consistent with [[ECMASCRIPT]] representation
12889-
created by using the <code>JSON.parse</code> function as defined in
12890-
<a data-cite="ECMASCRIPT#sec-json-object">Section 24.5 The JSON Object</a> of [[ECMASCRIPT]].</dd>
12891-
<dt>The canonical mapping</dt>
12892-
<dd>is non-normative, as a normative recommendation for
12893-
JSON canonicalization is not yet defined. Implementations
12894-
SHOULD use the following guidelines when creating the lexical
12895-
representation of a <a>JSON literal</a>:
12896-
12897-
<ul class="changed">
12898-
<li>Serialize JSON using no unnecessary whitespace,</li>
12899-
<li>Keys in objects SHOULD be ordered lexicographically,</li>
12900-
<li>Native Numeric values SHOULD be serialized according to
12861+
<dd class="changed">is the set of UNICODE [[UNICODE]] strings which conform to the <a data-cite="JSON#section-2">JSON Grammar</a>
12862+
as described in <a data-cite="RFC8259#section-2">Section 2 JSON Grammar</a> of [[RFC8259]],
12863+
and furthermore comply with the following constraints:
12864+
<ul>
12865+
<li>It MUST not contain any unnecessary whitespace,</li>
12866+
<li>Keys in objects MUST be ordered lexicographically,</li>
12867+
<li>Native Numeric values MUST be serialized according to
1290112868
<a data-cite="?ECMASCRIPT#sec-tostring-applied-to-the-number-type">Section 7.1.12.1</a> of [[?ECMASCRIPT]],</li>
12902-
<li>Strings SHOULD be serialized with Unicode codepoints from <code>U+0000</code> through <code>U+001F</code>
12869+
<li>Strings MUST be serialized with Unicode codepoints from <code>U+0000</code> through <code>U+001F</code>
1290312870
using lower case hexadecimal Unicode notation (<code>\uhhhh</code>) unless in the set
1290412871
of predefined JSON control characters <code>U+0008</code>, <code>U+0009</code>,
1290512872
<code>U+000A</code>, <code>U+000C</code> or <code>U+000D</code>
@@ -12908,7 +12875,6 @@ <h3>Serializing/Deserializing RDF</h3>
1290812875
<code>U+005C</code> (<code>\</code>) and <code>U+0022</code> (<code>"</code>)
1290912876
which SHOULD be serialized as <code>\\</code> and <code>\"</code> respectively.</li>
1291012877
</ul>
12911-
1291212878
<div class="issue changed">The JSON Canonicalization Scheme [[?JCS]]
1291312879
is an emerging standard for JSON canonicalization
1291412880
not yet ready to be referenced.
@@ -12917,7 +12883,25 @@ <h3>Serializing/Deserializing RDF</h3>
1291712883
Users are cautioned from depending on the
1291812884
<a>JSON literal</a> lexical representation as an <a>RDF literal</a>,
1291912885
as the specifics of serialization may change in a future revision of this document.</div>
12886+
Despite being defined as a set of strings,
12887+
this value space is considered distinct from the value space of `xsd:string`,
12888+
in order to avoid side effects with existing specifications.
1292012889
</dd>
12890+
<dt>The lexical-to-value mapping</dt>
12891+
<dd>maps any element of the lexical space to the result of
12892+
<ol>
12893+
<li>parsing it into
12894+
an internal representation consistent with [[ECMASCRIPT]] representation
12895+
created by using the <code>JSON.parse</code> function as defined in
12896+
<a data-cite="ECMASCRIPT#sec-json-object">Section 24.5 The JSON Object</a> of [[ECMASCRIPT]],</li>
12897+
<li>then serializing it in the JSON format [[RFC8259]]
12898+
in compliance with the constraints of the value space described above.
12899+
</li>
12900+
</ol>
12901+
</dd>
12902+
<dt>The canonical mapping</dt>
12903+
<dd>maps any element of the value space to the identical string in the lexical space.</dd>
12904+
1292112905
</dl>
1292212906
</section>
1292312907

0 commit comments

Comments
 (0)