Mention array compaction in algorithms (option "compactArrays").
authorDave Longley <dlongley@digitalbazaar.com>
Tue, 05 Mar 2013 00:36:17 -0500
changeset 1370 2b6e7c6ac1eb
parent 1369 8c81fe1414b8
child 1371 7a6cb1939190
Mention array compaction in algorithms (option "compactArrays").

This addresses #218.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Mon Mar 04 21:32:35 2013 -0500
+++ b/spec/latest/json-ld-api/index.html	Tue Mar 05 00:36:17 2013 -0500
@@ -1972,7 +1972,7 @@
         contained two or more items in an <tref>array</tref>. If no
         <tref>context</tref> was given, the <em>result</em> is only simplified
         from an <tref>array</tref> to a <tref>JSON object</tref> if it has one or
-        fewer items.</p>
+        fewer items and array compaction has been requested.</p>
     </section>
 
     <section>
@@ -2007,7 +2007,8 @@
             <li>If <em>result</em> contains only one item (it has a length of
               <code>1</code>) and <tref>active property</tref> has no
               <tref>container mapping</tref> in <tref>active context</tref>,
-              then set <em>result</em> to its only item.</li>
+              and array compaction has been requested, then set <em>result</em>
+              to its only item.</li>
             <li>Return <em>result</em>.</li>
           </ol>
         </li>
@@ -2215,6 +2216,7 @@
                   Otherwise,
                   <ol class="algorithm">
                     <li>Initialize <em>useArray</em> to <tref>false</tref>. If
+                      array compaction has not been requested, or
                       <em>container</em> is <code>@set</code> or
                       <code>@list</code>, or <em>compacted item</em> is
                       an empty <tref>array</tref>, or
@@ -2251,8 +2253,9 @@
         key-value pair where the key is the result of using the
         <a href="#iri-compaction">IRI Compaction algorithm</a>, passing
         <tref>active context</tref>, <tref>inverse context</tref>, <code>@graph</code>
-        as <em>iri</em>, and <em>result</em> as <em>value</em>. Otherwise, if <em>result</em> is an
-        <tref>array</tref> with only one item, set <em>result</em> to that item.
+        as <em>iri</em>, and <em>result</em> as <em>value</em>. Otherwise, if
+        <em>result</em> is an <tref>array</tref> with only one item and
+        array compaction has been requested, set <em>result</em> to that item.
         Otherwise, if <em>result</em> is an <tref>array</tref> with zero items,
         replace it with an empty <tref>JSON object</tref>. Finally, if a
         <em>context</em> has been passed, add an <code>@context</code> property to