Update "Data Model" and "Relationship to RDF" according Peter P. Schneider's suggestions
... also clarified with/without fractions in the API spec.
--- a/spec/latest/json-ld-api/index.html Tue Jul 09 21:25:17 2013 +0200
+++ b/spec/latest/json-ld-api/index.html Tue Jul 09 22:11:16 2013 +0200
@@ -3285,8 +3285,8 @@
<a class="sectionRef" href="#data-round-tripping">Data Round Tripping</a>
If <i>datatype</i> is <tref>null</tref>, set it to
<code>xsd:boolean</code>.</li>
- <li>Otherwise, if <i>value</i> is a <tref>number</tref> with fractions
- or <i>value</i> is a <tref>number</tref> and <i>datatype</i> equals
+ <li>Otherwise, if <i>value</i> is a <tref>number</tref> with a non-zero fractional
+ part or <i>value</i> is a <tref>number</tref> and <i>datatype</i> equals
<code>xsd:double</code>, convert <i>value</i> to a
<tref>string</tref> in <tref>canonical lexical form</tref> of
an <code>xsd:double</code> as defined in [[!XMLSCHEMA11-2]]
@@ -3294,9 +3294,9 @@
<a class="sectionRef" href="#data-round-tripping">Data Round Tripping</a>.
If <i>datatype</i> is <tref>null</tref>, set it to
<code>xsd:double</code>.</li>
- <li>Otherwise, if <i>value</i> is a <tref>number</tref> without fractions
- or <i>value</i> is a <tref>number</tref> and <i>datatype</i> equals
- <code>xsd:integer</code>, convert <i>value</i> to a
+ <li>Otherwise, if <i>value</i> is a <tref>number</tref> with no non-zero
+ fractional part or <i>value</i> is a <tref>number</tref> and <i>datatype</i>
+ equals <code>xsd:integer</code>, convert <i>value</i> to a
<tref>string</tref> in <tref>canonical lexical form</tref> of
an <code>xsd:integer</code> as defined in [[!XMLSCHEMA11-2]]
and described in
@@ -3659,17 +3659,17 @@
<p>When <a href="#convert-to-rdf-algorithm">converting JSON-LD to RDF</a>
JSON-native <tref title="number">numbers</tref> are automatically
type-coerced to <code>xsd:integer</code> or <code>xsd:double</code>
- depending on whether the <tref>number</tref> has fractions or not,
- the boolean values <tref>true</tref> and <tref>false</tref> are
+ depending on whether the <tref>number</tref> has a non-zero fractional part
+ or not, the boolean values <tref>true</tref> and <tref>false</tref> are
coerced to <code>xsd:boolean</code>, and <tref title="string">strings</tref>
are coerced to <code>xsd:string</code>. The numeric or boolean values
themselves are converted to <tdef>canonical lexical form</tdef>, i.e., a
deterministic string representation as defined in
[[!XMLSCHEMA11-2]].</p>
- <p>The <tref>canonical lexical form</tref> of an <em>integer</em>, i.e.,
- a <tref>number</tref> without fractions or a <tref>number</tref> coerced
- to <code>xsd:integer</code>, is a finite-length sequence of decimal
+ <p>The <tref>canonical lexical form</tref> of an <em>integer</em>, i.e., a
+ <tref>number</tref> with no non-zero fractional part or a <tref>number</tref>
+ coerced to <code>xsd:integer</code>, is a finite-length sequence of decimal
digits (<code>0-9</code>) with an optional leading minus sign; leading
zeros are prohibited. In JavaScript, implementers can use the following
snippet of code to convert an integer to
@@ -3683,8 +3683,8 @@
</pre>
<p>The <tref>canonical lexical form</tref> of a <em>double</em>, i.e., a
- <tref>number</tref> with fractions or a <tref>number</tref> coerced to
- <code>xsd:double</code>, consists of a mantissa followed by the
+ <tref>number</tref> with a non-zero fractional part or a <tref>number</tref>
+ coerced to <code>xsd:double</code>, consists of a mantissa followed by the
character <code>E</code>, followed by an exponent. The mantissa is a
decimal number and the exponent is an integer. Leading zeros and a
preceding plus sign (<code>+</code>) are prohibited in the exponent.
--- a/spec/latest/json-ld/index.html Tue Jul 09 21:25:17 2013 +0200
+++ b/spec/latest/json-ld/index.html Tue Jul 09 22:11:16 2013 +0200
@@ -2709,10 +2709,13 @@
<p>JSON-LD is a serialization format for Linked Data based on JSON.
It is therefore important to distinguish between the syntax, which is
- defined by JSON in [[RFC4627]], and the
- <tdef title="data model">data model</tdef> which is an extension of the
- RDF data model [[RDF11-CONCEPTS]]. To ease understanding for developers
- unfamiliar with the RDF model, the following summary is provided:</p>
+ defined by JSON in [[RFC4627]], and the <tdef>data model</tdef> which is
+ an extension of the RDF data model [[RDF11-CONCEPTS]]. The precise
+ details of how JSON-LD relates to the RDF data model are given in
+ <a class="sectionRef" href="#relationship-to-rdf"></a>.</p>
+
+ <p>To ease understanding for developers unfamiliar with the RDF model, the
+ following summary is provided:</p>
<ul>
<li>A <tdef>JSON-LD document</tdef> serializes a
@@ -2753,9 +2756,14 @@
is a string that can be used as an identifier for a <tref>blank node</tref> within
the scope of a <tref>JSON-LD document</tref>. Blank node identifiers begin with
<code>_:</code>.</li>
- <li>A <tdef>JSON-LD value</tdef> is a <tref>string</tref>, a <tref>number</tref>,
- <tref>true</tref> or <tref>false</tref>, a <tref>typed value</tref>, or a
- <tref>language-tagged string</tref>.</li>
+ <li>A <tdef>JSON-LD value</tdef> is a <tref>typed value</tref>, a <tref>string</tref> (which is interpreted
+ as <tref>typed value</tref> with type <code>xsd:string</code>), a <tref>number</tref>
+ (<tref title="number">numbers</tref> with a non-zero fractional part are interpreted as
+ <tref title="typed value">typed values</tref> with type <code>xsd:double</code>, all other
+ <tref title="number">numbers</tref> are interpreted as <tref title="typed value">typed values</tref>
+ with type <code>xsd:integer</code>), <tref>true</tref> or <tref>false</tref> (which are interpreted as
+ <tref title="typed value">typed values</tref> with type <code>xsd:boolean</code>),
+ or a <tref>language-tagged string</tref>.</li>
<li>A <tdef>typed value</tdef> consists of a value, which is a string, and a type, which is an
<tref>IRI</tref>.</li>
<li>A <tdef><a href="http://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string" class="externalDFN">language-tagged string</a></tdef>
@@ -2763,10 +2771,10 @@
The language tag MUST be well-formed according to section
<a href="http://tools.ietf.org/html/bcp47#section-2.2.9">2.2.9 Classes of Conformance</a>
of [[BCP47]].</li>
- <li>A <tdef>list</tdef> is an sequence of zero or more
- <tref title="IRI">IRIs</tref>,
- <tref title="blank node">blank nodes</tref>, and
- <tref title="JSON-LD value">JSON-LD values</tref>.</li>
+ <li>A <tdef>list</tdef> is a sequence of zero or more <tref title="IRI">IRIs</tref>,
+ <tref title="blank node">blank nodes</tref>, and <tref title="JSON-LD value">JSON-LD values</tref>.
+ <tref title="list">Lists</tref> are interpreted as
+ <a href="http://www.w3.org/TR/rdf11-mt/#rdf-collections" class="externalDFN">RDF list structures</a> [[RDF11-MT]].</li>
</ul>
<div class="issue atrisk" data-number="3" title="Allow blank nodes to be used as properties">
@@ -2787,23 +2795,12 @@
If this change would affect you, be sure to send in a comment.</p>
</div>
- <p>The intent is for the definitions above to be as compatible as possible
- with the abstract syntax of RDF datasets and RDF graphs. The only point at
- which the definitions deviate from the ones in RDF Concepts is when
- the RDF model is extended. Complete details of how JSON-LD
- extends the RDF model can be found in
- <a class="sectionRef" href="#relationship-to-rdf"></a>.</p>
-
- <p>
- <tref title="JSON-LD document">JSON-LD documents</tref>
- MAY contain data that cannot be represented by the
- <tref title="data model">data model</tref> defined above. Unless otherwise
- specified, such data is ignored when a <tref>JSON-LD document</tref>
- is being processed. One result of this rule is that properties which
- are not mapped to an <tref>IRI</tref> or <tref>blank node</tref> will
- be ignored.
- </p>
-
+ <p><tref title="JSON-LD document">JSON-LD documents</tref> MAY contain data
+ that cannot be represented by the <tref title="data model">data model</tref>
+ defined above. Unless otherwise specified, such data is ignored when a
+ <tref>JSON-LD document</tref> is being processed. One result of this rule
+ is that properties which are not mapped to an <tref>IRI</tref>,
+ a <tref>blank node</tref>, or <tref>keyword</tref> will be ignored.</p>
<p style="text-align: center"><img src="linked-data-graph.png" title="An illustration of the data model" alt="An illustration of the data model" /></p>
<p style="text-align: center">Figure 1: An illustration of the data model.</p>
@@ -3177,40 +3174,26 @@
<ul>
<li>In JSON-LD <tref title="property">properties</tref> can be
<tref title="IRI">IRIs</tref> or <tref title="blank node">blank nodes</tref>
- whereas in RDF properties (predicates) have to be
- <tref title="IRI">IRIs</tref>.</li>
- <li>In JSON-LD sets and lists are part of the data model whereas in RDF
- they are part of a vocabulary, namely [[RDF-SCHEMA]].</li>
+ whereas in RDF properties (predicates) have to be <tref title="IRI">IRIs</tref>. This
+ means that JSON-LD serializes
+ <tref href="http://www.w3.org/TR/rdf11-concepts/#fn-generalized-rdf-dataset">generalized RDF Datasets</tref>.</li>
+ <li>In JSON-LD <tref title="list">lists</tref> are part of the data model
+ whereas in RDF they are part of a vocabulary, namely [[RDF-SCHEMA]].</li>
<li>RDF values are either typed <em>literals</em>
(<tref title="typed value">typed values</tref>) or <em>language-tagged strings</em>
(<tref title="language-tagged string">language-tagged strings</tref>) whereas
JSON-LD also supports JSON's native data types, i.e., <tref title="number">number</tref>,
<tref title="string">strings</tref>, and the boolean values <tref>true</tref>
and <tref>false</tref>. The JSON-LD Processing Algorithms and API specification [[JSON-LD-API]]
- defines the conversion rules between JSON's native data types and RDF's counterparts to
- allow full round-tripping.</li>
-
+ defines the <a href="../json-ld-api/#data-round-tripping">conversion rules</a>
+ between JSON's native data types and RDF's counterparts to allow round-tripping.</li>
</ul>
- <p class="note">All JSON numbers and booleans can be mapped to XML Schema
- datatypes, which are built-in datatypes in the RDF model.
- Non-decimal JSON numbers map to <code>xsd:integer</code> and
- decimal numbers map to <code>xsd:double</code>. JSON numbers are
- described as extensions to the RDF data model because they combine the value
- space of <code>xsd:integer</code> and <code>xsd:double</code> into a single
- value space. JSON booleans may be mapped to XML Schema using the
- <code>xsd:boolean</code> datatype. JSON booleans are described as extensions
- to the RDF data model because, while they have the same value space,
- they omit the values of <code>0</code> and <code>1</code> from the
- lexical space.
- </p>
-
<p>Summarized, these differences mean that JSON-LD is capable of serializing any RDF
graph or dataset and most, but not all, JSON-LD documents can be directly
interpreted as RDF. It is possible to work around this restriction, when
interpreting JSON-LD as RDF, by transforming <tref title="blank node">blank nodes</tref>
- used as <tref title="graph name">graph names</tref> or
- <tref title="property">properties</tref> to <tref title="IRI">IRIs</tref>,
+ used as <tref title="property">properties</tref> to <tref title="IRI">IRIs</tref>,
minting new "Skolem IRIs" as per
<cite><a href="http://www.w3.org/TR/rdf11-concepts/#section-skolemization">Replacing Blank Nodes with IRIs</a></cite>
of [[RDF11-CONCEPTS]]. The normative algorithms for interpreting JSON-LD as RDF
@@ -3218,7 +3201,7 @@
JSON-LD Processing Algorithms and API specification [[JSON-LD-API]].</p>
<p>Even though JSON-LD serializes
- <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset">RDF Datasets</tref>, it can
+ <tref href="http://www.w3.org/TR/rdf11-concepts/#fn-generalized-rdf-dataset">generalized RDF Datasets</tref>, it can
also be used as a <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-source">RDF graph source</tref>.
In that case, a consumer MUST only use the default graph and ignore all named graphs.
This allows servers to expose data in, e.g., both Turtle and JSON-LD using content
--- a/spec/latest/respec-w3c-extensions.js Tue Jul 09 21:25:17 2013 +0200
+++ b/spec/latest/respec-w3c-extensions.js Tue Jul 09 22:11:16 2013 +0200
@@ -11,7 +11,8 @@
"RFC6906": "Erik Wilde. <cite><a href=\"http://www.ietf.org/rfc/rfc6906.txt\">The 'profile' Link Relation Type</a>.</cite> March 2013. Internet RFC 6906. URL: <a href=\"http://www.ietf.org/rfc/rfc6906.txt\">http://www.ietf.org/rfc/rfc6906.txt</a>",
"TURTLE": "Eric Prud'hommeaux, Gavin Carothers, Editors. <cite><a href=\"http://www.w3.org/TR/2013/CR-turtle-20130219/\">Turtle: Terse RDF Triple Language.</a></cite> 19 February 2013. W3C Candidate Recommendation (work in progress). URL: <a href=\"http://www.w3.org/TR/2013/CR-turtle-20130219/\">http://www.w3.org/TR/2013/CR-turtle-20130219/</a>. The latest edition is available at <a href=\"http://www.w3.org/TR/turtle/\">http://www.w3.org/TR/turtle/</a>",
"WEBIDL": "Cameron McCormack, Editor. <cite><a href=\"http://www.w3.org/TR/2012/CR-WebIDL-20120419/\">Web IDL.</a></cite> 19 April 2012. W3C Candidate Recommendation (work in progress). URL: <a href=\"http://www.w3.org/TR/2012/CR-WebIDL-20120419/\">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a>. The latest edition is available at <a href=\"http://www.w3.org/TR/WebIDL/\">http://www.w3.org/TR/WebIDL/</a>",
- "DOM-WHATWG": "Anne van Kesteren, Aryeh Gregor, Ms2ger, Editors. <cite><a href=\"http://dom.spec.whatwg.org/\">DOM</a>.</cite> April 2013. WHATWG Living Standard (work in progress). URL: <a href=\"http://dom.spec.whatwg.org/\">http://dom.spec.whatwg.org/</a>"
+ "DOM-WHATWG": "Anne van Kesteren, Aryeh Gregor, Ms2ger, Editors. <cite><a href=\"http://dom.spec.whatwg.org/\">DOM</a>.</cite> April 2013. WHATWG Living Standard (work in progress). URL: <a href=\"http://dom.spec.whatwg.org/\">http://dom.spec.whatwg.org/</a>",
+ "RDF11-MT": "Patrick J. Hayes, Peter F. Patel-Schneider, Editors. <cite><a href=\"http://www.w3.org/TR/2013/WD-rdf11-mt-20130409/\">RDF 1.1 Semantics.</a></cite> 9 April 2013. W3C Working Draft (work in progress). URL: <a href=\"http://www.w3.org/TR/2013/WD-rdf11-mt-20130409/\">http://www.w3.org/TR/2013/WD-rdf11-mt-20130409/</a>. The latest edition is available at <a href=\"http://www.w3.org/TR/rdf11-mt/\">http://www.w3.org/TR/rdf11-mt/</a>"
};
var preProc = {