xml/schema/prov.xsd
author Luc Moreau <l.moreau@ecs.soton.ac.uk>
Wed, 26 Sep 2012 11:33:57 +0100
changeset 4486 f0e8bc2ae457
parent 4472 b88f0f02344f
child 4488 d9863da309f8
permissions -rw-r--r--
issue-515
     1 <?xml version="1.0" encoding="utf-8"?>
     2 
     3 <!-- 
     4      *warning*
     5      transformation of the opm opmx schema into prov compatible.
     6      purely tentative at this stage. 
     7 
     8      In PROV-DM, all ids are qualified names, specified as prov:QualifiedName in PROV-N.
     9      In this schema, all ids are instead defined as xsd:QNames. 
    10 
    11 
    12      ISSUES to tackle:
    13      - How do we support internationalization? 
    14        There is explicit support for internationalization for label.
    15        How can we support xml:lang for any string, as per prov-dm?
    16 
    17   -->
    18 
    19 
    20 <xs:schema targetNamespace="http://www.w3.org/ns/prov#"
    21            xmlns:xs="http://www.w3.org/2001/XMLSchema"
    22            xmlns:prov="http://www.w3.org/ns/prov#"
    23            xmlns:cu="http://www.w3.org/1999/xhtml/datatypes/"
    24            xmlns:xml="http://www.w3.org/XML/1998/namespace"
    25            elementFormDefault="qualified"
    26            attributeFormDefault="unqualified">
    27 
    28 
    29 
    30   <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" />
    31   <xs:import namespace="http://www.w3.org/XML/1998/namespace" 
    32              schemaLocation="http://www.w3.org/2001/xml.xsd"/>
    33 
    34   <!-- Component 1 -->
    35   
    36   <xs:complexType name="Entity">
    37     <xs:sequence>
    38       <xs:choice minOccurs="0" maxOccurs="unbounded">
    39         <xs:element name="location"/>
    40         <xs:element name="value"/>
    41         <xs:element name="label"/>
    42         <xs:element name="type"/>
    43         <xs:any namespace="##other"/>
    44       </xs:choice>
    45     </xs:sequence>
    46     <xs:attribute ref="prov:id"/>
    47   </xs:complexType>  
    48 
    49   <xs:complexType name="Activity">
    50     <xs:sequence>
    51       <xs:element name="startTime"    type="xs:dateTime" minOccurs="0"/> 
    52       <xs:element name="endTime"      type="xs:dateTime" minOccurs="0"/> 
    53       <xs:choice minOccurs="0" maxOccurs="unbounded">
    54         <xs:element name="location"/>
    55         <xs:element name="label"/>
    56         <xs:element name="type"/>
    57         <xs:any namespace="##other"/>
    58       </xs:choice>
    59     </xs:sequence>
    60     <xs:attribute ref="prov:id"/>
    61   </xs:complexType>
    62 
    63   <xs:complexType name="WasGeneratedBy">
    64     <xs:sequence>
    65       <xs:element name="entity"   type="prov:EntityRef"/>
    66       <xs:element name="activity" type="prov:ActivityRef" minOccurs="0"/>
    67       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    68       <xs:choice minOccurs="0" maxOccurs="unbounded">
    69         <xs:element name="location"/>
    70         <xs:element name="role"/>
    71         <xs:element name="label"/>
    72         <xs:element name="type"/>
    73         <xs:any namespace="##other"/>
    74       </xs:choice>
    75     </xs:sequence>
    76     <xs:attribute ref="prov:id"/>
    77   </xs:complexType>
    78 
    79   <xs:complexType name="Used">
    80     <xs:sequence>
    81       <xs:element name="activity" type="prov:ActivityRef"/>
    82       <xs:element name="entity"   type="prov:EntityRef" minOccurs="0"/>
    83       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    84       <xs:choice minOccurs="0" maxOccurs="unbounded">
    85         <xs:element name="location"/>
    86         <xs:element name="role"/>
    87         <xs:element name="label"/>
    88         <xs:element name="type"/>
    89         <xs:any namespace="##other"/>
    90       </xs:choice>
    91     </xs:sequence>
    92     <xs:attribute ref="prov:id"/>
    93   </xs:complexType>
    94 
    95   <xs:complexType name="WasInformedBy">
    96     <xs:sequence>
    97       <xs:element name="informed"  type="prov:ActivityRef"/>
    98       <xs:element name="informant" type="prov:ActivityRef"/>
    99       <xs:choice minOccurs="0" maxOccurs="unbounded">
   100         <xs:element name="label"/>
   101         <xs:element name="type"/>
   102         <xs:any namespace="##other"/>
   103       </xs:choice>
   104     </xs:sequence>
   105     <xs:attribute ref="prov:id"/>
   106   </xs:complexType>
   107 
   108   <xs:complexType name="WasStartedBy">
   109     <xs:sequence>
   110       <xs:element name="activity" type="prov:ActivityRef"/>
   111       <xs:element name="trigger"  type="prov:EntityRef" minOccurs="0"/>
   112       <xs:element name="starter"  type="prov:ActivityRef" minOccurs="0"/>
   113       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
   114       <xs:choice minOccurs="0" maxOccurs="unbounded">
   115         <xs:element name="location"/>
   116         <xs:element name="role"/>
   117         <xs:element name="label"/>
   118         <xs:element name="type"/>
   119         <xs:any namespace="##other"/>
   120       </xs:choice>
   121     </xs:sequence>
   122     <xs:attribute ref="prov:id"/>
   123   </xs:complexType>
   124 
   125   <xs:complexType name="WasEndedBy">
   126     <xs:sequence>
   127       <xs:element name="activity" type="prov:ActivityRef"/>
   128       <xs:element name="trigger"  type="prov:EntityRef"  minOccurs="0"/>
   129       <xs:element name="ender"    type="prov:ActivityRef" minOccurs="0"/>
   130       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
   131       <xs:choice minOccurs="0" maxOccurs="unbounded">
   132         <xs:element name="location"/>
   133         <xs:element name="role"/>
   134         <xs:element name="label"/>
   135         <xs:element name="type"/>
   136         <xs:any namespace="##other"/>
   137       </xs:choice>
   138     </xs:sequence>
   139     <xs:attribute ref="prov:id"/>
   140   </xs:complexType>
   141 
   142   <xs:complexType name="WasInvalidatedBy">
   143     <xs:sequence>
   144       <xs:element name="entity"   type="prov:EntityRef"/>
   145       <xs:element name="activity" type="prov:ActivityRef" minOccurs="0"/>
   146       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
   147       <xs:choice minOccurs="0" maxOccurs="unbounded">
   148         <xs:element name="location"/>
   149         <xs:element name="role"/>
   150         <xs:element name="label"/>
   151         <xs:element name="type"/>
   152         <xs:any namespace="##other"/>
   153       </xs:choice>
   154     </xs:sequence>
   155     <xs:attribute ref="prov:id"/>
   156   </xs:complexType>
   157 
   158   <!-- Component 2 -->
   159   
   160   <xs:complexType name="WasDerivedFrom">
   161     <xs:sequence>
   162       <xs:element name="generatedEntity"  type="prov:EntityRef"/>
   163       <xs:element name="usedEntity"       type="prov:EntityRef"/>
   164       <xs:element name="activity"         type="prov:ActivityRef" minOccurs="0"/>
   165       <xs:element name="generation"       type="prov:GenerationRef" minOccurs="0"/>
   166       <xs:element name="usage"            type="prov:UsageRef" minOccurs="0"/>
   167       <xs:choice minOccurs="0" maxOccurs="unbounded">
   168         <xs:element name="label"/>
   169         <xs:element name="type"/>
   170         <xs:any namespace="##other"/>
   171       </xs:choice>
   172     </xs:sequence>
   173     <xs:attribute ref="prov:id"/>
   174   </xs:complexType>
   175 
   176   <!-- Component 3 -->
   177   
   178   <xs:complexType name="Agent">
   179     <xs:sequence>
   180       <xs:choice minOccurs="0" maxOccurs="unbounded">
   181         <xs:element name="location"/>
   182         <xs:element name="label"/>
   183         <xs:element name="type"/>
   184         <xs:any namespace="##other"/>
   185       </xs:choice>
   186     </xs:sequence>
   187     <xs:attribute ref="prov:id"/>
   188   </xs:complexType>
   189 
   190   <xs:complexType name="WasAttributedTo">
   191     <xs:sequence>
   192       <xs:element name="entity" type="prov:EntityRef"/>
   193       <xs:element name="agent"    type="prov:AgentRef"/>
   194       <xs:choice minOccurs="0" maxOccurs="unbounded">
   195         <xs:element name="label"/>
   196         <xs:element name="type"/>
   197         <xs:any namespace="##other"/>
   198       </xs:choice>
   199     </xs:sequence>
   200     <xs:attribute ref="prov:id"/>
   201   </xs:complexType>
   202 
   203   <xs:complexType name="WasAssociatedWith">
   204     <xs:sequence>
   205       <xs:element name="activity" type="prov:ActivityRef"/>
   206       <xs:element name="agent"    type="prov:AgentRef" minOccurs="0"/>
   207       <xs:element name="plan"     type="prov:EntityRef" minOccurs="0"/>
   208       <xs:choice minOccurs="0" maxOccurs="unbounded">
   209         <xs:element name="role"/>
   210         <xs:element name="label"/>
   211         <xs:element name="type"/>
   212         <xs:any namespace="##other"/>
   213       </xs:choice>
   214     </xs:sequence>
   215     <xs:attribute ref="prov:id"/>
   216   </xs:complexType>
   217 
   218   <xs:complexType name="ActedOnBehalfOf">
   219     <xs:sequence>
   220       <xs:element name="delegate" type="prov:AgentRef"/>
   221       <xs:element name="responsible" type="prov:AgentRef"/>
   222       <xs:element name="activity"    type="prov:ActivityRef" minOccurs="0"/>
   223       <xs:choice minOccurs="0" maxOccurs="unbounded">
   224         <xs:element name="label"/>
   225         <xs:element name="type"/>
   226         <xs:any namespace="##other"/>
   227       </xs:choice>
   228     </xs:sequence>
   229     <xs:attribute ref="prov:id"/>
   230   </xs:complexType>
   231 
   232   <xs:complexType name="WasInfluencedBy">
   233     <xs:sequence>
   234       <xs:element name="influencee"     type="prov:AnyRef"/>
   235       <xs:element name="influencer"     type="prov:AnyRef"/>
   236       <xs:choice minOccurs="0" maxOccurs="unbounded">
   237         <xs:element name="label"/>
   238         <xs:element name="type"/>
   239         <xs:any namespace="##other"/>
   240       </xs:choice>
   241     </xs:sequence>
   242     <xs:attribute ref="prov:id"/>
   243   </xs:complexType>
   244 
   245   <!-- Component 4 -->
   246 
   247   <!-- Component 5 -->
   248 
   249   <xs:complexType name="SpecializationOf">
   250     <xs:sequence>
   251       <xs:element name="specificEntity"   type="prov:EntityRef"/>
   252       <xs:element name="generalEntity"   type="prov:EntityRef"/>
   253     </xs:sequence>
   254   </xs:complexType>
   255 
   256   <xs:complexType name="AlternateOf">
   257     <xs:sequence>
   258       <xs:element name="alternate1"   type="prov:EntityRef"/>
   259       <xs:element name="alternate2"   type="prov:EntityRef"/>
   260     </xs:sequence>
   261   </xs:complexType>
   262 
   263   <xs:complexType name="MentionOf">
   264     <xs:sequence>
   265       <xs:element name="specificEntity"   type="prov:EntityRef"/>
   266       <xs:element name="generalEntity"     type="prov:EntityRef"/>
   267       <xs:element name="bundle"            type="prov:EntityRef"/>
   268     </xs:sequence>
   269   </xs:complexType>
   270 
   271   
   272   <!-- Component 6 -->
   273 
   274   <xs:complexType name="CollectionMemberOf">
   275     <xs:sequence>
   276       <xs:element name="collection"          type="prov:EntityRef"/>
   277       <xs:element name="complete"        type="xs:boolean" minOccurs="0"/>
   278       <xs:element name="member"          type="prov:EntityRef" maxOccurs="unbounded"/>
   279     </xs:sequence>
   280     <xs:attribute ref="prov:id"/>
   281   </xs:complexType>
   282 
   283   <xs:complexType name="InternationalizedString">
   284     <xs:simpleContent>
   285       <xs:extension base="xs:string">
   286         <xs:attribute ref="xml:lang" use="optional"/>
   287       </xs:extension>
   288     </xs:simpleContent>
   289   </xs:complexType>    
   290 
   291 
   292    <!--
   293        Typed literals are encoded by means
   294        of xsi:type that represent the prov:datatype.
   295 
   296        -->
   297   
   298   <xs:element name="label"    type="prov:InternationalizedString"/>
   299   <xs:element name="role"     type="xs:anySimpleType"/>
   300   <xs:element name="type"     type="xs:anySimpleType"/>
   301   <xs:element name="location" type="xs:anySimpleType"/>
   302   <xs:element name="value"    type="xs:anySimpleType"/>
   303 
   304   <!-- See comment in preamble.
   305        These should be prov:QualifiedName
   306        but instead are xsd:QName for tools to process them -->
   307 
   308   <xs:attribute name="id"  type="xs:QName"/>
   309   <xs:attribute name="ref" type="xs:QName"/>
   310 
   311   <xs:complexType name="ActivityRef">
   312     <xs:attribute ref="prov:ref" use="required" />
   313   </xs:complexType>
   314   <xs:complexType name="EntityRef">
   315     <xs:attribute ref="prov:ref" use="required"/>
   316   </xs:complexType>
   317   <xs:complexType name="AgentRef">
   318     <xs:attribute ref="prov:ref" use="required"/>
   319   </xs:complexType>
   320   <xs:complexType name="UsageRef">
   321     <xs:attribute ref="prov:ref" use="required"/>
   322   </xs:complexType>
   323   <xs:complexType name="GenerationRef">
   324     <xs:attribute ref="prov:ref" use="required"/>
   325   </xs:complexType>
   326   <xs:complexType name="AnyRef">
   327     <xs:attribute ref="prov:ref" use="required"/>
   328   </xs:complexType>
   329 
   330   <xs:group name="documentElements">
   331     <xs:sequence>
   332       <xs:choice minOccurs="0" maxOccurs="unbounded">
   333         <xs:element name="entity"               type="prov:Entity"/>
   334         <xs:element name="activity"             type="prov:Activity"/>
   335         <xs:element name="wasGeneratedBy"       type="prov:WasGeneratedBy"/>
   336         <xs:element name="used"                 type="prov:Used"/>
   337         <xs:element name="wasInformedBy"        type="prov:WasInformedBy"/>
   338         <xs:element name="wasStartedBy"         type="prov:WasStartedBy"/>
   339         <xs:element name="wasEndedBy"           type="prov:WasEndedBy"/>
   340         <xs:element name="wasInvalidatedBy"     type="prov:WasInvalidatedBy"/>
   341 
   342         <xs:element name="wasDerivedFrom"       type="prov:WasDerivedFrom"/>
   343 
   344         <xs:element name="agent"                type="prov:Agent"/>
   345         <xs:element name="wasAttributedTo"      type="prov:WasAttributedTo"/>
   346         <xs:element name="wasAssociatedWith"    type="prov:WasAssociatedWith"/>
   347         <xs:element name="actedOnBehalfOf"      type="prov:ActedOnBehalfOf"/>
   348         <xs:element name="wasInfluencedBy"      type="prov:WasInfluencedBy"/>
   349         
   350         <xs:element name="specializationOf"     type="prov:SpecializationOf"/>
   351         <xs:element name="alternateOf"          type="prov:AlternateOf"/>
   352         <xs:element name="mentionOf"            type="prov:MentionOf"/>
   353 
   354         <xs:element name="collectionMemberOf"   type="prov:CollectionMemberOf"/>
   355       </xs:choice>
   356     </xs:sequence>
   357   </xs:group>
   358 
   359   <xs:element name="document" type="prov:Document" />
   360   <xs:complexType name="Document">
   361     <xs:sequence>
   362       <xs:choice maxOccurs="unbounded">
   363         <xs:group ref="prov:documentElements"/>
   364         <xs:element name="bundle" type="prov:Bundle"/>
   365       </xs:choice>
   366     </xs:sequence>
   367   </xs:complexType>
   368   
   369   <xs:complexType name="Bundle">
   370     <xs:sequence>
   371       <xs:group ref="prov:documentElements"/>
   372     </xs:sequence>
   373     <xs:attribute ref="prov:id"/>
   374   </xs:complexType>
   375 
   376 </xs:schema>