changed dictionary membership to ternary relation [PROV-DICTIONARY]
authorTom De Nies <tom.denies@ugent.be>
Tue, 08 Jan 2013 11:37:30 +0100
changeset 5385 3d1243bf7709
parent 5384 b70b89f44da4
child 5386 476b2640af2e
changed dictionary membership to ternary relation [PROV-DICTIONARY]
dictionary/prov-dictionary.html
--- a/dictionary/prov-dictionary.html	Mon Jan 07 16:26:04 2013 +0000
+++ b/dictionary/prov-dictionary.html	Tue Jan 08 11:37:30 2013 +0100
@@ -776,7 +776,7 @@
 XML schema, allowing provenance descriptions to be expressed,
 represented in various representations, and interchanged between systems across the Web. 
 </p>
-<p>[[PROV-DM]] specifies Collection as an entity that provides a structure to some constituents, which are themselves entities. However, some applications may need a mechanism to specify mor structure to a Collection, in order to accurately describe its provenance.</p>
+<p>[[PROV-DM]] specifies Collection as an entity that provides a structure to some constituents, which are themselves entities. However, some applications may need a mechanism to specify more structure to a Collection, in order to accurately describe its provenance.</p>
 
 <p>Therefore, this document introduces a new concept, <a>Dictionary</a>, that has a logical structure consisting of key-entity pairs. The Provenance Working Group is seeking feedback from the community on its usefulness in practical scenarios.</p>
 </section>
@@ -822,15 +822,18 @@
 
 <span class="glossary-ref" data-ref="glossary-dictionary-membership"></span>
 
-<p>The <strong>dictionary  membership</strong> has the same purpose as the <a href="#term-collection-membership">collection membership</a> relation, but it applies to entities having <span class="name">prov:type = 'prov:Dictionary'</span>. It allows stating the members of a Dictionary.</p>
+<p>The <strong>dictionary  membership</strong> allows stating the members of a Dictionary, and has the purpose of providing more structure than the <a href="http://www.w3.org/TR/2012/CR-prov-dm-20121211/#term-membership">collection membership</a> relation. 
+Whereas the <a href="http://www.w3.org/TR/2012/CR-prov-dm-20121211/#term-membership">collection membership</a> relation applies to entities having <span class="name">prov:type = 'prov:Collection'</span> or <span class="name">prov:type = 'prov:Dictionary'</span>, the <a href="#term-dictionary-membership">dictionary  membership</a> only applies to the latter. 
+	Note that <a href="#term-dictionary-membership">dictionary  membership</a> implies <a href="http://www.w3.org/TR/2012/CR-prov-dm-20121211/#term-membership">collection membership</a>, but not vice versa.</p>
 
 <div class="attributes" id="attributes-hadMember-d">
- A <dfn title="hadMember-d">membership</dfn> relation, written <span class="pnExpression">hadMember(d, (key_1, e_1))</span>, has:
+ A <dfn title="hadMember-d">dictionary membership</dfn> relation, written <span class="pnExpression">hadDictionaryMember(d, e_1, key_1)</span>, has:
 <ul>
 <li><span class='attribute' id="membership-d.dictionary">dictionary</span>: an identifier (<span class="name">d</span>) for the dictionary whose members are asserted; </li>
-<li><span class='attribute' id="membership-d.key-entity-set">key-entity-pair</span>: a key-entity pair <span class="name">(key_1, e_1)</span> that is a member of the dictionary;</li>
+<li><span class='attribute' id="membership-d.entity">entity</span>: an entity <span class="name">e_1</span> that is associated with the key and is a member of the dictionary;</li>
+<li><span class='attribute' id="membership-d.key">key</span>: a key <span class="name">key_1</span> that is associated with the specified entity;</li>
 </ul>
-
+Keys cannot be repeated in the same dictionary. However, a dictionary can contain the same entity more than once, as long as it is associated with different keys.
 </div>
 
 <div class="anexample">
@@ -840,13 +843,13 @@
 entity(e1)
 entity(e2)
 
-hadMember(d, ("k1", e1))  
-hadMember(d, ("k2", e2))  
+hadMember(d, e1, "k1")  
+hadMember(d, e2, "k2")  
 
 </pre>
 From these descriptions, we conclude:
 <ul>
-<li> <span class="name">d</span>  has  the following pairs as members: <span class="name">("k1", e1), ("k2", e2)</span>, and may contain others.</li>
+<li> <span class="name">d</span>  has  the following key-entity pairs as members: <span class="name">("k1", e1), ("k2", e2)</span>, and may contain others.</li>
 </ul>
 <p> Thus, the membership of <span class="name">d</span> is only partially known, unless it was derived through insertions and removals from an empty dictionary (See <a href="#insertion-removal-membership-inference_text">Completeness constraints</a>).</p>
 </div>
@@ -984,11 +987,13 @@
 
 <div class="grammar">
  <span class="nonterminal">membershipExpression</span>&nbsp;::=  
-<span class="name">hadMember</span> 
+<span class="name">hadDictionaryMember</span> 
  <span class="name">(</span>
 <span class="nonterminal">dIdentifier</span>
  <span class="name">,</span>
-  <span class="nonterminal">keyValuePair</span>
+  <span class="nonterminal">entity</span>
+ <span class="name">,</span>
+  <span class="nonterminal">key</span>
   <span class="name">)</span>
   <br>
 </div>
@@ -1002,7 +1007,9 @@
 
 <tr><td><a href="http://www.w3.org/TR/prov-dm/#membership-d.dictionary"><span class='attribute' id="provn-membership-d.dictionary">dictionary</span></a></td><td><code class="content"><a class="grammarRef" href="#prod-dIdentifier">dIdentifier</a></code></td></tr>
 
-<tr><td><a href="http://www.w3.org/TR/prov-dm/#membership-d.key-entity-set"><span class='attribute' id="provn-membership-d.key-entity-set">key-entity-set</span></a></td><td><code class="content"><a class="grammarRef" href="#prod-keyEntitySet">keyEntityPair</a></code></td></tr>
+<tr><td><a href="http://www.w3.org/TR/prov-dm/#membership-d.key-entity-set"><span class='attribute' id="provn-membership-d.entity">entity</span></a></td><td><code class="content"><a class="grammarRef" href="#prod-entity">entity</a></code></td></tr>
+
+<tr><td><a href="http://www.w3.org/TR/prov-dm/#membership-d.key-entity-set"><span class='attribute' id="provn-membership-d.key">key</span></a></td><td><code class="content"><a class="grammarRef" href="#prod-key">key</a></code></td></tr>
 
 </table>
 </div>
@@ -1017,9 +1024,9 @@
 entity(e2)
 
 entity(d, [prov:type='prov:Dictionary'  ])      // d is a dictionary, with unknown content
-hadMember(d, ("k0", e0))
-hadMember(d, ("k1", e1))
-hadMember(d, ("k2", e2))
+hadDictionaryMember(d, e0, "k0")
+hadDictionaryMember(d, e1, "k1")
+hadDictionaryMember(d, e2, "k2")
 </pre>
 </div>
 
@@ -2597,38 +2604,47 @@
 
 <section id="dictionary-constraints"> 
 <h2>Constraints Associated with Dictionary</h2>
-In this section, we specify some inferences and constraints associated with dictionaries. These inferences and constraints need to be applied to obtain valid provenance. 
+In this section, we specify some inferences and constraints associated with dictionaries. These inferences and constraints need to be applied to obtain valid provenance when using dictionaries. 
+Whereas collections were deliberately left unconstrained in [[PROV-DM]] and [[PROV-CONSTRAINTS]] to remain as general as possible, dictionaries are intended to provide more structure, and thus, are constrained more strictly.
 For more information on how to read this section, we refer to [[PROV-CONSTRAINTS]].
+
 <section id="dictionary-constraints-inferences">
 	<h3>Inferences</h3>
+	<p id="dmembership-cmembership-inference_text"><a href="#term-dictionary-membership">Dictionary  membership</a> implies <a href="http://www.w3.org/TR/2012/CR-prov-dm-20121211/#term-membership">collection membership</a>.</p>
+	 <div class='inference' id='membership-membership-inference'>
+<p>
+<span class="conditional">IF</span>  <span class="name">hadDictionaryMember(d, e1, "k1")</span>
+   <span class='conditional'>THEN</span> <span class="name">hadMember(d, e1)</span>
+</p></div>
+
 	<p id="membership-membership-inference_text">Each key maps to a single entity.</p>
 	 <div class='inference' id='membership-membership-inference'>
 <p>
-<span class="conditional">IF</span>  <span class="name">hadMember(d1, ("k1",e1))</span>
-   and <span class="name">hadMember(d1, ("k1",e2))</span> 
+<span class="conditional">IF</span>  <span class="name">hadDictionaryMember(d1, e1, "k1")</span>
+   and <span class="name">hadDictionaryMember(d1, e2, "k1")</span> 
    <span class='conditional'>THEN</span> <span class="name">e1 = e2</span>
 </p></div>
 
 <p id="membership-insertion-membership-inference_text">If a dictionary was derived from another dictionary by an insertion, then the former holds all key-entity pairs of the latter, except those updated by the insertion.</p>
 	 <div class='inference' id='membership-insertion-membership-inference'>
 <p>
-<span class="conditional">IF</span>  <span class="name">hadMember(d1, ("k1",e1))</span>
+<span class="conditional">IF</span>  <span class="name">hadDictionaryMember(d1, e1, "k1")</span>
    and <span class="name">derivedByInsertionFrom(d2, d1, {("k2", _e2)})</span> and <span class="name">k1</span> &ne; <span class="name">k2</span>
-   <span class='conditional'>THEN</span> <span class="name">hadMember(d2, ("k1", e1))</span>
+   <span class='conditional'>THEN</span> <span class="name">hadDictionaryMember(d2, e1, "k1")</span>
 </p></div>
 <p id="membership-update-membership-inference_text">Insertion provides an "update semantics" for the keys that are already present in a dictionary. A new pair replaces an existing pair with the same key in the new dictionary. </p>
 	 <div class='inference' id='membership-update-membership-inference'>
 <p>
-<span class="conditional">IF</span>  <span class="name">hadMember(d1, ("k1", e1))</span>
+<span class="conditional">IF</span>  <span class="name">hadDictionaryMember(d1, e1, "k1")</span>
    and <span class="name">derivedByInsertionFrom(d2, d1, {("k1", e2)})</span>
-   <span class='conditional'>THEN</span> <span class="name">hadMember(d2, ("k1", e2))</span>
+   <span class='conditional'>THEN</span> <span class="name">hadDictionaryMember(d2, e2, "k1"))</span>
 </p></div>
 
 <p id="insertion-membership-inference_text">A dictionary that was derived by an insertion of key-entity pairs, holds all these specified key-entity pairs.</p>
 	 <div class='inference' id='insertion-membership-inference'>
 <p>
 <span class="conditional">IF</span> <span class="name">derivedByInsertionFrom(d2, d1, {("k1", e1)})</span> 
-   <span class='conditional'>THEN</span> <span class="name">hadMember(d2, ("k1", e1))</span>
+   <span class='conditional'>THEN</span> <span class="name">hadDictionaryMember(d2, e1, "k1")</span>
 </p></div>
 
 
@@ -2636,7 +2652,7 @@
 	 <div class='inference' id='removal-membership-inference'>
 <p>
 <span class="conditional">IF</span> <span class="name">derivedByRemovalFrom(d2, d1, {"k1"})</span> 
-   <span class='conditional'>THEN</span> <span class="name">hadMember(d1, ("k1",_e1))</span>
+   <span class='conditional'>THEN</span> <span class="name">hadDictionaryMember(d1, e1, "k1")</span>
 </p></div>
 
 <p id="insertion-derivation-inference_text">Insertion and removal are special cases of derivation.</p>
@@ -2656,12 +2672,12 @@
 	 <div class='inference' id='insertion-removal-membership-inference'>
 <p>
 <span class="conditional">IF</span> <span class="name">derivedByInsertionFrom(d2, d1, {("k1", _e1)})</span> and <span class="name">derivedByRemovalFrom(d3, d2, {"k1"})</span> 
-   <span class='conditional'>THEN</span> <span class="name">hadMember(d1, ("k2",e2))</span> holds <span
-  class='conditional'>IF AND ONLY IF</span> <span class="name">hadMember(d3, ("k2",e2))</span>
+   <span class='conditional'>THEN</span> <span class="name">hadDictionaryMember(d1, e2, "k2")</span> holds <span
+  class='conditional'>IF AND ONLY IF</span> <span class="name">hadDictionaryMember(d3, e2, "k2")</span>
 </p></div>
   <div class="remark">
   Note that this inference, together with the constraints that specify that a dictionary cannot be derived by multiple insertions or removals, and that an EmptyDictionary does not contain any key-entity pairs, guarantees <b>completeness</b> of a dictionary, if it can be traced back to an EmptyDictionary through insertions and removals.
-  Here, completeness means that all key-entity pairs of the dictionary are known through a hadMember statement.
+  Here, completeness means that all key-entity pairs of the dictionary are known through a hadDictionaryMember statement.
 	  </div>
 
 </section>
@@ -2674,7 +2690,7 @@
 	 <div class='constraint' id='impossible-removal-membership'>
 <p>
 <span class="conditional">IF</span> <span class="name">derivedByRemovalFrom(d2, d1, {"k1"})</span> and 
-    <span class="name">hadMember(d2, {("k1",_e1)})</span><span class='conditional'>THEN</span> <span
+    <span class="name">hadDictionaryMember(d2, e1, "k1")</span><span class='conditional'>THEN</span> <span
 	 class="conditional">INVALID</span>
 </p></div>
 	
@@ -2701,13 +2717,51 @@
 <p id="impossible-removal-insertion_text">An empty dictionary cannot hold any key-entity pairs.</p>
 	 <div class='constraint' id='impossible-removal-insertion'>
 <p>
-<span class="conditional">IF</span> <span class="name">hadMember(d,("_k1", e1))</span> and 
-    <span class="name">'EmptyDictionary' &isin; typeOf(e1)</span><span class='conditional'>THEN</span> <span
+<span class="conditional">IF</span> <span class="name">hadDictionaryMember(d, e1, "k1")</span> and 
+    <span class="name">'prov:EmptyDictionary' &isin; typeOf(d)</span><span class='conditional'>THEN</span> <span
 	 class="conditional">INVALID</span>
 </p></div>
 	
 </section> <!-- end constraints -->
-	
+
+<section id="dictionary-typing">
+		<h3>Typing</h3>
+	 <div class='constraint' id='typing'>
+		<ol>
+			<li>
+			<p>
+			<span class="conditional">IF</span>  <span class="name">entity(d, [prov:type='prov:Dictionary'])</span> <span class='conditional'>THEN</span> 
+			<span class="name">'prov:Dictionary' &isin; typeOf(d)</span> and <span class="name">'prov:Collection' &isin; typeOf(d)</span>
+			</p>
+			</li>
+			<li>
+			<p>
+			<span class="conditional">IF</span>  <span class="name">entity(d, [prov:type='prov:EmptyDictionary'])</span> <span class='conditional'>THEN</span> 
+			<span class="name">'prov:EmptyDictionary' &isin; typeOf(d)</span> and <span class="name">'prov:Dictionary' &isin; typeOf(d)</span>
+			</p>
+			</li>
+			<li>
+			<p>
+			<span class="conditional">IF</span>  <span class="name">hadDictionaryMember(d, e, "k")</span> <span class='conditional'>THEN</span> 
+			<span class="name">'prov:Dictionary' &isin; typeOf(d)</span> and <span class="name">'entity' &isin; typeOf(e)</span>
+			</p>
+			</li>
+			<li>
+			<p>
+			<span class="conditional">IF</span>  <span class="name">derivedByInsertionFrom(d2, d1, {("k1", e1)})</span> <span class='conditional'>THEN</span> 
+			<span class="name">'prov:Dictionary' &isin; typeOf(d1)</span> and <span class="name">'prov:Dictionary' &isin; typeOf(d2)</span> and <span class="name">'entity' &isin; typeOf(e1)</span>
+			</p>
+			</li>
+			<li>
+			<p>
+			<span class="conditional">IF</span>  <span class="name">derivedByRemovalFrom(d2, d1, {"k1"})</span> <span class='conditional'>THEN</span> 
+			<span class="name">'prov:Dictionary' &isin; typeOf(d1)</span> and <span class="name">'prov:Dictionary' &isin; typeOf(d2)</span>
+			</p>
+			</li>
+		</ol>
+		</div>
+
+</section>
 	
 </section>