Ensure that the result of flattening is deterministic
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 21 Dec 2012 19:12:34 +0100
changeset 1081 1397358d2186
parent 1080 43297f8955e3
child 1082 c027cd997488
Ensure that the result of flattening is deterministic
spec/latest/json-ld-api/index.html
--- a/spec/latest/json-ld-api/index.html	Fri Dec 21 19:09:09 2012 +0100
+++ b/spec/latest/json-ld-api/index.html	Fri Dec 21 19:12:34 2012 +0100
@@ -1726,13 +1726,13 @@
         <li>Add a <code>@graph</code> member set to an empty <tref>array</tref>
           (referred to as <em>nodes</em>) to the <tref>JSON object</tref> which is the
           value of the <em>graphName</em> member of <em>nodeMap</em>.</li>
-        <li>For each <em>id</em>-<em>node</em> pair in <em>graph</em>, add <em>node</em>
-          to the <em>nodes</em> <tref>array</tref>.</li>
+        <li>For each <em>id</em>-<em>node</em> pair in <em>graph</em> ordered by <em>id</em>,
+          add <em>node</em> to the <em>nodes</em> <tref>array</tref>.</li>
       </ol>
     </li>
     <li>Initialize an empty <tref>array</tref> flattened.</li>
-    <li>For each <em>id</em>-<em>node</em> pair in <em>defaultGraph</em>, add <em>node</em>
-      to <em>flattened</em>.</li>
+    <li>For each <em>id</em>-<em>node</em> pair in <em>defaultGraph</em> ordered by <em>id</em>,
+      add <em>node</em> to <em>flattened</em>.</li>
     <li>If <em>context</em> equals <tref>null</tref>, return <em>flattened</em>.</li>
     <li>Otherwise, return the result of compacting <em>flattened</em> according the
       <a href="#compaction-algorithm">Compaction algorithm</a> passing <em>context</em>