XSDFile

ControlFile.xsd :
<?xml version = "1.0" encoding = "ISO-8859-1"?>

<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
              targetNamespace = "http://Grinder.ucsc.edu"
              xmlns = "http://Grinder.ucsc.edu"
              elementFormDefault = "qualified"
>
   <xsd:simpleType name = "KeyspaceName">
      <xsd:restriction base = "xsd:string">
         <xsd:maxLength value = "30"/>
         <xsd:pattern value = "([^{}])+"/>
         <xsd:whiteSpace value = "preserve"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:simpleType name = "MixedText">
      <xsd:annotation>
         <xsd:documentation>
            Describes a text field that <b>can</b> have Keyword text, but can have
            other text instead, or as well.  May have no characters.  If
            it has an '{' it must have a matching '}', and it must be a keyword.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base = "xsd:string">
         <xsd:pattern value = "([^{]*|\{[^\-][^}]*\})+"/>
         <xsd:whiteSpace value = "preserve"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:simpleType name = "MixedTextCollapse">
      <xsd:restriction base = "MixedText">
         <xsd:pattern value = "([^{]*|\{[^\-][^}]*\})+"/>
         <xsd:whiteSpace value = "collapse"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:simpleType name = "KeywordAndMixed">
      <xsd:annotation>
         <xsd:documentation>
            Describes a text field that <b>must</b> have Keyword text,
            and can have other text as well.  Format is:
            (Optional random text){Keyword}(Optional random text w/ or w/o keywords)
         </xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base = "MixedText">
         <xsd:pattern value = "[^{]*\{[^\-][^}]*\}([^{]*|\{[^\-][^}]*\})*"/>
         <xsd:whiteSpace value = "preserve"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:complexType name = "KeyField">
      <xsd:simpleContent>
         <xsd:extension base = "KeywordAndMixed">
            <xsd:attribute name = "splitter" type = "xsd:string" use = "optional"/>
         </xsd:extension>
      </xsd:simpleContent>
   </xsd:complexType>

   <xsd:simpleType name = "KeywordOnly">
      <xsd:annotation>
         <xsd:documentation>
            User defined keywords cannot contain a '-' in their names.  The
            '-' is strictly reserved for saying "This column, minus the following
            text".  They also cannot contain a "}".  Anything else is allowed.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base = "KeywordAndMixed">
         <xsd:pattern value = "\{[^}\-]+\}"/>
         <xsd:whiteSpace value = "preserve"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:simpleType name = "MultType">
      <xsd:restriction base = "xsd:string">
         <xsd:length value = "3"/>
         <xsd:pattern value = "[1M]-[1M]"/>
      </xsd:restriction>
   </xsd:simpleType>

   <xsd:element name = "ControlFile">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref = "UserKeywords" minOccurs = "0"/>
            <xsd:element name = "DataFile" type = "xsd:string"/>
            <xsd:element ref = "FTP" minOccurs = "0"/>
            <xsd:element ref = "Separator" minOccurs = "0"/>
            <xsd:element ref = "Ignore" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element ref = "IgnoreLines" minOccurs = "0"/>
            <xsd:element ref = "IgnoreIfColumn" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element name = "DoneIfBeginsWith" type = "xsd:string" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element ref = "KeyDefinitions" minOccurs = "0"/>
            <xsd:element ref = "Keyspace" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element ref = "Mapping" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element ref = "GeneSetFamily" minOccurs = "0" maxOccurs = "unbounded"/>
            <xsd:element ref = "GeneSets" minOccurs = "0"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "UserKeywords">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref = "Keyword" minOccurs = "1" maxOccurs = "unbounded"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "Keyword">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name = "Key" type = "KeywordOnly"/>
            <xsd:element name = "Definition" type = "xsd:string"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "IgnoreIfColumn">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name = "Column" type = "xsd:positiveInteger"/>
            <xsd:choice>
               <xsd:element name = "IgnoreIfContains" type = "xsd:string"/>
               <xsd:element name = "IgnoreIfIs" type = "xsd:string"/>
               <xsd:element name = "IgnoreIfIsNot" type = "xsd:string"/>
            </xsd:choice>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "KeyDefinitions">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref = "Key" minOccurs = "1" maxOccurs = "unbounded"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "Key">
      <xsd:annotation>
         <xsd:documentation>
            Key Definitions are limited to names of 30 or fewer characters,
            on the grounds that a longer name would be silly.  They cannot
            contain any Keywords in them.
            They exist at all because most will be used more than once in any
            given file.   Because if they're in a keyspace, they're also going
            to be in a mapping.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name = "Name" type = "KeyspaceName"/>
            <xsd:element name = "Definition" type = "KeyField"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "Keyspace">
      <xsd:complexType>
         <xsd:all>
            <xsd:element ref = "Name"/>
            <xsd:element name = "Species" type = "MixedText"/>
            <xsd:element ref = "Description"/>
            <xsd:element ref = "Type" minOccurs = "0"/>
            <xsd:element ref = "URL" minOccurs = "0"/>
            <xsd:element ref = "FTP" minOccurs = "0"/>
            <xsd:element ref = "KeyInfo"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "Type">
      <xsd:complexType>
         <xsd:choice>
            <xsd:element name = "Gene" type = "xsd:boolean" fixed = "true"/>
            <xsd:element name = "DNA_Probe" type = "xsd:boolean" fixed = "true"/>
            <xsd:element name = "RNA_Probe" type = "xsd:boolean" fixed = "true"/>
            <xsd:element name = "Protein_Domain" type = "xsd:boolean" fixed = "true"/>
            <xsd:element name = "Categorization" type = "xsd:boolean" fixed = "true"/>
            <xsd:element name = "microRNA" type = "xsd:boolean" fixed = "true"/>
         </xsd:choice>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "KeyInfo">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref = "KeyName"/>
            <xsd:element name = "KeyDescription" type = "MixedText"/>
            <xsd:element name = "ID" type = "xsd:unsignedInt" minOccurs = "0"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "Mapping">
      <xsd:complexType>
         <xsd:all>
            <xsd:element ref = "Name"/>
            <xsd:element ref = "Description" minOccurs = "0"/>
            <xsd:element ref = "URL" minOccurs = "0"/>
            <xsd:element ref = "FTP" minOccurs = "0"/>
            <xsd:element ref = "AddNew" minOccurs = "0"/>
            <xsd:element name = "DownloadDate" type = "xsd:dateTime" minOccurs = "0"/>
            <xsd:element name = "Quality" type = "xsd:positiveInteger" minOccurs = "0"/>
            <xsd:element ref = "MapData"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "MapData">
      <xsd:complexType>
         <xsd:choice>
            <xsd:element ref = "MapPair"/>
            <xsd:element ref = "MapFamily" minOccurs = "2" maxOccurs = "unbounded"/>
         </xsd:choice>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "MapPair">
      <xsd:complexType>
         <xsd:all>
            <xsd:element name = "SourceKeyspace" type = "MixedTextCollapse"/>
            <xsd:element name = "SourceKeys" type = "KeyspaceName"/>
            <xsd:element name = "TargetKeyspace" type = "MixedTextCollapse"/>
            <xsd:element name = "TargetKeys" type = "KeyspaceName"/>
            <xsd:element ref = "Bidirectional" minOccurs = "0"/>
            <xsd:element name = "Multiplicity" type = "MultType" minOccurs = "0"/>
            <xsd:element name = "SourceDescription" type = "xsd:string" minOccurs = "0"/>
            <xsd:element name = "TargetDescription" type = "xsd:string" minOccurs = "0"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "MapFamily">
      <xsd:complexType>
         <xsd:all>
            <xsd:element name = "KeyspaceName" type = "MixedTextCollapse"/>
            <xsd:element ref = "KeyName"/>
            <xsd:element name = "ExtraKeyDescription" type = "xsd:string" minOccurs = "0"/>
            <xsd:element ref = "MultiMap" minOccurs = "0"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "GeneSetFamily">
      <xsd:annotation>
         <xsd:documentation>
            Gene Familes are how we organize Gene Sets.  An example would be KEGG,
            or GO.  The UserID field is filled in if it is a User Family rather than
            a System family.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:all>
            <xsd:element ref = "Name"/>
            <xsd:element ref = "Description"/>
            <xsd:element name = "UserID" type = "xsd:anyURI" minOccurs = "0"/>
            <xsd:element ref = "URL" minOccurs = "0"/>
            <xsd:element ref = "FTP" minOccurs = "0"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "GeneSets">
      <xsd:annotation>
         <xsd:documentation>
            A way to group some keys from one or more Keyspaces together.  Names are
            unique.  If you have multiple listings with the same name, the items will be
            joined into a single set.  In the Interaction Browser you will be able to change
            its display name to something else, that doesn't have to be unique.
            The KeyspaceName tells what Keyspace the set's items are in.
            Specify a UserID (user's email address) if it's a User set that shouldn't be
            available to other users.  User sets are deleted a week after their last use.
            NameCol defaults to 1 (first column), DataStartCol defaults to NameCol + 1,
            and DataStartCol, if specified, <b>must</b> be greater than NameCol.
            ExtraDescription gives the description that will be added to set elements
            that are not currently in the database.  If you don't want those elements
            added to the database, simply do not define an ExtraDescription.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:all>
            <xsd:element name = "Family" type = "MixedTextCollapse" minOccurs = "0"/>
            <xsd:element name = "KeyspaceName" type = "MixedTextCollapse"/>
            <xsd:element name = "UserID" type = "xsd:anyURI" minOccurs = "0"/>
            <xsd:element name = "NameCol" type = "xsd:positiveInteger" minOccurs = "0"/>
            <xsd:element name = "DataStartCol" type = "xsd:positiveInteger" minOccurs = "0"/>
            <xsd:element name = "ExtraDescription" type = "xsd:string" minOccurs = "0"/>
         </xsd:all>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name = "FTP" type = "xsd:anyURI"/>
   <xsd:element name = "Separator" type = "xsd:string"/>
   <xsd:element name = "Ignore" type = "xsd:string"/>
   <xsd:element name = "IgnoreLines" type = "xsd:nonNegativeInteger"/>
   <xsd:element name = "Name" type = "MixedTextCollapse"/>
   <xsd:element name = "KeyName" type = "KeyspaceName"/>
   <xsd:element name = "Description" type = "MixedTextCollapse"/>
   <xsd:element name = "URL" type = "xsd:anyURI"/>
   <xsd:element name = "AddNew" type = "xsd:boolean" fixed = "true"/>
   <xsd:element name = "Bidirectional" type = "xsd:boolean" fixed = "true"/>
   <xsd:element name = "MultiMap" type = "xsd:boolean" fixed = "true"/>
<!--
   <xsd:element name = "DataFile" type = "xsd:string"/>
   <xsd:element name = "Species" type = "MixedText"/>
   <xsd:element name = "KeyDescription" type = "KeyField"/>
   <xsd:element name = "ID" type = "xsd:unsignedInt"/>
   <xsd:element name = "DownloadDate" type = "xsd:dateTime"/>
   <xsd:element name = "Quality" type = "xsd:positiveInteger"/>
   <xsd:element name = "SourceKeyspace" type = "MixedText"/>
   <xsd:element name = "TargetKeyspace" type = "MixedText"/>
   <xsd:element name = "SourceKeys" type = "KeyField"/>
   <xsd:element name = "TargetKeys" type = "KeyField"/>
   <xsd:element name = "Multiplicity" type = "MultType"/>
   <xsd:element name = "SourceDescription" type = "xsd:string"/>
   <xsd:element name = "TargetDescription" type = "xsd:string"/>
 -->
</xsd:schema>

-- Main.gregd - 17 Jul 2007