Introduce useNativeTypes flag
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 14 Aug 2012 19:04:40 +0200
changeset 807 57d2b01ec070
parent 806 1e75ba730109
child 808 f35d32e78b5d
Introduce useNativeTypes flag

The fromRDF algorithm hasn't been updated yet. I just added an issue marker for the time being.

This addresses #150.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Tue Aug 14 18:50:49 2012 +0200
+++ b/spec/latest/json-ld-api/index.html	Tue Aug 14 19:04:40 2012 +0200
@@ -960,6 +960,15 @@
         <code>@type</code> when converting <a>fromRDF</a>.<br>
         The default value is <code>false</code>.
       </dd>
+      <dt>boolean useNativeTypes = true</dt>
+      <dd>If set to <code>true</code>, the JSON-LD processor will try to convert
+        datatyped literals to JSON native types instead of using the
+        expanded object form when converting <a>fromRDF</a>. <code>xsd:boolean</code>
+        values will be converted to <tref>true</tref>/<tref>false</tref>,
+        <code>xsd:integer</code> and <code>xsd:double</code> values to
+        <tref title="number">JSON numbers</tref>.<br>
+        The default value is <code>true</code>.
+      </dd>
     </dl>
     </section>
 
@@ -2090,8 +2099,13 @@
   <p>When expanding <tref>typed literal</tref> values having a datatype of <code>xsd:string</code>,
     the <code>@type</code> MUST NOT be set to <code>xsd:string</code> and the resulting value
     MUST have only a <code>@value</code> property.</p>
+
+  <p class="issue" data-number="150">The <code class="idlMemberName"><a href="#widl-JsonLdOptions-useNativeTypes">useNativeTypes</a></code>
+    flag is not yet supported by this algorithm.</p>
+
   <p>The conversion algorithm takes a single parameter <em>input</em> in the form of an
     array of <a>Quad</a> representations.</p>
+
   <ol class="algorithm">
     <li id="new_graph">Construct <em>defaultGraph</em> as a <tref>JSON object</tref>
       containing <em>subjects</em> and <em>listMap</em>, each an empty <tref>JSON object</tref>.</li>