edited collections
authorPaolo Missier <pmissier@acm.org>
Tue, 27 Mar 2012 09:30:07 +0100
changeset 2008 e553777c5663
parent 2007 21b96bf05727
child 2009 83cd9491cc3d
edited collections
model/working-copy/wd5-prov-dm-components.html
--- a/model/working-copy/wd5-prov-dm-components.html	Mon Mar 26 22:36:42 2012 +0100
+++ b/model/working-copy/wd5-prov-dm-components.html	Tue Mar 27 09:30:07 2012 +0100
@@ -1866,13 +1866,20 @@
   <li><span class="name">prov:EmptyCollection</span> denotes an empty collection.
 </ul>
 
+<!--
+In addition, the attribute  <span class="name">prov:content</span> is introduced to allow the explicit specification of the collection's content. The example below illustrates the syntax.
+-->
+
 <div class="anexample">
 <pre class="codeexample">
    entity(c, [prov:type="EmptyCollection"])    // e is an empty collection
    entity(c1, [prov:type="Collection"])   // c1 is a collection, with unknown content
+<!--   entity(c2, [prov:type="Collection", prov:content="{ ("k1", v1), ("k2", v2), ("k3", v3)} ])  -->
 </pre>
 </div>
 
+
+
 </section>  <!-- end of collection-types -->
 
 
@@ -1880,16 +1887,15 @@
 <h3>Insertion</h3>
 
 
-<strong>Derivation-by-Insertion</strong> relation <span class="name">derivedByInsertionFrom(c2, c1, k, v)</span> states that  <span class="name">c2</span> is the state of the collection
-following the insertion of pair <span class="name">(k,v)</span> into collection  <span class="name">c1</span>.
-
-<p> A Derivation-by-Insertion relation<span class="withPn">, written <span class="pnExpression"> derivedByInsertionFrom(id, collAfter, collBefore, key, value, attrs)</span>,</span> contains:</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
+following the insertion of the set of pairs <span class="name"> {(key_1, value_1), ..., (key_n, value_n)}</span> into collection  <span class="name">c1</span>.
+
+<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>
 <ul>
 <li><span class='attribute'>id</span>:  an OPTIONAL identifier identifying the relation;</li>
 <li><span class='attribute'>after</span>: an identifier for the collection <em>after</em> insertion; </li>
 <li><span class='attribute'>before</span>: an identifier for the collection <em>before</em> insertion;</li>
-<li><span class='attribute'>key</span>: the key that has been inserted</li>
-<li><span class='attribute'>value</span>: an identifier  for the value that has been inserted with the key.</li>
+<li><span class='attribute'>key-value-set</span>: a set of inserted key-value pairs, of the form {(key_1, value_1), ..., (key_n, value_n)} where each key_i is a value, and value_i is an identifier  for the value that has been inserted with the key. This may be an entity identifier;</li>
 <li><span class='attribute'>attributes</span>: an OPTIONAL set of attribute-value pairs to further describe the properties of the relation.</li>
 </ul>
 
@@ -1902,14 +1908,14 @@
    entity(c1, [prov:type="Collection"])
    entity(c2, [prov:type="Collection"])
   
-  derivedByInsertionFrom(c1, c, "k1", v1)       
-  derivedByInsertionFrom(c2, c1, "k2", v2)    
+  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
+  derivedByInsertionFrom(c2, c1, {("k3", v3)})    
 </pre>
   From this set of assertions, we conclude:
   <pre class="codeexample">
    c =  {  }
-   c1 = { ("k1",v1) }
-   c2 = { ("k1",v1), ("k2", v2) }
+   c1 = { ("k1",v1),("k2",v2) }
+   c2 =  { ("k1",v1),("k2",v2), ("k3", v3) }
   </pre>
 </div>
 
@@ -1919,14 +1925,14 @@
 <section id="term-collection-removal">
 <h3>Removal</h3>
 
-<strong>Derivation-by-Removal</strong> relation <span class="name">derivedByRemovalFrom(c2,c1, k)</span> states that  <span class="name">c2</span> is  the  state of the collection following the removal of the pair corresponding to key  <span class="name">k</span> from  <span class="name">c1</span>.
-
-<p> A Derivation-by-Removal relation, written <span class="pnExpression"> derivedByRemovalFrom(id, collAfter, collBefore, key, attrs)</span>, contains:</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> A Derivation-by-Removal relation, written <span class="pnExpression"> derivedByRemovalFrom(id, collAfter, collBefore, key-set, attrs)</span>, contains:</p>
 <ul>
 <li><span class='attribute'>id</span>:  an OPTIONAL identifier identifying the relation;</li>
 <li><span class='attribute'>after</span>: an identifier  for the collection  <em>after</em> the deletion; </li>
 <li><span class='attribute'>before</span>: an identifier  for the collection <em>before</em> the deletion;</li>
-<li><span class='attribute'>key</span>: the key corresponding to the (key, value) pair that has been deleted from the collection.</li>
+<li><span class='attribute'>key-set</span>: a set of deleted keys, of the form {key_1,..., key_n};</li>
 <li><span class='attribute'>attributes</span>: an OPTIONAL set of attribute-value pairs to further describe the properties of the relation.</li>
 </ul>
 
@@ -1938,16 +1944,16 @@
    entity(v2)
    entity(c1, [prov:type="Collection"])
    entity(c2, [prov:type="Collection"])
-  
-  derivedByInsertionFrom(c1, c, "k1", v1)       
-  derivedByInsertionFrom(c2, c1, "k2", v2)      
-  derivedByRemovalFrom(c3, c2, k1)              
+
+  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
+  derivedByInsertionFrom(c2, c1, {("k3", v3)})
+  derivedByRemovalFrom(c3, c2, {k1,k3})   
 </pre>
   From this set of assertions, we conclude:
   <pre class="codeexample">
    c =  {  }
-   c1 = { ("k1",v1) }
-   c2 = { ("k1",v1), ("k2", v2) }
+   c1 = { ("k1",v1), ("k2", v2)  }
+   c2 = { ("k1",v1), ("k2", v2), ("k3", v3) }
    c3 = { ("k2",v2) }
   </pre>
 
@@ -1957,16 +1963,11 @@
 </section>  <!-- removal -->
 
 
-
-<section id="collection-convenience-relations">
-<h3>Convenience relations</h3>
-
-The following set of additional relations are introduced to simplify assertions about the state and state changes of collections.
-
+<!--
 <section id="term-collection-bulk">
 <h3>Bulk insertion and removal</h3>
 
-The following relations allow for insertion and removal assertions involving a set of key-value pairs..
+The following relations allow for insertion and removal assertions involving a set of key-value pairs.
 
 <p> A  <strong>Derivation-by-Bulk-Insertion</strong> relation <span class="withPn">, written <span class="pnExpression"> derivedByBulkInsertionFrom(id, collAfter, collBefore, key-value-set, attrs)</span>,</span> contains:</p>
 <ul>
@@ -1986,25 +1987,26 @@
 <li><span class='attribute'>attributes</span>: an OPTIONAL set of attribute-value pairs to further describe the properties of the relation.</li>
 </ul>
 
-
-
 </section> <!-- bulk ops -->
 
+
+
 <section id="term-collection-containment">
-<h3>Containment</h3>
-
-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 containment 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">contained(c,k, v)</span> asserts that  <span class="name">c</span> is known to contain <span class="name">(k,v)</span>, without having to introduce an initial state. <br/>
+<h3>Membership</h3>
+
+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/>
+
+<!--
 This relation is introduced as a convenience, as it can be rewritten as an insertion operation by introducing a prior state:  <br/>
 <span class="name">contained(c,k, v)</span> iff there exists a collection <span class="name">c0</span>  such that <span class="name">derivedByInsertionFrom(c, c0, k, v)</span>.     
-
-
-<p> A <strong>Containment</strong> relation, written <span class="pnExpression"> contained(id, coll, key, values, attrs)</span>, contains:</p>
+-->
+
+<p> A <strong>Membership</strong> relation, written <span class="pnExpression"> memberOf(id, coll, key-value-set, attrs)</span>, contains:</p>
 <ul>
 <li><span class='attribute'>id</span>:  an OPTIONAL identifier identifying the relation;</li>
 <li><span class='attribute'>after</span>: an identifier  for the collection whose members are asserted; </li>
-<li><span class='attribute'>key</span>: the key of the pair contained by the collection;</li>
-<li><span class='attribute'>value</span>: an identifier for the value corresponding to the key;</li>
+<li><span class='attribute'>key-value-set</span>: a set of key-value pairs that are members of the collection, of the form {(key_1, value_1), ..., (key_n, value_n)}</li>
 <li><span class='attribute'>attributes</span>: an OPTIONAL set of attribute-value pairs to further describe the properties of the relation.</li>
 
 </ul>
@@ -2018,13 +2020,12 @@
   
    entity(v1)
    entity(v2)
-   contained(c, "k1", v1)
-   contained(c, "k1", v2)    // c is contains at least ("k1", v1)  and ("k2", v2)
+   memberOf(c, {("k1", v1), ("k2", v2)} )  // c is contains ("k1", v1), ("k2", v2)
   
    entity(v2)
    entity(c1, [prov:type="Collection"])
   
-   derivedByInsertionFrom(c1, c, "k3", v3)     
+   derivedByInsertionFrom(c1, c, {("k3", v3)})     
 </pre>
   From this set of assertions, we conclude:
   <pre class="codeexample">
@@ -2036,6 +2037,7 @@
   one would conclude that, based on these assertions,  <span class="name">c1 = {("k1", v1) ("k2", v2), ("k3",v3)}</span>.
 </div>
 
+<!--
 <p> A <strong>Bulk-Containment</strong> relation, written <span class="pnExpression"> containedBulk(id, coll, key-value-set, attrs)</span>, contains:</p>
 <ul>
 <li><span class='attribute'>id</span>:  an OPTIONAL identifier identifying the relation;</li>
@@ -2064,13 +2066,13 @@
    c3  = { ("k2", v2), ("k4", v4), ("k5", v5)}
   </pre>
 </div>
+-->
+
 
 
 </section>  <!-- Containment -->
 
 
-</section> <!-- convenience relations -->
-
 <section id="term-collection-state">
 
 <h3>State of collections and use of weaker <a href="#Derivation-Relation">derivation</a> relation</h3>