Fix broken @list RDF expansion algorithm.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Sun, 06 Nov 2011 18:54:07 -0800
changeset 257 740c15e6c7ce
parent 256 5a15a47908ae
child 258 fec17e851267
child 261 574b314a1f2c
Fix broken @list RDF expansion algorithm.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Sun Nov 06 18:53:44 2011 -0800
+++ b/spec/latest/json-ld-api/index.html	Sun Nov 06 18:54:07 2011 -0800
@@ -2701,7 +2701,8 @@
         </li>
         <li>
           If the <tref>JSON object</tref> has a <code>@list</code> key and the value is an <tref>array</tref>
-          process the value as a list starting at <a href="#processing-step-list">Step 4</a>.
+          process the value as a list starting at <a href="#processing-step-list">Step 4</a> as if the
+          <tref>active property</tref> is the target of a <code>@list</code> coercion.
         </li>
         <li id="processing-step-subject">If the <tref>JSON object</tref> has a <code>@subject</code> key:
           <ol class="algorithm">
@@ -2761,39 +2762,48 @@
     </li>
 
     <li>
-      If a regular <tref>array</tref> is detected, process each value in the <tref>array</tref> by doing the following
-      returning the result of processing the last value in the <tref>array</tref>:
-
+      If a regular <tref>array</tref> is detected
       <ol class="algorithm">
-        <li>
-          Create a new <tref>processor state</tref> using copies of the <tref>active
-          context</tref>, <tref>active subject</tref> and <tref>active property</tref> and process the value
-          starting at <a href="#processing-step-associative">Step 2</a> then proceed using the previous
-          <tref>processor state</tref>.
+        <li id="processing-step-list">If the <tref>active property</tref> is the target of an
+          <code>@list</code> coercion Generate an RDF List by linking each element of the list using
+          <code>rdf:first</code> and <code>rdf:next</code>, terminating the list with <code>rdf:nil</code> using the
+          following sequence:
+          <ol class="algorithm">
+            <li>
+              If the list has no element, generate a triple using the <tref>active subject</tref>, <tref>active
+              property</tref> and <code>rdf:nil</code>.
+            </li>
+            <li>
+              Otherwise, generate a triple using using the <tref>active subject</tref>, <tref>active property</tref>
+              and a newly generated BNode identified as <em>first <tref>blank node identifier</tref></em>.
+            </li>
+            <li>
+              For each element other than the last element in the list:
+              <ol class="algorithm">
+                <li>Create a processor state using the active context,
+                  <em>first <tref>blank node identifier</tref></em> as the <tref>active subject</tref>, and
+                  <code>rdf:first</code> as the <tref>active property</tref>.</li>
+                <li>Unless this is the last element in the list, generate a new BNode identified as<
+                  em>rest <tref>blank node identifier</tref></em>, otherwise use <code>rdf:nil</code>.</li>
+                <li>Generate a new triple using <em>first <tref>blank node identifier</tref></em>,
+                  <code>rdf:rest</code> and <em>rest <tref>blank node identifier</tref></em>.</li>
+                <li>Set <em>first <tref>blank node identifier</tref></em> to
+                  <em>rest <tref>blank node identifier</tref></em>.</li>
+              </ol>
+            </li>
+          </ol>
         </li>
-      </ol>
-    </li>
 
-    <li id="processing-step-list">
-      Generate an RDF List by linking
-      each element of the list using <code>rdf:first</code> and <code>rdf:next</code>, terminating the list with <code>rdf:nil</code>
-      using the following sequence:
-      <ol class="algorithm">
-        <li>
-          If the list has no element, generate a triple using the <tref>active subject</tref>, <tref>active property</tref>
-          and <code>rdf:nil</code>.
-        </li>
         <li>
-          Otherwise, generate a triple using using the <tref>active subject</tref>, <tref>active property</tref>
-          and a newly generated BNode identified as <em>first <tref>blank node identifier</tref></em>.
-        </li>
-        <li>
-          For each element other than the last element in the list:
+          Otherwise, process each value in the <tref>array</tref> by doing the following returning the result of
+          processing the last value in the <tref>array</tref>:
           <ol class="algorithm">
-            <li>Create a processor state using the active context, <em>first <tref>blank node identifier</tref></em> as the <tref>active subject</tref>, and <code>rdf:first</code> as the <tref>active property</tref>.</li>
-            <li>Unless this is the last element in the list, generate a new BNode identified as <em>rest <tref>blank node identifier</tref></em>, otherwise use <code>rdf:nil</code>.</li>
-            <li>Generate a new triple using <em>first <tref>blank node identifier</tref></em>, <code>rdf:rest</code> and <em>rest <tref>blank node identifier</tref></em>.</li>
-            <li>Set <em>first <tref>blank node identifier</tref></em> to <em>rest <tref>blank node identifier</tref></em>.</li>
+            <li>
+              Create a new <tref>processor state</tref> using copies of the <tref>active
+              context</tref>, <tref>active subject</tref> and <tref>active property</tref> and process the value
+              starting at <a href="#processing-step-associative">Step 2</a> then proceed using the previous
+              <tref>processor state</tref>.
+            </li>
           </ol>
         </li>
       </ol>