added prov-mention.xsd to mention directory
authorStephan Zednik <zednis@rpi.edu>
Tue, 13 Nov 2012 00:45:02 -0700
changeset 4761 cb75358697a9
parent 4760 5515c5bcd61c
child 4763 6ff006f9574c
added prov-mention.xsd to mention directory
examples/eg-40-xml-examples-by-term/xml/Entity.xml
mention/prov-mention.xsd
--- a/examples/eg-40-xml-examples-by-term/xml/Entity.xml	Mon Nov 12 16:25:25 2012 -0700
+++ b/examples/eg-40-xml-examples-by-term/xml/Entity.xml	Tue Nov 13 00:45:02 2012 -0700
@@ -14,4 +14,8 @@
     <ex:version>2</ex:version>
   </prov:entity>
 
+  <!-- not valid if prov:id has range xs:QName
+  <prov:entity prov:id="ex:001"/>
+  -->
+
 </prov:document>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mention/prov-mention.xsd	Tue Nov 13 00:45:02 2012 -0700
@@ -0,0 +1,418 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- 
+     *warning*
+     transformation of the opm opmx schema into prov compatible.
+     purely tentative at this stage. 
+
+     In PROV-DM, all ids are qualified names, specified as prov:QualifiedName in PROV-N.
+     In this schema, all ids are instead defined as xsd:QNames. 
+
+
+     ISSUES to tackle:
+     - How do we support internationalization? 
+       There is explicit support for internationalization for label.
+       How can we support xml:lang for any string, as per prov-dm?
+
+  -->
+
+
+<xs:schema targetNamespace="http://www.w3.org/ns/prov#"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:prov="http://www.w3.org/ns/prov#"
+           xmlns:cu="http://www.w3.org/1999/xhtml/datatypes/"
+           xmlns:xml="http://www.w3.org/XML/1998/namespace"
+           elementFormDefault="qualified"
+           attributeFormDefault="unqualified">
+
+
+
+  <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" />
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace" 
+             schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+  <!-- Component 1 -->
+  
+  <xs:complexType name="Entity">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:value"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>  
+
+  <xs:complexType name="Activity">
+    <xs:sequence>
+      <xs:element name="startTime"    type="xs:dateTime" minOccurs="0"/> 
+      <xs:element name="endTime"      type="xs:dateTime" minOccurs="0"/> 
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Generation">
+    <xs:sequence>
+      <xs:element name="entity"   type="prov:EntityRef"/>
+      <xs:element name="activity" type="prov:ActivityRef" minOccurs="0"/>
+      <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Usage">
+    <xs:sequence>
+      <xs:element name="activity" type="prov:ActivityRef"/>
+      <xs:element name="entity"   type="prov:EntityRef" minOccurs="0"/>
+      <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Communication">
+    <xs:sequence>
+      <xs:element name="informed"  type="prov:ActivityRef"/>
+      <xs:element name="informant" type="prov:ActivityRef"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Start">
+    <xs:sequence>
+      <xs:element name="activity" type="prov:ActivityRef"/>
+      <xs:element name="trigger"  type="prov:EntityRef" minOccurs="0"/>
+      <xs:element name="starter"  type="prov:ActivityRef" minOccurs="0"/>
+      <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="End">
+    <xs:sequence>
+      <xs:element name="activity" type="prov:ActivityRef"/>
+      <xs:element name="trigger"  type="prov:EntityRef"  minOccurs="0"/>
+      <xs:element name="ender"    type="prov:ActivityRef" minOccurs="0"/>
+      <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Invalidation">
+    <xs:sequence>
+      <xs:element name="entity"   type="prov:EntityRef"/>
+      <xs:element name="activity" type="prov:ActivityRef" minOccurs="0"/>
+      <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <!-- Component 2 -->
+  
+  <xs:complexType name="Derivation">
+    <xs:sequence>
+      <xs:element name="generatedEntity"  type="prov:EntityRef"/>
+      <xs:element name="usedEntity"       type="prov:EntityRef"/>
+      <xs:element name="activity"         type="prov:ActivityRef" minOccurs="0"/>
+      <xs:element name="generation"       type="prov:GenerationRef" minOccurs="0"/>
+      <xs:element name="usage"            type="prov:UsageRef" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <!-- Component 3 -->
+  
+  <xs:complexType name="Agent">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:location"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Attribution">
+    <xs:sequence>
+      <xs:element name="entity" type="prov:EntityRef"/>
+      <xs:element name="agent"    type="prov:AgentRef"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Association">
+    <xs:sequence>
+      <xs:element name="activity" type="prov:ActivityRef"/>
+      <xs:element name="agent"    type="prov:AgentRef" minOccurs="0"/>
+      <xs:element name="plan"     type="prov:EntityRef" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:role"/>
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Delegation">
+    <xs:sequence>
+      <xs:element name="delegate" type="prov:AgentRef"/>
+      <xs:element name="responsible" type="prov:AgentRef"/>
+      <xs:element name="activity"    type="prov:ActivityRef" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <xs:complexType name="Influence">
+    <xs:sequence>
+      <xs:element name="influencee"     type="prov:AnyRef"/>
+      <xs:element name="influencer"     type="prov:AnyRef"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:label"/>
+        <xs:element ref="prov:type"/>
+        <xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <!-- Component 4 -->
+
+  <xs:complexType name="Bundle">
+    <xs:sequence>
+      <xs:group ref="prov:documentElements"/>
+    </xs:sequence>
+    <xs:attribute ref="prov:id"/>
+  </xs:complexType>
+
+  <!-- Component 5 -->
+
+  <xs:complexType name="Specialization">
+    <xs:sequence>
+      <xs:element name="specificEntity"   type="prov:EntityRef"/>
+      <xs:element name="generalEntity"   type="prov:EntityRef"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="Alternate">
+    <xs:sequence>
+      <xs:element name="alternate1"   type="prov:EntityRef"/>
+      <xs:element name="alternate2"   type="prov:EntityRef"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="Mention">
+    <xs:sequence>
+      <xs:element name="specificEntity"   type="prov:EntityRef"/>
+      <xs:element name="generalEntity"     type="prov:EntityRef"/>
+      <xs:element name="bundle"            type="prov:EntityRef"/>
+    </xs:sequence>
+  </xs:complexType>
+  
+  <!-- Component 6 -->
+
+  <xs:complexType name="Membership">
+    <xs:sequence>
+      <xs:element name="collection"          type="prov:EntityRef"/>
+      <xs:element name="entity"          type="prov:EntityRef" maxOccurs="unbounded"/>
+    </xs:sequence>
+  </xs:complexType>
+
+  <xs:complexType name="InternationalizedString">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute ref="xml:lang" use="optional"/>
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>    
+
+
+   <!--
+       Typed literals are encoded by means
+       of xsi:type that represent the prov:datatype.
+
+       -->
+  
+  <xs:element name="label"    type="prov:InternationalizedString"/>
+  <xs:element name="role"     type="xs:anySimpleType"/>
+  <xs:element name="type"     type="xs:anySimpleType"/>
+  <xs:element name="location" type="xs:anySimpleType"/>
+  <xs:element name="value"    type="xs:anySimpleType"/>
+
+  <!-- See comment in preamble.
+       These should be prov:QualifiedName
+       but instead are xsd:QName for tools to process them -->
+
+  <!--  Possible alternative, but may cause us 
+        to lose benefit of existing XML tooling
+  <xs:attribute name="id"  type="xs:anyURI"/>
+  <xs:attribute name="ref" type="xs:anyURI"/>
+  -->
+
+  <xs:attribute name="id"  type="xs:QName"/>
+  <xs:attribute name="ref" type="xs:QName"/>
+
+  <xs:complexType name="ActivityRef">
+    <xs:attribute ref="prov:ref" use="required" />
+  </xs:complexType>
+  <xs:complexType name="EntityRef">
+    <xs:attribute ref="prov:ref" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="AgentRef">
+    <xs:attribute ref="prov:ref" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="UsageRef">
+    <xs:attribute ref="prov:ref" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="GenerationRef">
+    <xs:attribute ref="prov:ref" use="required"/>
+  </xs:complexType>
+  <xs:complexType name="AnyRef">
+    <xs:attribute ref="prov:ref" use="required"/>
+  </xs:complexType>
+
+  <!--
+     top-level definition of elements following the salami slice XSD design pattern
+     to encourage integration within existing non-prov XML documents.
+  -->
+
+  <!-- Component 1 elements -->
+
+  <xs:element name="entity"               type="prov:Entity"/>
+  <xs:element name="activity"             type="prov:Activity"/>
+  <xs:element name="wasGeneratedBy"       type="prov:Generation"/>
+  <xs:element name="used"                 type="prov:Usage"/>
+  <xs:element name="wasInformedBy"        type="prov:Communication"/>
+  <xs:element name="wasStartedBy"         type="prov:Start"/>
+  <xs:element name="wasEndedBy"           type="prov:End"/>
+  <xs:element name="wasInvalidatedBy"     type="prov:Invalidation"/>
+
+  <!-- Component 2 elements -->
+
+  <xs:element name="wasDerivedFrom"       type="prov:Derivation"/>
+
+  <!-- Component 3 elements -->
+
+  <xs:element name="agent"                type="prov:Agent"/>
+  <xs:element name="wasAttributedTo"      type="prov:Attribution"/>
+  <xs:element name="wasAssociatedWith"    type="prov:Association"/>
+  <xs:element name="actedOnBehalfOf"      type="prov:Delegation"/>
+  <xs:element name="wasInfluencedBy"      type="prov:Influence"/>
+  
+  <!-- Component 5 elements -->
+
+  <xs:element name="specializationOf"     type="prov:Specialization"/>
+  <xs:element name="alternateOf"          type="prov:Alternate"/>
+  <xs:element name="mentionOf"            type="prov:Mention"/>
+
+  <!-- Component 6 elements -->
+
+  <xs:element name="hadMember"            type="prov:Membership"/>
+
+
+
+  <!-- doucment elements -->
+
+  <xs:group name="documentElements">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="prov:entity"/>
+        <xs:element ref="prov:activity"/>
+        <xs:element ref="prov:wasGeneratedBy"/>
+        <xs:element ref="prov:used"/>
+        <xs:element ref="prov:wasInformedBy"/>
+        <xs:element ref="prov:wasStartedBy"/>
+        <xs:element ref="prov:wasEndedBy"/>
+        <xs:element ref="prov:wasInvalidatedBy"/>
+        <xs:element ref="prov:wasDerivedFrom"/>
+        <xs:element ref="prov:agent"/>
+        <xs:element ref="prov:wasAttributedTo"/>
+        <xs:element ref="prov:wasAssociatedWith"/>
+        <xs:element ref="prov:actedOnBehalfOf"/>
+        <xs:element ref="prov:wasInfluencedBy"/>
+        <xs:element ref="prov:specializationOf"/>
+        <xs:element ref="prov:alternateOf"/>
+        <xs:element ref="prov:mentionOf"/>
+        <xs:element ref="prov:hadMember"/>
+		<xs:any namespace="##other"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+
+  <xs:element name="document" type="prov:Document" />
+  <xs:complexType name="Document">
+    <xs:sequence>
+      <xs:choice maxOccurs="unbounded">
+        <xs:group ref="prov:documentElements"/>
+        <xs:element name="bundle" type="prov:Bundle"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:complexType>
+
+</xs:schema>