Clarify when the identifier map and the counter are reset
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sun, 09 Jun 2013 01:19:42 +0200
changeset 1713 c6d2b3792680
parent 1712 99bfc393ecb5
child 1714 ae3b0ff1e844
Clarify when the identifier map and the counter are reset

This reverts commit 0f13c832a0214b0b01b6c803d74b0dadd69519ba.

See https://github.com/json-ld/json-ld.org/commit/177b5041c9fc145d84ddb307b8f11c86c805fca2#commitcomment-3376131

/cc @dlongley @gkellogg
spec/latest/json-ld-api/index.html
test-suite/tests/toRdf-0108-out.nq
--- a/spec/latest/json-ld-api/index.html	Sat Jun 08 23:23:35 2013 +0200
+++ b/spec/latest/json-ld-api/index.html	Sun Jun 09 01:19:42 2013 +0200
@@ -184,6 +184,9 @@
     <li>Ensure determinism of the Convert to RDF Algorithm by specifying the processing order</li>
     <li>Change the default value of the <em>use native types</em> flag in the Convert from RDF Algorithm
       to <code>false</code></li>
+    <li>Clarify that the <i>identifier map</i> and the <i>counter</i> used by the
+      Generate Blank Node Identifier algorithm are reset before running the Flattening
+      and the Convert to RDF algorithms</li>
   </ul>
 </section>
 
@@ -2792,6 +2795,14 @@
         an optional <i>context</i> used to compact the flattened document. If not
         passed, <i>context</i> is set to <tref>null</tref>.</p>
 
+      <p>This algorithm generates new <tref title="blank node identifier">blank node identifiers</tref>
+        and relabels existing <tref title="blank node identifier">blank node identifiers</tref>.
+        The used <a href="#generate-blank-node-identifier">Generate Blank Node Identifier algorithm</a>
+        keeps an <i>identifier map</i> and a <i>counter</i> to ensure consistent
+        relabeling and avoid collisions. Thus, before this algorithm is run,
+        the <i>identifier map</i> is reset and the <i>counter</i> is initialized
+        to <code>0</code>.</p>
+
       <ol class="algorithm">
         <li>Initialize <i>node map</i> to a <tref>JSON object</tref> consisting of
           a single member whose key is <code>@default</code> and whose value is
@@ -3165,6 +3176,14 @@
       <p>The algorithm takes a JSON-LD document <i>element</i> and returns an
         <tref>RDF dataset</tref>.</p>
 
+      <p>This algorithm generates new <tref title="blank node identifier">blank node identifiers</tref>
+        and relabels existing <tref title="blank node identifier">blank node identifiers</tref>.
+        The used <a href="#generate-blank-node-identifier">Generate Blank Node Identifier algorithm</a>
+        keeps an <i>identifier map</i> and a <i>counter</i> to ensure consistent
+        relabeling and avoid collisions. Thus, before this algorithm is run,
+        the <i>identifier map</i> is reset and the <i>counter</i> is initialized
+        to <code>0</code>.</p>
+
       <ol class="algorithm">
         <li>Expand <i>element</i> according to the
           <a href="#expansion-algorithm">Expansion algorithm</a>.</li>
--- a/test-suite/tests/toRdf-0108-out.nq	Sat Jun 08 23:23:35 2013 +0200
+++ b/test-suite/tests/toRdf-0108-out.nq	Sun Jun 09 01:19:42 2013 +0200
@@ -1,2 +1,2 @@
-_:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> _:b1 .
-_:b0 _:b2 "all these IRIs remain unchanged because they are interpreted as blank node identifiers" .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> _:b0 .
+_:b1 _:b2 "all these IRIs remain unchanged because they are interpreted as blank node identifiers" .