sequence mappings and DbRef mapping objects unified and source binding for castor...
[vamsas.git] / schemas / vamsas.xsd
index cdbc003..946b609 100644 (file)
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by MSD (EMBL OUTSTATION THE EBI WELLCOME TRUST GENOME CAMPUS) -->
 <!-- edited with XMLSpy v2006 sp1 U (http://www.altova.com) by ioh[ (o[ih[oh) -->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vamsas="http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes" targetNamespace="http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes" elementFormDefault="qualified" attributeFormDefault="unqualified">
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       xmlns:vamsas="http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes"
+       targetNamespace="http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes" elementFormDefault="qualified"
+       attributeFormDefault="unqualified">
        <xs:annotation>
                <xs:documentation> Vorba ID - Vamsas Object Request Broker Address ID (name needs to be
                        worked on): Suggest it could be of the form documentRoot/datasetName/SequenceUID for a
                                </xs:element>
                                <xs:element name="treenode" minOccurs="0" maxOccurs="unbounded">
                                        <xs:annotation>
-                                               <xs:documentation>
-                                                       node identity and mapping data between tree representations and vamsas document objects
-                                               </xs:documentation>
+                                               <xs:documentation> node identity and mapping data between tree
+                                                       representations and vamsas document objects </xs:documentation>
                                        </xs:annotation>
                                        <xs:complexType>
                                                <xs:complexContent>
                                                        <xs:extension base="vamsas:nodeType">
                                                                <xs:attribute name="treeId" type="xs:IDREFS">
                                                                        <xs:annotation>
-                                                                               <xs:documentation>
-                                                                                       reference to one or more trees containing the node being described.
-                                                                               </xs:documentation>
+                                                                               <xs:documentation> reference to one or more trees containing
+                                                                                       the node being described. </xs:documentation>
                                                                        </xs:annotation>
                                                                </xs:attribute>
                                                                <xs:attribute name="nodespec" type="xs:string">
                                                                        <xs:annotation>
-                                                                               <xs:documentation>
-                                                                                       String uniquely identifying a particular node in the referenced tree according to the format of the tree representation that is referenced.
+                                                                               <xs:documentation> String uniquely identifying a particular
+                                                                                       node in the referenced tree according to the format of
+                                                                                       the tree representation that is referenced.
                                                                                </xs:documentation>
                                                                        </xs:annotation>
                                                                </xs:attribute>
-                                                               
+
                                                        </xs:extension>
                                                </xs:complexContent>
                                        </xs:complexType>
        </xs:element>
        <xs:complexType name="referenceType">
                <xs:annotation>
-                       <xs:documentation>
-                               base type for citing arbitrary links between vamsas objects
+                       <xs:documentation> base type for citing arbitrary links between vamsas objects
                        </xs:documentation>
                </xs:annotation>
                <xs:simpleContent>
                        <xs:extension base="xs:string">
                                <xs:annotation>
-                                       <xs:documentation>
-                                               Optional human readable description of the relationship
+                                       <xs:documentation> Optional human readable description of the relationship
                                        </xs:documentation>
                                </xs:annotation>
                                <xs:attribute name="id" type="xs:ID" use="optional">
                                        <xs:annotation>
-                                               <xs:documentation> Primary Key for vamsas object referencing </xs:documentation>
+                                               <xs:documentation> Primary Key for vamsas object referencing
+                                               </xs:documentation>
                                        </xs:annotation>
                                </xs:attribute>
                                <xs:attribute name="refs" type="xs:IDREFS">
                                        <xs:annotation>
-                                               <xs:documentation>List of one or more vamsas object references</xs:documentation>
+                                               <xs:documentation>List of one or more vamsas object
+                                               references</xs:documentation>
                                        </xs:annotation>
                                </xs:attribute>
                        </xs:extension>
                        </xs:element>
                        <xs:element name="vref" type="vamsas:referenceType" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
-                                       <xs:documentation>Direct associations between this node and any vamsas objects</xs:documentation>
+                                       <xs:documentation>Direct associations between this node and any vamsas
+                                       objects</xs:documentation>
                                </xs:annotation>
                        </xs:element>
                        <xs:element ref="vamsas:property" minOccurs="0" maxOccurs="unbounded"/>
                                                <xs:complexType>
                                                        <xs:simpleContent>
                                                                <xs:extension base="xs:float">
-                                                                       <xs:attribute name="name" type="xs:string" use="optional" default="score"/>
+                                                                       <xs:attribute name="name" type="xs:string" use="optional"
+                                                                               default="score"/>
                                                                </xs:extension>
                                                        </xs:simpleContent>
                                                </xs:complexType>
                                                                        <xs:documentation> Did what </xs:documentation>
                                                                </xs:annotation>
                                                        </xs:element>
-                                                       <xs:element name="Date" type="xs:dateTime"> 
+                                                       <xs:element name="Date" type="xs:dateTime">
                                                                <xs:annotation>
                                                                        <xs:documentation> When</xs:documentation>
                                                                </xs:annotation>
        <xs:element name="DataSet">
                <xs:complexType>
                        <xs:annotation>
-                               <xs:documentation> A collection of sequences, alignments, trees and other things.
+                               <xs:documentation> A collection of sequences, alignments, trees and other things. </xs:documentation>
+                               <xs:documentation> TODO: Add a title field and properties for programs that can
+                                       present the user with different distinct datasets For the moment, the program
+                                       just presents them as a list and perhaps lets the user work out which dataset it
+                                       wants based on the alignments that it contains. (Dominik and Jim 7th June 2007)
                                </xs:documentation>
                        </xs:annotation>
                        <xs:sequence>
                                                                                </xs:annotation>
                                                                                <xs:complexType>
                                                                                        <xs:sequence>
-                                                                                               <xs:element name="map" minOccurs="0" maxOccurs="unbounded">
-                                                                                                       <xs:annotation>
-                                                                                                               <xs:documentation> From: Offset to first
-                                                                                                               position in dataset sequence record that
-                                                                                                               this database entry maps to To: Offset
-                                                                                                               to last position in dataset sequence
-                                                                                                               record that this database entry maps to
-                                                                                                               Start: Offset to first last position in
-                                                                                                               database entry that first (or offset)
-                                                                                                               position in sequence maps to End: Offset
-                                                                                                               to last position in database entry that
-                                                                                                               last (offset) position in sequence maps
-                                                                                                               to </xs:documentation>
-                                                                                                       </xs:annotation>
-                                                                                                       <xs:complexType>
-                                                                                                               <xs:complexContent>
-                                                                                                                       <xs:extension base="vamsas:mapList"/>
-                                                                                                               </xs:complexContent>
-                                                                                                       </xs:complexType>
+                                                                                               <xs:element name="map" minOccurs="0"
+                                                                                               maxOccurs="1">
+                                                                                               <xs:annotation>
+                                                                                               <xs:documentation>
+                                                                                                       the local mapType maps from the parent
+                                                                                                       sequence coordinate frame to the reference
+                                                                                                       frame defined by the dbRef element.
+                                                                                                       The mapped mapType is the mapped range defined
+                                                                                                       on the dbRef element's reference frame.
+                                                                                                       Conventionally, the unit attribute defaults to 1, or
+                                                                                                       will be inferred from the local sequence's
+                                                                                                       dictionary type and any dictionary type associated
+                                                                                                       with the database being mapped to. 
+                                                                                                       However, it may be used to avoid ambiguity.
+                                                                                               </xs:documentation>
+                                                                                               </xs:annotation>
+                                                                                               <xs:complexType>
+                                                                                               <xs:complexContent>
+                                                                                                       <xs:extension base="vamsas:mapType">
+                                                                                                               <xs:attribute name="id" type="xs:ID"/>
+                                                                                                       </xs:extension>
+                                                                                               </xs:complexContent>
+                                                                                               </xs:complexType>
                                                                                                </xs:element>
-                                                                                               <xs:element ref="vamsas:link" minOccurs="0" maxOccurs="unbounded"/>
-                                                                                               <xs:element ref="vamsas:property" minOccurs="0" maxOccurs="unbounded"/>
+                                                                                               <xs:element ref="vamsas:link" minOccurs="0"
+                                                                                               maxOccurs="unbounded"/>
+                                                                                               <xs:element ref="vamsas:property" minOccurs="0"
+                                                                                               maxOccurs="unbounded"/>
                                                                                        </xs:sequence>
-                                                                                       <xs:attribute name="source" type="xs:string" use="required">
+                                                                                       <xs:attribute name="source" type="xs:string"
+                                                                                               use="required">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> TODO Database Naming
+                                                                                               <xs:documentation> TODO Database Naming
                                                                                                Convention: either start using LSID (so
                                                                                                change type to URI) or leave this as an
                                                                                                uncontrolled/unspecified string ID
                                                                                                </xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
-                                                                                       <xs:attribute name="version" type="xs:string" use="required">
+                                                                                       <xs:attribute name="version" type="xs:string"
+                                                                                               use="required">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> Version must be specified -
+                                                                                               <xs:documentation> Version must be specified -
                                                                                                </xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
-                                                                                       <xs:attribute name="accessionId" type="xs:string" use="required">
+                                                                                       <xs:attribute name="accessionId" type="xs:string"
+                                                                                               use="required">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> TODO: make some specification
+                                                                                               <xs:documentation> TODO: make some specification
                                                                                                of the database field from which this
                                                                                                accessionId is taken from - should that be a
                                                                                                special property of the dbRef object ?
                                                                                        </xs:attribute>
                                                                                        <xs:attribute name="id" type="xs:ID" use="optional">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> Primary Key for vamsas object
+                                                                                               <xs:documentation> Primary Key for vamsas object
                                                                                                referencing </xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
                                                                                </xs:complexType>
                                                                        </xs:element>
-                                                                       <xs:element name="vxref" type="vamsas:referenceType" minOccurs="0" maxOccurs="unbounded">
+                                                                       <xs:element name="vxref" type="vamsas:referenceType"
+                                                                               minOccurs="0" maxOccurs="unbounded">
                                                                                <xs:annotation>
-                                                                                       <xs:documentation>
-                                                                                               explicitly named cross reference to other objects in the document.
-                                                                                       </xs:documentation>
+                                                                                       <xs:documentation> explicitly named cross reference to
+                                                                                               other objects in the document. </xs:documentation>
                                                                                </xs:annotation>
                                                                        </xs:element>
                                                                </xs:sequence>
                                </xs:element>
                                <xs:element name="sequenceMapping" minOccurs="0" maxOccurs="unbounded">
                                        <xs:complexType>
-                                               <xs:sequence>
-                                                       <xs:element name="range" maxOccurs="unbounded">
-                                                               <xs:complexType>
-                                                                       <xs:attribute name="seqAStart" type="xs:int"/>
-                                                                       <xs:attribute name="seqAEnd" type="xs:int"/>
-                                                                       <xs:attribute name="seqBStart" type="xs:int"/>
-                                                                       <xs:attribute name="seqBEnd" type="xs:int"/>
-                                                               </xs:complexType>
-                                                       </xs:element>
-                                                       <xs:element ref="vamsas:Provenance"/>
-                                               </xs:sequence>
-                                               <xs:attribute name="sequenceA" type="xs:IDREF" use="required"/>
-                                               <xs:attribute name="sequenceB" type="xs:IDREF" use="required"/>
-                                               <xs:attribute name="id" type="xs:ID" use="optional"/>
+                                               <xs:annotation>
+                                                       <xs:documentation> 
+                                                               A mapping between the specified 'local' and 'mapped' sequence coordinate frames. 
+                                                               The step size between each coordinate frame depends on the sequence
+                                                               dictionary types, or alternatively specified in the optional unit
+                                                               attribute on each range element. </xs:documentation>
+                                               </xs:annotation>
+                                               <xs:complexContent>
+                                                       <xs:extension base="vamsas:mapType">
+                                                               <xs:sequence>
+                                                                       <xs:element ref="vamsas:Provenance"/>
+                                                               </xs:sequence>
+                                                               <xs:attribute name="loc" type="xs:IDREF" use="required">
+                                                                       <xs:annotation>
+                                                                               <xs:documentation> Object on which the local
+                                                                                       range is defined. </xs:documentation>
+                                                                       </xs:annotation>
+                                                               </xs:attribute>
+                                                               <xs:attribute name="map" type="xs:IDREF" use="required">
+                                                                       <xs:annotation>
+                                                                               <xs:documentation>Object on which the mapped
+                                                                                       range is defined. </xs:documentation>
+                                                                       </xs:annotation>
+                                                               </xs:attribute>
+                                                               <xs:attribute name="id" type="xs:ID" use="optional"/>
+                                                       </xs:extension>
+                                               </xs:complexContent>
                                        </xs:complexType>
                                </xs:element>
                                <xs:element name="DataSetAnnotations" minOccurs="0" maxOccurs="unbounded">
                                <xs:element name="Alignment" minOccurs="0" maxOccurs="unbounded">
                                        <xs:complexType>
                                                <xs:sequence>
-                                                       <xs:element name="AlignmentAnnotation" minOccurs="0" maxOccurs="unbounded">
+                                                       <xs:element name="AlignmentAnnotation" minOccurs="0"
+                                                               maxOccurs="unbounded">
                                                                <xs:annotation>
                                                                        <xs:documentation> This is annotation over the coordinate frame
                                                                                defined by all the columns in the alignment.
                                                                                        <xs:sequence>
                                                                                                <xs:element ref="vamsas:Provenance"/>
                                                                                        </xs:sequence>
-                                                                                       <xs:attribute name="graph" type="xs:boolean" use="required">
+                                                                                       <xs:attribute name="graph" type="xs:boolean"
+                                                                                               use="required">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> TODO: decide if this flag is
+                                                                                               <xs:documentation> TODO: decide if this flag is
                                                                                                redundant - when true it would suggest that
                                                                                                the annotationElement values together form a
                                                                                                graph </xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
-                                                                                       <xs:attribute name="seqrefs" type="xs:IDREFS" use="optional">
+                                                                                       <xs:attribute name="seqrefs" type="xs:IDREFS"
+                                                                                               use="optional">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> annotation is associated with a
-                                                                                                               range on a particular group of alignment sequences</xs:documentation>
+                                                                                               <xs:documentation> annotation is associated with
+                                                                                               a range on a particular group of alignment
+                                                                                               sequences</xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
-                                                                                       
+
                                                                                </xs:extension>
                                                                        </xs:complexContent>
                                                                </xs:complexType>
                                                                        <xs:complexContent>
                                                                                <xs:extension base="vamsas:SequenceType">
                                                                                        <xs:sequence>
-                                                                                               <xs:element name="AlignmentSequenceAnnotation" minOccurs="0" maxOccurs="unbounded">
-                                                                                                       <xs:complexType>
-                                                                                                               <xs:annotation>
-                                                                                                                       <xs:documentation> Annotate over
+                                                                                               <xs:element name="AlignmentSequenceAnnotation"
+                                                                                               minOccurs="0" maxOccurs="unbounded">
+                                                                                               <xs:complexType>
+                                                                                               <xs:annotation>
+                                                                                               <xs:documentation> Annotate over
                                                                                                positions and regions of the
                                                                                                ungapped sequence in the context of
                                                                                                the alignment </xs:documentation>
-                                                                                                                       <xs:documentation/>
-                                                                                                               </xs:annotation>
-                                                                                                               <xs:complexContent>
-                                                                                                                       <xs:extension base="vamsas:rangeAnnotation">
-                                                                                                                               <xs:sequence>
-                                                                                                                                       <xs:element ref="vamsas:Provenance"/>
-                                                                                                                               </xs:sequence>
-                                                                                                                               <xs:attribute name="graph" type="xs:boolean" use="required">
-                                                                                                                                       <xs:annotation>
-                                                                                                                                               <xs:documentation> TODO:
+                                                                                               <xs:documentation/>
+                                                                                               </xs:annotation>
+                                                                                               <xs:complexContent>
+                                                                                               <xs:extension
+                                                                                               base="vamsas:rangeAnnotation">
+                                                                                               <xs:sequence>
+                                                                                               <xs:element
+                                                                                               ref="vamsas:Provenance"/>
+                                                                                               </xs:sequence>
+                                                                                               <xs:attribute name="graph"
+                                                                                               type="xs:boolean" use="required">
+                                                                                               <xs:annotation>
+                                                                                               <xs:documentation> TODO:
                                                                                                decide if this flag is
                                                                                                redundant - when true it
                                                                                                would suggest that the
                                                                                                annotationElement values
                                                                                                together form a graph
                                                                                                </xs:documentation>
-                                                                                                                                       </xs:annotation>
-                                                                                                                               </xs:attribute>
-                                                                                                                       </xs:extension>
-                                                                                                               </xs:complexContent>
-                                                                                                               <!--                                                            
+                                                                                               </xs:annotation>
+                                                                                               </xs:attribute>
+                                                                                               </xs:extension>
+                                                                                               </xs:complexContent>
+                                                                                               <!--                                                            
                                                                                                                        This replaces the flat list of sequenceFeatures.
                                                                                                                        <xs:element name="AlignmentFeatures" minOccurs="0" maxOccurs="unbounded"><xs:complexType><xs:annotation>
                                                                                                                        <xs:documentation>Annotate over positions and regions of the alignment</xs:documentation>
                                                                                                                        </xs:attribute>
                                                                                                                        </xs:extension>
                                                                                                                        </xs:complexContent></xs:complexType></xs:element> -->
-                                                                                                       </xs:complexType>
+                                                                                               </xs:complexType>
                                                                                                </xs:element>
                                                                                        </xs:sequence>
                                                                                        <xs:attribute name="id" type="xs:ID" use="optional">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> Primary Key for vamsas object
+                                                                                               <xs:documentation> Primary Key for vamsas object
                                                                                                referencing </xs:documentation>
                                                                                                </xs:annotation>
                                                                                        </xs:attribute>
-                                                                                       <xs:attribute name="refid" type="xs:IDREF" use="required">
+                                                                                       <xs:attribute name="refid" type="xs:IDREF"
+                                                                                               use="required">
                                                                                                <xs:annotation>
-                                                                                                       <xs:documentation> Dataset Sequence from which
+                                                                                               <xs:documentation> Dataset Sequence from which
                                                                                                this alignment sequence is taken from
                                                                                                </xs:documentation>
                                                                                                </xs:annotation>
                                        <xs:complexType>
                                                <xs:simpleContent>
                                                        <xs:extension base="xs:string">
-                                                               <xs:attribute name="dict" type="xs:string" use="optional" default="utf8">
+                                                               <xs:attribute name="dict" type="xs:string" use="optional"
+                                                                       default="utf8">
                                                                        <xs:annotation>
                                                                                <xs:documentation> specifies the symbol dictionary for this
                                                                                        glyph - eg utf8 (the default), aasecstr_3 or
                                                                                        <xs:documentation> Data available to just a particular
                                                                                                user </xs:documentation>
                                                                                </xs:annotation>
-                                                                               <xs:attribute name="fullname" type="xs:string" use="required"/>
-                                                                               <xs:attribute name="organization" type="xs:string" use="required"/>
+                                                                               <xs:attribute name="fullname" type="xs:string"
+                                                                                       use="required"/>
+                                                                               <xs:attribute name="organization" type="xs:string"
+                                                                                       use="required"/>
                                                                        </xs:extension>
                                                                </xs:complexContent>
                                                        </xs:complexType>
                        <xs:element name="dataReference" type="xs:string"/>
                </xs:choice>
        </xs:complexType>
-       <xs:complexType name="mapList">
-               <xs:attribute name="from" type="xs:integer" use="optional" default="0">
-                       <xs:annotation>
-                               <xs:documentation> Offset to first position in dataset sequence record that start
-                                       position on 'onto' maps to </xs:documentation>
-                       </xs:annotation>
-               </xs:attribute>
-               <xs:attribute name="to" type="xs:integer" use="optional" default="0">
-                       <xs:annotation>
-                               <xs:documentation> Offset to last position in dataset sequence record that end
-                                       position on 'onto' maps to </xs:documentation>
-                       </xs:annotation>
-               </xs:attribute>
-               <xs:attribute name="start" type="xs:integer" use="required">
-                       <xs:annotation>
-                               <xs:documentation> Offset to first position in database entry that first (or offset)
-                                       position in sequence maps to </xs:documentation>
-                       </xs:annotation>
-               </xs:attribute>
-               <xs:attribute name="end" type="xs:integer" use="required">
-                       <xs:annotation>
-                               <xs:documentation> Offset to last position in database entry that last (offset)
-                                       position in sequence maps to </xs:documentation>
-                       </xs:annotation>
-               </xs:attribute>
+       <xs:complexType name="mapType">
+               <xs:annotation>
+                       <xs:documentation> Two sets of ranges defined between objects - usually sequences, indicating which
+                               regions on each are mapped. </xs:documentation>
+               </xs:annotation>
+               <xs:sequence>
+                       <xs:element name="local" type="vamsas:mapRangeType">
+                               <xs:annotation>
+                                       <xs:documentation>
+                                               
+                                       </xs:documentation>
+                               </xs:annotation>
+                       </xs:element>
+                       <xs:element name="mapped" type="vamsas:mapRangeType">
+                               <xs:annotation>
+                                       <xs:documentation>
+                                               
+                                       </xs:documentation>
+                               </xs:annotation>
+                       </xs:element>
+               </xs:sequence>
+               </xs:complexType>
+       
+       <xs:complexType name="mapRangeType">
+               <xs:complexContent>
+                       <xs:extension base="vamsas:rangeType">
+                               <xs:attribute name="unit" type="xs:positiveInteger" use="optional">
+                                       <xs:annotation>
+                                               <xs:documentation> number of dictionary symbol widths involved in each
+                                                       mapped position on this sequence (for example, 3 for a dna sequence exon
+                                                       region that is being mapped to a protein sequence). This is optional,
+                                                       since the unit can be usually be inferred from the dictionary type of
+                                                       each sequence involved in the mapping. </xs:documentation>
+                                       </xs:annotation>
+                               </xs:attribute>
+                       </xs:extension>
+               </xs:complexContent>    
        </xs:complexType>
+
        <xs:simpleType name="locks">
                <xs:annotation>
-                       <xs:documentation>
-                               Contains lock information:
-                               locktype:ApplicationHandle
-                               locktype is 'local' or 'full'
-                               A lock is only valid if the ApplicationHandle resolves to a living application in the vamsas session.
-                               A local lock means that the application has locked changes to all local properties on the object.
-                               A full lock means that the application has locked changes to all properties on the object, and any objects that it holds references to.
-                       </xs:documentation>
+                       <xs:documentation> Contains lock information: locktype:ApplicationHandle locktype is
+                               'local' or 'full' A lock is only valid if the ApplicationHandle resolves to a living
+                               application in the vamsas session. A local lock means that the application has
+                               locked changes to all local properties on the object. A full lock means that the
+                               application has locked changes to all properties on the object, and any objects that
+                               it holds references to. </xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:string"/>
        </xs:simpleType>