Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdf:JSON lexical-to-value updates #114

Merged
merged 10 commits into from
Nov 14, 2024
33 changes: 23 additions & 10 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
</div></dd>

<dt id="JSON-value-space">The <a>value space</a></dt>
<dd>is the set of
<dd>is the smallest set containing
<a>strings</a>,
numbers (<a data-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a>),
<a data-cite="INFRA#ordered-map">maps</a>
Expand All @@ -1571,6 +1571,10 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
literal values (<a data-cite="INFRA#boolean">`true`, `false`</a>, and <a data-cite="INFRA#nulls">`null`</a>)
from [[[INFRA]]] [[INFRA]] and [[[XMLSCHEMA11-2]]] [[XMLSCHEMA11-2]].

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

<p>Two values (|a| and |b|) are considered equal if any of the following are true:
<ul>
<li>They are the same <a>string</a>,
Expand Down Expand Up @@ -1605,27 +1609,36 @@ <h3>The <code>rdf:JSON</code> Datatype</h3>
literal value (<a data-cite="INFRA#boolean">`true`, `false`</a>, and <a data-cite="INFRA#nulls">null</a>).

<ul>
<li>A <a href="RFC8259#section-4">JSON Object</a> is mapped to a <a data-cite="INFRA#ordered-map">map</a>
<li>A <a data-cite="RFC8259#section-4">JSON Object</a> is mapped to a <a data-cite="INFRA#ordered-map">map</a>
by transforming each object member into a <a data-cite="INFRA#map-entry">map entry</a>
with the <a data-cite="INFRA#map-key">key</a> taken from the member name and
<a data-cite="INFRA#map-value">value</a> taken by performing this mapping
to the member value.
<a data-cite="INFRA#map-entry">Map entries</a> are treated as being unordered.
</li>
<li>A <a href="RFC8259#section-5">JSON Array</a> is mapped to a <a data-cite="INFRA#list">list</a>
by performing this mapping on each array value.</li>
<li>A <a href="RFC8259#section-6">JSON Number</a> is mapped to
</li>
<li>A <a data-cite="RFC8259#section-5">JSON Array</a> is mapped to a <a data-cite="INFRA#list">list</a>
such that this <a data-cite="INFRA#list">list</a> contains as many
elements as the <a data-cite="RFC8259#section-5">JSON Array</a> and, for
every position |i| in the <a data-cite="RFC8259#section-5">array</a>,
the element at the |i|-th position in the
<a data-cite="INFRA#list">list</a> is the value that results from
applying this mapping to the |i|-th element of the
<a data-cite="RFC8259#section-5">array</a>.</li>
<li>A <a data-cite="RFC8259#section-6">JSON Number</a> is mapped to
an <a data-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a>
using a method consistent with <a data-cite="XMLSCHEMA11-2#f-doubleLexmap">doubleLexicalMap</a>.
gkellogg marked this conversation as resolved.
Show resolved Hide resolved
<div class="note">Some numbers cannot be represented
as finite <a data-cite="XMLSCHEMA11-2#double"><strong>xsd:double</strong></a> values
and may map to `+INF` or `-INF`.
Such values cannot be represented as JSON Numbers, limiting the ability to serialize such values back to JSON.</div>
</li>
<li>A <a href="RFC8259#section-7">JSON String</a> is mapped to
a <a>string</a>.</li>
<li>A <a href="RFC8259#section-3">JSON literal name</a> is mapped to
<a data-cite="INFRA#boolean">`true`, `false`</a>, or <a data-cite="INFRA#nulls">null</a>.</li>
<li>A <a data-cite="RFC8259#section-7">JSON String</a> is mapped to
a <a>string</a> after converting any escape sequences to the associated
<a data-cite="I18N-GLOSSARY#dfn-code-point">Unicode code point</a>.</li>
<li>A <a data-cite="RFC8259#section-3">JSON literal name</a> maps
`true` to <a data-cite="INFRA#boolean">`true`</a>,
`false` to <a data-cite="INFRA#boolean">`false`</a>, and
`null` to <a data-cite="INFRA#nulls">`null`</a>.</li>
gkellogg marked this conversation as resolved.
Show resolved Hide resolved
</ul>
</dd>
</dl>
Expand Down
Loading