update to section 4/5/6
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Wed, 28 Mar 2012 12:46:18 +0100
changeset 2043 7cbd72a346b8
parent 2042 f5a306210ef3 (current diff)
parent 2041 5d7f2b63ce50 (diff)
child 2044 ca08d62d7be6
update to section 4/5/6
model/prov-dm.html
--- a/model/prov-dm.html	Wed Mar 28 12:46:00 2012 +0100
+++ b/model/prov-dm.html	Wed Mar 28 12:46:18 2012 +0100
@@ -1969,7 +1969,7 @@
 
 
 <p>
-<strong>Derivation-by-Insertion</strong> relation <span class="name">derivedByInsertionFrom(c2, c1,  {(key_1, value_1), ..., (key_n, value_n)})</span> states that  <span class="name">c2</span> is the state of the collection
+<strong>Derivation-by-Insertion</strong> relation <span class="name">derivedByInsertionFrom(id, c2, c1,  {(key_1, value_1), ..., (key_n, value_n)})</span> states that  <span class="name">c2</span> is the state of the collection
 following the insertion of pairs <span class="name"> {(key_1, value_1), ..., (key_n, value_n)}</span> into collection  <span class="name">c1</span>, with the provision that each <span class="name">key_i</span> is unique.
 
 <p> A Derivation-by-Insertion relation<span class="withPn">, written <span class="pnExpression"> derivedByInsertionFrom(id, collAfter, collBefore, key-value-set, attrs)</span>,</span> contains:</p>
@@ -2001,6 +2001,26 @@
   </pre>
 </div>
 
+<div class="anexample">
+<pre class="codeexample">
+   entity(c, [prov:type="EmptyCollection"])    // c is an empty collection
+   entity(v1)
+   entity(v2)
+   entity(c1, [prov:type="Collection"])
+   entity(c2, [prov:type="Collection"])
+  
+  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
+  derivedByInsertionFrom(c2, c1, {(<strong>"k1"</strong>, v3)})    
+</pre>
+   This is a case of <strong>update</strong> of v1 to v3 for the same key, "k1". <br/>
+  From this set of assertions, we conclude:
+  <pre class="codeexample">
+   c =  {  }
+   c1 = { ("k1",v1),("k2",v2) }
+   c2 =  { ("k1",v3),("k2",v2) }
+  </pre>
+</div>
+
 </section>  <!-- insertion -->
 
 
@@ -2010,7 +2030,7 @@
 <span class="glossary-ref" data-ref="glossary-removal"></span>
 
 
-<p><strong>Derivation-by-Removal</strong> relation <span class="name">derivedByRemovalFrom(c2,c1, {key_1, ... key_n})</span> states that  <span class="name">c2</span> is  the  state of the collection following the removal of the set of pairs corresponding to keys  <span class="name">key_1...key_n</span> from  <span class="name">c1</span>.
+<p><strong>Derivation-by-Removal</strong> relation <span class="name">derivedByRemovalFrom(id, c2,c1, {key_1, ... key_n})</span> states that  <span class="name">c2</span> is  the  state of the collection following the removal of the set of pairs corresponding to keys  <span class="name">key_1...key_n</span> from  <span class="name">c1</span>.
 
 <p> A Derivation-by-Removal relation, written <span class="pnExpression"> derivedByRemovalFrom(id, collAfter, collBefore, key-set, attrs)</span>, contains:</p>
 <ul>
@@ -2056,7 +2076,7 @@
 
 <p>
 The insertion and removal relations make insertions and removals explicit as part of the history of a collection. This, however, requires explicit mention of the state of the collection prior to each insertion. The membership relation removes this needs, allowing the state of a collection <span class="name">c</span> to be asserted without having to introduce a prior state. This allows for the natural expression of a collection state, for instance in cases where a program or workflow block produces a new collection <span class="name">c</span>  with known content. In such cases, 
-<span class="name">memberOf(c,{(key_1, value_1), ..., (key_n, value_n)})</span> asserts that  <span class="name">c</span> is known to include <span class="name">{(key_1, value_1), ..., (key_n, value_n)}</span>, without having to introduce an initial state. <br/>
+<span class="name">memberOf(id, c,{(key_1, value_1), ..., (key_n, value_n)})</span> asserts that  <span class="name">c</span> is known to include <span class="name">{(key_1, value_1), ..., (key_n, value_n)}</span>, without having to introduce an initial state. <br/>
 
 <p> A <strong>Membership</strong> relation, written <span class="pnExpression"> memberOf(id, coll, key-value-set, attrs)</span>, contains:</p>
 <ul>
@@ -2076,9 +2096,9 @@
   
    entity(v1)
    entity(v2)
-   memberOf(c, {("k1", v1), ("k2", v2)} )  // c is contains ("k1", v1), ("k2", v2)
+   memberOf(c, {("k1", v1), ("k2", v2)} )  
   
-   entity(v2)
+   entity(v3)
    entity(c1, [prov:type="Collection"])
   
    derivedByInsertionFrom(c1, c, {("k3", v3)})     
@@ -2088,9 +2108,13 @@
    c  contains   ("k1", v1), ("k2", v2) 
    c1 contains   ("k1", v1), ("k2", v2), ("k3", v3) 
   </pre>
- Note that the state of <span class="name">c1</span> after these assertions is only partially known, because the initial state of <span class="name">c</span> is unknown. Alternatively, had the first assertion been
-  <span class="name"> entity(c, [prov:type="EmptyCollection"])</span>,
-  one would conclude that, based on these assertions,  <span class="name">c1 = {("k1", v1) ("k2", v2), ("k3",v3)}</span>.
+ Note that the state of <span class="name">c1</span> with these relations is only partially known, because the initial state of <span class="name">c</span> is unknown.
+
+  Note that the following one cannot have at the same time an empty collection and membership relations for it, i.e., the following example is invalid:
+<pre class="codeexample">
+  <span class="name"> entity(c, [prov:type="EmptyCollection"])</span>
+   memberOf(c, {("k1", v1), ("k2", v2)} )  
+  </pre>
 </div>
 
 </section>  <!-- Membership -->