collections
authorStian Soiland-Reyes <soiland-reyes@cs.manchester.ac.uk>
Wed, 26 Oct 2011 11:37:40 +0100
changeset 778 f7da058677da
parent 777 a98c47598695
child 779 ecda03959b53
collections
ontology/ProvenanceFormalModel.html
--- a/ontology/ProvenanceFormalModel.html	Mon Oct 24 14:42:03 2011 +0100
+++ b/ontology/ProvenanceFormalModel.html	Wed Oct 26 11:37:40 2011 +0100
@@ -930,6 +930,118 @@
 		  <a href="https://dvcs.w3.org/hg/prov/raw-file/34a479f3f5d0/ontology/diagram-history/2011-10-03-tlebo/ProvenanceOntology.owl.pdf"><img src="https://dvcs.w3.org/hg/prov/raw-file/34a479f3f5d0/ontology/diagram-history/2011-10-03-tlebo/ProvenanceOntology.owl.png" alt="Object properties among all classes in the PROV ontology"/></a>
 -->
       </section>
+      <section id="extensions">
+        <h3>PROV-DM extensions</h3>
+        <p>
+        The properties and classes defined in this section correspond to
+        the <a
+        href="http://www.w3.org/TR/prov-dm/#prov-dm-extensions">extensions</a>
+        of [[PROV-DM]]. They are defined as subclasses and subproperties
+        of existing PROV-O term and can be used as shortcuts for
+        the expanded PROV-O assertions.
+        </p>
+        <section id="collections">
+            <h4>Collections</h4>
+            <p>A <code>Collection</code> is a type of
+            <code>Entity</code> which have been composed of other
+            entities. A PROV-O <code>Collection</code> can represent 
+            any typical collection, such as a ordered list, associative
+            list/dictionary/hashe/map. It is out of scope for PROV to
+            further define the exact nature of the collection, but
+            PROV-O defines shortcuts for defining that a entity have
+            been added or removed to a collection. These operations are
+            modelled as subproperties of <code>wasDerivedFrom</code>.
+            </p>
+            <section id="collection-adding">
+            <h5>Expansion - adding to a collection</h5>
+            <p>
+            An <code>Entity</code> can be added to a
+            <code>Collection</code>, producing a new (derived)
+            <code>Collection</code> which contains the new item. 
+            The item can be added at a <em>key</em> (represented as an
+            <code>Entity</code>), which can be 
+            a <em>position</em> (for ordered lists), <em>hash key</em>
+            for a dictionary, or for sets the key is the value itself.
+            In PROV-O the addition are specified using the functional
+            properties <code>wasExpandedFrom</code>,
+            </code>wasExpandedBy</code> and <code>wasExpandedAt</code>.
+            These correspond to [[PROV-DM]] <a
+            href="http://www.w3.org/TR/prov-dm/#expression-Collection">collection
+            assertions</a> 
+            <code>wasAddedTo_Coll</code>, <code>wasAddedTo_Entity</code>
+            and <code>wasAddedTo_Key</code>. The properties are
+            functional so that only one expansion is asserted at a time,
+            relating the three properties without requiring an
+            explicit "Expansion" class, and also asserting that no other
+            entities have been added or removed between the two
+            collections related using <code>prov:wasExpandedBy</code>.
+            </p>
+            <div class="issue">[[PROV-DM]] does not make the guarantee
+            that other entities have not been added. Is it fair to make
+            such an assumption? 
+            </div>
+              <div class="exampleOuter">
+                <pre class="example">
+                    :col1 a prov:Collection ;
+                        prov:wasExpandedBy :e1 ;
+                        prov:wasExpandedFrom :col0 ;
+                        prov:wasExpandedAt :key1 .
+                    
+                    :col2 a prov:Collection ;
+                        prov:wasExpandedBy :e2 ;
+                        prov:wasExpandedFrom :col1 ;
+                        prov:wasExpandedAt :key2 .    
+                </pre>
+            </div>
+            <div class="issue">TODO: Write example above as RDF/XML</div>
+            <p>
+            The above example describes collections <code>:col0</code>,
+            <code>:col1</code> and <code>:col2</code>. We know that
+            <code>:col2:</code> has the entries:
+            <code>(:key2, :e2)</code> and <code>(:key1, :e2)</code>.  As
+            we don't have the provenance of :col0 we don't know of any
+            other entities which might or might not be contained in it.
+            </p>
+            <div class="issue">Does prov:Collection allow replacement?
+            If we do a second expansion using the :key1,
+            will :col0 still be in the collection? We
+            recommend that for <em>map</em> functionality replacement
+            should always be represented by first a removal
+            (wasReducedBy) followed by insertion (wasExpandedBy). 
+            </div>
+            </section>
+            <section id="collection-removal">
+            <h5>Reduction - removing from a collection</h5>
+            <p>
+            Removing from a collection is modelled in a similar way to
+            expansion, by deriving a new <em>reduced</em> collection
+            which does not have the removed item or key. This is done
+            using the properties <code>prov:wasReducedFrom</code>,
+            <code>prov:wasReducedBy</code> and
+            <code>prov:wasReducedAt</code>.
+            </p>
+              <div class="exampleOuter">
+                <pre class="example">
+                    :col3 a prov:Collection ;
+                        prov:wasReducedFrom :col2 ;
+                        prov:wasReducedAt :key1 .
+                    
+                    :col4 a prov:Collection ;
+                        prov:wasReducedBy :e2 ;
+                        prov:wasReducedFrom :col3 ;
+                        prov:wasReducedAt :key2 .    
+                </pre>
+            </div>
+            <p>
+            Asserting <code>prov:wasReducedBy</code> is optional, as
+            <code>prov:wasReducedAt</code> will remove any value at that
+            key.
+            </p>
+            <div class="issue">
+            </div>
+            </section>
+        </section>
+      </section>
 	  <section id="data-model-properties-not-addressed-in-prov-ontology"> 
 	  	<h3>Data model properties not yet addressed in PROV-O</h3>
         <p>The following data model properties have not yet been discussed and included in the ontology: </p>