xml/experimental/extensions/prov.xsd
author Stian Soiland-Reyes <soiland-reyes@cs.manchester.ac.uk>
Thu, 06 Dec 2012 16:51:27 +0000
changeset 5310 6113b10ac714
parent 5309 60d1dbc7145e
permissions -rw-r--r--
xsd:any switched for prov:extraRecord
     1 <?xml version="1.0" encoding="utf-8"?>
     2 
     3 <!-- work in progress.
     4 
     5      In this schema, all ids are encoded as QNames. 
     6 
     7      Instead, a more permissive definition should be used such as CURIEs.
     8 
     9      Note that typical implementations won't recognize CURIEs :-(
    10 
    11   -->
    12 
    13 
    14 <xs:schema targetNamespace="http://www.w3.org/ns/prov#"
    15            xmlns:xs="http://www.w3.org/2001/XMLSchema"
    16            xmlns:prov="http://www.w3.org/ns/prov#"
    17            xmlns:cu="http://www.w3.org/1999/xhtml/datatypes/"
    18            elementFormDefault="qualified"
    19            attributeFormDefault="unqualified">
    20 
    21 
    22 
    23 <!-- CURIEs  <xs:import namespace="http://www.w3.org/1999/xhtml/datatypes/" />  -->
    24 
    25 
    26   <!-- Component 1 -->
    27   
    28   <xs:element name="entity" type="prov:Entity"/>
    29   <xs:complexType name="Entity">
    30     <xs:sequence>
    31       <xs:element ref="prov:label" minOccurs="0"/> 
    32       <xs:element ref="prov:type"  minOccurs="0" maxOccurs="unbounded"/>
    33  
    34       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    35     </xs:sequence>
    36     <xs:attribute ref="prov:id"/>
    37   </xs:complexType>  
    38 
    39   <xs:element name="activity" type="prov:Activity"/>
    40   <xs:complexType name="Activity">
    41     <xs:sequence>
    42       <xs:element name="startTime"    type="xs:dateTime" minOccurs="0"/> 
    43       <xs:element name="endTime"      type="xs:dateTime" minOccurs="0"/> 
    44       <xs:element ref="prov:label" minOccurs="0"/> 
    45       <xs:element ref="prov:type"  minOccurs="0" maxOccurs="unbounded"/> 
    46       
    47       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    48     </xs:sequence>
    49     <xs:attribute ref="prov:id"/>
    50   </xs:complexType>
    51   
    52 
    53   <xs:complexType name="Used">
    54     <xs:sequence>
    55       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    56       <xs:element name="activity" type="prov:ActivityRef"/>
    57       <xs:element name="entity"   type="prov:EntityRef"/>
    58       <xs:element ref="prov:type"  minOccurs="0" maxOccurs="unbounded"/>
    59 
    60       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
    61       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    62     </xs:sequence>
    63     <xs:attribute ref="prov:id"/>
    64   </xs:complexType>
    65   
    66   <xs:complexType name="WasGeneratedBy">
    67     <xs:sequence>
    68       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    69       <xs:element name="entity"   type="prov:EntityRef"/>
    70       <xs:element name="activity" type="prov:ActivityRef" minOccurs="0"/>
    71       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
    72       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
    73       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    74     </xs:sequence>
    75     <xs:attribute ref="prov:id"/>
    76   </xs:complexType>
    77 
    78   <xs:complexType name="WasStartedBy">
    79     <xs:sequence>
    80       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    81       <xs:element name="activity" type="prov:ActivityRef"/>
    82       <xs:element name="trigger"  type="prov:EntityRef"  minOccurs="0"/>
    83       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
    84       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
    85       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    86     </xs:sequence>
    87     <xs:attribute ref="prov:id"/>
    88   </xs:complexType>
    89 
    90   <xs:complexType name="WasEndedBy">
    91     <xs:sequence>
    92       <xs:element name="time"     type="xs:dateTime" minOccurs="0"/>
    93       <xs:element name="activity" type="prov:ActivityRef"/>
    94       <xs:element name="trigger"  type="prov:EntityRef"  minOccurs="0"/>
    95       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
    96       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
    97       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
    98     </xs:sequence>
    99     <xs:attribute ref="prov:id"/>
   100   </xs:complexType>
   101 
   102   <xs:complexType name="WasInformedBy">
   103     <xs:sequence>
   104       <xs:element name="time"    type="xs:dateTime" minOccurs="0"/>
   105       <xs:element name="effect"  type="prov:ActivityRef"/>
   106       <xs:element name="cause"   type="prov:ActivityRef"/>
   107       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   108       <xs:element ref="prov:role" minOccurs="0" maxOccurs="unbounded"/> 
   109       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   110     </xs:sequence>
   111     <xs:attribute ref="prov:id"/>
   112   </xs:complexType>
   113 
   114   <xs:complexType name="WasStartedByActivity">
   115     <xs:sequence>
   116       <xs:element name="started" type="prov:ActivityRef"/>
   117       <xs:element name="starter" type="prov:ActivityRef"/>
   118       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   119       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
   120       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   121     </xs:sequence>
   122     <xs:attribute ref="prov:id"/>
   123   </xs:complexType>
   124 
   125 
   126   <!-- Component 2 -->
   127   
   128   <xs:element name="agent" type="prov:Agent"/>
   129   <xs:complexType name="Agent">
   130     <xs:sequence>
   131       <xs:element ref="prov:label" minOccurs="0"/> 
   132       <xs:element ref="prov:type"  minOccurs="0" maxOccurs="unbounded"/>
   133       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   134     </xs:sequence>
   135     <xs:attribute ref="prov:id"/>
   136   </xs:complexType>
   137 
   138   <xs:complexType name="WasAssociatedWith">
   139     <xs:sequence>
   140       <xs:element name="activity" type="prov:ActivityRef"/>
   141       <xs:element name="agent"    type="prov:AgentRef"/>
   142       <xs:element name="plan"     type="prov:EntityRef" minOccurs="0"/>
   143       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   144       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
   145       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   146     </xs:sequence>
   147     <xs:attribute ref="prov:id"/>
   148   </xs:complexType>
   149 
   150 
   151   <xs:complexType name="WasAttributedTo">
   152     <xs:sequence>
   153       <xs:element name="entity" type="prov:EntityRef"/>
   154       <xs:element name="agent"    type="prov:AgentRef"/>
   155       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   156       <xs:element ref="prov:role"  minOccurs="0" maxOccurs="unbounded"/> 
   157       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   158     </xs:sequence>
   159     <xs:attribute ref="prov:id"/>
   160   </xs:complexType>
   161 
   162   <xs:complexType name="ActedOnBehalfOf">
   163     <xs:sequence>
   164       <xs:element name="subordinate" type="prov:AgentRef"/>
   165       <xs:element name="responsible" type="prov:AgentRef"/>
   166       <xs:element name="activity"    type="prov:ActivityRef"/>
   167       <xs:element ref="prov:type"   minOccurs="0" maxOccurs="unbounded"/>
   168       <xs:element ref="prov:role"   minOccurs="0" maxOccurs="unbounded"/> 
   169       <xs:any namespace="##other"   minOccurs="0" maxOccurs="unbounded"/>
   170     </xs:sequence>
   171     <xs:attribute ref="prov:id"/>
   172   </xs:complexType>
   173 
   174 
   175   <!-- Component 3 -->
   176 
   177   
   178   <xs:complexType name="WasDerivedFrom">
   179     <xs:sequence>
   180       <xs:element name="generation"       type="prov:DependencyRef" minOccurs="0"/>
   181       <xs:element name="usage"            type="prov:DependencyRef" minOccurs="0"/>
   182       <xs:element name="activity"         type="prov:ActivityRef" minOccurs="0"/>
   183       <xs:element name="generatedEntity"  type="prov:EntityRef"/>
   184       <xs:element name="usedEntity"       type="prov:EntityRef"/>
   185       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   186       <xs:element ref="prov:role" minOccurs="0" maxOccurs="unbounded"/> 
   187       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   188     </xs:sequence>
   189     <xs:attribute ref="prov:id"/>
   190   </xs:complexType>
   191 
   192   <xs:complexType name="WasRevisionOf">
   193     <xs:sequence>
   194       <xs:element name="newer"           type="prov:EntityRef"/>
   195       <xs:element name="older"           type="prov:EntityRef"/>
   196       <xs:element name="responsibility"  type="prov:AgentRef" minOccurs="0"/>
   197       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   198       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   199     </xs:sequence>
   200     <xs:attribute ref="prov:id"/>
   201   </xs:complexType>
   202 
   203   <xs:complexType name="WasQuotedFrom">
   204     <xs:sequence>
   205       <xs:element name="quote"        type="prov:EntityRef"/>
   206       <xs:element name="original"     type="prov:EntityRef"/>
   207       <xs:element name="quoterAgent"  type="prov:AgentRef" minOccurs="0"/>
   208       <xs:element name="quotedAgent"  type="prov:AgentRef" minOccurs="0"/>
   209       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   210       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   211     </xs:sequence>
   212     <xs:attribute ref="prov:id"/>
   213   </xs:complexType>
   214 
   215   <xs:complexType name="HadOriginalSource">
   216     <xs:sequence>
   217       <xs:element name="derived"     type="prov:EntityRef"/>
   218       <xs:element name="source"      type="prov:EntityRef"/>
   219       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   220       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   221     </xs:sequence>
   222     <xs:attribute ref="prov:id"/>
   223   </xs:complexType>
   224 
   225   <xs:complexType name="TracedTo">
   226     <xs:sequence>
   227       <xs:element name="entity"      type="prov:EntityRef"/>
   228       <xs:element name="ancestor"    type="prov:EntityRef"/>
   229       <xs:element ref="prov:type" minOccurs="0" maxOccurs="unbounded"/>
   230       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   231     </xs:sequence>
   232     <xs:attribute ref="prov:id"/>
   233   </xs:complexType>
   234 
   235   <!-- Component 4 -->
   236 
   237   <xs:complexType name="AlternateOf">
   238     <xs:sequence>
   239       <xs:element name="entity2"   type="prov:EntityRef"/>
   240       <xs:element name="entity1"   type="prov:EntityRef"/>
   241     </xs:sequence>
   242   </xs:complexType>
   243 
   244   <xs:complexType name="SpecializationOf">
   245     <xs:sequence>
   246       <xs:element name="specializedEntity"   type="prov:EntityRef"/>
   247       <xs:element name="generalEntity"   type="prov:EntityRef"/>
   248     </xs:sequence>
   249   </xs:complexType>
   250   
   251   <!-- Component 5 -->
   252 
   253 
   254   <!-- Component 6 -->
   255   
   256   <xs:element name="note" type="prov:Note"/>
   257   <xs:complexType name="Note">
   258     <xs:sequence>
   259       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   260     </xs:sequence>
   261     <xs:attribute ref="prov:id"/>
   262   </xs:complexType>
   263   
   264   <xs:complexType name="HasAnnotation">
   265     <xs:sequence>
   266       <xs:element name="thing"   type="prov:NoteRef" minOccurs="1"/> <!-- note, just a ref to anything, really -->
   267       <xs:element name="note"    type="prov:NoteRef" minOccurs="1"/>
   268       <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
   269     </xs:sequence>
   270     <xs:attribute ref="prov:id"/>
   271   </xs:complexType>
   272 
   273    <!--
   274        Typed literals are encoded by means
   275        of xsi:type that represent the prov:datatype.
   276 
   277        -->
   278   
   279   <xs:element name="label" type="xs:string"/>
   280   <xs:element name="role"  type="xs:anySimpleType"/>
   281   <xs:element name="type"  type="xs:anySimpleType"/>
   282 
   283   <xs:attribute name="id"  type="xs:QName"/>
   284   <xs:attribute name="ref" type="xs:QName"/>
   285 
   286   <xs:complexType name="ActivityRef">
   287     <xs:attribute ref="prov:ref"/>
   288   </xs:complexType>
   289   <xs:complexType name="EntityRef">
   290     <xs:attribute ref="prov:ref"/>
   291   </xs:complexType>
   292   <xs:complexType name="AgentRef">
   293     <xs:attribute ref="prov:ref"/>
   294   </xs:complexType>
   295   
   296   <xs:complexType name="DependencyRef">
   297     <xs:attribute ref="prov:ref"/>
   298   </xs:complexType>
   299   
   300   <xs:complexType name="NoteRef">
   301     <xs:attribute ref="prov:ref"/>
   302   </xs:complexType>
   303   
   304   <xs:complexType name="Dependencies">
   305     <xs:sequence>
   306       <xs:choice minOccurs="0" maxOccurs="unbounded">
   307 
   308             <xs:element name="used"                 type="prov:Used"/>
   309             <xs:element name="wasGeneratedBy"       type="prov:WasGeneratedBy"/>
   310             <xs:element name="wasStartedBy"         type="prov:WasStartedBy"/>
   311             <xs:element name="wasEndedBy"           type="prov:WasEndedBy"/>
   312             <xs:element name="wasInformedBy"        type="prov:WasInformedBy"/>
   313             <xs:element name="wasStartedByActivity" type="prov:WasStartedByActivity"/>
   314 
   315             <xs:element name="wasAttributedTo"      type="prov:WasAttributedTo"/>
   316             <xs:element name="wasAssociatedWith"    type="prov:WasAssociatedWith"/>
   317             <xs:element name="actedOnBehalfOf"      type="prov:ActedOnBehalfOf"/>
   318 
   319             <xs:element name="wasDerivedFrom"       type="prov:WasDerivedFrom"/>
   320             <xs:element name="wasRevisionOf"        type="prov:WasRevisionOf"/>
   321             <xs:element name="wasQuotedFrom"        type="prov:WasQuotedFrom"/>
   322             <xs:element name="hadOriginalSource"    type="prov:HadOriginalSource"/>
   323             <xs:element name="tracedTo"             type="prov:TracedTo"/>
   324 
   325             <xs:element name="alternateOf"          type="prov:AlternateOf"/>
   326             <xs:element name="specializationOf"     type="prov:SpecializationOf"/>
   327 
   328             <xs:element name="hasAnnotation"        type="prov:HasAnnotation"/>
   329       </xs:choice>
   330       <xs:element ref="prov:extraDependency" minOccurs="0" maxOccurs="unbounded" />
   331       
   332     </xs:sequence>
   333   </xs:complexType>
   334   
   335   <xs:element name="extraDependency" abstract="true" />
   336   <xs:element name="extraRecord" abstract="true" />
   337   
   338   <!-- BUNDLES -->
   339   
   340   <xs:element name="account" type="prov:Account"/>
   341   <xs:complexType name="Account">
   342     <xs:sequence>
   343       <xs:element name="asserter" type="prov:AgentRef"  minOccurs="0" maxOccurs="unbounded"/>
   344       <xs:element ref="prov:records"  minOccurs="1" maxOccurs="1"/>
   345     </xs:sequence>
   346     <xs:attribute ref="prov:id"/>
   347   </xs:complexType>
   348   
   349   <xs:element name="container" type="prov:Container">
   350     <xs:annotation>
   351       <xs:documentation>A set of assertions about the provenance of things</xs:documentation>
   352     </xs:annotation>
   353   </xs:element>
   354   
   355   <!-- a wrapper element for all records, used in Container or Account -->
   356   <xs:element name="records" type="prov:Records"/>
   357   <xs:complexType name="Records">
   358     <xs:sequence>
   359       <xs:element ref="prov:account"  minOccurs="0" maxOccurs="unbounded"/>
   360       <xs:element ref="prov:activity" minOccurs="0" maxOccurs="unbounded"/>
   361       <xs:element ref="prov:entity"   minOccurs="0" maxOccurs="unbounded"/>
   362       <xs:element ref="prov:agent"    minOccurs="0" maxOccurs="unbounded"/>
   363       <xs:element ref="prov:note"     minOccurs="0" maxOccurs="unbounded"/>
   364       <xs:element name="dependencies" type="prov:Dependencies" minOccurs="0"/>
   365       <xs:element ref="prov:extraRecord" minOccurs="0" maxOccurs="unbounded"/>
   366     </xs:sequence>
   367     <xs:attribute ref="prov:id"/>
   368   </xs:complexType>
   369   
   370   <xs:complexType name="Container">
   371     <xs:sequence>
   372       <xs:element ref="prov:records"  minOccurs="1" maxOccurs="1"/>
   373     </xs:sequence>
   374     <xs:attribute ref="prov:id"/>
   375     <!-- tentative, this could allow us to annotate containers ... -->
   376   </xs:complexType>
   377   
   378   
   379   
   380   
   381   
   382   
   383   
   384   
   385   
   386 </xs:schema>