Handle xsd:string properly when converting from RDF
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 04 Apr 2013 17:21:02 +0200
changeset 1537 394709b48ee2
parent 1536 97d0f3b0a326
child 1538 4159183e173c
Handle xsd:string properly when converting from RDF

This addresses #237.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Thu Apr 04 17:09:53 2013 +0200
+++ b/spec/latest/json-ld-api/index.html	Thu Apr 04 17:21:02 2013 +0200
@@ -3210,7 +3210,7 @@
           <i>value</i> to the value associated with the <code>@value</code>
           member in <i>item</i>.
         <li>Initialize <i>datatype</i> to the value associated with the
-          <code>@type</code> member of <i>item</i> or  <code>null</code> if
+          <code>@type</code> member of <i>item</i> or  <tref>null</tref> if
           <i>item</i> does not have such a member.</li>
         <li>If <i>value</i> is <tref>true</tref> or
           <tref>false</tref>, set <i>value</i> to the <tref>string</tref>
@@ -3242,9 +3242,8 @@
           item has an <code>@language</code> member.</li>
         <li>Initialize <i>literal</i> as an <tref>RDF literal</tref> using
           <i>value</i> and <i>datatype</i>. If <i>item</i> has an
-          <code>@language</code> member and <i>datatype</i> is
-          <code>rdf:langString</code>, then add the value associated with the
-          <code>@language</code> key as the language of <i>literal</i>.</li>
+          <code>@language</code> member, add the value associated with the
+          <code>@language</code> key as the language tag of <i>literal</i>.</li>
         <li>Return <i>literal</i>.</li>
         </li>
       </ol>
@@ -3553,6 +3552,12 @@
               <ol class="algorithm">
                 <li>If the
                   <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri">datatype IRI</tref>
+                  of <i>value</i> equals <code>xsd:string</code>, set
+                  <i>converted value</i> to the
+                  <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form">lexical form</tref>
+                  of <i>value</i>.</li>
+                <li>Otherwise, if the
+                  <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri">datatype IRI</tref>
                   of <i>value</i> equals <code>xsd:boolean</code>, set
                   <i>converted value</i> to <tref>true</tref> if the
                   <tref href="http://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form">lexical form</tref>
@@ -3596,10 +3601,11 @@
     <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 and
+      depending on whether the <tref>number</tref> has fractions or not,
       the boolean values <tref>true</tref> and <tref>false</tref> are
-      coerced to <code>xsd:boolean</code>. The numeric or boolean value
-      itself is converted to <tdef>canonical lexical form</tdef>, i.e., a
+      coerced to <code>xsd:boolean</code>, and <tref title="string">strings</tref>
+      are coerced to <code>xsd:string</code>. The numeric or boolean values
+      itself are converted to <tdef>canonical lexical form</tdef>, i.e., a
       deterministic string representation as defined in
       [[!XMLSCHEMA11-2]].</p>