collections
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Wed, 28 Mar 2012 14:47:36 +0100
changeset 2052 da6e42e07436
parent 2050 70412d398aa9
child 2053 e5e547053bcd
collections
model/prov-dm.html
--- a/model/prov-dm.html	Wed Mar 28 14:22:51 2012 +0100
+++ b/model/prov-dm.html	Wed Mar 28 14:47:36 2012 +0100
@@ -1957,7 +1957,7 @@
 
 <p>Conceptually, a collection has a logical structure consisting of key-entity pairs. This structure is often referred to as a <em>map</em>, and is a generic indexing mechanisms that can abstract commonly used data structures, including associative lists (also known as "dictionaries" in some programming languages), relational tables, ordered lists, and more (the specification of such specialized structures in terms of key-value pairs is out of the scope of this document).</p>
 
-<p>A given collection forms a given structure for its  parts.  A different structure (obtained either by insertion or removal parts) constitutes a different collection. Hence,
+<p>A given collection forms a given structure for its  parts.  A different structure (obtained either by insertion or removal of parts) constitutes a different collection. Hence,
  for the purpose of provenance, a collection entity is viewed as a snapshot of a structure. Insertion and removal operations result in new snapshots, each snapshot forming an identifiable collection entity.</p>
 
 
@@ -1996,56 +1996,70 @@
 
 
 
+
+
 <p><div class="attributes" id="attributes-derivedByInsertionFrom">
-A <dfn title="derivedByInsertionFrom">Derivation-by-Insertion</dfn> relation <span class="name">derivedByInsertionFrom(id, c2, c1,  {(key_1, e_1), ..., (key_n, e_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, e_1)</span>, ..., <span class="name">(key_n, e_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, c2, c1, key-value-set, attrs)</span>,</span> contains:</p>
+A <dfn title="derivedByInsertionFrom">Derivation-by-Insertion</dfn> relation<span class="withPn">, written <span class="pnExpression"> derivedByInsertionFrom(id, c2, c1, {(key_1, e_1), ..., (key_n, e_n)}, 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 (<span class="name">c2</span>) for the collection <em>after</em> insertion; </li>
 <li><span class='attribute'>before</span>: an identifier (<span class="name">c1</span>) for the collection <em>before</em> insertion;</li>
-<li><span class='attribute'>key-value-set</span>: the inserted key-value pairs, of the form {(key_1, e_1), ..., (key_n, e_n)} where each key_i is a value, and e_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>
+<li><span class='attribute'>key-entity-set</span>: the inserted key-entity pairs <span class="name">(key_1, e_1)</span>, ..., <span class="name">(key_n, e_n)</span> in which each <span class="name">key_i</span> is a <a>value</a>, and <span class="name">e_i</span> is an identifier  for the entity that has been inserted with the key;
+ each <span class="name">key_i</span> is expected to be unique for the key-entity-set;
+</li>
+<li><span class='attribute'>attributes</span>: an OPTIONAL set (<span class="name">attrs</span>) of attribute-value pairs to further describe the properties of the relation.</li>
 </ul>
+</div>
+
+<p>
+A Derivation-by-Insertion relation <span class="name">derivedByInsertionFrom(id, c2, c1,  {(key_1, e_1), ..., (key_n, e_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, e_1)</span>, ..., <span class="name">(key_n, e_n)</span> into collection  <span class="name">c1</span>.</p>
+
+
+
+
 
 
 <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"])
+   entity(c, [prov:type="EmptyCollection" %% xsd:QName])    // c is an empty collection
+   entity(e1)
+   entity(e2)
+   entity(e3)
+   entity(c1, [prov:type="Collection" %% xsd:QName])
+   entity(c2, [prov:type="Collection" %% xsd:QName])
   
-  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
-  derivedByInsertionFrom(c2, c1, {("k3", v3)})    
+  derivedByInsertionFrom(c1, c,  {("k1", e1), ("k2", e2)})       
+  derivedByInsertionFrom(c2, c1, {("k3", e3)})    
 </pre>
-  From this set of assertions, we conclude:
-  <pre class="codeexample">
-   c =  {  }
-   c1 = { ("k1",v1),("k2",v2) }
-   c2 =  { ("k1",v1),("k2",v2), ("k3", v3) }
+From this set of descriptions, we conclude:
+<pre class="codeexample">
+   c  = {  }
+   c1 = { ("k1", e1), ("k2", e2) }
+   c2 = { ("k1", e1), ("k2", e2), ("k3", e3) }
   </pre>
 </div>
 
+<p>Insertion provides an "update semantics" for the keys that are already present in the collection. </p>
+
 <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"])
+   entity(c, [prov:type="EmptyCollection" %% xsd:QName])    // c is an empty collection
+   entity(e1)
+   entity(e2)
+   entity(e3)
+   entity(c1, [prov:type="Collection" %% xsd:QName])
+   entity(c2, [prov:type="Collection" %% xsd:QName])
   
-  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
-  derivedByInsertionFrom(c2, c1, {(<strong>"k1"</strong>, v3)})    
+  derivedByInsertionFrom(c1, c,  {("k1", e1), ("k2", e2)})       
+  derivedByInsertionFrom(c2, c1, {("k1", e3)})    
 </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:
+   This is a case of <em>update</em> of <span class="name">e1</span> to <span class="name">e3</span> for the same key, <span class="name">"k1"</span>. <br/>
+  From this set of descriptions, we conclude:
   <pre class="codeexample">
    c =  {  }
-   c1 = { ("k1",v1),("k2",v2) }
-   c2 =  { ("k1",v3),("k2",v2) }
+   c1 = { ("k1", e1), ("k2", e2) }
+   c2 = { ("k1", e3), ("k2", e2) }
   </pre>
 </div>
 
@@ -2073,21 +2087,21 @@
 <div class="anexample">
 <pre class="codeexample">
    entity(c, [prov:type="EmptyCollection"])    // e is an empty collection
-   entity(v1)
-   entity(v2)
+   entity(e1)
+   entity(e2)
    entity(c1, [prov:type="Collection"])
    entity(c2, [prov:type="Collection"])
 
-  derivedByInsertionFrom(c1, c, {("k1", v1), ("k2",v2)})       
-  derivedByInsertionFrom(c2, c1, {("k3", v3)})
+  derivedByInsertionFrom(c1, c, {("k1", e1), ("k2",e2)})       
+  derivedByInsertionFrom(c2, c1, {("k3", e3)})
   derivedByRemovalFrom(c3, c2, {k1,k3})   
 </pre>
   From this set of assertions, we conclude:
   <pre class="codeexample">
    c =  {  }
-   c1 = { ("k1",v1), ("k2", v2)  }
-   c2 = { ("k1",v1), ("k2", v2), ("k3", v3) }
-   c3 = { ("k2",v2) }
+   c1 = { ("k1",e1), ("k2", e2)  }
+   c2 = { ("k1",e1), ("k2", e2), ("k3", e3) }
+   c3 = { ("k2",e2) }
   </pre>
 
   
@@ -2122,26 +2136,26 @@
    activity(a)
    wasGeneratedBy(c,a)   // a produced c
   
-   entity(v1)
-   entity(v2)
-   memberOf(c, {("k1", v1), ("k2", v2)} )  
+   entity(e1)
+   entity(e2)
+   memberOf(c, {("k1", e1), ("k2", e2)} )  
   
-   entity(v3)
+   entity(e3)
    entity(c1, [prov:type="Collection"])
   
-   derivedByInsertionFrom(c1, c, {("k3", v3)})     
+   derivedByInsertionFrom(c1, c, {("k3", e3)})     
 </pre>
   From this set of assertions, we conclude:
   <pre class="codeexample">
-   c  contains   ("k1", v1), ("k2", v2) 
-   c1 contains   ("k1", v1), ("k2", v2), ("k3", v3) 
+   c  contains   ("k1", e1), ("k2", e2) 
+   c1 contains   ("k1", e1), ("k2", e2), ("k3", v3) 
   </pre>
  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)} )  
+   memberOf(c, {("k1", e1), ("k2", v2)} )  
   </pre>
 </div>