add rdf:HTML datatype; change DOM reference to DOM4 everywhere
authorRichard Cyganiak <richard@cyganiak.de>
Thu, 17 May 2012 19:09:31 +0100
changeset 401 8650b44c3c0c
parent 400 c031fe6272cf
child 402 8e9f1f4911ca
add rdf:HTML datatype; change DOM reference to DOM4 everywhere
rdf-concepts/index.html
--- a/rdf-concepts/index.html	Thu May 17 18:33:06 2012 +0100
+++ b/rdf-concepts/index.html	Thu May 17 19:09:31 2012 +0100
@@ -656,12 +656,8 @@
     [[!XMLSCHEMA11-2]]. Any datatype definition that conforms
     to this abstraction MAY be used in RDF, even if not defined
     in terms of XML Schema. RDF re-uses the XML Schema built-in datatypes,
-    and provides one additional built-in datatype,
-    <code><a>rdf:XMLLiteral</a></code>.</p>
-
-    <p class="issue">The Working Group is planning to add an HTML datatype
-    to better address the use case of including text with markup. This is
-    <a href="http://www.w3.org/2011/rdf-wg/track/issues/63">ISSUE-63</a>.</p>
+    and provides two additional built-in datatypes,
+    <code><a>rdf:HTML</a></code> and <code><a>rdf:XMLLiteral</a></code>.</p>
 
     <p>A <dfn>datatype</dfn> consists of a <a>lexical space</a>,
     a <a>value space</a> and a <a>lexical-to-value mapping</a>, and
@@ -865,6 +861,60 @@
 </section>
 
 
+<section id="section-html">
+    <h3>The <code>rdf:HTML</code> Datatype</h3>
+
+    <p>RDF provides for HTML content as a possible <a>literal value</a>.
+    This allows markup in literal values. Such content is indicated
+    in an <a>RDF graph</a> using a <a>literal</a> whose <a>datatype</a>
+    is a special built-in datatype <code><dfn>rdf:HTML</dfn></code>.
+    This datatype is defined as follows:</p>
+
+    <dl>
+    <dt>An IRI denoting this datatype</dt>
+    <dd>is <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML</code>.</dd>
+
+    <dt>The lexical space</dt>
+    <dd>is the set of Unicode [[UNICODE]] strings.</dd>
+
+    <dt>The value space</dt>
+    <dd>is a set of DOM
+    <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
+    nodes [[!DOM4]]. Two
+    <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
+    nodes <em>A</em> and <em>B</em> are considered equal if and only if
+    the DOM method
+    <code><em>A</em>.<a href="http://www.w3.org/TR/dom/#dom-node-isequalnode">isEqualNode</a>(<em>B</em>)</code>
+    [[!DOM4]] returns <code>true</code>.</dd>
+
+    <dt>The lexical-to-value mapping</dt>
+    <dd>
+      <ul>
+        <li>Let <code>domnodes</code> be the list of
+        <a href="http://www.w3.org/TR/dom/#node">DOM nodes</a> [[!DOM4]]
+        that result from applying the
+        <a href="http://www.w3.org/TR/html5/the-end.html#parsing-html-fragments">HTML fragment parsing algorithm</a> [[!HTML5]]
+        to the literal's <a>lexical form</a>, without a context element.</li>
+        <li>Let <code>domfrag</code> be a DOM
+        <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
+        [[!DOM4]] whose <code>childNodes</code> attribute is equal to
+        <code>domnodes</code></li>
+        <li>Return <code>domfrag.<a href="http://www.w3.org/TR/dom/#dom-node-normalize">normalize</a>()</code></li>
+      </ul>
+    </dd>
+    </dl>
+
+    <p class="note">Any language annotation desired in the HTML content
+    must be included explicitly in the HTML literal
+    (<code>@lang="…"</code>).</p>
+
+    <p class="note">RDF applications may use additional equivalence relations,
+    such as that which relates an <code>xsd:string</code> with an
+    <code>rdf:HTML</code> literal corresponding to a single text node
+    of the same string.</p>
+
+</section>
+
 <section id="section-XMLLiteral">
     <h3>The <code>rdf:XMLLiteral</code> Datatype</h3>
 
@@ -892,22 +942,22 @@
       <dt><a name="XMLLiteral-value-space" id="XMLLiteral-value-space">The value space</a></dt>
 
       <dd>is a set of DOM
-      <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3"><code>DocumentFragment</code></a>
-      nodes [[!DOM-LEVEL-3-CORE]]. Two
-      <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3"><code>DocumentFragment</code></a>
+      <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
+      nodes [[!DOM4]]. Two
+      <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
       nodes <em>A</em> and <em>B</em> are considered equal
       if and only if the DOM method
-      <code><em>A</em>.<a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-isEqualNode">isEqualNode</a>(<em>B</em>)</code>
+      <code><em>A</em>.<a href="http://www.w3.org/TR/dom/#dom-node-isequalnode">isEqualNode</a>(<em>B</em>)</code>
       returns <code>true</code>.</dd>
 
       <dt><a name="XMLLiteral-mapping" id="XMLLiteral-mapping">The lexical-to-value mapping</a></dt>
 
       <dd><ul>
       <li>Let <code>domfrag</code> be a DOM
-      <a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-B63ED1A3"><code>DocumentFragment</code></a>
-      node [[!DOM-LEVEL-3-CORE]] corresponding to the literal's
+      <a href="http://www.w3.org/TR/dom/#interface-documentfragment"><code>DocumentFragment</code></a>
+      node [[!DOM4]] corresponding to the literal's
       <a>lexical form</a></li>
-      <li>Return <code>domfrag.<a href="http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-normalize">normalize</a>()</code></li>
+      <li>Return <code>domfrag.<a href="http://www.w3.org/TR/dom/#dom-node-normalize">normalize</a>()</code></li>
       </ul></dd>
 
       <dt><a name="XMLLiteral-canonical" id="XMLLiteral-canonical">The canonical mapping</a></dt>
@@ -1135,6 +1185,8 @@
   <h2>Changes from RDF 2004</h2>
 
   <ul>
+    <li>2012-05-17: Changed normative reference for DOM in <code><a>rdf:XMLLiteral</a></code> from [DOM3CORE] to [DOM4] as we need DOM4 anyways for <code><a>rdf:HTML</a></code></li>
+    <li>2012-05-17: Added <code><a>rdf:HTML</a></code> datatype (<a href="http://www.w3.org/2011/rdf-wg/track/issues/63">ISSUE-63</a>)</li>
     <li>2012-05-17: Added <a href="http://www.w3.org/TR/xmlschema11-2/#duration"><code>xsd:duration</code></a> to list of <a>RDF-compatible XSD types</a> (<a href="http://www.w3.org/2011/rdf-wg/track/issues/88">ISSUE-88</a>)</li>
     <li>2012-05-14: Replaced the example graph diagram in <a href="#data-model">Section 1.1</a> with a re-drawn SVG version, with support from Dominik Tomaszuk</li>
     <li>2012-05-10: New <a href="#conformance">Conformance section</a> to explain that this specification is not implemented directly, but through other specifications that use our definitions</li>