PROV-DICTIONARY XML serialization complete
authorTom De Nies <tom.denies@ugent.be>
Fri, 11 Jan 2013 10:10:34 +0100
changeset 5420 d1bc3cbaeb24
parent 5419 0b3618a85778
child 5421 7f7d0e153a65
PROV-DICTIONARY XML serialization complete
dictionary/prov-dictionary.html
--- a/dictionary/prov-dictionary.html	Thu Jan 10 18:24:25 2013 +0100
+++ b/dictionary/prov-dictionary.html	Fri Jan 11 10:10:34 2013 +0100
@@ -1162,9 +1162,9 @@
 
 <section id="dictionary-ontological-definition"> 
 <h2>Ontological Definition of Dictionary</h2>
-
+<p>In this section, the ontological definition of <code>prov:Dictionary</code> is given, in order to extend [[PROV-O]] with dictionaries.</p>
 	<p> A <code><a class="qname"
-href='#Dictionary'>prov:Dictionary</a></code> is an <code
+	href='#Dictionary'>prov:Dictionary</a></code> is a <code
 class="repeated">prov:Entity</code> that acts as a container to some members,
 which are themselves entities.
 Specifically, a dictionary is composed of set of key-value pairs, where a
@@ -1509,6 +1509,7 @@
       <dt>is subclass of</dt>
       <dd>
         <a title="http://www.w3.org/ns/prov#Dictionary" href="#Dictionary" class="owlclass">prov:Dictionary</a>
+        <a title="http://www.w3.org/ns/prov#EmptyCollection" href="http://www.w3.org/TR/2012/CR-prov-o-20121211/#EmptyCollection" class="owlclass">prov:EmptyCollection</a>
       </dd>
     </dl>
   </div>
@@ -2424,11 +2425,12 @@
 
 <section id="dictionary-xml-schema"> 
 <h2>XML Schema Dictionary</h2>
+In this section, we provide the XML Schema to use dictionaries with the [[PROV-XML]] serialization.
 <section id="term-Dictionary">
 <h3>Dictionary</h3>
 <div class="glossary-ref" data-ref="glossary-dictionary"></div>
 <p>To specialize an Entity as a Dictionary, include a <code>prov:type</code> with the value "prov:Dictionary".</p>
-<p>An EmptyDictionary is asserted with the <code>prov:type</code> "prov:EmptyCollection" and denotes a Dictionary with no members.</p>
+<p>An EmptyDictionary is asserted with the <code>prov:type</code> "prov:EmptyDictionary" and denotes a Dictionary with no members.</p>
 <pre class="example">
 &lt;prov:document
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -2448,24 +2450,58 @@
 
 &lt;/prov:document&gt;
 </pre>
-</section>  <!-- end term-Collection -->
+</section>  <!-- end XML:Dictionary -->
+
+
+<section id="term-KeyValuePair">
+<h3>Key-Value Pair</h3>
+<div class="glossary-ref" data-ref="glossary-keyValuePair"></div>
+<p>Key-value pairs are used to identify the members of a dictionary.</p>
+<pre class="schema-type">
+&lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="KeyValuePair"  &gt;
+  &lt;xs:element name="entity" type="prov:EntityRef" /&gt;
+  &lt;xs:element name="key" type="xs:String" /&gt;
+&lt;/xs:complexType&gt;
+</pre>
+<pre class="schema-usage">
+&lt;xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="keyValuePair" type="prov:KeyValuePair"/&gt;
+</pre>
+<pre class="example">
+&lt;prov:document
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:prov="http://www.w3.org/ns/prov#"
+    xmlns:ex="http://example.com/ns/ex#"&gt;
+
+  &lt;prov:entity prov:id="e0"/&gt;
+  &lt;prov:entity prov:id="e1"/&gt;
+  
+  <b>&lt;prov:keyValuePair&gt
+    &lt;prov:entity prov:ref="e0"/&gt;
+    &lt;prov:key&gt;k0&lt;/prov:key&gt;
+  &lt;/prov:keyValuePair&gt
+  
+  &lt;prov:keyValuePair&gt
+    &lt;prov:entity prov:ref="e1"/&gt;
+    &lt;prov:key&gt;k1&lt;/prov:key&gt;
+  &lt;/prov:keyValuePair&gt</b>
+  
+</pre>
+</section>  <!-- end XML:KeyValuePair -->
 
 <section id="term-DictionaryMembership">
 <h3>Dictionary Membership</h3>
 <div class="glossary-ref" data-ref="glossary-dictionarymembership"></div>
+<p>The members of a dictionary are specified by listing all the key-value pairs inside a <code>prov:DictionaryMembership</code> element</p>
 <pre class="schema-type">
 &lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="DictionaryMembership"&gt;
   &lt;xs:sequence&gt;
-    &lt;xs:element name="dictionary"  type="prov:EntityRef"/&gt;
-    &lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="KeyValuePair" maxOccurs="unbounded" &gt;
-      &lt;xs:element name="entity"      type="prov:EntityRef" /&gt;
-      &lt;xs:element name="key"      type="xs:String" /&gt;
-    &lt;/xs:complexType&gt;
+    &lt;xs:element name="dictionary" type="prov:EntityRef"/&gt;
+	&lt;xs:element name="keyValuePair type="prov:KeyValuePair" maxOccurs="unbounded"/&gt;
   &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
 </pre>
 <pre class="schema-usage">
-&lt;xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="keyValuePair" type="prov:KeyValuePair"/&gt;
 &lt;xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="hadDictionaryMember" type="prov:DictionaryMembership"/&gt;
 </pre>
 <pre class="example">
@@ -2502,6 +2538,124 @@
 </pre>
 </section>  <!-- end term-Membership -->
 
+<section id="term-Insertion">
+<h3>Insertion</h3>
+<div class="glossary-ref" data-ref="glossary-insertion"></div>
+<p>To specify that one dictionary was derived by insertion of key-value pairs into another one, a <code>prov:Insertion</code> element is used.</p>
+<pre class="schema-type">
+&lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Insertion"&gt;
+  &lt;xs:sequence&gt;
+    &lt;xs:element name="newDictionary" type="prov:EntityRef"/&gt;
+    &lt;xs:element name="oldDictionary" type="prov:EntityRef"/&gt;
+	&lt;xs:element name="keyValuePair type="prov:KeyValuePair" maxOccurs="unbounded"/&gt;
+  &lt;/xs:sequence&gt;
+&lt;/xs:complexType&gt;
+</pre>
+<pre class="schema-usage">
+&lt;xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="derivedByInsertionFrom" type="prov:Insertion"/&gt;
+</pre>
+<pre class="example">
+&lt;prov:document
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:prov="http://www.w3.org/ns/prov#"&gt;
+
+  &lt;prov:entity prov:id="e0"/&gt;
+  &lt;prov:entity prov:id="e1"/&gt;
+  &lt;prov:entity prov:id="e2"/&gt;
+
+  &lt;prov:entity prov:id="d1"&gt;
+    &lt;prov:type xsi:type="xsd:QName"&gt;prov:Dictionary&lt;/prov:type&gt;
+  &lt;/prov:entity&gt;
+  
+  &lt;prov:entity prov:id="d2"&gt;
+    &lt;prov:type xsi:type="xsd:QName"&gt;prov:Dictionary&lt;/prov:type&gt;
+  &lt;/prov:entity&gt;
+
+  &lt;prov:hadDictionaryMember&gt;
+    &lt;prov:dictionary prov:ref="d1"/&gt;
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e0"/&gt;
+      &lt;prov:key&gt;k0&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+  &lt;/prov:hadDictionaryMember>
+  
+  <b>&lt;prov:derivedByInsertionFrom&gt;
+    &lt;prov:newDictionary prov:ref="d2"/&gt;
+    &lt;prov:oldDictionary prov:ref="d1"/&gt;
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e1"/&gt;
+      &lt;prov:key&gt;k1&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e2"/&gt;
+      &lt;prov:key&gt;k2&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+  &lt;/prov:derivedByInsertionFrom></b>
+  
+&lt;/prov:document&gt;
+</pre>
+</section> <!-- end term-Insertion -->
+<section id="term-Removal">
+<h3>Removal</h3>
+<div class="glossary-ref" data-ref="glossary-insertion"></div>
+<p>To specify that one dictionary was derived by removal of key-value pairs from another one, a <code>prov:Removal</code> element is used.</p>
+<pre class="schema-type">
+&lt;xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Removal"&gt;
+  &lt;xs:sequence&gt;
+    &lt;xs:element name="newDictionary" type="prov:EntityRef"/&gt;
+    &lt;xs:element name="oldDictionary" type="prov:EntityRef"/&gt;
+    &lt;xs:element name="key" type="xs:String" maxOccurs="unbounded" /&gt;
+  &lt;/xs:sequence&gt;
+&lt;/xs:complexType&gt;
+</pre>
+<pre class="schema-usage">
+&lt;xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="derivedByRemovalFrom" type="prov:Removal"/&gt;
+</pre>
+<pre class="example">
+&lt;prov:document
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:prov="http://www.w3.org/ns/prov#"&gt;
+
+  &lt;prov:entity prov:id="e0"/&gt;
+  &lt;prov:entity prov:id="e1"/&gt;
+  &lt;prov:entity prov:id="e2"/&gt;
+
+  &lt;prov:entity prov:id="d1"&gt;
+    &lt;prov:type xsi:type="xsd:QName"&gt;prov:Dictionary&lt;/prov:type&gt;
+  &lt;/prov:entity&gt;
+  
+  &lt;prov:entity prov:id="d2"&gt;
+    &lt;prov:type xsi:type="xsd:QName"&gt;prov:Dictionary&lt;/prov:type&gt;
+  &lt;/prov:entity&gt;
+
+  &lt;prov:hadDictionaryMember&gt;
+    &lt;prov:dictionary prov:ref="d1"/&gt;
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e0"/&gt;
+      &lt;prov:key&gt;k0&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e1"/&gt;
+      &lt;prov:key&gt;k1&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+    &lt;prov:keyValuePair&gt
+      &lt;prov:entity prov:ref="e2"/&gt;
+      &lt;prov:key&gt;k2&lt;/prov:key&gt;
+    &lt;/prov:keyValuePair&gt
+  &lt;/prov:hadDictionaryMember>
+  
+  <b>&lt;prov:derivedByRemovalFrom&gt;
+    &lt;prov:newDictionary prov:ref="d2"/&gt;
+    &lt;prov:oldDictionary prov:ref="d1"/&gt;
+    &lt;prov:key&gt;k1&lt;/prov:key&gt;
+    &lt;prov:key&gt;k2&lt;/prov:key&gt;
+  &lt;/prov:derivedByRemovalFrom></b>
+  
+&lt;/prov:document&gt;
+</pre>
+</section> <!-- end term-Removal -->
 </section>
 
 <section id="dictionary-constraints">