<?xml version="1.0" encoding="UTF-8"?>
<!--

This Schema defines the representation of genomic sequences and features.

Author: Brian King (bking@animorphics.net)

-->
<schema targetNamespace="http://www.biodas.org/names/annotation" xmlns:ls="http://www.i3c.org/names/core" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://www.biodas.org/names/annotation">
   <annotation>
      <documentation>This Schema defines the representation of genomic sequences and features.

Author: Brian King (bking@animorphics.net)</documentation>
   </annotation>
   <import namespace="http://www.i3c.org/names/core" schemaLocation="lscore.xsd"/>
   <element name="Feature" type="tns:Feature"/>
   <complexType name="Feature">
      <sequence>
         <element ref="tns:Type" minOccurs="0"/>
         <element name="Features" minOccurs="0">
            <complexType>
               <sequence>
                  <element ref="tns:Feature" minOccurs="0" maxOccurs="unbounded"/>
               </sequence>
            </complexType>
         </element>
      </sequence>
      <attribute ref="ls:lsid"/>
   </complexType>
   <element name="Segment" type="tns:Segment">
      <annotation>
         <documentation>A Segment is any physical sequence such as a Chromosome, Contig, or BAC.</documentation>
      </annotation>
   </element>
   <complexType name="Segment">
      <sequence>
         <element name="View" minOccurs="0">
            <annotation>
               <documentation>A View is a way to divide the features of large segments among multiple documents.  The View specifies the range in which features appear.</documentation>
            </annotation>
            <complexType>
               <complexContent>
                  <extension base="tns:Location"/>
               </complexContent>
            </complexType>
         </element>
         <element name="Assembly" minOccurs="0">
            <annotation>
               <documentation>an assembly or ordering of segments that tile the parent segment.  Use the TileLocation to provide a position for the segments within the parent.</documentation>
            </annotation>
            <complexType>
               <sequence>
                  <element ref="tns:Contig" maxOccurs="unbounded"/>
               </sequence>
            </complexType>
         </element>
         <element name="Features" minOccurs="0">
            <complexType>
               <sequence>
                  <element ref="tns:Feature" minOccurs="0" maxOccurs="unbounded"/>
               </sequence>
            </complexType>
         </element>
         <element ref="tns:Code" minOccurs="0"/>
         <element name="Tiling" minOccurs="0">
            <complexType>
               <sequence>
                  <element ref="tns:TileLocation" minOccurs="0" maxOccurs="unbounded"/>
               </sequence>
            </complexType>
         </element>
      </sequence>
      <attribute ref="ls:lsid"/>
      <attribute ref="tns:length"/>
   </complexType>
   <element name="TileLocation" type="tns:TileLocation">
      <annotation>
         <documentation>Locates a segment within a parent segment.</documentation>
      </annotation>
   </element>
   <complexType name="TileLocation">
      <complexContent>
         <extension base="tns:Location">
            <attribute name="substart" type="integer">
               <annotation>
                  <documentation>The start point of the sub-segment that aligns with a point on its parent.  The parent start point is specified with the "start" attribute.</documentation>
               </annotation>
            </attribute>
         </extension>
      </complexContent>
   </complexType>
   <element name="Code" type="string">
      <annotation>
         <documentation>Code string representing a molecular sequence</documentation>
      </annotation>
   </element>
   <element name="Chromosome" type="tns:Chromosome">
      <annotation>
         <documentation>The chromosome contains sub-assemblies of DNA such as contigs or BACs.</documentation>
      </annotation>
   </element>
   <complexType name="Chromosome">
      <complexContent>
         <extension base="tns:Segment">
            <attribute name="number" type="string" use="optional">
               <annotation>
                  <documentation>The chromosome identifier, for example, "1", "2", "X".</documentation>
               </annotation>
            </attribute>
         </extension>
      </complexContent>
   </complexType>
   <element name="Contig" type="tns:Contig">
      <annotation>
         <documentation/>
      </annotation>
   </element>
   <complexType name="Contig">
      <complexContent>
         <extension base="tns:Segment"/>
      </complexContent>
   </complexType>
   <complexType name="DataSource">
      <sequence>
         <element name="description" type="string"/>
      </sequence>
      <attribute name="lsid" type="ls:lsid"/>
   </complexType>
   <element name="Type" type="tns:Type">
      <annotation>
         <documentation/>
      </annotation>
   </element>
   <complexType name="Type">
      <attribute name="system" type="string"/>
      <attribute name="id" type="ls:lsid"/>
   </complexType>
   <!-- common attributes -->
   <attribute name="start" type="integer">
      <annotation>
         <documentation>type should be positiveInteger but IBM's WSTK doesnt' recognize it.</documentation>
      </annotation>
   </attribute>
   <attribute name="length" type="integer">
      <annotation>
         <documentation>type should be positiveInteger but IBM's WSTK doesnt' recognize it.</documentation>
      </annotation>
   </attribute>
   <attribute name="orientation">
      <simpleType>
         <restriction base="string">
            <enumeration value="+"/>
            <enumeration value="-"/>
            <enumeration value="none"/>
         </restriction>
      </simpleType>
   </attribute>
   <!-- location definition -->
   <element name="Location" type="tns:Location"/>
   <complexType name="Location">
      <annotation>
         <documentation>A contiguous region of 
sequence.</documentation>
      </annotation>
      <attribute ref="tns:start" use="required">
         <annotation>
            <documentation>the start position in the container 
coordinate system.</documentation>
         </annotation>
      </attribute>
      <attribute ref="tns:length" default="1"/>
      <attribute ref="tns:orientation" use="optional">
         <annotation>
            <documentation>indicates the orientation within the 
sequence</documentation>
         </annotation>
      </attribute>
   </complexType>
</schema>

