type constraints instead of type inference
authorLuc Moreau <l.moreau@ecs.soton.ac.uk>
Mon, 23 Jul 2012 12:55:14 +0100
changeset 4220 34993bea2bef
parent 4219 8729d8cd4157
child 4221 38f8310d8f28
type constraints instead of type inference
model/prov-constraints.html
--- a/model/prov-constraints.html	Mon Jul 23 10:42:03 2012 +0100
+++ b/model/prov-constraints.html	Mon Jul 23 12:55:14 2012 +0100
@@ -678,7 +678,7 @@
 	<td><a class="rule-text" href="#generation-use-communication-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#derivation-use"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-generation"><span>TBD</span></a><br>
 		<a class="rule-text" href="#generation-within-activity"><span>TBD</span></a><br>
@@ -699,7 +699,7 @@
 	<td class="essential"><a>Usage</a></td>
 	<td><a class="rule-text" href="#generation-use-communication-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#usage-within-activity"><span>TBD</span></a><br>
 		<a class="rule-text" href="#generation-precedes-usage"><span>TBD</span></a><br>
@@ -712,7 +712,7 @@
 	<td class="essential"><a>Communication</a></td>
 	<td><a class="rule-text" href="#communication-generation-use-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#wasInformedBy-ordering"><span>TBD</span></a><br>
 		<a class="rule-text" href="#impossible-property-overlap"><span>TBD</span></a><br>
@@ -722,7 +722,7 @@
 	<td class="essential"><a>Start</a></td>
 	<td><a class="rule-text" href="#wasStartedBy-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-wasStartedBy"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-startTime"><span>TBD</span></a><br>
@@ -739,7 +739,7 @@
 	<td class="essential"><a>End</a></td>
 	<td><a class="rule-text" href="#wasEndedBy-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-wasEndedBy"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-endTime"><span>TBD</span></a><br>
@@ -755,7 +755,7 @@
 <tr class="component1-color">
 	<td class="essential"><a>Invalidation</a></td>
 	<td><a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#unique-invalidation"><span>TBD</span></a><br>
 		<a class="rule-text" href="#generation-precedes-invalidation"><span>TBD</span></a><br>
@@ -778,7 +778,7 @@
 		<a class="rule-text" href="#derivation-use"><span>TBD</span></a><br>
 		<a class="rule-text" href="#specific-derivation-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#derivation-usage-generation-ordering"><span>TBD</span></a><br>
 		<a class="rule-text" href="#derivation-generation-generation-ordering"><span>TBD</span></a><br>
@@ -814,7 +814,7 @@
 	<td class="essential"><a>Attribution</a></td>
 	<td><a class="rule-text" href="#attribution-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#wasAttributedTo-ordering"><span>TBD</span></a><br>
 		<a class="rule-text" href="#impossible-property-overlap"><span>TBD</span></a><br>
@@ -823,7 +823,7 @@
 <tr class="component3-color">
 	<td class="essential"><a>Association</a></td>
 	<td><a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#wasAssociatedWith-ordering"><span>TBD</span></a><br>
 		<a class="rule-text" href="#impossible-property-overlap"><span>TBD</span></a><br>
@@ -833,7 +833,7 @@
 	<td class="essential"><a>Delegation</a></td>
 	<td><a class="rule-text" href="#delegation-inference"><span>TBD</span></a><br>
 		<a class="rule-text" href="#influence-inference"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#key-properties"><span>TBD</span></a><br>
 		<a class="rule-text" href="#actedOnBehalfOf-ordering"><span>TBD</span></a><br>
 		<a class="rule-text" href="#impossible-property-overlap"><span>TBD</span></a><br>
@@ -864,7 +864,7 @@
 	<td><a class="rule-text" href="#alternate-reflexive"><span>TBD</span></a><br>
 		<a class="rule-text" href="#alternate-transitive"><span>TBD</span></a><br>
 		<a class="rule-text" href="#alternate-symmetric"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 	</td>
 	<td  rowspan="3"><a href="http://www.w3.org/TR/prov-dm/#component5">Component 5: Alternate Entities</a></td>
 </tr>
@@ -873,7 +873,7 @@
 	<td><a class="rule-text" href="#specialization-transitive"><span>TBD</span></a><br>
 		<a class="rule-text" href="#specialization-alternate"><span>TBD</span></a><br>
 		<a class="rule-text" href="#specialization-attributes"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#specialization-generation"><span>TBD</span></a><br>
 		<a class="rule-text" href="#specialization-invalidation"><span>TBD</span></a><br>
 		<a class="rule-text" href="#impossible-specialization-reflexive"><span>TBD</span></a><br>
@@ -882,7 +882,7 @@
 <tr class="component5-color">
 	<td><a>Mention</a></td>
 	<td><a class="rule-text" href="#mention-specialization"><span>TBD</span></a><br>
-		<a class="rule-text" href="#type-inference"><span>TBD</span></a><br>
+		<a class="rule-text" href="#typing"><span>TBD</span></a><br>
 		<a class="rule-text" href="#mention-unique"><span>TBD</span></a><br>
 	</td>
 </tr>
@@ -895,7 +895,7 @@
 </tr>
 <tr class="component6-color">
 	<td><a>Membership</a></td>
-	<td><a class="rule-text" href="#type-inference"><span>TBD</span></a><br></td>
+	<td><a class="rule-text" href="#typing"><span>TBD</span></a><br></td>
 </tr>
 </table>
 </div>
@@ -1790,150 +1790,6 @@
 </section>
 
 
-<section id="type-rules">
-<h2>Type inference rules</h2>
-
-<p>The following rule  establishes the existence of entities, activities, and agents from their use within expressions. </p>
-
-<div class='inference' id="type-inference">
-
-
-<ul>
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>wasGeneratedBy(gen;e,a,t,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that  <span class="name">entity(e,[])</span> AND 
- <span class="name">activity(a, _t1, _t2,[])</span>.
-
-
-<li>
-
-<span class='conditional'>IF</span> 
-   <span class='name'>used(u;a,e,t,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that  <span class="name">entity(e,[])</span> AND 
- <span class="name">activity(a, _t1, _t2,[])</span>.
-
-
-<li>
-
-<span class='conditional'>IF</span> 
-   <span class='name'>wasInformedBy(id;a2,a1,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span>,  <span class="name">_t3</span>, <span class="name">_t4</span> such that
- <span class="name">activity(a1, _t1,_t2,[])</span> AND
- <span class="name">activity(a2, _t3,_t4,[])</span>.
-
-<li>
-
-<span class='conditional'>IF</span> 
-   <span class='name'>wasStartedBy(id;a2,e,a1,t,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span>,  <span class="name">_t3</span>, <span class="name">_t4</span> such that
- <span class="name">activity(a1, _t1,_t2,[])</span> AND
- <span class="name">activity(a2, _t3,_t4,[])</span> AND
-<span class="name">entity(e,[])</span>.
-
-
-<li>
-
-
-<span class='conditional'>IF</span> 
-   <span class='name'>wasEndedBy(id;a2,e,a1,t,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span>,  <span class="name">_t3</span>, <span class="name">_t4</span> such that
- <span class="name">activity(a1, _t1,_t2,[])</span> AND
- <span class="name">activity(a2, _t3,_t4,[])</span> AND
-<span class="name">entity(e,[])</span>.
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>wasInvalidatedBy(id;e,a,t,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that
- <span class="name">activity(a1, _t1,_t2,[])</span> AND
-<span class="name">entity(e,[])</span>.
-
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>wasDerivedFrom(id; e2, e1, a, g2, u1, attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that
-<span class="name">entity(e1,[])</span> AND 
-<span class="name">entity(e2,[])</span> AND
- <span class="name">activity(a, _t1,_t2,[])</span>.
-
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>wasAttributedTo(id;e,ag,attr)</span>  
-<span class='conditional'>THEN</span> 
-<span class="name">entity(e,[])</span> AND
-<span class="name">agent(ag,[])</span>.
-
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>wasAssociatedWith(id;a,ag,pl,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that
- <span class="name">activity(a, _t1,_t2,[])</span> AND 
-<span class="name">agent(ag,[])</span> AND
-<span class="name">entity(pl,[prov:type='prov:Plan'])</span>.
-
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>actedOnBehalfOf(id;ag2,ag1,a,attrs)</span>  
-<span class='conditional'>THEN</span> 
-there exist <span class="name">_t1</span>, <span class="name">_t2</span> such that
- <span class="name">activity(a, _t1,_t2,[])</span> AND 
-<span class="name">agent(ag1,[])</span> AND
-<span class="name">agent(ag2,[])</span>.
-
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>alternateOf(alt1, alt2)</span>  
-<span class='conditional'>THEN</span> 
-<span class="name">entity(alt1,[])</span> AND
-<span class="name">entity(alt2,[])</span>.
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>specializationOf(e2, e1)</span>  
-<span class='conditional'>THEN</span> 
-<span class="name">entity(e2,[])</span> AND
-<span class="name">entity(e1,[])</span>.
-
-
-<li>
-<span class='conditional'>IF</span> 
-   <span class='name'>mentionOf(e2,e1,b)</span>  
-<span class='conditional'>THEN</span> 
-<span class="name">entity(e2,[])</span> AND 
-<span class="name">entity(e1,[])</span> AND
-<span class="name">entity(b,[prov:type='prov:bundle'])</span>.
-
-<li>
-
-<span class='conditional'>IF</span> 
-   <span class='name'>hadMember(c,e)</span>  
-<span class='conditional'>THEN</span> 
-<span class="name">entity(c,[prov:type="prov:Collection"])</span> AND
-<span class="name">entity(e,[])</span>.
-</ul>
-</div>
-
-</section>
 
 
 
@@ -3052,8 +2908,182 @@
   </div>
 
   
+
+</section> <!--impossibility-constraints -->
+
+<section id="type-constraints">
+<h2>Type Constraints</h2>
+
+<p id="typing_text">The following rule  establishes types denoted by identifiers from their use within expressions. 
+The following types are recognized: 'entity', 'activity', 'agent', 'prov:Collection', 'prov:EmptyCollection'.</p>
+
+<div class='constraint' id="typing">
+
+
+<ul>
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>wasGeneratedBy(gen;e,a,t,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e)</span> AND
+<span class="name">'activity' &isin; typeOf(a)</span>.
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>entity(e,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e)</span>.
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>agent(ag,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'agent' &isin; typeOf(ag)</span>.
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>activity(a,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a)</span>.
+
+
+<li>
+
+<span class='conditional'>IF</span> 
+   <span class='name'>used(u;a,e,t,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a)</span> AND
+<span class="name">'entity' &isin; typeOf(e)</span>.
+
+
+<li>
+
+<span class='conditional'>IF</span> 
+   <span class='name'>wasInformedBy(id;a2,a1,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a2)</span> AND
+<span class="name">'activity' &isin; typeOf(a1)</span>.
+
+<li>
+
+<span class='conditional'>IF</span> 
+   <span class='name'>wasStartedBy(id;a2,e,a1,t,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a2)</span> AND
+<span class="name">'entity' &isin; typeOf(e)</span> AND
+<span class="name">'activity' &isin; typeOf(a1)</span>.
+
+
+
+<li>
+
+
+<span class='conditional'>IF</span> 
+   <span class='name'>wasEndedBy(id;a2,e,a1,t,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a2)</span> AND
+<span class="name">'entity' &isin; typeOf(e)</span> AND
+<span class="name">'activity' &isin; typeOf(a1)</span>.
+
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>wasInvalidatedBy(id;e,a,t,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e)</span> AND
+<span class="name">'activity' &isin; typeOf(a)</span>.
+
+
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>wasDerivedFrom(id; e2, e1, a, g2, u1, attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e2)</span> AND
+<span class="name">'entity' &isin; typeOf(e1)</span> AND
+<span class="name">'activity' &isin; typeOf(a)</span>.
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>wasAttributedTo(id;e,ag,attr)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e)</span> AND
+<span class="name">'agent' &isin; typeOf(ag)</span>.
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>wasAssociatedWith(id;a,ag,pl,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'activity' &isin; typeOf(a)</span> AND
+<span class="name">'agent' &isin; typeOf(ag)</span> AND
+<span class="name">'entity' &isin; typeOf(pl)</span>.
+
+
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>actedOnBehalfOf(id;ag2,ag1,a,attrs)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'agent' &isin; typeOf(ag2)</span> AND
+<span class="name">'agent' &isin; typeOf(ag1)</span> AND
+<span class="name">'activity' &isin; typeOf(a)</span>.
+
+
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>alternateOf(e2, e1)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e2)</span> AND
+<span class="name">'entity' &isin; typeOf(e1)</span>.
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>specializationOf(e2, e1)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e2)</span> AND
+<span class="name">'entity' &isin; typeOf(e1)</span>.
+
+
+<li>
+<span class='conditional'>IF</span> 
+   <span class='name'>mentionOf(e2,e1,b)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(e2)</span> AND
+<span class="name">'entity' &isin; typeOf(e1)</span> AND
+<span class="name">'entity' &isin; typeOf(b)</span>.
+
+
+<li>
+
+<span class='conditional'>IF</span> 
+   <span class='name'>hadMember(c,e)</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'prov:Collection' &isin; typeOf(c)</span> AND
+<span class="name">'entity' &isin; typeOf(c)</span> AND
+<span class="name">'entity' &isin; typeOf(e)</span>.
+
+
+<li>
+
+<span class='conditional'>IF</span> 
+   <span class='name'>entity(c,[prov:type='prov:EmptyCollection'])</span>  
+<span class='conditional'>THEN</span> 
+<span class="name">'entity' &isin; typeOf(c)</span>  AND
+<span class="name">'prov:EmptyCollection' &isin; typeOf(c)</span>.
+
+</ul>
+</div>
+
+
    <hr />
-   <p id='entity-activity-disjoint_text'> Furthermore,  the set of entities and activities are disjoint, expressed by 
+   <p id='entity-activity-disjoint_text'>   The set of entities and activities are disjoint, expressed by 
   the following constraint:
   </p>
   <div class='constraint' id='entity-activity-disjoint'>
@@ -3061,26 +3091,33 @@
 <span  class="name">activity(id,_t1,_t2,_attrs2)</span>.
 </p>-->
     
-<p> <span class="conditional">IF</span> <span  class="name">entity(id,_attrs1)</span> and <span
-   class="name">activity(id,_t1,_t2,_attrs2)</span> <span class="conditional">THEN</span> <span class="conditional">INVALID</span>.</p>
-  </div>
+<p>
+ <span class="conditional">IF</span>
+<span class="name">'entity' &isin; typeOf(id)</span>  AND
+<span class="name">'activity' &isin; typeOf(id)</span>
+<span class="conditional">THEN</span> <span class="conditional">INVALID</span>.</p>
+ </div>
 	<div class="remark">
 	Note that there is no disjointness between entities and agents. This is because one might want to make statements about the provenance of an agent, by making it an entity. 
-	Therefore, users MAY assert both <span class="name">entity(a1)</span> and <span class="name">agent(a1)</span> in a valid PROV instance. However, it is RECOMMENDED that users refrain from using the same identifier for an entity and an agent unless they refer to the same thing.
+	Therefore, users MAY assert both <span class="name">entity(a1)</span> and <span class="name">agent(a1)</span> in a valid PROV instance. 
+<!-- However, it is RECOMMENDED that users refrain from using the same identifier for an entity and an agent unless they refer to the same thing. -->
   </div>
 
 
    <hr />
-   <p id='membership-empty-collection_text'> An empty colleciton cannot contain any member, expressed by
+   <p id='membership-empty-collection_text'> An empty collection cannot contain any member, expressed by
   the following constraint:
   </p>
   <div class='constraint' id='membership-empty-collection'>
-<p> <span class="conditional">IF</span> <span  class="name">entity(c,[prov:type='prov:EmptyCollection'])</span> and <span  class="name">entity(e,_attrs)</span>  and <span
-   class="name">hasMember(c,e)</span> <span class="conditional">THEN</span> <span class="conditional">INVALID</span>.</p>
+<p> <span class="conditional">IF</span> 
+ <span class="name">hasMember(c,e)</span> and
+<span class="name">'prov:EmptyCollection' &isin; typeOf(c)</span>
+<span class="conditional">THEN</span> <span class="conditional">INVALID</span>.</p>
   </div>
 
 
-</section> <!--impossibility-constraints -->
+</section>
+
 
 </section> <!-- constraints -->