Clean up value expansion algorithm per Markus' feedback.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 11 Feb 2013 15:38:22 -0500
changeset 1220 ec1876bab8f0
parent 1219 1897d8069a40
child 1221 78fecd2d7b33
Clean up value expansion algorithm per Markus' feedback.
spec/latest/json-ld-api/alternate2.html
--- a/spec/latest/json-ld-api/alternate2.html	Mon Feb 11 14:22:42 2013 -0500
+++ b/spec/latest/json-ld-api/alternate2.html	Mon Feb 11 15:38:22 2013 -0500
@@ -2229,9 +2229,6 @@
     <em>documentRelative</em>.
   </li>
   <li>
-    Initialize <em>type</em> to <tref>null</tref>.
-  </li>
-  <li>
     If <tref>active property</tref> has a <tref>type mapping</tref> in
     <tref>active context</tref> that is <code>@id</code> or if
     <em>expanded property</em> equals <code>@graph</code>, then return
@@ -2272,12 +2269,23 @@
     </ol>
   </li>
   <li>
-    Otherwise, if <em>value</em> is a <tref>string</tref> and
-    <tref>active property</tref> has a <tref>language mapping</tref> in
-    <tref>active context</tref> that is not <tref>null</tref>, then
-    add a key-value pair to <em>result</em> where the key is
-    <code>@language</code> and the value is the value associated with
-    the <tref>language mapping</tref>.
+    Otherwise, if <em>value</em> is a <tref>string</tref>:
+    <ol class="algorithm">
+      <li>
+        If <em>value</em> has a <tref>language mapping</tref> in
+        <tref>active context</tref> that is not <tref>null</tref>, then
+        add a key-value pair to <em>result</em> where the key is
+        <code>@language</code> and the value is the value associated with
+        the <tref>language mapping</tref>.
+      </li>
+      <li>
+        Otherwise, if <em>value</em> has no <tref>language mapping</tref> in
+        <tref>active context</tref> and <tref>active context</tref> has a
+        <tref>default language</tref>, then add a key-value pair to
+        <em>result</em> where the key is <code>@language</code> and the value
+        is the <tref>default language</tref>.
+      </li>
+    </ol>
   </li>
   <li>
     Finally, add the key-value pair, (<code>@value</code>-<em>value</em>), to