Make it clearer how compaction can be prevented when flattening
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 21 Dec 2012 15:29:59 +0100
changeset 1078 04e261c13940
parent 1077 1c3fdf956d5b
child 1079 af99e1f3fa85
Make it clearer how compaction can be prevented when flattening

This addresses #109.
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Thu Dec 20 21:47:38 2012 +0100
+++ b/spec/latest/json-ld-api/index.html	Fri Dec 21 15:29:59 2012 +0100
@@ -409,7 +409,8 @@
   </pre>
 
   <p>Running the <a href="#flattening-algorithm">Flattening Algorithm</a>
-    with an empty context returns the following document:</p>
+    with a context set to <tref>null</tref> to prevent compaction returns
+    the following document:</p>
 
   <pre class="example" data-transform="updateExample">
   <!--
@@ -483,6 +484,11 @@
   }
   -->
   </pre>
+
+  <p>Please note that the flattened and compacted result will always explicitly
+    designate the default by the <code>@graph</code> member in the top-level
+    <tref>JSON object</tref>. <a href="#compaction">Compaction</a> optimizes that
+    member away if its value contains just one item.</p>
 </section>
 
 <section class="informative">
@@ -2251,11 +2257,11 @@
           <dt>(object or object[] or DOMString) input</dt>
            <dd>The JSON-LD object or array of JSON-LD objects or an <tref>IRI</tref>
             referencing the JSON-LD document to flatten.</dd>
-          <dt>(object or DOMString) context</dt>
+          <dt>(object or DOMString)? context</dt>
           <dd>The context to use when compacting the flattened <code>input</code>; either
-            in the form of an <tref>JSON object</tref> or as <tref>IRI</tref>. To keep
-            the result in expanded form, an empty <tref>JSON object</tref> can
-            be passed.</dd>
+            in the form of an <tref>JSON object</tref> or as <tref>IRI</tref>. If
+            <tref>null</tref> is passed, the result will not be compacted but keept
+            in expanded form.</dd>
           <dt>JsonLdCallback callback</dt>
           <dd>A callback that is called when processing is complete on the given
             <code>input</code>.</dd>