<?xml version="1.0" encoding="UTF-8"?>
<schema name="BioWarehouse Schema" version="4.5" xsi:noNamespaceSchemaLocation="../utils/xsd/db-schema.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!-- ========================================================================================== -->
    <!-- Change Log                                                                                 -->
    <!-- ========================================================================================== -->
    <!-- Key: TJL Tom Lee                                                                           -->
    <!--      VW  Valerie Wagner                                                                    -->
    <!--      NG  Nan Guo                                                                           -->
    <!--      YP  Yannick Pouliot                                                                   -->
    <!--      AK  Anish Kejariwal                                                                   -->
    <!--      DHD David Dunkley                                                                     -->
    <!-- ========================================================================================== -->
    <!--
    Change log:
    Date        Who  Change
    ==========  ===  =================================================================================
    2009-06-17  VW   4.6 release
    2009-06-15  VW   Added 'variant' enumeration to Feature.Class
    2009-06-08  VW   Added Feature.Variant column
    2009-0-05   TJL  Added index for BioSource.Strain
    2009-04-06  TJL  Changed '4.2' to '4.5' in Warehouse.Version column definitions
    2008-12-23  VW   4.5 release
    2008-10-06  VW   Changed DataSet.ReleaseDate to be of type "@datetime" (mysql="DATETIME" oracle="DATE")
    2008-09-22  VW   4.3 release for Purdue
    2008-05-22  TJL  Added DataSetHierarchy table
    2008-05-0   TJL  Indexed Citation.Citation; make Citation.PMID index initial.
    2008-05-01  TJL  Added enumeration Rank.subkingdom
    2008-04-04  VW   4.2 release
    2007-12-17  TJL  Shortened index name to TranscriptionUnitComponent_OW.
    2007-11-25  NG   Added EvidenceType column to Support table and enumeration descriptions.
    2007-05-25  TJL  Added documentation and enumeration descriptions; revised Feature position representation
    2007-05-18  TJL  Added 'terminator' enumeration to Feature and TranscriptionUnitComponent.
    2007-05-11  TJL  Added tables TranscriptionUnit and TranscriptionUnitComponent;
                       added columns RegionOrPoint, PointType to Feature
    2007-05-11  TJL  Upped version to 4.1
    2007-01-29  TJL  Made OtherWID column a primary key (and badly needed index) of Entry table
    2007-01-19  TJL  Shortened index name FlowCytometrySample_Measurement to FlowCytometrySample_Meas
    2006-11-29  TJL  Added general-purpose table RelatedTerm for associatng a term with an object
    2006-11-29  TJL  Added new tables for flow cytometry: LightSource, FlowCytometryProbe, FlowCytometrySample
    2006-11-29  TJL  Added BioSource columns Diseased, Disease, ATCCId.
    2006-11-29  TJL  Added ExperimentData.MageData
    2006-11-10  AK   Set WID_sequence to start at 1,000,000 so that reserved WIDS are from 1002 to 999,999
    2006-11-08  VW   Set starting value for WIDs at 999,999 to support reserved WID range
    2006-11-06  VW   Add Warehouse.MaxReservedWID column
    2006-11-06  DHD  Changed NucleicAcid.Class to a non-required column
    2006-11-02  VW   Changed Citation.Year to varchar (from date)
    2006-11-02  VW   Increased size of DBID.XID to 150
    2006-10-27  AK   Added tables, and altered tables to support 2D gel/spot data:
                     Added ExperimentRelationship, GelLocation, ProteinWIDSpotWID, Spot, SpotIdMethod, SpotWIDSpotIdMethodWID
                     Spots can have a DBID record, so added FK_DBID_Spot to Spot table
	                 GelLocations have a DBID record, so added FK_DBID_Experiment
	                 Added OtherWID to ExperimentData table
    2006-10-10  VW   Added BioSource.MAGEClass discriminator column
    2006-09-21  VW   Added GeneExpressionData table
    2006-09-20  VW   Removed PointOfContact table which is replaced by MAGE Contact table
    2006-08-29  TJL  Added Chemical.Class flag.
    2006-07-10  VW   Increased size of DBID.XID to 100
    2006-06-19  NG   Added Interaction and InteractionParticipant tables to store molecular interaction data.
    2006-06-19  NG   Modify PathwayReaction table to store not only relationships between pathway and reactions but
                     also relationships between molecular interaction network and interactions.
    2006-06-19  NG   Remove foreign key FK_PathwayReaction2.
    2006-06-07  TJL  Added Reaction.Name and CrossReference.Relationship
    2006-04-11  TJL  Upped version to 4.0 (the presumed number of next release)
    2006-06-05  VW   Clarified definition of CrossReference table
    2006-04-17  NG   Increase Feature.Description length to 1300, BioSource.Strain length to 220,
                     BioSource.Tissue length to 100, BioSubtype.Type length to 25 and Gene.GenomeID length to 35
    2006-04-11  TJL  Upped version to 3.6
    2005-12-09  TJL  Added Term.Hierarchical and Term.Root
    2005-11-03  TJL  Worked around bug 681 and commented the limitation
    2005-10-28  YP   Changed description of Division table at PK's request
    2005-08-31  TJL  Extended length of Support.Type to accomodate long BioCyc evidence codes
    2005-08-05  TJL  Added Location table
    2005-08-05  TJL  Upped version to 3.501
    2005-07-01       RELEASE 3.5
    2005-06-20  YP   Clarified NucleicAcid.MoleculeLength
    2005-06-14  YP   Updated NucleicAcid table to correct definitions of MoleculeLength, CumulativeLength,
                     MoleculeLengthApproximate and CumulativeLengthApproximate
    2005-06-14  VW   Made Citation.Citation nullable; updated URL to list of genetic codes in GeneticCode
    2005-06-09  YP   Added restriction to DBID and CrossReference that only keys which uniquely identify objects in the
                     referenced DB can be stored in these tables
    2005-06-07  YP   Clarified description of CrossReference.Type and DBID.Type;
    2005-06-02  VW   Increased size of Term.Name to 255
    2005-04-28  TJL  Added precision & scale to Warehouse.Version to support nonintegral version#s
                     Added FOREIGN KEY support for MySQL
    2005-04-28  VW   Added columns to DataSet: LoadedBy, Application, ApplicationVersion
    2005-04-15  TJL  Added a couple comments; moved TermRelationship to correct section; clarified coding region comments on Gene
    2005-04-04  VW   Added Term.Definition.  Replaced TermWIDParentWID with TermRelationship table.
    2004-12-07  YP   Removed Type='Name' from DBID and CrossReference, per meeting on 12/3/04
    2004-11-18  VW   Increased BioSource.Strain length to 50
    2004-10-22  YP   In NucleicAcid and Subsequence, I stated that Length and PercentGC can be calculated if they are not stated explicitely
    2004-09-22  YP   Added a note to description of Reaction table to indicate that only fully qualified EC numbers are stored in that table
    2004-09-22  YP   Refined description of Protein table to emphasize that it can store complexes, and that such entries do not have e.g. a sequence attached to them
    2004-09-22  VW   Removed NOT NULL requirement of Subsequence.FullSequence
    2004-09-22  YP   Corrected definition of NucleicAcid.Class
    2004-09-20  TJL  Changed name of table EnzReactionWIDChemicalWID to EnzReactionInhibitorActivator
    2004-09-20  TJL  Added EnzReactionAltCompound.Cofactor; recommented the EnzReaction* link tables.
    2004-09-20  TJL  Changed EnzReactionWIDChemicalWID.Chemical to EnzReactionAltCompound; changed table constraints to allow Proteins
    2004-09-15  VW   Changed type of Gene.Direction to varchar to reflect use of enumerated values
    2004-09-13  TJL  Updated 'SD' comments for OtherWID tables for 3.0 table changes
    2004-09-13  TJL  Variety of comment changes
    2004-09-10  TJL  Noted that Protein molecular weights are now stored in kiloDaltons.
    2004-08-31  YP   Upgraded description of BioSourceWIDGeneWID
    2004-08-26  YP   Further clarified definition of CrossReference.Type and DBID.Type at PK's request
    2004-08-23  YP   Further clarified definition of CrossReference.Type and DBID.Type at PK's request
    2004-08-20  YP   Clarified definition of CrossReference.Type and DBID.Type at PK's request
    2004-08-19  TJL  Added Support.DataSetWID.
    2004-08-19  TJL  Added DataSet.ChangeDate for future use by loaders.
    2004-08-19  TJL  Organized this file into sections
    2004-08-16  VW   Added Term.DataSetWID
    2004-08-06  TJL  Changed Protein.Name length spec to accomodate MySQL (1000 too big for VARCHAR)
    2004-07-20  TJL  Changed Type and Value column names in Subtype to drop the 'Subtype' portion of their name
    2004-07-20  TJL  Changed column names in NucleicAcid from CumulatedLengthApproximate to CumulativeLengthApproximate and CumulatedLength to CumulativeLength
    2004-07-18  TJL  Removed Protein.BioSourceWID
    2004-07-14  YP   Added examples of enumerated values for NucleicAcid.Class and NucleicAcid.Type, per request from Peter
    2004-07-11  TJL  Removed Organism table, and replaced all references to it with BioSource.
    2004-07-11  TJL  Made Gene.Name nullable.
    2004-07-10  TJL  Reinstated GeneWIDNucleicAcidWID, and clarified it associates a nucleic acid product
                     with the gene that produces it.
    2004-07-08  TJL  TODO: Should Protein.BiosourceWID be replaced by a linking table? ie. can one protein be in 1+ Biosources?
    2004-07-08  TJL  In GeneticCode: reduced max. lengths of TranslationTable and StartCodon to 64.
    2004-07-08  TJL  Added GeneticCode.NCBIID
    2004-07-08  TJL  Added NucleicAcid.Name
    2004-07-08  TJL  Added BioSource.Name
    2004-07-08  TJL  In BioSource and BioSubtype, changed varchar to @varchar
                      (ie in Oracle this will make those columns VARCHAR2 as recommended by Oracle)
    2004-07-06  TJL  Added Feature.Description
    2004-07-06  TJL  Added NucleicAcid.SubsequenceWID
    2004-07-06  TJL  Removed ProteinWIDFeatureWID and NucleicAcidWIDFeatureWID since relations are not many-many
                     Added Feature.SequenceWID and Feature.SequenceType to replace linking tables with 1-many relations
    2004-07-07  YP   Updated definition of molecule length, sequence length in NucleicAcid, per suggestions from Tom
    2004-07-01? TJL  Removed GeneWIDNucleicAcidWID since relation is not many-many
    2004-06-30  TJL  Changed Gene.NucleicAcidWID to nullable.
    2004-06-24  YP   Clarified comments for NucleicAcid and Subsequence; deleted NucleicAcid.Length and NucleicAcid.LengthApproximate
    2004-06-24  VW   Increased Protein.Name size to 1000 because some protein names are verbose descriptions
    2004-06-8   YP   Refined description of Feature.Class
    2004-06-1   YP   Changed NOT NULL to nullable for BioSource.TaxonWID
    2004-05-18  TJL  Changed CrossReference.DatasetName to DatabaseName
    2004-05-17  TJL  Added Warehouse.Description
    2004-05-17  TJL  Removed and replaced dangling references to Replicon
    2004-05-17  TJL  Added CrossWID to CrossReference; removed DatasetWID;
                     made XID nullable.
    2004-05-17  YP   Added Type to Gene
    2004-05-17  YP   Fixed Class/Type problem in NucleicAcid (bug 237)
    2004-05-17  YP   Allowed Protein.Name to be NULL
    2004-05-16  YP   Updated definition of Division to emphasize table is referring to a taxonomic usage of the term "Division", not its data organization usage
    2004-05-11  YP   Updated definitions of BioSubtype
    2004-05-10  YP   Updated definition of BioSource to emphasize dependency on Taxon to be populated prior to loading BioSource
    2004-05-10  YP   Changed definition of CrossReference to enable the association of sequences within the SAME dataset to each other
    2004-05-04  YP   Added new fields StartPositionApproximate and EndPositionApproximate to Feature
    2004-05-04  YP   Added new fields CodingRegionStart and CodingRegionEndApproximate to Gene (again!)
    2004-04-28  TJL  Replaced GeneWIDRepliconWID table with GeneWIDNucleicAcidWID table..
                     Replaced all refs to RepliconWID with NucleicAcidWID.
                     Replaced refs to Replicon table in structured comments with NucleicAcid.
    2004-04-26  YP   Clarified various definitions, added new tables (BioSource, BioSubtype)
    2004-04-26  Y    Added new fields Length and LengthApproximate for Protein, LengthApproximate for SubSequence
    2004-04-26  YP   Added new field CodingRegionStartApproximate and CodingRegionEndApproximate  for Gene
    2004-04-16  PG   Changed NucleicAcid.Circular to NucleicAcid.Topology
                     Added the following new fields to NucleicAcid
                     LengthApproximate, TotalLength, TotalLengthApproximate,
                     SequenceDerivation, Strandedness
    2004-03-25  TJL  Added Type and Version to DBID and CrossReference
    2004-03-23  TJL  Updated NucleicAcid for GenBank; removed Replicon
    2004-03-23  TJL  Added Subsequence table
    2004-03-23  TJL  Added Description table
    -->

    <!-- ========================================================================================== -->
    <!-- Definition of BioWarehouse types                                                           -->
    <!-- ========================================================================================== -->
    <datatypes>
        <dtype notation="@varchar" mysql="VARCHAR" oracle="VARCHAR2"
               description="@varchar(nnn): a varying-length string of length &lt;= nnn"/>
        <dtype notation="@datetime" mysql="DATETIME" oracle="DATE"
               description="a date and/or a time"/>
        <dtype notation="@real32" mysql="FLOAT" oracle="NUMBER"
               description="signed floating point types using 32 bits"/>
        <dtype notation="@real64" mysql="DOUBLE" oracle="NUMBER"
               description="signed floating point types using 64 bits"/>
        <dtype notation="@int16" mysql="SMALLINT" oracle="NUMBER"
               description="signed integral types using 16 bits"/>
        <dtype notation="@int32" mysql="INT" oracle="NUMBER"
               description="signed integral types using 32 bits"/>
        <dtype notation="@int64" mysql="BIGINT" oracle="NUMBER"
               description="signed integral types using 64 bits"/>
        <dtype notation="@byte32" mysql="LONGBLOB" oracle="BLOB"
               description="binary data of length &lt;= 4294967295 bytes"/>
        <dtype notation="@string10" mysql="TEXT" oracle="VARCHAR2(4000)"
               description="a varying-length string of length &lt;= 2047"/>
        <dtype notation="@string16" mysql="TEXT" oracle="CLOB"
               description="a varying-length string of length &lt;= 65535"/>
        <dtype notation="@string32" mysql="LONGTEXT" oracle="CLOB"
               description="a varying-length string of length &lt;= 4294967295"/>
        <dtype notation="@wid" mysql="BIGINT" oracle="NUMBER"
               description="a Warehouse Identifier (a number that is unique throughout the Warehouse)"/>
        <dtype notation="@number" mysql="DECIMAL" oracle="NUMBER"
               description="@number(precision,scale): any number for which exact precision is preserved."/>
        <dtype notation="@boolean" mysql="CHAR(1)" oracle="CHAR(1)"
               description="a boolean value: 'T' for true and 'F' for false"/>
        <dtype notation="@char" mysql="CHAR(1)" oracle="CHAR(1)"
               description="a single character value"/>
    </datatypes>

    <tabletypes>
        <ttype name="state">
            <comment>Tables that are used to define the Warehouse contents and its current state.</comment>
        </ttype>
        <ttype name="independent">
            <comment>Tables that contain universally- or widely-accepted scientific data. These tables are independent
                of any dataset.
            </comment>
        </ttype>
        <ttype name="object">
            <comment>Tables that represent the principal objects in the Warehouse.
                All object tables have a WID column that is globally unique identifier,
                and a DataSetWID column that refers to the DataSet row of the dataset that
                loaded the object.
            </comment>
        </ttype>
        <ttype name="arbitrary-relation">
            <comment>Tables that implement arbitrary relations among Warehouse objects.
                Naming convention is to use /table/WID as a column name for any WID
                referencing an object from /table/.
            </comment>
        </ttype>
        <ttype name="object-descriptor">
            <comment>Tables that reference an untyped WID (one that could be from one of several object tables).
                Naming convention is to use OtherWID as a column name for the untyped WID.
            </comment>
        </ttype>
        <ttype name="associative">
            <comment>Tables that (only) link WIDs from two object tables.
                These tables implement many-many relations between Warehouse objects.
                Naming convention is /table1/WID/table2/WID.
            </comment>
        </ttype>
    </tabletypes>

    <!-- ========================================================================================== -->
    <!--  Tables that are used to define the Warehouse contents and its current state.  -->
    <!-- ========================================================================================== -->
    <table name="Warehouse" type="state">
        <comment>Describes this version of the BioSPICE Warehouse.</comment>
        <comment>This table contains exactly one row.</comment>
        <column name="Version" type="@number" precision="6" scale="3" required="true">
            <comment>Numbered version of the warehouse schema that is loaded</comment>
        </column>
        <column name="LoadDate" type="@datetime" required="true">
            <comment>Date that this schema was loaded</comment>
        </column>
        <column name="MaxSpecialWID" type="@wid" required="true">
            <comment>Maximum value allowed for SpecialWIDTable.PreviousWID / specialWID sequence</comment>
        </column>
        <column name="MaxReservedWID" type="@wid" required="true">
            <comment>Maximum value allowed for reserved WIDs (regulard WIDs start above this WID number)</comment>
        </column>
        <column name="Description" type="@string10" required="false">
            <comment>Free-form text as desired by the warehouse maintainers</comment>
        </column>
    </table>

    <command dialect="mysql">INSERT INTO Warehouse (Version, LoadDate, MaxSpecialWID, MaxReservedWID)
        VALUES (4.6, now(), 999, 999999);
    </command>
    <command dialect="oracle">INSERT INTO Warehouse (Version, LoadDate, MaxSpecialWID, MaxReservedWID)
        VALUES (4.6, sysdate, 999, 999999);
    </command>

    <sequence name="WID_sequence" increment="1" start="1000000" minValue="1000000">
        <comment>Warehouse ID (WID) allocation --</comment>
        <comment>Generate a unlimited sequence of unique numbers to do the bookkeeping for</comment>
        <comment>Warehouse ID (WID) numbers, which serve as keys for all Warehouse entities.</comment>
        <comment>WIDs 0 and 1 are reserved and not allocated.</comment>
        <comment>Oracle dataset loaders use the following SQL for WID assignment:</comment>
        <comment>SELECT WID_sequence.nextval FROM DUAL;</comment>
        <comment>using an INTO clause in some APIs to store the result in a variable.</comment>
    </sequence>

    <table name="WIDTable" type="state">
        <comment>To allow for compatibility with RDBMS systems that do not support</comment>
        <comment>sequences, this table may be used to store the last used WID.</comment>
        <comment>MySQL dataset loaders use the following SQL for WID assignment:</comment>
        <comment>DELETE FROM WIDTable;</comment>
        <comment>INSERT INTO WIDTable VALUES ();</comment>
        <comment>SELECT last_insert_id();</comment>
        <comment>It may also be used in RDBMS systems that do not support auto-increment</comment>
        <comment>of a counter; however additional protocol like table locking may be</comment>
        <comment>needed to assure the integrity of WIDs during concurrent assignment.</comment>
        <comment>This table contains exactly one row at any given time.</comment>
        <column name="PreviousWID" type="@wid" required="true" auto-increment="true">
            <comment>Last-used Warehouse identifier.</comment>
        </column>
        <primaryKey name="PK_WIDTable" column="PreviousWID"/>
    </table>

    <!--<command>INSERT INTO WIDTable (PreviousWID) values (@maxspecialwid);</command>-->
    <command>INSERT INTO WIDTable (PreviousWID) values (999999);</command>

    <sequence name="SpecialWID_sequence" increment="1" start="2" minValue="2">
        <comment>Generate a finite sequence of WIDs for use as special Warehouse entities,</comment>
        <comment>including DataSet WIDs. These are small integers.</comment>
    </sequence>

    <table name="SpecialWIDTable" type="state">
        <comment>Special WIDs are low-valued WIDs, assigned to globally and frequently used</comment>
        <comment>WIDs within a dataset, such as its DataSetWID. They are both more</comment>
        <comment>mnemonic, and potentially more efficient to store. Warehouse.MaxSpecialWID</comment>
        <comment>delimits special and regular WIDs.</comment>
        <comment>Analogous to WIDTable, this table is used to allocate special WIDs.</comment>
        <comment>MySQL dataset loaders use the following protocol for WID assignment:</comment>
        <comment>DELETE FROM SpecialWIDTable;</comment>
        <comment>INSERT INTO SpecialWIDTable VALUES ();</comment>
        <comment>SELECT last_insert_id();</comment>
        <comment>This table contains exactly one row at any given time.</comment>
        <column name="PreviousWID" type="@wid" required="true" auto-increment="true">
            <comment>Last-used special WID</comment>
        </column>
        <primaryKey name="PK_SpecialWIDTable" column="PreviousWID"/>
    </table>

    <command>INSERT INTO SpecialWIDTable (PreviousWID) values (1);</command>

    <table name="Enumeration" type="state">
        <comment>This table defines enumerated types used within the warehouse. Essentially,</comment>
        <comment>enumerated types correspond to small controlled vocabularies used within</comment>
        <comment>one or more warehouse tables. For example, the warehouse table Feature has</comment>
        <comment>a column called Type that defines the type of a feature within an amino-acid</comment>
        <comment>sequence. Examples types might be PHOS-RESIDUE and GLY-RESIDUE, corresponding</comment>
        <comment>to residues in a protein that are phosphorylated and glycosylated, respectively.</comment>
        <comment>Those two enumerated types would be entered into two rows of this Enumeration</comment>
        <comment>table. Note that in some cases the values actually stored in the warehouse</comment>
        <comment>table are numbers, which are stored in the Value field of the Enumeration table</comment>
        <comment>as the string form of that number.</comment>
        <column length="50" name="TableName" type="@varchar" required="true">
            <comment>Table this enumeration is used in</comment>
        </column>
        <column length="50" name="ColumnName" type="@varchar" required="true">
            <comment>Column this enumeration is used in</comment>
        </column>
        <column length="50" name="Value" type="@varchar" required="true">
            <comment>The enumeration value</comment>
        </column>
        <column name="Meaning" type="@string10" required="false">
            <comment>A comment describing its meaning</comment>
        </column>
        <index name="ENUM_TBNAME" columns="TABLENAME"/>
        <index name="ENUM_COLNAME" columns="COLUMNNAME"/>
        <index name="ENUM_VALUE" columns="VALUE"/>
    </table>

    <table name="DataSet" type="state">
        <comment>Table whose rows define each dataset currently loaded into the warehouse.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entry.</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="true">
            <comment>Name of the database.</comment>
        </column>
        <column length="50" name="Version" type="@varchar" required="false">
            <comment>Version of the database described by this warehouse dataset; in practice, this can be
                populated
            </comment>
            <comment>with whatever the user chooses to put in it from the command line arguments</comment>
        </column>
        <column name="ReleaseDate" type="@datetime" required="false">
            <comment>Date that the original database was first released.</comment>
        </column>
        <column name="LoadDate" type="@datetime" required="true">
            <comment>Date that the load of this data set into the warehouse began.</comment>
        </column>
        <column name="ChangeDate" type="@datetime" required="false">
            <comment>Date of the last change to this dataset, or the date the load</comment>
            <comment>completed if no changes have occurred. NULL means that the</comment>
            <comment>is currently loading, or a fatal error occurred on the load.</comment>
            <comment>NOTE: This feature is not supported by most loaders until version 4.0.</comment>
        </column>
        <column length="255" name="HomeURL" type="@varchar" required="false">
            <comment>Web address of the home page of the original database.</comment>
        </column>
        <column length="255" name="QueryURL" type="@varchar" required="false">
            <comment>A URL at which we can retrieve objects in this database via the WWW</comment>
            <comment>by substituting the unique ID of the object we wish to retrieve for the</comment>
            <comment>string "%s" in the query URL. An example URL is:</comment>
            <comment>http://database.university.edu/get-object/5050%s</comment>
        </column>
        <column length="255" name="LoadedBy" type="@varchar" required="false">
            <comment>The name (or username) of the person who loaded this dataset.</comment>
            <comment>NOTE: This feature is not supported by most loaders until</comment>
            <comment>version 4.0. At that time, this column should be required.</comment>
        </column>
        <column length="255" name="Application" type="@varchar" required="false">
            <comment>The name of the application that created this dataset.</comment>
            <comment>NOTE: This feature is not supported by most loaders until</comment>
            <comment>version 4.0. At that time, this column should be required.</comment>
        </column>
        <column length="255" name="ApplicationVersion" type="@varchar" required="false">
            <comment>The version of the application that created this dataset.</comment>
            <comment>NOTE: This feature is not supported by most loaders until</comment>
            <comment>version 4.0. At that time, this column should be required.</comment>
        </column>
        <primaryKey name="PK_DataSet1" column="WID"/>
        <index name="DATASET_NAME_Version" columns="Name,Version"/>
    </table>

    <table name="DataSetHierarchy" type="arbitrary-relation">
        <comment>Defines a dataset containment hierarchy.
	If a dataset contains another, either directly or indirectly,
	a row exists for that dataset pair in this table.
	A dataset always contains itself; therefore each dataset is included in at least one row in this table.
	A dataset may contain any number of datasets, and be contained in any number of datasets.
	To query for an object in a containing dataset whose datasetwid is NN,
	regardless of which contained dataset it is in, use a query like the following: </comment>
	<comment>select wid from DataSetHierarchy h, Protein p
	    where h.superwid=NN and h.subwid=p.datasetwid
	    and p.name='some name'</comment>
        <column name="SuperWID" type="@wid" required="true">
            <comment>Reference to the containing DataSet.</comment>
            <foreignKey name="FK_DataSetHierarchy1" toTable="DataSet" toColumn="WID"/>
        </column>
        <column name="SubWID" type="@wid" required="true">
            <comment>Reference to the contained DataSet.</comment>
            <foreignKey name="FK_DataSetHierarchy2" toTable="DataSet" toColumn="WID"/>
        </column>
        <index name="DATASETHIERARCHY_SuperWID" columns="SuperWID"/>
        <index name="DATASETHIERARCHY_SubWID" columns="SubWID"/>
    </table>

    <table name="Entry" type="object-descriptor">
        <comment>Defines metadata describing a warehouse object.</comment>
        <comment>Every warehouse object (that is, anything with a WID column) must have an associated Entry
            row.
        </comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Warehouse ID of the entity</comment>
            <sdKey name="FK_ENTRY1" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_ENTRY2" toTable="Element" toColumn="WID"/>
            <sdKey name="FK_ENTRY3" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_ENTRY4" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_ENTRY5" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_ENTRY6" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_ENTRY7" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_ENTRY8" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_ENTRY9" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_ENTRY10" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_ENTRY11" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_ENTRY12" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_ENTRY13" toTable="Support" toColumn="WID"/>
            <sdKey name="FK_ENTRY14" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_ENTRY15" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_ENTRY16" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_ENTRY17" toTable="Taxon" toColumn="WID"/>
        </column>
        <column name="InsertDate" type="@datetime" required="true">
            <comment>Date entity was stored in the warehouse</comment>
        </column>
        <column name="CreationDate" type="@datetime" required="false">
            <comment>Date entity was created in its source dataset</comment>
        </column>
        <column name="ModifiedDate" type="@datetime" required="false">
            <comment>Date that the entry was last modified, either</comment>
            <comment>in the warehouse or in the source dataset</comment>
        </column>
        <column name="LoadError" type="@boolean" required="true">
            <comment>'T' if an error (eg. parse error on some field of the entry)</comment>
            <comment>occured during loading of this entry into the warehouse, else 'F'.</comment>
        </column>
        <column name="LineNumber" type="@int32" required="false">
            <comment>Either line number or entry number from dataset source file</comment>
        </column>
        <column name="ErrorMessage" type="@string10" required="false">
            <comment>Message describing error, if any</comment>
        </column>
        <column name="DatasetWID" type="@wid" required="true">
            <comment>The dataset the entity is from</comment>
            <foreignKey name="FK_Entry" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Entry" column="OtherWID"/>
        <index name="ENTRY_INSERTDATE" columns="InsertDate"/>
        <index name="ENTRY_CREATEDATE" columns="CreationDate"/>
        <index name="ENTRY_MODDATE" columns="ModifiedDate"/>
        <index name="ENTRY_DATASETWID" columns="DatasetWID"/>
    </table>

    <!-- ========================================================================================== -->
    <!-- Tables that contain universally- or widely-accepted scientific data.                       -->
    <!-- These tables are independent of any dataset.                                               -->
    <!-- ========================================================================================== -->

    <table name="GeneExpressionData" type="indepdendent">
        <comment>MAGE gene expression data (BioDataCube)</comment>
        <comment>This table definition may evolve as the requirements for gene expression data
        are better understood.  The MAGE OM currently allows 'any' type for the Value component
        of the BioDataCube.  We are investigating ways to make this table better accomodate
        the variety of allowed datatypes.  Please send suggestions to support@biowarehouse.org</comment>
        <column name="B" type="@int16" required="true">
            <comment>BioAssay index</comment>
        </column>
        <column name="D" type="@int16" required="true">
            <comment>DesignElement index</comment>
        </column>
        <column name="Q" type="@int16" required="true">
            <comment>Quantitation Type index</comment>
        </column>
        <column name="Value" type="@varchar" length="100" required="true">
            <comment>Data value. See associated QuantiatitationType obect for type information.</comment>
        </column>
        <column name="BioAssayValuesWID" type="@wid" required="true">
            <comment>The BioAssayValues object the entity is from</comment>
            <foreignKey name="FK_GEDBAV" toTable="BioDataValues" toColumn="WID"/>
        </column>
    </table>

    <table name="Element" type="independent">
        <comment>The periodic table of elements</comment>
        <column name="WID" type="@wid" required="true">
            <comment>WID of this element</comment>
        </column>
        <column length="15" name="Name" type="@varchar" required="true">
            <comment>Long name (e.g. 'Oxygen')</comment>
        </column>
        <column length="2" name="ElementSymbol" type="@varchar" required="true">
            <comment>Symbol (e.g. 'O')</comment>
        </column>
        <column name="AtomicWeight" type="@real32" required="true">
            <comment>Weighted average weight (e.g. 16.x)</comment>
        </column>
        <column name="AtomicNumber" type="@int16" required="true">
            <comment>Number of protons</comment>
        </column>
        <primaryKey name="PK_Element" column="WID"/>
        <index name="ELEMENT_NAME" columns="Name"/>
        <index name="ELEMENT_ELEMENTSYMBOL" columns="ElementSymbol"/>
        <index name="ELEMENT_ATOMICWEIGHT" columns="AtomicWeight"/>
        <index name="ELEMENT_ATOMICNUMBER" columns="AtomicNumber"/>
    </table>

    <table name="Valence" type="independent">
        <comment>Defines one or more valences for each element.</comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>WID of the element</comment>
            <foreignKey name="FK_Valence" toTable="Element" toColumn="WID"/>
        </column>
        <column name="Valence" type="@int16" required="true">
            <comment>Number of valence electrons</comment>
        </column>

        <index name="VALENCE_WID" columns="OtherWID"/>
        <index name="VALENCE_VALENCE" columns="Valence"/>
    </table>

    <!-- ========================================================================================== -->
    <!-- Object tables. These represent the principal objects in the Warehouse.                     -->
    <!-- All object tables have a WID column that is globally unique identifier,                    -->
    <!-- and a DataSetWID column that refers to the DataSet row of the dataset that                 -->
    <!-- loaded the object.                                                                         -->
    <!-- ========================================================================================== -->

    <table name="LightSource" type="object">
        <comment>Defines a light source, e.g., as produced by a scientific instrument.
	         Used by flow cytometry in describing the cytometry instrument. 
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse idetification number for this light source</comment>
        </column>
        <column name="Wavelength" type="@real32" required="false">
            <comment>Wavelength of the light emitted, in nanometers</comment>
        </column>
        <column name="Type" type="@varchar" length="100" required="false">
            <comment>Enumeration. Specifies the type of light source (arc lamp, a particular laser, etc.).
            </comment>
            <enumeration>
                <restriction value="arc-lamp" description="A type of light source"/>
                <restriction value="argon-laser" description="An ion laser that uses argon gas to produce light"/>
                <restriction value="krypton-laser" description="An ion laser that uses krypton gas to produce light"/>
                <restriction value="argon-krypton-laser" description="An ion laser that uses a combination of krypton and argon gases to produce light"/>
                <restriction value="helium-neon-laser" description="A laser that uses helium and neon gases to produce light"/>
            </enumeration>
        </column>
        <column name="InstrumentWID" type="@wid" required="false">
            <comment>WID of the object representing the instrument producing the light.
	    For a flow cytometry experiment, this is typically
	    a reference to a Parameterizable row defining the cytometry instrument used.
	    This instrument is instantiated as a ParameterizableApplication row, and has
	    an associated ExperimentData row that defines the compensation parameter.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>References the data set the entity came from</comment>
            <foreignKey name="FK_LightSource1" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_LightSource1" column="WID"/>
        <index name="LightSource_DWID" columns="DataSetWID" initial="true"/>
        <index name="LightSource_Instrument" columns="InstrumentWID"/>
        <index name="LightSource_Wavelength" columns="Wavelength"/>
    </table>

    <table name="FlowCytometrySample" type="object">
        <comment>Defines an experimental sample prepared for use in a flow cytometry experiment.
	A typical experiment consists of multiple samples X multiple readings
	(forward/side scatter and using filters of various wavelengths),
	with a vector of observations (one per cell of the BioSource)
	for each sample/reading combination.</comment>
	<comment> An ExperimentData row is defined for each observation; see that table for representation details.</comment>
	<comment> An Experiment row is defined to associate each ExperimentData row with the experiment. </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse idetification number for this flow cytometry sample</comment>
        </column>
        <column name="BioSourceWID" type="@wid" required="false">
            <comment>References the biological source of this sample.</comment>
            <foreignKey name="FK_FlowCytometrySample1" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="FlowCytometryProbeWID" type="@wid" required="false">
            <comment>References the probe used with this sample.</comment>
            <foreignKey name="FK_FlowCytometrySample2" toTable="FlowCytometryProbe" toColumn="WID"/>
        </column>
        <column name="MeasurementWID" type="@wid" required="false">
            <comment>References a specification of the amount of the probe used.</comment>
            <foreignKey name="FK_FlowCytometrySample3" toTable="Measurement" toColumn="WID"/>
        </column>
        <column name="ManufacturerWID" type="@wid" required="false">
            <comment>References the Contact that describes the manufacturer of this sample.</comment>
            <foreignKey name="FK_FlowCytometrySample4" toTable="Contact" toColumn="WID"/>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>References the data set the entity came from</comment>
            <foreignKey name="FK_FlowCytometrySampleDS" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_FlowCytometrySample1" column="WID"/>
        <index name="FlowCytometrySample_DWID" columns="DataSetWID" initial="true"/>
        <index name="FlowCytometrySample_BioSource" columns="BioSourceWID"/>
        <index name="FlowCytometrySample_Manufac" columns="ManufacturerWID"/>
        <index name="FlowCytometrySample_Meas" columns="MeasurementWID"/>
        <index name="FlowCytometrySample_Probe" columns="FlowCytometryProbeWID"/>
    </table>

    <table name="FlowCytometryProbe" type="object">
        <comment>Defines a material used to measure characteristics of a cell using flow cytometry.
	         If probe is a protein, a CrossReference may be defined to specify the protein;
		 in that case CrossReference.OtherWID refers to this FlowCytometryProbe.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse idetification number for this probe</comment>
        </column>
        <column name="Type" type="@varchar" length="100" required="true">
            <comment>Enumeration. Specifies the type of probe
            </comment>
            <enumeration>
                <restriction value="acid-dye" description="An acid dye probe"/>
                <restriction value="antibody" description="An antibody probe"/>
                <restriction value="reporter" description="A protein probe"/>
            </enumeration>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Probe1" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_FlowCytometryProbe1" column="WID"/>
        <index name="FlowCytometryProbe_DWID" columns="DataSetWID" initial="true"/>
    </table>

    <table name="TranscriptionUnit" type="object">
        <comment>Defines a transcription unit, similar to an operon.  There is a one-to-one
                 relationship between a promoter and a transcription unit.  The transcription
                 unit includes the promoter, nearby site that regulate its activity, and downstream
                 genes and the terminator.  Unlike operons, a transcription unit can contain a single
                 gene, and a transcription unit can contain only one promoter.  For operons containing
                 multiple promoters, a different transcription unit would be created for each operon.
                 See TranscriptionUnitComponent for the types of components represented.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this TranscriptionUnit</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="true">
            <comment>Name of the transcription unit</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_TranscriptionUnit1" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_TranscriptionUnit1" column="WID"/>
        <index name="TranscriptionUnit_DWID" columns="DataSetWID" initial="true"/>
        <index name="TranscriptionUnit_Name" columns="Name" initial="false"/>
    </table>

    <table name="TranscriptionUnitComponent" type="associative">
        <comment>Associates a TranscriptionUnit with its components. Components consist of
          genes and/or features. A feature component may be either a promoter, a terminator or a DNA binding site
          (transcription-factor binding site).
        </comment>
        <column name="Type" type="@varchar" length="100" required="true">
            <comment>Enumeration. Specifies the type of component
            </comment>
            <enumeration>
                <restriction value="gene" description=""/>
                <restriction value="binding site" description=""/>
                <restriction value="promoter" description=""/>
                <restriction value="terminator" description=""/>
            </enumeration>
        </column>
        <column name="TranscriptionUnitWID" type="@wid" required="true">
            <comment>Links to the TranscriptionUnit associated with this object.</comment>
            <foreignKey name="FK_TranscriptionUnitComponent1" toTable="TranscriptionUnit" toColumn="WID"/>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>WID of the Gene or Feature associated with the TranscriptionUnit</comment>
            <sdKey name="FK_TUC_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_TUC_Feature" toTable="Feature" toColumn="WID"/>
        </column>
        <index name="TranscriptionUnitComponent_TU" columns="TranscriptionUnitWID"/>
        <index name="TranscriptionUnitComponent_OW" columns="OtherWID"/>
    </table>

    <table type="object" name="Chemical">
        <comment>Defines small molecular weight chemical compounds.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse idetification number for this chemical</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="true">
            <comment>Common name of the chemical</comment>
        </column>
        <column name="Class" type="@boolean" required="false">
            <comment>'T' this is a class or family of related chemicals, else 'F'</comment>
        </column>
        <column length="50" name="BeilsteinName" type="@varchar" required="false">
            <comment>The Beilstein name of this chemical</comment>
        </column>
        <column length="255" name="SystematicName" type="@varchar" required="false">
            <comment>The systematic name for this chemical</comment>
        </column>
        <column length="50" name="CAS" type="@varchar" required="false">
            <comment>The Chemical Abstract Service number</comment>
        </column>
        <column name="Charge" type="@int16" required="false">
            <comment>Charge of the chemical</comment>
        </column>
        <column length="50" name="EmpiricalFormula" type="@varchar" required="false">
            <comment>The empirical formula of this chemical</comment>
            <comment>Format: { ElementSymbol Integer }+</comment>
            <comment>E.g. 'H2O1', 'C2H6O1', 'Na1Cl1'.</comment>
        </column>
        <column name="MolecularWeightCalc" type="@real32" required="false">
            <comment>Molecular weight calculated from chemical formula.</comment>
            <comment>Units: Daltons.</comment>
        </column>
        <column name="MolecularWeightExp" type="@real32" required="false">
            <comment>Molecular Weight determined through experimentation. Units: Daltons.</comment>
        </column>
        <column length="50" name="OctH2OPartitionCoeff" type="@varchar" required="false">
            <comment>Octanol-water-partition coefficient</comment>
        </column>
        <column name="PKA1" type="@real32" required="false">
            <comment>First ionization potential</comment>
        </column>
        <column name="PKA2" type="@real32" required="false">
            <comment>Second ionization potential</comment>
        </column>
        <column name="PKA3" type="@real32" required="false">
            <comment>Third ionization potential</comment>
        </column>
        <column name="WaterSolubility" type="@boolean" required="false">
            <comment>'T' if soluble in water, else 'F'</comment>
        </column>
        <column length="255" name="Smiles" type="@varchar" required="false">
            <comment>Ascii representation of the chemical structure</comment>
            <comment>Simplified Molecular Input Line Entry System</comment>
            <comment>http://www.epa.gov/medatwrk/databases/smiles.html</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Chemical1" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Chemical1" column="WID"/>
        <index name="CHEMICAL_DWID_NAME" columns="DataSetWID, Name" initial="true"/>
        <index name="CHEMICAL_NAME" columns="Name" initial="true"/>
        <index name="CHEMICAL_BEILSTEINNAME" columns="BEILSTEINNAME"/>
        <index name="CHEMICAL_SYSTEMATICNAME" columns="SYSTEMATICNAME"/>
        <index name="CHEMICAL_CAS" columns="CAS"/>
        <index name="CHEMICAL_CHARGE" columns="CHARGE"/>
        <index name="CHEMICAL_EMPIRICALFORMULA" columns="EMPIRICALFORMULA"/>
        <index name="CHEMICAL_MOLEWEIGHTCALC" columns="MOLECULARWEIGHTCALC"/>
        <index name="CHEMICAL_MOLEWEIGHTEXP" columns="MOLECULARWEIGHTEXP"/>
        <index name="CHEMICAL_OCTH2OCOEFF" columns="OCTH2OPARTITIONCOEFF"/>
        <index name="CHEMICAL_PKA1" columns="PKA1"/>
        <index name="CHEMICAL_PKA2" columns="PKA2"/>
        <index name="CHEMICAL_PKA3" columns="PKA3"/>
        <index name="CHEMICAL_SMILES" columns="SMILES"/>
        <index name="CHEMICAL_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Reaction">
        <comment>Defines a chemical reaction. The reaction could be enzyme catalyzed</comment>
        <comment>or occur spontaneously. The reaction could involve small molecules, macromolecules,</comment>
        <comment>or a combination of the two. Every reaction will be stored in the warehouse in</comment>
        <comment>a given direction, for example, every reaction that has an assigned EC number is</comment>
        <comment>written in a direction assigned by the enzyme commission. In physiological settings,</comment>
        <comment>the reaction could occur in the direction the reaction is stored, the reverse direction,</comment>
        <comment>or both directions.</comment>
        <comment>Restrictions: Reaction only stores fully qualified EC numbers, e.g., NOT of the form
            "X.Y.Z.-"
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this entiry</comment>
        </column>
        <column name="Name" type="@varchar" length="250" required="false">
            <comment>Name of reaction</comment>
        </column>
        <column length="50" name="DeltaG" type="@varchar" required="false">
            <comment>Delta G subzero prime value for this reaction</comment>
        </column>
        <column length="50" name="ECNumber" type="@varchar" required="false">
            <comment>Official enzyme-commission-number.</comment>
        </column>
        <column length="50" name="ECNumberProposed" type="@varchar" required="false">
            <comment>Proposed enzyme-commission-number</comment>
        </column>
        <column name="Spontaneous" type="@boolean" required="false">
            <comment>'T' if the reaction occurs spontaneously, else 'F'</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the reaction is from</comment>
            <foreignKey name="FK_Reaction" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Reaction" column="WID"/>
        <index name="REACTION_DWID" columns="DataSetWID" initial="true"/>
        <index name="REACTION_DeltaG" columns="DeltaG"/>
        <index name="REACTION_ECNumber" columns="ECNumber"/>
        <index name="REACTION_ECNumberProposed" columns="ECNumberProposed"/>
    </table>

    <table name="Interaction" type="object">
        <comment>Defines a molecular interaction, such as two proteins observed to interact in a yeast-two-hybrid
            experiement. The interaction could involve macromolecules, small molecules or both.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this interaction</comment>
        </column>
        <column name="Type" type="@varchar" length="100" required="false">
            <comment>Interaction type. It is recommended to use external controled vacabulary terms, such as PSI-MI
                Interaction Type CV.
            </comment>
        </column>
        <column name="Name" type="@varchar" length="120" required="false">
            <comment>Name of the interaction.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the interaction is from.</comment>
            <foreignKey name="FK_Interaction1" toTable="DataSet" toColumn="WID"/>
        </column>
        <primaryKey name="PK_Interaction" column="WID"/>
        <index name="INTERACTION_DWID" columns="DataSetWID" initial="true"/>
    </table>

    <table type="object" name="Protein">
        <comment>Defines a specific protein, that is, a real-world protein which was either purified and
            isolated,
        </comment>
        <comment>OR is reasonably inferred by genomic analysis or other means, such as enzymological
            characterization.
        </comment>
        <comment>The protein could be a monomer or a multimer. In the latter case, a sequence would not be stored for
            such a record.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>The warehouse ID of this protein</comment>
        </column>
        <column name="Name" type="@string10" required="false">
            <comment>Common name of the protein, if it exists</comment>
        </column>
        <column name="AASequence" type="@string32" required="false">
            <comment>Amino-acid sequence for this protein, if available</comment>
        </column>
        <column name="Length" type="@int32" required="false">
            <comment>Length of the amino-acid sequence for this protein, if available</comment>
            <comment>This value is not necessarily exact, as can be modified by LengthApproximate</comment>
        </column>
        <column length="10" name="LengthApproximate" type="@varchar" required="false">
            <comment>Indicates that the Length is an approximate. It could be 'gt' for</comment>
            <comment>greater than, 'lt' for less than and 'ne' to indicate that it is not</comment>
            <comment>equal. This is a controlled vocabulary.</comment>
        </column>
        <column name="Charge" type="@int16" required="false">
            <comment>Charge of the chemical</comment>
        </column>
        <column name="Fragment" type="@boolean" required="false">
            <comment>'T' if protein is a fragment, else 'F'</comment>
        </column>
        <column name="MolecularWeightCalc" type="@real32" required="false">
            <comment>Molecular weight calculated from sequence.</comment>
            <comment>Units: kiloDaltons.</comment>
        </column>
        <column name="MolecularWeightExp" type="@real32" required="false">
            <comment>Molecular Weight determined through experimentation.</comment>
            <comment>Units: kiloDaltons.</comment>
        </column>
        <column length="50" name="PICalc" type="@varchar" required="false">
            <comment>Isoelectric point (pI) calculated from its sequence.</comment>
        </column>
        <column length="50" name="PIExp" type="@varchar" required="false">
            <comment>Isoelectric point (pI) determined through experimentation.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the protein is from</comment>
            <foreignKey name="FK_Protein" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Protein" column="WID"/>
        <index name="PROTEIN_DWID" columns="DataSetWID" initial="true"/>
        <index name="PROTEIN_NAME">
            <variant dialect="mysql" columns="NAME(20)"/>
            <variant dialect="oracle" columns="NAME"/>
        </index>
        <index name="PROTEIN_CHARGE" columns="CHARGE"/>
        <index name="PROTEIN_MOLEWEIGHTCALC" columns="MOLECULARWEIGHTCALC"/>
        <index name="PROTEIN_MOLEWEIGHTEXP" columns="MOLECULARWEIGHTEXP"/>
        <index name="PROTEIN_PICALC" columns="PICALC"/>
        <index name="PROTEIN_PIEXP" columns="PIEXP"/>
    </table>

    <table type="object" name="Feature">
        <comment>Features define regions or points of interest on the protein sequence or</comment>
        <comment>nucleic acid sequence specified by SequenceWID.</comment>
        <comment>Features are not used to describe objects such as Genes, BioSources, etc,</comment>
        <comment>because attributes of those objects are described in their own tables.</comment>
        <comment>Exceptions:</comment>
        <comment>1. Since pseudogenes are not entered in the Gene table, they are listed as sequence features in
            Feature
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier of this feature.</comment>
        </column>
        <column length="1300" name="Description" type="@varchar" required="false">
            <comment>Textual description of this feature.</comment>
        </column>
        <column length="50" name="Type" type="@varchar" required="false">
            <comment>Type of feature. These type values come from the source dataset and</comment>
            <comment>are not necessarily enumerated. Example: "Promoter CYZ".</comment>
        </column>
        <column length="50" name="Class" type="@varchar" required="false">
            <comment>Class of feature. Assigns our typology for types of features, or qualifiers</comment>
            <comment>associated with features. These are our own enumerated type values, to allow us</comment>
            <comment>to classify features without losing the original (author-provided) type values</comment>
            <comment>stored in Type. Example: Class=promoter.</comment>
            <enumeration>
                <restriction value="binding site" description="Identifies the presence of a DNA binding site"/>
                <restriction value="promoter" description="Identifies the presence of a promoter"/>
                <restriction value="terminator" description="Identifies the presence of a terminator"/>
                <restriction value="pseudogene" description="Identifies a pseudogene, whether non-transcribed or processed"/>
                <restriction value="ORF" description="Identifies a truly unknown open reading frame according to warehouse definition (no strong evidence that a product is produced)"/>
                <restriction value="partial" description="Qualifier: States that feature is not complete"/>
                <restriction value="unknown product" description="Identifies an unspecified product is produced from this genomic location, as stated in dataset"/>
                <restriction value="notable" description="Qualifier: Characterizes the feature value as notable (same as 'Exceptional' in GB dataset)"/>
                <restriction value="by similarity" description="Qualifier: states that feature was derived by similarity analysis"/>
                <restriction value="potential" description="Qualifier: states that feature may be incorrect"/>
                <restriction value="probably" description="Qualifier: states that feature is probably correct"/>
                <restriction value="variant" description="Qualifier: states that the feature is a sequence variation. Feature.Variant will contain the alternate sequence."/>
            </enumeration>
        </column>
        <column name="SequenceType" type="@char" required="true">
            <comment>Enumeration (see also SequenceWID) that indicates whether the sequence</comment>
            <comment>is protein or nucleic and how the sequence (if available) is represented:</comment>
            <comment>If 'P', feature resides on a protein.</comment>
            <comment>If 'S' or 'N', feature resides on a nucleic acid.</comment>
            <enumeration>
                <restriction value="P" description="Feature resides on a protein. Implies SequenceWID (if nonNULL) references a Protein"/>
                <restriction value="S" description="Feature resides on a nucleic acid. Implies SequenceWID is nonNULL and references a Subsequence"/>
                <restriction value="N" description="Feature resides on a nucleic acid. Implies SequenceWID (if nonNULL) references a NucleicAcid"/>
            </enumeration>
        </column>
        <column name="SequenceWID" type="@wid" required="false">
            <comment>References the Protein or Subsequence containing the sequence on which we</comment>
            <comment>are defining a feature:</comment>
            <comment>SequenceType of 'S' implies SequenceWID is nonNULL and references a Subsequence-</comment>
            <comment>sequence = Subsequence.Sequence (i.e., it is stored explicitly),</comment>
            <comment>SequenceType of 'N' implies SequenceWID (if nonNULL) references a NucleicAcid-</comment>
            <comment>sequence is the substring Subsequence.Sequence[StartPosition : EndPosition]</comment>
            <comment>where Subsequence is the full Subsequence of the nucleic acid.</comment>
            <comment>SequenceType of 'P' implies SequenceWID (if nonNULL) references a Protein-</comment>
            <comment>sequence is the substring Protein.AASequence[StartPosition : EndPosition].</comment>
            <sdKey name="FK_Feature1" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_Feature3" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Variant" type="@string32" required="false">
            <comment>Amino-acid sequence for this protein, if available</comment>
        </column>
        <column length="10" name="RegionOrPoint" type="@varchar" required="false">
            <comment>Specifies whether this feature is specified with starting and ending coordinates</comment>
            <comment>or with a single coordinate.</comment>
            <enumeration>
                <restriction value="region" description="Feature is specified by a start point and an end point on the sequence"/>
                <restriction value="point" description="Feature is specified by a single point on the sequence"/>
            </enumeration>
        </column>
        <column length="10" name="PointType" type="@varchar" required="false">
            <comment>Only defined if RegionOrPoint='point'. Specifies where the feature is relative </comment>
            <comment>to its location as encoded in StartPosition and EndPosition:</comment>
            <enumeration>
                <restriction value="center" description="Feature is centered at location."/>
                <restriction value="left" description="Feature extends to the left (decreasing position) of location."/>
                <restriction value="right" description="Feature extends to the right (increasing position) of location."/>
            </enumeration>
        </column>
        <column name="StartPosition" type="@int32" required="false">
            <comment>Start position of the feature within the NucleicAcid or Protein sequence.</comment>
            <comment>If Feature.RegionOrPoint is 'point', StartPosition and EndPosition will</comment>
            <comment>either be equal (location is exactly at a nucleotide or amino acid) or will differ by 1</comment>
            <comment>(location is centered between two adjacent nucleotides or amino acids).</comment>
            <comment> </comment>
        </column>
        <column name="EndPosition" type="@int32" required="false">
            <comment>End position of the feature within the NucleicAcid or Protein sequence.</comment>
            <comment>If Feature.RegionOrPoint is 'point', StartPosition and EndPosition will</comment>
            <comment>either be equal (location is exactly at a nucleotide or amino acid) or will differ by 1</comment>
            <comment>(location is between two adjacent nucleotides or amino acids).</comment>
        </column>
        <column length="10" name="StartPositionApproximate" type="@varchar" required="false">
            <comment>Indicates that the Start position of the coding region is an approximate value</comment>
            <comment>It could be 'gt' for greater than, 'lt' for less than and 'ne' to indicate that it is not</comment>
            <comment>equal. This is a controlled vocabulary.</comment>
            <enumeration>
                <restriction value="gt" description="The start position of the feature is greater than the actual position specified."/>
                <restriction value="lt" description="The start position of the feature is less than the actual position specified."/>
                <restriction value="ne" description="The start position of the feature is less than or greater than the actual position. All we know is that its not the exact position."/>
            </enumeration>
        </column>
        <column length="10" name="EndPositionApproximate" type="@varchar" required="false">
            <comment>Indicates that the End position of the coding region is an approximate value.</comment>
            <comment>It could be 'gt' for greater than, 'lt' for less than and 'ne' to indicate that it is not</comment>
            <comment>equal. This is a controlled vocabulary.</comment>
            <enumeration>
                <restriction value="gt" description="The end position of the feature is greater than the actual position specified."/>
                <restriction value="lt" description="The end position of the feature is less than the actual position specified."/>
                <restriction value="ne" description="The end position of the feature is less than or greater than the actual position. All we know is that its not the exact position."/>
            </enumeration>
        </column>
        <column name="ExperimentalSupport" type="@boolean" required="false">
            <comment>'T' if the feature is supported by experimental evidence, else 'F'</comment>
        </column>
        <column name="ComputationalSupport" type="@boolean" required="false">
            <comment>'T' if the feature is supported by computational evidence, else 'F'</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Feature" toTable="DataSet" toColumn="WID"/>
        </column>
        <primaryKey name="PK_Feature" column="WID"/>
        <index name="FEATURE_Description">
            <variant dialect="mysql" columns="Description(20)"/>
            <variant dialect="oracle" columns="Description"/>
        </index>
        <index name="FEATURE_TYPE" columns="Type"/>
        <index name="FEATURE_Class" columns="Class"/>
        <index name="FEATURE_SequenceWID" columns="SequenceWID"/>
        <index name="FEATURE_START_ENDPOS" columns="STARTPOSITION,ENDPOSITION"/>
        <index name="FEATURE_ENDPOSITION" columns="ENDPOSITION"/>
        <index name="FEATURE_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Function">
        <comment>Describes the non-enzymatic function(s) of proteins. That is,</comment>
        <comment>this table should not be used to describe the enzymatic function of a protein whose enzymatic</comment>
        <comment>function is described using the EnzymaticReaction table. Function names are stored as</comment>
        <comment>strings with no particular format or interpretation.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this function.</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="false">
            <comment>Name of this function.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Data set the entity came from</comment>
            <foreignKey name="FK_Function" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Function" column="WID"/>
        <index name="FUNCTION_NAME" columns="NAME"/>
        <index name="FUNCTION_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="EnzymaticReaction">
        <comment>Defines an association between a reaction and an enzyme that catalyzes</comment>
        <comment>that reaction (ProteinWID). In the case where we are defining an</comment>
        <comment>association between a subunit of a larger enzyme complex, and a</comment>
        <comment>reaction catalyzed by that subunit only when the subunit is part of</comment>
        <comment>that larger complex, ComplexWID specifies that larger complex (assumes</comment>
        <comment>that complex is in the warehouse).</comment>
        <comment>This table requires a WID as it is referenced in multiple linking tables</comment>
        <comment>to associate alternate compounds, cofactors, etc., to allow for multiple</comment>
        <comment>valued attributes of the enzymatic reaction.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>WID of this enzymatic reaction</comment>
        </column>
        <column name="ReactionWID" type="@wid" required="true">
            <comment>WID of the catalyzed reaction</comment>
            <foreignKey name="FK_EnzymaticReaction1" toTable="Reaction" toColumn="WID"/>
        </column>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>WID of the enzyme</comment>
            <foreignKey name="FK_EnzymaticReaction2" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="ComplexWID" type="@wid" required="false">
            <comment>WID of protein of which ProteinWID</comment>
            <comment>must be a subunit of for this reaction</comment>
            <foreignKey name="FK_EnzymaticReaction3" toTable="Protein" toColumn="WID"/>
        </column>
        <column length="30" name="ReactionDirection" type="@varchar" required="false">
            <comment>Reaction Direction Enumeration</comment>
            <enumeration>
                <restriction value="reversible" description="Reaction occurs in both directions in physiological settings."/>
                <restriction value="physiol-left-to-right" description="Reaction occurs in the left-to-right direction in physiological settings."/>
                <restriction value="physiol-right-to-left" description="Reaction occurs in the right-to-left direction in physiological settings."/>
                <restriction value="irreversible-left-to-right" description="For all practical purposes, the reaction occurs only in the left-to-right direction in physiological settings, because of chemical properties of the reaction."/>
                <restriction value="irreversible-right-to-left" description="For all practical purposes, the reaction occurs only in the right-to-left direction in physiological settings, because of chemical properties of the reaction."/>
            </enumeration>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the reaction is from</comment>
            <foreignKey name="FK_EnzymaticReaction4" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_EnzymaticReaction" column="WID"/>
        <index name="ER_DATASETWID" columns="DataSetWID" initial="true"/>
        <index name="ER_REAWID" columns="REACTIONWID"/>
        <index name="ER_PROWID" columns="PROTEINWID"/>
        <index name="ER_COMWID" columns="COMPLEXWID"/>
        <index name="ER_DIRWID" columns="REACTIONDIRECTION"/>
    </table>

    <table type="object" name="GeneticCode">
        <comment>Defines the genetic codes with a name, translation table and a start codon for each code.</comment>
        <comment>See http://embryology.med.unsw.edu.au/DNA/Genetic_Codes.htm for more information.</comment>
        <comment>Genbank ID is stored as DBID.XID, where DBID.OtherWID = GeneticCode.WID.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this GeneticCode.</comment>
        </column>
        <column length="2" name="NCBIID" type="@varchar" required="false">
            <comment>1- or 2-digit ID assigned to this code. See URL above.</comment>
        </column>
        <column length="100" name="Name" type="@varchar" required="false">
            <comment>Genetic code name.</comment>
        </column>
        <column length="64" name="TranslationTable" type="@varchar" required="false">
            <comment>Translation table for this genetic code. See URL above for format.</comment>
        </column>
        <column length="64" name="StartCodon" type="@varchar" required="false">
            <comment>Start Codon for this genetic code. See URL above for format</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from.</comment>
            <foreignKey name="FK_GeneticCode" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_GeneticCode" column="WID"/>
        <index name="GENCODE_NAME" columns="NAME"/>
        <index name="GENCODE_TRANSTABLE" columns="TRANSLATIONTABLE"/>
        <index name="GENCODE_STARTCODON" columns="STARTCODON"/>
        <index name="GENCODE_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Division">
        <comment>Stores the GenBank Division and the NCBI three letter code for records originating from GenBank.
            NCBI uses Divisions to organize GenBank records according to two definitions: some divisions are based on
            taxonomy (e.g., the "BCT" division), whereas other divisions exist purely for data organization reasons
            (e.g., the "CON" division, whose records store instructions for the construction of large contigs).
            Sequences from different GenBank divisions vary substantially in quality based upon the way they were
            generated, e.g., single-pass genomic sequencing, ESTs (low quality, single-pass sequencing), cDNAs
            (high coverage sequencing) and genomic sequencing (moderate coverage sequencing). All BioWarehouse
            records associated with a GenBank dataset also have a record in the Division table.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this Division.</comment>
        </column>
        <column length="10" name="Code" type="@varchar" required="false">
            <comment>Genbank Division code (3 characters) which is an abbreviation for the GenBank Name.</comment>
        </column>
        <column length="100" name="Name" type="@varchar" required="false">
            <comment>Division name.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from.</comment>
            <foreignKey name="FK_Division" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Division" column="WID"/>
        <index name="DIVISION_NAME" columns="NAME"/>
        <index name="DIVISION_DIVCODE" columns="CODE"/>
        <index name="DIVISION_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Taxon">
        <comment>Defines a taxon, which could be a species, genus, family or some other rank.</comment>
        <comment>These ranks are controlled vocabulary and are stored in the Enumeration table.</comment>
        <comment>The taxon table associates a taxon with its parent, gives the name, division code and the</comment>
        <comment>genetic code information for the taxon.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this Taxon</comment>
        </column>
        <column name="ParentWID" type="@wid" required="false">
            <comment>Warehouse ID of the parent of this taxon</comment>
        </column>
        <column length="100" name="Name" type="@varchar" required="false">
            <comment>Taxonomic Name of this taxon</comment>
        </column>
        <column length="100" name="Rank" type="@varchar" required="false">
            <comment>Rank of this taxon (kingdom, superkingdom ..)</comment>
            <enumeration>
                <restriction value="no rank" description="Origin:NCBI- Taxonomy databaseOrigin:NCBI- Taxonomy database. Parent: none"/>
                <restriction value="forma" description="Origin:NCBI- Taxonomy database."/>
                <restriction value="varietas" description="Origin:NCBI- Taxonomy database"/>
                <restriction value="subspecies" description="Origin:NCBI- Taxonomy database Parent: species"/>
                <restriction value="species" description="Origin:NCBI- Taxonomy database. Parent: species subgroup"/>
                <restriction value="species subgroup" description="Origin:NCBI- Taxonomy database. Parent: species group"/>
                <restriction value="species group" description="Origin:NCBI- Taxonomy database. Parent: subgenus"/>
                <restriction value="subgenus" description="Origin:NCBI- Taxonomy database. Parent: genus"/>
                <restriction value="genus" description="Origin:NCBI- Taxonomy database. Parent: subtribe"/>
                <restriction value="subtribe" description="Origin:NCBI- Taxonomy database. Parent: tribe"/>
                <restriction value="tribe" description="Origin:NCBI- Taxonomy database. Parent: subfamily"/>
                <restriction value="subfamily" description="Origin:NCBI- Taxonomy database. Parent: family"/>
                <restriction value="family" description="Origin:NCBI- Taxonomy database Parent:superfamily"/>
                <restriction value="superfamily" description="Origin:NCBI- Taxonomy database. Parent: infraorder"/>
                <restriction value="infraorder" description="Origin:NCBI- Taxonomy database. Parent: parvorder"/>
                <restriction value="parvorder" description="Origin:NCBI- Taxonomy database. Parent: suborder"/>
                <restriction value="suborder" description="Origin:NCBI- Taxonomy database. Parent:order"/>
                <restriction value="order" description="Origin:NCBI- Taxonomy database Parent:superorder"/>
                <restriction value="superorder" description="Origin:NCBI- Taxonomy database. Parent: infraclass"/>
                <restriction value="infraclass" description="Origin:NCBI- Taxonomy database. Parent: subclass"/>
                <restriction value="subclass" description="Origin:NCBI- Taxonomy database.Parent: class"/>
                <restriction value="class" description="Origin:NCBI- Taxonomy database. Parent:superclass"/>
                <restriction value="superclass" description="Origin:NCBI- Taxonomy database. Parent: subphylum"/>
                <restriction value="subphylum" description="Origin:NCBI- Taxonomy database. Parent: phylum."/>
                <restriction value="phylum" description="Origin:NCBI- Taxonomy database.Parent:superphylum"/>
                <restriction value="superphylum" description="Origin:NCBI- Taxonomy database. Parent:kingdom"/>
                <restriction value="subkingdom" description="Origin:NCBI- Taxonomy database. Parent: kingdom"/>
                <restriction value="kingdom" description="Origin:NCBI- Taxonomy database. Parent:superkingdom"/>
                <restriction value="superkingdom" description="Origin:NCBI- Taxonomy database. Parent: root"/>
                <restriction value="root" description="Origin:NCBI- Taxonomy database"/>
            </enumeration>
        </column>
        <column name="DivisionWID" type="@wid" required="false">
            <comment>Warehouse ID of the division this taxon belongs to.</comment>
            <foreignKey name="FK_Taxon_Division" toTable="Division" toColumn="WID"/>
        </column>
        <column name="InheritedDivision" type="@boolean" required="false">
            <comment>'T' if division is inherited from parent, else 'F'</comment>
        </column>
        <column name="GencodeWID" type="@wid" required="false">
            <comment>Warehouse ID of the genetic code for this taxon.</comment>
            <foreignKey name="FK_Taxon_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
        </column>
        <column name="InheritedGencode" type="@boolean" required="false">
            <comment>'T' if gencode is inherited from parent, else 'F'</comment>
        </column>
        <column name="MCGencodeWID" type="@wid" required="false">
            <comment>Warehouse ID of the mitochondrial genetic code for this taxon.</comment>
        </column>
        <column name="InheritedMCGencode" type="@boolean" required="false">
            <comment>'T' if the mitochondrial gencode is inherited from parent, else 'F'</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Taxon" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Taxon" column="WID"/>
        <index name="TAXON_PARENTWID" columns="PARENTWID"/>
        <index name="TAXON_NAME" columns="NAME"/>
        <index name="TAXON_RANK" columns="RANK"/>
        <index name="TAXON_DIVWID" columns="DIVISIONWID"/>
        <index name="TAXON_GENCODEWID" columns="GENCODEWID"/>
        <index name="TAXON_MCGENCODEWID" columns="MCGENCODEWID"/>
        <index name="TAXON_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="BioSource">
        <comment>Defines the biological source of an entry in the Protein,
        NucleicAcid or Gene tables ("the object"), as well as other tables
        eventually storing experimental data related to e.g., microarray or
        proteomic experiments. For example, BioSource might be used to specify
        the organism, organ, and tissue in which gene expression experiments
        were performed. DEPENDENCIES: 1. As BioSource references Taxon.WID to
        specify the species, the NCBI taxonomy dataset must have ALREADY been
        loaded prior to populating BioSource. 2. BioSource stores subtype
        information in BioSubtype via the BioSourceWIDBioSubtypeWID linking
        table
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for biological source.</comment>
        </column>
        <column required="false" name="MAGEClass" length="100" type="@varchar">
            <comment>Discriminator column specifies type of MAGE object this row represents (if needed)</comment>
        </column>
        <column name="TaxonWID" type="@wid" required="false">
            <comment>Warehouse GUID identifying WID of Taxon entry for the species. Always
            references species level or higher.</comment>
            <foreignKey name="FK_BioSource1" toTable="Taxon" toColumn="WID"/>
        </column>
        <column length="200" name="Name" type="@varchar" required="false">
            <comment>Informal name assigned to this source.</comment>
            <comment>Ex. (CMR): 'Escherichia coli K12-MG1655'</comment>
        </column>
        <column length="220" name="Strain" type="@varchar" required="false">
            <comment>Strain of organism from which object is derived, if applicable. This is a
            subspecies taxonomic classification not supported by Taxon because it is not
            a rigorous concept.
            Strain is defined as a population of homogeneous organisms possessing a set of
            defined characteristics. In bacteriology, the set of descendants that retains
            the characteristics of the ancestor. Members of a strain that subsequently
            differ from the original isolate are regarded as belonging either to a substrain
            of the original strain, or to a new strain.</comment>
        </column>
        <column length="50" name="Organ" type="@varchar" required="false">
            <comment>Organ of organism from which object is derived, if applicable.</comment>
            <comment>Organ is defined as any part of the body exercising a specific function, such as</comment>
            <comment>respiration, secretion, or digestion, if applicable.</comment>
        </column>
        <column length="50" name="Organelle" type="@varchar" required="false">
            <comment>Organelle of organism from which object is derived, if applicable.</comment>
        </column>
        <column length="100" name="Tissue" type="@varchar" required="false">
            <comment>Tissue of organism from which object is derived, if applicable. Can be used in</comment>
            <comment>conjunction with Organ.</comment>
            <comment>Tissue is defined as a collection of similar cells and the intercellular substances</comment>
            <comment>surrounding them. Multiple tissues can be part of an Organ.</comment>
        </column>
        <column length="50" name="CellType" type="@varchar" required="false">
            <comment>Cell type of organism from which object is derived, if applicable.</comment>
            <comment>Cell type is defined as the type of an individual cell, e.g., "myoblast". This is a</comment>
            <comment>cellular-level classification.</comment>
        </column>
        <column length="50" name="CellLine" type="@varchar" required="false">
            <comment>Cell line from which object is derived, if applicable</comment>
            <comment>Cell line usually pertains to an immortalized version of a given cell type</comment>
        </column>
        <column length="50" name="ATCCId" type="@varchar" required="false">
            <comment>Identifier assigned by ATCC.org to the cell.</comment>
        </column>
        <column name="Diseased" type="@boolean" required="false">
            <comment>'T' if source is diseased, else 'F'.</comment>
        </column>
        <column length="250" name="Disease" type="@varchar" required="false">
            <comment>If source was diseased, describes the disease borne by it.</comment>
        </column>
        <column length="50" name="DevelopmentStage" type="@varchar" required="false">
            <comment>Stage of development associated with the object, if applicable</comment>
        </column>
        <column length="15" name="Sex" type="@varchar" required="false">
            <comment>Sex of the organism from which object is derived, if
            applicable Enumerated. Values=Male/Female/Hermaphrodite/Asexual/NULL
            (NULL here means not provided by dataset)
            </comment>
            <enumeration>
                <restriction value="Male" description="Sex of organism is male"/>
                <restriction value="Female" description="Sex of organism is female"/>
                <restriction value="Hermaphrodite" description="Sex of organism is hermaphrodite"/>
                <restriction value="DoesNotApply" description="The notion of a sex does not apply to this organism"/>
            </enumeration>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>The dataset this entity came from or is associated with</comment>
            <foreignKey name="FK_BioSource2" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_BioSource" column="WID"/>
        <index name="BIOSOURCE_NAME" columns="Name"/>
        <index name="BIOSOURCE_STRAIN" columns="Strain"/>
        <index name="BIOSOURCE_ATCC" columns="ATCCId"/>
        <index name="BIOSOURCE_TAXONWID" columns="TAXONWID"/>
        <index name="BIOSOURCE_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="BioSubtype">
        <comment>Describes idiosyncratic sub-species descriptions such as "serotype", "variety", etc.</comment>
        <comment>These can be many to one (1 BioSource - many BioSubtypes) linked via
            BioSourceWIDBioSubtypeWID
        </comment>
        <!-- @- Created by YP 4/27/04 -->
        <!-- @- Added Version 3.0 -->
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse GUID for this BioSubtype</comment>
        </column>
        <column length="25" name="Type" type="@varchar" required="false">
            <comment>Type of subtype, e.g., "serotype"</comment>
        </column>
        <column length="50" name="Value" type="@varchar" required="true">
            <comment>Value of the subtype, e.g., "O157"</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>The dataset this entity came from or is associated with</comment>
            <foreignKey name="FK_BioSubtype2" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_BioSubtype" column="WID"/>
        <index name="BIOSUBTYPE_Type" columns="Type"/>
        <index name="BIOSUBTYPE_Value" columns="Value"/>
        <index name="BIOSUBTYPE_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="NucleicAcid">
        <comment>Defines a specific nucleic acid molecule, such as DNA or of RNA.</comment>
        <comment>Entries in this table correspond to a real-world DNA or RNA molecules</comment>
        <comment>which at one point were purified and isolated ("something you can point at"). A row in this
            table
        </comment>
        <comment>can define a complete molecule, a fragment of a molecule, or a molecule that has been
            partially
        </comment>
        <comment>sequenced in different regions.</comment>
        <comment>This table will be used in several ways: (1) to associate a sequence with an entire</comment>
        <comment>replicon, or a region of a replicon, when the sequence of that replicon is known; (2) to
            associate
        </comment>
        <comment>a DNA sequence with a single gene; (3) to define a DNA or RNA molecule that has not been</comment>
        <comment>sequenced; (4) to define RNA molecules such as tRNAs.</comment>
        <comment>Features on a NucleicAcid molecule (such as promoters or binding sites) can be defined using</comment>
        <comment>the Feature table.</comment>
        <comment>The Subsequence table contains zero or more full or partial sequences contents of this
            molecule.
        </comment>
        <comment>If one represents the full sequence of this molecule, Subsequence.FullSequence = 'T' where</comment>
        <comment>Subsequence.NucleicAcidWID references this molecule. In this case, NucleicAcid.FullySequenced = 'T' as
            well.
        </comment>
        <!-- @- TODO: Could add Unsequenced flag -->
        <!-- @- Updated extensively Version 3.0 -->
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this NucleicAcid.</comment>
        </column>
        <column length="200" name="Name" type="@varchar" required="false">
            <comment>Name or description of this molecule.</comment>
            <comment>Ex: (CMR) 'Chromosome II Brucella melitensis 16M'.</comment>
        </column>
        <column length="30" name="Type" type="@varchar" required="true">
            <comment>Enumeration: 'DNA' 'RNA' or 'na'</comment>
            <enumeration>
                <restriction value="DNA" description="The molecule is composed of DNA"/>
                <restriction value="RNA" description="The molecule is composed of RNA"/>
                <restriction value="NA" description="The molecule is specified as a nucleic acid but whether of type DNA or RNA is not known"/>
            </enumeration>
        </column>
        <column length="30" name="Class" type="@varchar" required="false">
            <comment>Enumeration: describes the molecule as it exists in the organism; stores values such as RNA subtype
                ("pre-RNA", "mRNA"), replicon type (e.g., "chromosome", "plasmid")
            </comment>
            <enumeration>
                <restriction value="pre-RNA" description="As it exists within the organism, the molecule is a pre-RNA molecule. NCBI: used when there is no evidence that mature RNA is produced"/>
                <restriction value="mRNA" description="As it exists within the organism, the molecule is a mature mRNA. NCBI: used when there is evidence that mature mRNA is produced"/>
                <restriction value="rRNA" description="As it exists within the organism, the molecule is an rRNA; NCBI used when there is evidence that mature rRNA is produced"/>
                <restriction value="tRNA" description="As it exists within the organism, the molecule is a tRNA; NCBI: used when there is evidence that mature tRNA is produced"/>
                <restriction value="snRNA" description="As it exists within the organism, the molecule is a small nuclear RNA. NCBI: used when there is evidence that snRNA is produced"/>
                <restriction value="scRNA" description="As it exists within the organism, the molecule is an RNA which encodes small cytoplasmic ribonucleic proteins. NCBI: used when there is evidence that gene codes of small cytoplasmic (sc) ribonucleoproteins (RNP)s"/>
                <restriction value="snoRNA" description="As it exists within the organism, the molecule is a small nucleolar RNA. NCBI: used when there is evidence that transcript is a small nucleolar RNA"/>
                <restriction value="other" description="Check notes as to how we map this..."/>
                <restriction value="chromosome" description="As it exists within the organism, the molecule is a chromosome"/>
                <restriction value="plasmid" description="As it exists within the organism, the molecule is a plasmid"/>
                <restriction value="organelle-chromosome" description="As it exists within the organism, the molecule is the chromosome of an organelle"/>
                <restriction value="transposon" description="As it exists within the organism, the molecule is a transposon"/>
                <restriction value="virus" description="As it exists within the organism, the molecule is a virus"/>
                <restriction value="unknown" description="Used when the class is unknown"/>
            </enumeration>
        </column>
        <column length="30" name="Topology" type="@varchar" required="false">
            <comment>Enumeration: 'circular', 'linear' or 'other'.</comment>
            <enumeration>
                <restriction value="linear" description="The topology of the molecule is Linear"/>
                <restriction value="circular" description="The topology of the molecule is Circular"/>
                <restriction value="other" description="The topology of the molecule is neither circular nor linear but is known"/>
            </enumeration>
        </column>
        <column length="30" name="Strandedness" type="@varchar" required="false">
            <comment>Enumeration indicating whether Nucleic Acid is single stranded, double stranded or mixed
                stranded.
            </comment>
            <enumeration>
                <restriction value="ss" description="The molecule is single stranded"/>
                <restriction value="ds" description="The molecule is double stranded"/>
                <restriction value="mixed" description="The molecule is composed of single and double stranded regions"/>
            </enumeration>
        </column>
        <column length="30" name="SequenceDerivation" type="@varchar" required="false">
            <comment>Enumeration describing how the sequence was generated</comment>
            <comment>(e.g., from single clone, from assembly of sequences</comment>
            <comment>from other sequence entries, collection of different clones, etc).</comment>
            <enumeration>
                <restriction value="virtual" description="NCBI: The sequence of the molecule is NOT known. NOTE: this should map to null."/>
                <restriction value="raw" description="POORLY DEFINED; seems to be used to indicate that the sequence of the molecule was actually generated from one single continuous molecule, as opposed to assembled together from sequences from different molecules (e.g., different clones)"/>
                <restriction value="seg" description="NCBI: The sequence of the molecule is made up of collection of segments arranged according to specified coordinates, e.g., sequence was derived from assembling sequences from different clones"/>
                <restriction value="reference" description="NCBI: The sequence of the molecule is constructed from existing Bioseqs;It behaves exactly like a segmented Bioseq in taking it's data and character from the Bioseq to which it points."/>
                <restriction value="constructed" description="NCBI: The sequence of the molecule is constructed by assembling other Bioseqs"/>
                <restriction value="consensus" description="NCBI: The sequence of the molecule represents a pattern typical of a sequence region or family of sequences;' it summarizes attributes of an aligned collection of real sequences. Note that this is NOT A REAL OBJECT"/>
                <restriction value="map" description="NCBI: The molecule does not have a sequence describing it, but rather a set of coordinates (restriction fragment order, genetic markers, physical map, etc)"/>
            </enumeration>
        </column>
        <column name="Fragment" type="@boolean" required="false">
            <comment>'T' if this is a fragment of a molecule,</comment>
            <comment>'F' if this NucleicAcid describes an entire molecule.</comment>
        </column>
        <column name="FullySequenced" type="@boolean" required="false">
            <comment>'T' if the molecule is completely</comment>
            <comment>sequenced within this dataset, else 'F'.</comment>
        </column>
        <column name="MoleculeLength" type="@int32" required="false">
            <comment>The length of the molecule, in nucleotides. This value is firm if FullySequenced is 'T';</comment>
            <comment>otherwise,MoleculeLength is an approximation and is not necessarily equal to
                CumulativeLength,
            </comment>
            <comment>as the the molecule may not have been sequenced to completion.</comment>
            <comment>This value is calculated if it is not explicitely stated in the source dataset</comment>
        </column>
        <column length="10" name="MoleculeLengthApproximate" type="@varchar" required="false">
            <comment>Enumeration; specifies whether MoleculeLength stores an approximate value:</comment>
            <comment>'gt' for greater than,</comment>
            <comment>'lt' for less than, or</comment>
            <comment>'ne' for not equal.</comment>
            <enumeration>
                <restriction value="gt" description="The length of the molecule's sequence is greater than the actual length specified"/>
                <restriction value="lt" description="The length of the molecule's sequence is less than the actual length specified"/>
                <restriction value="ne" description="The length of the molecule's sequence is less than or greater than the actual length. All we know is that its not the exact length"/>
            </enumeration>
        </column>
        <column name="CumulativeLength" type="@int32" required="false">
            <comment>The cumulative number of nucleotides for all Subsequences referenced by this NucleicAcid
                entry,
            </comment>
            <comment>whether contiguous or not. This value is a summation of the number of nucleotides for these
                Subsequences.
            </comment>
            <comment>If the molecule is completely sequenced, this value should be identical</comment>
            <comment>to that of MoleculeLength, and both fields are populated.</comment>
        </column>
        <column length="10" name="CumulativeLengthApproximate" type="@varchar" required="false">
            <comment>Enumeration; specifies whether CumulativeLength how approximates actual total length:</comment>
            <comment>'gt' for greater than,</comment>
            <comment>'lt' for less than, or</comment>
            <comment>'ne' for not equal.</comment>
            <enumeration>
                <restriction value="gt" description="The total length of the molecule's sequence is greater than the actual length"/>
                <restriction value="lt" description="The total length of the molecule's sequence is less than the actual length"/>
                <restriction value="ne" description="The total length of the molecule's sequence is less than or greater than the actual length. All we know is that its not the exact length"/>
            </enumeration>
        </column>
        <column name="GeneticCodeWID" type="@wid" required="false">
            <comment>References the genetic code of this molecule.</comment>
            <foreignKey name="FK_NucleicAcid1" toTable="GeneticCode" toColumn="WID"/>
        </column>
        <column name="BioSourceWID" type="@wid" required="false">
            <comment>References the biological source of this molecule.</comment>
            <foreignKey name="FK_NucleicAcid2" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>References the data set from which the entity came from</comment>
            <foreignKey name="FK_NucleicAcid3" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_NucleicAcid" column="WID"/>
        <index name="NUCLEICACID_Name" columns="Name"/>
        <index name="NUCLEICACID_Type" columns="Type"/>
        <index name="NUCLEICACID_Class" columns="Class"/>
        <index name="NUCLEICACID_MoleculeLength" columns="MoleculeLength"/>
        <index name="NUCLEICACID_CumulativeLength" columns="CumulativeLength"/>
        <index name="NUCLEICACID_GCWID" columns="GeneticCodeWID"/>
        <index name="NUCLEICACID_BSWID" columns="BioSourceWID"/>
        <index name="NUCLEICACID_DATASETWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Subsequence">
        <comment>Contains a contiguous sequence of a nucleic acid molecule. Multiple Subsequences can make up a given
            NucleicAcid entry.
        </comment>
        <comment>Contains either the full or partial nucleotide sequence of the nucleic acid molecule stored in
            NucleicAcid.
        </comment>
        <comment>Todo: Currently the schema has no way of indicating an approximate position</comment>
        <comment>of this Subsequence on the NucleicAcid as a whole.</comment>
        <!-- @- Ordering/map issues avoided for this release as too complex -->
        <!-- @- Added Version 3.0 -->
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this Subsequence.</comment>
        </column>
        <column name="NucleicAcidWID" type="@wid" required="true">
            <comment>References the containing nucleic acid molecule.</comment>
            <foreignKey name="FK_Subsequence1" toTable="NucleicAcid" toColumn="WID"/>
        </column>
        <column name="FullSequence" type="@boolean" required="false">
            <comment>'T' if this is the complete sequence of the nucleic acid molecule</comment>
            <comment>referenced by NucleicAcidWID, else 'F'.</comment>
        </column>
        <column name="Sequence" type="@string32" required="false">
            <comment>Nucleotide sequence of this Subsequence.</comment>
        </column>
        <column name="Length" type="@int32" required="false">
            <comment>Number of nucleotides (and characters) in Sequence. This value</comment>
            <comment>is calculated if it is not explicitely stated in the source</comment>
            <comment>dataset</comment>
        </column>
        <column length="10" name="LengthApproximate" type="@varchar" required="false">
            <comment>Enumeration; indicates that Length approximates actual Sequence length:</comment>
            <comment>'gt' for greater than,</comment>
            <comment>'lt' for less than, or</comment>
            <comment>'ne' for not equal.</comment>
        </column>
        <column name="PercentGC" type="@real32" required="false">
            <comment>Percentage of Sequence nucleotides that are either guanine or cytosine.</comment>
            <comment>This value is calculated if it is not explicitely stated in the source</comment>
            <comment>dataset</comment>
        </column>
        <column length="30" name="Version" type="@varchar" required="false">
            <comment>Dataset-specific information to indicate the version of this Subsequence.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Subsequence2" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Subsequence" column="WID"/>
        <index name="Subsequence_NAWID" columns="NucleicAcidWID"/>
        <index name="Subsequence_Length" columns="Length"/>
        <index name="Subsequence_PercentGC" columns="PercentGC"/>
        <index name="Subsequence_DWID" columns="DATASETWID"/>
    </table>

    <table type="object" name="Gene">
        <comment>Defines a notion of gene that is limited to procaryotic aspects of</comment>
        <comment>genes. Later versions of the warehouse will expand this definition to include</comment>
        <comment>eukaryotic aspects of genes. Separate tables define associations between a gene and</comment>
        <comment>(1) its biological source(s),</comment>
        <comment>(2) its protein product(s), if any, and</comment>
        <comment>(3) its RNA product(s), if any.</comment>
        <!-- @- Modified for 3.0 -->
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier this gene.</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="false">
            <comment>Name of the gene.</comment>
        </column>
        <column name="NucleicAcidWID" type="@wid" required="false">
            <comment>Reference to the NucleicAcid molecule (replicon) this gene resides upon.</comment>
            <foreignKey name="FK_Gene1" toTable="NucleicAcid" toColumn="WID"/>
        </column>
        <column name="SubsequenceWID" type="@wid" required="false">
            <comment>Reference to the Subsequence containing the nucleotide sequence of this Gene.</comment>
            <!-- @- Added 3.0 -->
        </column>
        <column length="100" name="Type" type="@varchar" required="false">
            <comment>Describes the type of molecule which is known to be *ultimately* produced by this gene</comment>
            <comment>enumerated values (polypeptide, pre-mRNA, rRNA, tRNA, etc)</comment>
            <enumeration>
                <restriction value="unknown" description="used when transcriptional status of gene is unknown"/>
                <restriction value="pre-RNA" description="used when there is no evidence that a mature RNA is ultimately produced by the gene"/>
                <restriction value="mRNA" description="used when there is evidence that a mature mRNA is ultimately produced by the gene"/>
                <restriction value="rRNA" description="used when there is evidence that a mature rRNA is ultimately produced by the gene"/>
                <restriction value="tRNA" description="used when there is evidence that a mature tRNA is ultimately produced by the gene"/>
                <restriction value="snRNA" description="used when there is evidence that an snRNA is ultimately produced by the gene"/>
                <restriction value="scRNA" description="????"/>
                <restriction value="polypeptide" description="used when there is evidence that the ultimate product of this gene is proteinaceous"/>
                <restriction value="snoRNA" description="???"/>
                <restriction value="other" description="catchall ?"/>
            </enumeration>
        </column>
        <column length="35" name="GenomeID" type="@varchar" required="false">
            <comment>Unique ID assigned to this gene, such as by a genome project</comment>
        </column>
        <column name="CodingRegionStart" type="@int32" required="false">
            <comment>Base position of start of coding region. Start is always less than End,</comment>
            <comment>except for genes that wrap around the origin of a circular chromosome.</comment>
        </column>
        <column name="CodingRegionEnd" type="@int32" required="false">
            <comment>Base position of end of coding region.</comment>
            <comment>Indexes the stop codon that terminates the gene.</comment>
        </column>
        <column length="10" name="CodingRegionStartApproximate" type="@varchar" required="false">
            <comment>Indicates that the Start position of the coding region is an approximate value.</comment>
            <comment>It could be 'gt' for greater than, 'lt' for less than and 'ne' to indicate that it is not</comment>
            <comment>equal. This is a controlled vocabulary.</comment>
        </column>
        <column length="10" name="CodingRegionEndApproximate" type="@varchar" required="false">
            <comment>Indicates that the End position of the coding region is an approximate value.</comment>
            <comment>It could be 'gt' for greater than, 'lt' for less than and 'ne' to indicate that it is not</comment>
            <comment>equal. This is a controlled vocabulary.</comment>
        </column>
        <column length="25" name="Direction" type="@varchar" required="false">
            <comment>Direction of transcription as defined in the enumeration table</comment>
            <enumeration>
                <restriction value="unknown" description="unknown the strand being transcribed is unknown"/>
                <restriction value="forward" description="the plus strand is being transcribed"/>
                <restriction value="reverse" description="the minus strand is being transcribed"/>
                <restriction value="forward_and_reverse" description="both strands are being transcribed"/>
                <restriction value="undefined_value" description="UNDEFINED; the NCBI documentation does not define this value"/>
            </enumeration>
        </column>
        <column name="Interrupted" type="@boolean" required="false">
            <comment>'T' if the gene is interrupted, else 'F'.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>Reference to the data set from which the entity came from</comment>
            <foreignKey name="FK_Gene2" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Gene" column="WID"/>
        <index name="GENE_DATASETWID" columns="DATASETWID" initial="true"/>
        <index name="GENE_Name" columns="Name"/>
        <index name="GENE_Type" columns="Type"/>
        <index name="GENE_GenomeID" columns="GenomeID"/>
        <index name="GENE_START_END_POSITION" columns="CODINGREGIONSTART, CODINGREGIONEND"/>
        <index name="GENE_ENDPOSITION" columns="CODINGREGIONEND"/>
        <index name="GENE_NAWID" columns="NucleicAcidWID"/>
        <index name="GENE_SubsequenceWID" columns="SubsequenceWID"/>
    </table>

    <table type="object" name="Pathway">
        <comment>Pathways are graphs of reactions, grouped together according to a</comment>
        <comment>higher biological function they perform. Some pathways may be</comment>
        <comment>"template", "reference", "model" or "sum of organisms" pathways. Those</comment>
        <comment>pathways do not contain an BioSourceWID reference, and have the type</comment>
        <comment>field set to "R" (Reference/Model/Theoretical). For real organisms,</comment>
        <comment>the type is "O".</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse ID for this pathway</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="true">
            <comment>Name of the pathway</comment>
            <enumeration>
                <restriction value="unknown" description="Name assigned when it is unknown or missing"/>
            </enumeration>
        </column>
        <column name="Type" type="@boolean" required="true">
            <comment>Type of pathway (see comment above)</comment>
        </column>
        <column name="BioSourceWID" type="@wid" required="false">
            <comment>BioSource this pathway occurs in</comment>
            <foreignKey name="FK_Pathway1" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the pathway is from</comment>
            <foreignKey name="FK_Pathway2" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Pathway" column="WID"/>
        <!-- @- Does KEGG loader use these indexes? -->
        <index name="PATHWAY_BSWID_WID_DWID" columns="BioSourceWID, WID, DataSetWID" initial="true"/>
        <index name="PATHWAY_TYPE_WID_DWID" columns="TYPE, WID, DataSetWID" initial="true"/>
        <index name="PATHWAY_DWID" columns="DataSetWID" initial="true"/>
        <index name="PATHWAY_Name" columns="Name"/>
    </table>

    <table type="object" name="Term">
        <comment>A term is a controlled vocabulary term used within a particular dataset.</comment>
        <comment>E.g. the keyword attached to proteins in SwissProt. Terms can be arranged</comment>
        <comment>in a hierarchy (see the TermRelationship table).</comment>
        <!-- @- Modified for 3.5 -->
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this term</comment>
        </column>
        <column length="255" name="Name" type="@varchar" required="true">
            <comment>Name for the term</comment>
        </column>
        <column name="Definition" type="@string10" required="false">
            <comment>Definition of the term</comment>
        </column>
        <column name="Hierarchical" type="@boolean" required="false">
            <comment>'T' if term is part of a hierarchy of terms</comment>
        </column>
        <column name="Root" type="@boolean" required="false">
            <comment>'T' if this term is at the top of a hierarchy</comment>
        </column>
        <column name="Obsolete" type="@boolean" required="false">
            <comment>'T' if term is known to be obsolete</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the pathway is from</comment>
        </column>
        <primaryKey name="PK_Term" column="WID"/>
        <index name="TERM_NAME" columns="NAME"/>
    </table>

    <table type="object" name="Computation">
        <comment>Defines a parameterized computation that has been performed on objects in the warehouse.</comment>
        <comment>TODO: Parameters are specified in the Parameter table.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>WID of this computation</comment>
        </column>
        <column length="50" name="Name" type="@varchar" required="true">
            <comment>Name of the algorithm, procedure, or program, e.g. 'BLAST'</comment>
        </column>
        <column name="Description" type="@string16" required="false">
            <comment>Description of the computation performed</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the computation is from</comment>
            <foreignKey name="FK_Computation" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Computation" column="WID"/>
        <index name="COMPUTATION_NAME" columns="NAME"/>
        <index name="COMPUTATION_DATASETWID" columns="DataSetWID"/>
    </table>

    <table type="object" name="Citation">
        <comment>Defines a literature citation.</comment>
        <comment>Typically a citation is associated with one or more Warehouse objects via the CitationWIDOtherWID
            table.
        </comment>
        <column name="WID" type="@wid" required="true">
            <comment>WID of this citation</comment>
        </column>
        <column name="Citation" type="@string10" required="false">
            <comment>Line of text containing the citation</comment>
        </column>
        <column name="PMID" type="@number" required="false">
            <comment>Pubmed ID of the citation, if known</comment>
        </column>

        <column name="Title" type="@varchar" length="255" required="false">
            <comment>Title of the article</comment>
        </column>
        <column name="Authors" type="@varchar" length="255" required="false">
            <comment>Author name(s)</comment>
        </column>
        <column name="Publication" type="@varchar" length="255" required="false">
            <comment>Publication title</comment>
        </column>
        <column name="Publisher" type="@varchar" length="255" required="false">
            <comment>Publisher's name</comment>
        </column>
        <column name="Editor" type="@varchar" length="255" required="false">
            <comment>Editor's name</comment>
        </column>
        <column name="Year" type="@varchar" length="255" required="false">
            <comment>Year of publication</comment>
        </column>
        <column name="Volume" type="@varchar" length="255" required="false">
            <comment>Volume of publication</comment>
        </column>
        <column name="Issue" type="@varchar" length="255" required="false">
            <comment>Issue number</comment>
        </column>
        <column name="Pages" type="@varchar" length="255" required="false">
            <comment>Page number(s)</comment>
        </column>
        <column name="URI" type="@varchar" length="255" required="false">
            <comment>Publication URI</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>WID of the dataset the Citation is from</comment>
            <foreignKey name="FK_Citation" toTable="DataSet" toColumn="WID"/>
        </column>

        <primaryKey name="PK_Citation" column="WID"/>
        <index name="CITATION_PMID" columns="PMID" initial="true"/>
        <index name="CITATION_CITATION" initial="true">
            <variant dialect="mysql" columns="Citation(20)"/>
            <variant dialect="oracle" columns="Citation"/>
        </index>
        <index name="CITATION_DATASETWID" columns="DataSetWID"/>
    </table>

    <table type="object" name="Archive">
        <comment>Defines an association between a warehouse entity and an external representation or depiction</comment>
        <comment>of that entity in a well-defined format.</comment>
        <comment>Can be used to store the contents itself, or to indicate that an archive is present at a URL.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>WID of entity archive is associated with</comment>
        </column>
        <column length="10" name="Format" type="@varchar" required="true">
            <comment>Storage/compression format used eg. 'zip' 'tar' 'tgz' 'jpeg'</comment>
        </column>
        <column name="Contents" type="@byte32" required="false">
            <comment>Archive contents</comment>
        </column>
        <column name="URL" type="@string10" required="false">
            <comment>Web address the archive is found at, ideally a specific file</comment>
        </column>
        <column length="50" name="ToolName" type="@varchar" required="false">
            <comment>The name of the tool or software kit the archive is used by</comment>
            <comment>eg. 'MIAMExpress'</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>DataSet.WID this entity is associated with</comment>
        </column>
        <primaryKey name="PK_ARCHIVE" column="WID"/>
        <!--<sd>SD CONSTRAINT FK_Archive1 FOREIGN KEY (ExperimentWID) REFERENCES Experiment(WID)</sd>-->
        <index name="ARCHIVE_OTHERWID" columns="OTHERWID"/>
        <index name="ARCHIVE_TOOL" columns="TOOLNAME"/>
        <index name="ARCHIVE_DATASETWID" columns="DataSetWID"/>
    </table>

    <table name="Experiment" type="object">
        <comment>Defines an experiment. Provides a context for associating experimental data with it.</comment>
        <comment>Allows tree-structured experiments consisting of heterogeneous subexperiments,</comment>
        <comment>subexperiments corresponding to time-series observations,</comment>
        <comment>and repeated trials of identical experiments.</comment>
        <comment>For a hierarchical experiment, data should be associated with the Experiment</comment>
        <comment>at the appropriate level. For example, if data reflects results from averaging</comment>
        <comment>numerous identically conducted trials, that data should be associated with the</comment>
        <comment>Experiment representing the group of these trials.</comment>
        <comment>A Comment table entry may be created to contain discussion of results, etc.</comment>
        <comment>A DBID table entry may be created if the (sub)experiment has a unique name within its
            DataSet.
        </comment>
        <comment>SynonymTable table entries may be created to associate names with the (sub)experiment.</comment>
        <comment>If published, a reference may be created in Citation table.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column length="50" name="Type" type="@varchar" required="true">
            <comment>Mnemonic for the general type of experiment, e.g. 'microarray'</comment>
        </column>
        <column name="ContactWID" type="@wid" required="false">
            <comment>Contact.WID for submitter/investigator</comment>
            <foreignKey name="FK_Experiment3" toTable="Contact" toColumn="WID"/>
        </column>
        <column name="ArchiveWID" type="@wid" required="false">
            <comment>Archive.WID of external rep'n of experiment and its data.</comment>
            <foreignKey name="FK_Experiment4" toTable="Archive" toColumn="WID"/>
        </column>
        <column name="StartDate" type="@datetime" required="false">
            <comment>Date+time experiment was started</comment>
        </column>
        <column name="EndDate" type="@datetime" required="false">
            <comment>Date+time experiment was completed</comment>
        </column>
        <column name="Description" type="@string16" required="false">
            <comment>Description of this experiment</comment>
        </column>
        <column name="GroupWID" type="@wid" required="false">
            <comment>Experiment.WID defining the parent group of this subexperiment</comment>
            <foreignKey name="FK_Experiment2" toTable="Experiment" toColumn="WID"/>
        </column>
        <column length="50" name="GroupType" type="@varchar" required="false">
            <comment>Enumeration indicating type of any and all direct subexperiments</comment>
            <comment>Exs: 'replicate' 'variant' 'step' 'time-series'</comment>
            <enumeration>
                <restriction value="replicate" description="All subexperiments attempt to replicate identical experimental conditions and parameters"/>
                <restriction value="variant" description="Subexperiments are variations upon an experimental procedure, technique, conditions, and/or parameters"/>
                <restriction value="time-series" description="Subexperiments consist of observations according to a specific schedule"/>
                <restriction value="step" description="Subexperiments comprise an experimental procedure and consist of an ordered sequence"/>
            </enumeration>
        </column>
        <column name="GroupSize" type="@int32" required="true">
            <comment>Number of child experiments loaded</comment>
        </column>
        <column name="GroupIndex" type="@int32" required="false">
            <comment>Counter value identifying this experiment in a sequence or set</comment>
            <comment>of subexperiments (eg. time-series). NULL if GroupWID is NULL.</comment>
        </column>
        <column name="TimePoint" type="@int32" required="false">
            <comment>Time offset indicating when associated observations in a</comment>
            <comment>time-series experiment were conducted</comment>
        </column>
        <column length="20" name="TimeUnit" type="@varchar" required="false">
            <comment>Enumeration for units of TimePoint</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>DataSet.WID this entity is associated with</comment>
            <foreignKey name="FK_Experiment5" toTable="DataSet" toColumn="WID"/>
        </column>
        <column name="BioSourceWID" type="@wid" required="false">
            <comment>References the biological source of this experiment, if applicable.</comment>
            <foreignKey name="FK_Experiment6" toTable="BioSource" toColumn="WID"/>
        </column>
        <primaryKey name="PK_Experiment" column="WID"/>
        <index name="EXP_TYPE" columns="TYPE"/>
        <index name="EXP_CON" columns="CONTACTWID"/>
        <index name="EXP_GROUP" columns="GROUPWID"/>
        <index name="EXP_DS" columns="DATASETWID"/>
    </table>

    <table type="object" name="ExperimentData">
        <comment>Specifies a relationship between one data entity and an experiment in which it was
	recorded as an observation or used in some other fashion.</comment>
	<comment></comment>
	<comment> Used in flow cytometry to represent both observations and filter wavelengths.</comment>
	<comment> For an observation: </comment>
	<comment> ExperimentData.Data contains the vector of observations </comment>
	<comment>   ExperimentData.MageData = NULL </comment>
	<comment>   ExperimentData.OtherWID = the FlowCytometrySample.WID of the sample, </comment>
	<comment>   ExperimentData.Role defines the reading ('forward scatter', 'side scatter', or 'filter'), </comment>
	<comment>   ExperimentData.Type = 'flow cytometry', </comment>
	<comment>   ExperimentData.Kind = 'O' (observation) </comment>
	<comment> For a filter wavelength: </comment>
	<comment>   ExperimentData.Data = NULL </comment>
	<comment>   ExperimentData.MageData references a ParameterValue row for the wavelength </comment>
	<comment>   ExperimentData.Role = 'filter wavelength' </comment>
	<comment>   ExperimentData.Kind = 'P' (parameter) </comment>
	<comment>   ExperimentData.OtherWID = the ExperimentData.WID of the observation, </comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column name="ExperimentWID" type="@wid" required="true">
            <comment>Experiment entity</comment>
            <foreignKey name="FK_ExpData1" toTable="Experiment" toColumn="WID"/>
        </column>
        <column name="Data" type="@string32" required="false">
            <comment>Data associated with experiment, in an unspecified format.
	             May be specified instead of or along with MageData.
            </comment>
        </column>
        <column name="MageData" type="@wid" required="false">
            <comment>Data associated with experiment using MAGE structure.
	             May be specified instead of or along with Data.
            </comment>
            <foreignKey name="FK_ExpDataMD" toTable="ParameterValue" toColumn="WID"/>
        </column>
        <column length="50" name="Role" type="@varchar" required="true">
            <comment>Describes how data is used in experiment</comment>
            <comment>ex: 'green intensity', 'forward scatter', 'filter wavelength'</comment>
        </column>
        <column name="Kind" type="@char" required="true">
            <comment>Characterizes relationship of data to experiment</comment>
            <enumeration>
                <restriction value="O" description="Data is an observation"/>
                <restriction value="C" description="Data is computed from an observation"/>
                <restriction value="P" description="Data is a parameter to a procedure or compuatation"/>
                <restriction value="M" description="Data is metadata describing other data"/>
            </enumeration>
        </column>
        <column name="DateProduced" type="@datetime" required="false">
            <comment>When the observation was taken, the computation was performed, etc.</comment>
        </column>
        <column name="OtherWID" type="@wid" required="false">
            <comment>WID of entity this experiment data is associated with.
	             If Kind='O', it is typically the sample or specimen being observed.
		     If Kind='P', it is typically another ExperimentData or ParameterizableApplication
		     that is parameterized by this entity.</comment>
        </column>
         <column name="DataSetWID" type="@wid" required="true">
            <comment>The data set this entity came from or is associated with</comment>
            <foreignKey name="FK_ExpData2" toTable="DataSet" toColumn="WID"/>
        </column>
       <primaryKey name="PK_ExpData" column="WID"/>
        <index name="EXPDATA_ExperimentWID" columns="ExperimentWID"/>
        <index name="EXPDATA_Kind" columns="Kind"/>
        <index name="EXPDATA_MageData" columns="MageData"/>
        <index name="EXPDATA_OtherWID" columns="OtherWID"/>
        <index name="EXPDATA_DS" columns="DATASETWID"/>
    </table>

    <table type="object" name="Support">
        <comment>Describes the source and strength of evidence for individual facts in the warehouse.</comment>
        <comment>This table is designed to allow different types of evidential support to be asserted for</comment>
        <comment>different types of database assertions, such as using one set of evidence types for supporting</comment>
        <comment>assertions about protein function, and another, possibly overlapping set of evidence types</comment>
        <comment>for supporting assertions about protein existence.</comment>
        <comment>Example use: Record that there are two sources of support for the function of a given</comment>
        <comment>protein, one computational and one experimental. This table has a WID for use in the</comment>
        <comment>CitationWIDOtherWID table.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>WID of this support</comment>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>WID of supported entity, e.g. Protein Function</comment>
            <sdKey name="FK_Support1" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_Support2" toTable="Element" toColumn="WID"/>
            <sdKey name="FK_Support3" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_Support4" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_Support5" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_Support6" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_Support7" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_Support8" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_Support9" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_Support10" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_Support11" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_Support14" toTable="Citation" toColumn="WID"/>
        </column>
        <column length="100" name="Type" type="@varchar" required="false">
            <comment>Type: Identifies the type of assertion that this row pertains to.</comment>
            <enumeration>
                <restriction value="protein function" description="The evidence supports protein function"/>
                <restriction value="protein existence" description="The evidence supports protein existence"/>
            </enumeration>
        </column>
        <column length="100" name="EvidenceType" type="@varchar" required="false">
            <comment>EvidenceType: Defines the type of evidential support that this row pertains to.</comment>
            <enumeration>
                <restriction value="computational" description="Valid when type is 'protein function'. Protein function is supported by a computational prediction (example: existence of a gene could be supported by a gene-finding program)."/>
                <restriction value="experimental" description="Valid when type is 'protein function'. Protein function is supported by data from a wet-lab experiment (example: existence of a gene could be supported observation of the gene's mRNA product in a microarray experiment)."/>
                <restriction value="Evidence at protein level" description="Valid when type is 'protein existence'. Protein existence is supported by the evidences at protein level (e.g. clear identification by mass spectrometry)."/>
                <restriction value="Evidence at transcript level" description="Valid when type is 'protein existence'. Protein existence is supported by evidences at transcript level (e.g. Northern blot)."/>
                <restriction value="Inferred from homology" description="Valid when type is 'protein existence'. Protein existence is inferred by homology (strong sequence similarity to known proteins in related species)."/>
                <restriction value="Predicted" description="Valid when type is 'protein existence'. Protein existence is predicted"/>
                <restriction value="Uncertain" description="Valid when type is 'protein existence'. Protein existence is uncertain (e.g. dubious sequences that could be the erroneous translation of a pseudogene)."/>
            </enumeration>
        </column>
        <column name="Confidence" type="@real32" required="false">
            <comment>0 &lt; confidence &lt;= 1.</comment>
        </column>
        <column name="DataSetWID" type="@wid" required="true">
            <comment>The data set this entity came from or is associated with</comment>
        </column>
        <!--Other table constraint: CONSTRAINT CK_Support CHECK (Confidence &gt; 0 AND Confidence &lt;= 1),-->
        <constraint>CONSTRAINT CK_Support CHECK (Confidence > 0 AND Confidence &lt;= 1)</constraint>
        <primaryKey name="PK_Support" column="WID"/>

        <index name="SUPPORT_OTHERWID" columns="OTHERWID"/>
        <index name="SUPPORT_TYPE" columns="TYPE"/>
        <index name="SUPPORT_CONFIDENCE" columns="CONFIDENCE"/>
    </table>

    <!-- =========================================================================== -->
    <!-- Tables that implement arbitrary relations among Warehouse objects. -->
    <!-- Naming convention is to use <table>WID as a column name for any WID -->
    <!-- referencing an object from  <table>. -->
    <!-- Tables are listed in alphabetical order. -->
    <!-- =========================================================================== -->

    <table name="ChemicalAtom" type="arbitrary-relation">
        <comment>The tables ChemicalAtom and ChemicalBond define the chemical bond structure of a chemical,
            the
        </comment>
        <comment>charge on the constituent atoms, and encodes a two or three dimensional representation of the</comment>
        <comment>structure. It is implicit that ChemicalBonds are symmetric.</comment>
        <comment>Atoms that are chiral centers are have a non-zero StereoParity field. Values for this field
            are
        </comment>
        <comment>defined in the Enumeration table, and are taken from MDL Molfile format defined in</comment>
        <comment>http://www.mdli.com/downloads/ctfile/ctfile_subs.html . That specification is confusing
            because
        </comment>
        <comment>it appears to define two redundant ways (marking atoms and marking bonds) of defining stereo</comment>
        <comment>configurations. Our theory is that the redundancy exists to allow different drawings of
            stereo
        </comment>
        <comment>configurations, and that for simply capturing a configuration, setting the StereoParity field</comment>
        <comment>of an atom is sufficient. Also, setting the BondStereo field of a bond could simplify drawing</comment>
        <comment>of chemical structures, and can allow different drawings of the same stereo configurations,</comment>
        <comment>which can be desirable. But these two fields can be interpreted independently of one another.</comment>
        <comment>See the appendix of the MDL specification for details on interpreting stereo configurations.</comment>
        <comment>E.g. H2O could be encoded as:</comment>
        <comment>ChemicalAtom (wid, 1, 'H', 0)</comment>
        <comment>ChemicalAtom (wid, 2, 'O', 0)</comment>
        <comment>ChemicalAtom (wid, 3, 'H', 0)</comment>
        <comment>ChemicalBond (wid, 1, 2, 1)</comment>
        <comment>ChemicalBond (wid, 2, 3, 1)</comment>
        <column name="ChemicalWID" type="@wid" required="true">
            <comment>WID of the chemical</comment>
            <foreignKey name="FK_ChemicalAtom" toTable="Chemical" toColumn="WID"/>
        </column>
        <column name="AtomIndex" type="@int16" required="true">
            <comment>Order of the atoms within the structure,</comment>
            <comment>starting from 1</comment>
        </column>
        <column length="2" name="Atom" type="@varchar" required="true">
            <comment>Element symbol of the atom</comment>
        </column>
        <column name="Charge" type="@int16" required="true">
            <comment>Charge on the atom</comment>
        </column>
        <column name="X" type="@number" required="false">
            <comment>X display coordinates for a drawing of the chemical structure</comment>
        </column>
        <column name="Y" type="@number" required="false">
            <comment>Y display coordinates for a drawing of the chemical structure</comment>
        </column>
        <column name="Z" type="@number" required="false">
            <comment>Z display coordinates for a drawing of the chemical structure</comment>
        </column>
        <column name="StereoParity" type="@number" required="false">
            <comment>Defines parity of an atom that is a chiral center.</comment>
            <enumeration>
                <restriction value="0" description="Not stereo."/>
                <restriction value="1" description="Odd parity."/>
                <restriction value="2" description="Even parity."/>
                <restriction value="3" description="Either or unmarked stereo center."/>
            </enumeration>
        </column>

        <!--Other table constraint: CONSTRAINT UN_ChemicalAtom UNIQUE (ChemicalWID, AtomIndex) @using-index-->
        <constraint>CONSTRAINT UN_ChemicalAtom UNIQUE (ChemicalWID, AtomIndex)</constraint>
        <index name="CA_WID" columns="CHEMICALWID"/>
        <index name="CA_ATOMINDEX" columns="ATOMINDEX"/>
        <index name="CA_ATOM" columns="ATOM"/>
        <index name="CA_CHARGE" columns="CHARGE"/>
        <index name="CA_X" columns="X"/>
        <index name="CA_Y" columns="Y"/>
        <index name="CA_Z" columns="Z"/>
        <index name="CA_SPARITY" columns="STEREOPARITY"/>
    </table>

    <table name="ChemicalBond" type="arbitrary-relation">
        <comment>The tables ChemicalAtom and ChemicalBond define the chemical bond structure of a chemical, the charge
            on
        </comment>
        <comment>the constituent atoms, and encodes a two or three dimensional representation of the
            structure.
        </comment>
        <comment>It is implicit that ChemicalBonds are symmetric. BondTypes and BondStereo are defined in the</comment>
        <comment>Enumeration table, and are taken from MDL Molfile format defined in</comment>
        <comment>http://www.mdli.com/downloads/ctfile/ctfile_subs.html . That specification is confusing. See</comment>
        <comment>documentation of ChemicalAtom table for more information.</comment>
        <comment>E.g. H2O could be encoded as:</comment>
        <comment>ChemicalAtom (wid, 1, 'H', 0)</comment>
        <comment>ChemicalAtom (wid, 2, 'O', 0)</comment>
        <comment>ChemicalAtom (wid, 3, 'H', 0)</comment>
        <comment>ChemicalBond (wid, 1, 2, 1)</comment>
        <comment>ChemicalBond (wid, 2, 3, 1)</comment>
        <column name="ChemicalWID" type="@wid" required="true">
            <comment>WID of the chemical</comment>
            <foreignKey name="FK_ChemicalBond" toTable="Chemical" toColumn="WID"/>
        </column>
        <column name="Atom1Index" type="@int16" required="true">
            <comment>Index of first atom bonded (from ChemicalAtom)</comment>
        </column>
        <column name="Atom2Index" type="@int16" required="true">
            <comment>Index of second atom bonded</comment>
        </column>
        <column name="BondType" type="@int16" required="true">
            <comment>Type of bond enumeration, e.g., 1=Single, 2=Double, 3=Triple, 4=Aromatic.</comment>
            <enumeration>
                <restriction value="1" description="Single bond."/>
                <restriction value="2" description="Double bond."/>
                <restriction value="3" description="Triple bond."/>
                <restriction value="4" description="Aromatic bond."/>
                <restriction value="5" description="Single or double bond."/>
                <restriction value="6" description="Single or aromatic bond."/>
                <restriction value="7" description="Double or aromatic bond."/>
                <restriction value="8" description="Any bond."/>
            </enumeration>
        </column>
        <column name="BondStereo" type="@number" required="false">
            <comment>Stereo information about bond, e.g., 0 = Not stereo.</comment>
            <enumeration>
                <restriction value="0" description="For single bonds, 0 = not stereo.   Four double bonds, 0 = use X,Y,Z coords to determine cis or trans."/>
                <restriction value="1" description="For single bonds, 1 = up."/>
                <restriction value="3" description="For double bonds, 3 = cis or trans (either) (presumably meaning unspecified or a mixture)."/>
                <restriction value="4" description="For single bonds, 4 = either."/>
                <restriction value="6" description="For single bonds, 6 = down."/>
            </enumeration>
        </column>
        <!-- todo: rename fk 'column' to 'columns' and 'tocolumns'? -->
        <foreignKey name="FK_ChemicalBond2" column="ChemicalWID, Atom1Index" toTable="ChemicalAtom"
                    toColumn="ChemicalWID, AtomIndex"/>
        <foreignKey name="FK_ChemicalBond3" column="ChemicalWID, Atom2Index" toTable="ChemicalAtom"
                    toColumn="ChemicalWID, AtomIndex"/>

        <index name="CB_WID" columns="ChemicalWID"/>
        <index name="CB_INDEX1" columns="ATOM1INDEX"/>
        <index name="CB_INDEX2" columns="ATOM2INDEX"/>
        <index name="CB_BONDTYPE" columns="BONDTYPE"/>
        <index name="CB_BONDSTEREO" columns="BONDSTEREO"/>
    </table>

    <table name="EnzReactionCofactor" type="arbitrary-relation">
        <comment>Cofactors are chemicals that are required for the enzyme to catalyze</comment>
        <comment>the reaction, but are left unchanged by the reaction. If multiple</comment>
        <comment>cofactors are listed for a reaction, this is interpreted as a disjunction.</comment>
        <comment>This table also encodes prosthetic groups.</comment>
        <column name="EnzymaticReactionWID" type="@wid" required="true">
            <comment>EnzymaticReaction.WID of the Enzymatic Reaction</comment>
            <foreignKey name="FK_EnzReactionCofactor1" toTable="EnzymaticReaction" toColumn="WID"/>
        </column>
        <column name="ChemicalWID" type="@wid" required="true">
            <comment>Chemical.WID of the compound</comment>
            <foreignKey name="FK_EnzReactionCofactor2" toTable="Chemical" toColumn="WID"/>
        </column>
        <column name="Prosthetic" type="@boolean" required="false">
            <comment>'T' if covalently/tightly bound to enzyme, else 'F'</comment>
        </column>

        <index name="ERCOFACTOR_ERWID" columns="ENZYMATICREACTIONWID"/>
        <index name="ERCOFACTOR_CHEMWID" columns="CHEMICALWID"/>
    </table>

    <table name="EnzReactionAltCompound" type="arbitrary-relation">
        <comment>Identifies a compound that is either an alternate substrate or an alternate cofactor</comment>
        <comment>to a primary compound present in an enzymatic reaction.</comment>
        <column name="EnzymaticReactionWID" type="@wid" required="true">
            <comment>EnzymaticReaction.WID of the Enzymatic Reaction</comment>
            <foreignKey name="FK_ERAC1" toTable="EnzymaticReaction" toColumn="WID"/>
        </column>
        <column name="PrimaryWID" type="@wid" required="true">
            <comment>Chemical.WID of primary compound</comment>
            <foreignKey name="FK_ERAC2" toTable="Chemical" toColumn="WID"/>
        </column>
        <column name="AlternativeWID" type="@wid" required="true">
            <comment>Chemical.WID of alternate compound</comment>
            <foreignKey name="FK_ERAC3" toTable="Chemical" toColumn="WID"/>
        </column>
        <column name="Cofactor" type="@boolean" required="false">
            <comment>'T' if this alternative is a cofactor, 'F' if it is a substrate</comment>
        </column>

        <index name="ERALT_ERWID" columns="ENZYMATICREACTIONWID"/>
        <index name="ERALT_PRIMWID" columns="PRIMARYWID"/>
        <index name="ERALT_ALTWID" columns="ALTERNATIVEWID"/>
    </table>

    <table name="EnzReactionInhibitorActivator" type="arbitrary-relation">
        <comment>Associates an enzymatic reaction to the compounds that act as</comment>
        <comment>inhibitors and activators for the reaction.</comment>
        <comment>The mechanism of action is encoded in the Mechanism column.</comment>
        <column name="EnzymaticReactionWID" type="@wid" required="true">
            <comment>EnzymaticReaction.WID of the Enzymatic Reaction</comment>
            <foreignKey name="FK_EnzReactionIA1" toTable="EnzymaticReaction" toColumn="WID"/>
        </column>
        <column name="CompoundWID" type="@wid" required="true">
            <comment>Chemical.WID or Protein.WID of the compound</comment>
            <sdKey name="FK_EnzReactionIA2" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_EnzReactionIA3" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="InhibitOrActivate" type="@char" required="false">
            <comment>Specifies whether the compound is an inhibitor or an activator.</comment>
            <enumeration>
                <restriction value="I" description="Specifies a compound that inhibits an enzyme."/>
                <restriction value="A" description="Specifies a compound that activates an enzyme."/>
            </enumeration>
        </column>
        <column name="Mechanism" type="@char" required="false">
            <comment>Mechanism of inhibition or activation.</comment>
            <enumeration>
                <restriction value="A" description="The mechanism of inhibition or activation is allosteric."/>
                <restriction value="I" description="The mechanism of inhibition or activation is irreversible."/>
                <restriction value="C" description="The mechanism of inhibition or activation is competitive."/>
                <restriction value="N" description="The mechanism of inhibition or activation is neither allosteric nor competitive."/>
                <restriction value="O" description="The mechanism of inhibition or activation is known but not in this controlled vocabulary."/>
                <restriction value="U" description="The mechanism of inhibition or activation is unknown."/>
            </enumeration>
        </column>
        <column name="PhysioRelevant" type="@boolean" required="false">
            <comment>'T' if physiologically relevant, else 'F'</comment>
        </column>

        <index name="ERIA_ERWID" columns="ENZYMATICREACTIONWID"/>
        <index name="ERIA_COMPOUNDWID" columns="CompoundWID"/>
        <index name="ERIA_MECH" columns="Mechanism"/>
    </table>

    <table name="Location" type="arbitrary-relation">
        <comment>Defines one or more locations of a protein.</comment>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>WID of the protein</comment>
            <foreignKey name="FK_Location" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Location" type="@varchar" length="100" required="true">
            <comment>Subcellular location of a protein.</comment>
        </column>
        <index name="LOCATION_ProteinWID" columns="ProteinWID"/>
    </table>

    <table name="PathwayLink" type="arbitrary-relation">
        <comment>This table allows us to state that two pathways are neighbors in</comment>
        <comment>a biologically significant sense, because they share a substrate</comment>
        <comment>in common. This link between two pathways is represented by the WIDs of the</comment>
        <comment>interacting pathways, and of the chemical compound that they share.</comment>
        <column name="Pathway1WID" type="@wid" required="true">
            <comment>WID of one of the linked pathways</comment>
            <foreignKey name="FK_PathwayLink1" toTable="Pathway" toColumn="WID"/>
        </column>
        <column name="Pathway2WID" type="@wid" required="true">
            <comment>WID of the other linked pathways</comment>
            <foreignKey name="FK_PathwayLink2" toTable="Pathway" toColumn="WID"/>
        </column>
        <column name="ChemicalWID" type="@wid" required="true">
            <comment>WID of the linking chemical</comment>
            <foreignKey name="FK_PathwayLink3" toTable="Chemical" toColumn="WID"/>
        </column>

        <index name="PATHLINK_P1WID_P2WID_CHEMWID" columns="PATHWAY1WID, PATHWAY2WID, CHEMICALWID"/>
        <index name="PATHLINK_P2WID" columns="PATHWAY2WID"/>
        <index name="PATHLINK_CHEMWID" columns="CHEMICALWID"/>
    </table>

    <table name="PathwayReaction" type="arbitrary-relation">
        <comment>A pathway is defined as a set of reaction pairs or a collection of molecular interactions between
            molecules.
            This table stores not only the relationships between pathway and reactions, but also relationships between
            molecular interaction network/pathway and interactions.
            For each pair of reactions R1 and R2, R1 directly precedes R2 in the pathway.
            Some reactions in a pathway may be considered hypothetical, probably because the presence of the enzyme
            has not been demonstrated.
            To specify an interaction is a part of a molecular interaction network/pathway, use R2 to represents
            a molecular interaction, leave R1 blank.
        </comment>
        <column name="PathwayWID" type="@wid" required="true">
            <comment>WID of a pathway</comment>
            <foreignKey name="FK_PathwayReaction1" toTable="Pathway" toColumn="WID"/>
        </column>
        <column name="ReactionWID" type="@wid" required="true">
            <comment>WID of a reaction, R2, in the pathway</comment>
        </column>
        <column name="PriorReactionWID" type="@wid" required="false">
            <comment>WID, R1, of a predecessor reaction of R2</comment>
            <foreignKey name="FK_PathwayReaction3" toTable="Reaction" toColumn="WID"/>
        </column>
        <column name="Hypothetical" type="@boolean" required="true">
            <comment>'F' if R2 proven to exist, 'T' otherwise.</comment>
        </column>

        <index name="PR_PATHWID_REACTIONWID" columns="PathwayWID, ReactionWID" initial="true"/>
        <index name="PR_REACTIONWID" columns="ReactionWID"/>
        <index name="PR_PRIORWID" columns="PriorReactionWID"/>
    </table>

    <table name="Product" type="arbitrary-relation">
        <comment>Associates a reaction with a chemical product of that reaction.</comment>
        <column name="ReactionWID" type="@wid" required="true">
            <comment>Warehouse identifier of the reaction that this reactant is part of.</comment>
            <foreignKey name="FK_Product" toTable="Reaction" toColumn="WID"/>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Reference to the chemical or protein that is the reactant.</comment>
            <sdKey name="FK_Product1" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_Product2" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Coefficient" type="@int16" required="true">
            <comment>The number of molecules of this reactant used in the reaction.</comment>
        </column>

        <index name="PRODUCT_REACTWID" columns="REACTIONWID"/>
        <index name="PRODUCT_OTHERWID" columns="OTHERWID"/>
        <index name="PRODUCT_COEFFICIENT" columns="COEFFICIENT"/>
    </table>

    <table name="Reactant" type="arbitrary-relation">
        <comment>Associates a reaction with a chemical that is consumed by the reaction.</comment>
        <column name="ReactionWID" type="@wid" required="true">
            <comment>Warehouse identifier of the reaction that this reactant is part of</comment>
            <foreignKey name="FK_Reactant" toTable="Reaction" toColumn="WID"/>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Reference to the chemical or protein that is the reactant.</comment>
            <sdKey name="FK_Reactant1" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_Reactant2" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Coefficient" type="@int16" required="true">
            <comment>The amount of this reactant used in the reation</comment>
        </column>

        <index name="REACTANT_WID" columns="ReactionWID"/>
        <index name="REACTANT_OTHERWID" columns="OTHERWID"/>
        <index name="REACTANT_COEFFICIENT" columns="Coefficient"/>
    </table>

    <table name="InteractionParticipant" type="arbitrary-relation">
        <comment>Associates an interaction with the entity that participates in the interaction.</comment>
        <column name="InteractionWID" type="@wid" required="true">
            <comment>Reference to the interaction that the entity is involved in.</comment>
            <foreignKey name="FK_InteractionParticipant1" toTable="Interaction" toColumn="WID"/>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Reference to the protein, nucletic acid, chemical that involves in the interaction.</comment>
            <sdKey name="FK_IP_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_IP_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_IP_Protein" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Coefficient" type="@int16" required="false">
            <comment>The amount of this interaction participant involved in the interaction, if available.</comment>
        </column>
        <index name="PR_INTERACTIONWID_OTHERWID" columns="InteractionWID, OtherWID" initial="true"/>
    </table>

    <table name="SequenceMatch" type="arbitrary-relation">
        <comment>Records a result of a computation of the degree of match between two sequences.</comment>
        <comment>Sequences are either both Proteins or both Subsequences.</comment>
        <column name="QueryWID" type="@wid" required="true">
            <comment>WID of the Protein or Subsequence being matched</comment>
            <sdKey name="FK_SequenceMatch1" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_SequenceMatch3" toTable="Subsequence" toColumn="WID"/>
        </column>
        <column name="MatchWID" type="@wid" required="true">
            <comment>WID of the Protein or Subsequence matched against QueryWID</comment>
            <sdKey name="FK_SequenceMatch2" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_SequenceMatch4" toTable="Subsequence" toColumn="WID"/>
        </column>
        <column name="ComputationWID" type="@wid" required="true">
            <comment>WID of the Computation that describes the procedure used to determine the match</comment>
            <foreignKey name="FK_SequenceMatch" toTable="Computation" toColumn="WID"/>
        </column>
        <column name="EValue" type="@real64" required="false">
            <comment>Roughly, the log-probability of this match occurring; see
                http://www.ncbi.nlm.nih.gov/BLAST/tutorial/Altschul-1.html
            </comment>
        </column>
        <column name="PValue" type="@real64" required="false">
            <comment>1 - e^(-E), where E is EValue</comment>
        </column>
        <column name="PercentIdentical" type="@real32" required="false">
            <comment>Percentage of residues in the two molecules that are identical</comment>
        </column>
        <column name="PercentSimilar" type="@real32" required="false">
            <comment>Percentage of residues in the two molecules that are similar</comment>
        </column>
        <column name="Rank" type="@int16" required="false">
            <comment>Ordinal rank of Query molecule with other matches (1 is best)</comment>
        </column>
        <column name="Length" type="@int32" required="false">
            <comment>The length of the match between the two molecules</comment>
        </column>
        <column name="QueryStart" type="@int32" required="false">
            <comment>Start of the matching region in Query</comment>
        </column>
        <column name="QueryEnd" type="@int32" required="false">
            <comment>End of the matching region in Query</comment>
        </column>
        <column name="MatchStart" type="@int32" required="false">
            <comment>Start of the matching region in Match</comment>
        </column>
        <column name="MatchEnd" type="@int32" required="false">
            <comment>End of the matching region in Match</comment>
        </column>

        <index name="SM_QUERYWID" columns="QueryWID"/>
        <index name="SM_MATCHWID" columns="MatchWID"/>
        <index name="SM_COMPUTATIONWID" columns="ComputationWID"/>
        <index name="SM_EVALUE" columns="EValue"/>
        <index name="SM_PVALUE" columns="PValue"/>
        <index name="SM_PIDENTICAL" columns="PercentIdentical"/>
        <index name="SM_PSIMILAR" columns="PercentSimilar"/>
        <index name="SM_RANK" columns="Rank"/>
        <index name="SM_LENGTH" columns="Length"/>
        <index name="SM_QSTART_QEND" columns="QueryStart, QueryEnd"/>
        <index name="SM_QEND" columns="QueryEnd"/>
        <index name="SM_MSTART_MEND" columns="MatchStart,MatchEnd"/>
        <index name="SM_MEND" columns="MatchEnd"/>
    </table>

    <table name="Subunit" type="arbitrary-relation">
        <comment>Specifies that Subunit is a subunit of Complex. These subunit relationships could be</comment>
        <comment>described in multiple levels. For example, this table can be used to describe multimeric
            proteins,
        </comment>
        <comment>or ribosomes.</comment>
        <column name="ComplexWID" type="@wid" required="true">
            <comment>Reference to the parent Protein</comment>
            <foreignKey name="FK_Subunit1" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="SubunitWID" type="@wid" required="true">
            <comment>Reference to the child protein inside the parent Protein</comment>
            <foreignKey name="FK_Subunit2" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="Coefficient" type="@int16" required="false">
            <comment>Number of copies of the subunit within the complex</comment>
        </column>

        <index name="SUBUNIT_PROW1ID" columns="COMPLEXWID"/>
        <index name="SUBUNIT_PROW2ID" columns="SubunitWID"/>
        <index name="SUBUNIT_COEF" columns="COEFFICIENT"/>
    </table>

    <table name="SuperPathway" type="arbitrary-relation">
        <comment>Pathways may be arranged in a hierarchy, i.e. containment within one or</comment>
        <comment>more superpathways, as an abstraction mechanism.</comment>
        <column name="SubPathwayWID" type="@wid" required="true">
            <comment>WID of sub-pathway</comment>
            <foreignKey name="FK_SuperPathway1" toTable="Pathway" toColumn="WID"/>
        </column>
        <column name="SuperPathwayWID" type="@wid" required="true">
            <comment>WID of super-pathway</comment>
            <foreignKey name="FK_SuperPathway2" toTable="Pathway" toColumn="WID"/>
        </column>

        <index name="SUPER_SUBWID_SUPERWID" columns="SUBPATHWAYWID,SUPERPATHWAYWID"/>
        <index name="SUPER_SUPERWID_SUBWID" columns="SUPERPATHWAYWID,SUBPATHWAYWID"/>
    </table>

    <table name="TermRelationship" type="arbitrary-relation">
        <comment>Defines a relationship between two terms.</comment>
        <!-- @- Added for 3.5 -->
        <column name="TermWID" type="@wid" required="true">
            <comment>Reference to a term.</comment>
            <foreignKey name="FK_TermRelationship1" toTable="Term" toColumn="WID"/>
        </column>
        <column name="RelatedTermWID" type="@wid" required="true">
            <comment>The WID of the term the current term is related to.</comment>
            <foreignKey name="FK_TermRelationship2" toTable="Term" toColumn="WID"/>
        </column>
        <column length="10" name="Relationship" type="@varchar" required="true">
            <comment>Enumeration.</comment>
        </column>

        <index name="TR_TermRelationship" columns="TermWID,RelatedTermWID"/>
        <index name="RT_TermRelationship" columns="RelatedTermWID,TermWID"/>
    </table>

    <!-- ============================================================================================ -->
    <!-- Tables that reference an untyped WID (one that could be from one of several object tables).  -->
    <!-- Naming convention is to use OtherWID as a column name for the untyped WID.                   -->
    <!-- Tables are listed in alphabetical order.                                                     -->
    <!-- ============================================================================================ -->

    <table name="RelatedTerm" type="object-descriptor">
        <comment>Defines a relationship between a term and another object.
	         For relationships between terms, TermRelationship is generally used.
        </comment>
        <column name="TermWID" type="@wid" required="true">
            <comment>Reference to a term.</comment>
            <foreignKey name="FK_RelatedTerm1" toTable="Term" toColumn="WID"/>
        </column>
        <column name="OtherWID" type="@wid" required="true">
            <comment>The WID of the object associated with this term.</comment>
            <sdKey name="FK_RT_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_RT_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_RT_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_RT_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_RT_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_RT_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_RT_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_RT_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_RT_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_RT_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_RT_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_RT_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_RT_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_RT_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_RT_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_RT_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_RT_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_RT_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_RT_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_RT_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_RT_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_RT_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_RT_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column length="50" name="Relationship" type="@varchar" required="false">
            <comment>Enumeration.</comment>
            <enumeration>
                 <restriction value="keyword" description="The term is a keyword that characterizes the object."/>
                 <restriction value="superclass" description="The term names a class, and the object is an instance or a subclass of that class."/>
            </enumeration>
       </column>

        <index name="TO_RelatedTerm" columns="TermWID,OtherWID"/>
        <index name="OT_RelatedTerm" columns="OtherWID,TermWID"/>
    </table>

    <table name="CitationWIDOtherWID" type="object-descriptor">
        <comment>Link from citations to the entities described in that citation. Enables one citation to</comment>
        <comment>provide support for multiple entries in the warehouse.</comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>WID of the object associated with this citation</comment>
            <sdKey name="FK_CWOW_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_CWOW_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_CWOW_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_CWOW_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_CWOW_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_CWOW_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_CWOW_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_CWOW_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_CWOW_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_CWOW_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_CWOW_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_CWOW_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_CWOW_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_CWOW_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_CWOW_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_CWOW_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_CWOW_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_CWOW_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_CWOW_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_CWOW_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_CWOW_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_CWOW_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_CWOW_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column name="CitationWID" type="@wid" required="true">
            <comment>WID of the Citation</comment>
            <foreignKey name="FK_CitationWIDOtherWID" toTable="Citation" toColumn="WID"/>
        </column>

        <index name="CO_OTHERWID_CITATIONWID" columns="OtherWID,CitationWID"/>
        <index name="CO_CITATIONWID_OTHERWID" columns="CitationWID,OtherWID"/>
    </table>

    <table name="CommentTable" type="object-descriptor">
        <comment>This table allows for arbitrary association of (possibly lengthy) comments</comment>
        <comment>with any object in the warehouse.</comment>
        <comment>See the Description table for a more specific type of comment.</comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Warehouse id of an object</comment>
            <sdKey name="FK_COMMENT_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_COMMENT_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_COMMENT_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_COMMENT_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_COMMENT_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_COMMENT_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_COMMENT_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_COMMENT_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_COMMENT_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column name="Comm" type="@string32" required="false">
            <comment>Comment about the object</comment>
        </column>

        <index name="COMMENT_OTHERWID" columns=" OTHERWID "/>
    </table>

    <table name="CrossReference" type="object-descriptor">
        <comment>This table is used to define (i) links between databases; (ii) links between objects within the same
            dataset.
        </comment>
        <comment>For case (i):</comment>
        <comment>A row in this table defines a link between an object in the warehouse</comment>
        <comment>(OtherWID) and an entry in another dataset that may or may not be loaded</comment>
        <comment>into the warehouse. If it is not loaded, DatabaseName</comment>
        <comment>(and XID, Type, and Version if available) will be nonnull.</comment>
        <comment>For case (ii):</comment>
        <comment>A row in this table defines a link between an object in the warehouse</comment>
        <comment>(OtherWID) and an object in the same dataset for which the dataset specifies</comment>
        <comment>an association between them not otherwise represented within the warehouse.</comment>
        <comment>Such associations are currently (5/10/04) made between a gene described in one sequence (the root
            Bioseq) and
        </comment>
        <comment>another GenBank entry (the reference Bisoseq) which is being referenced and describes the gene
            independently
        </comment>
        <comment>of the first Bioseq. In such a case, CrossReference.OtherWID=Gene.WID.</comment>
        <comment>In either case: if CrossWID is nonnull, the object linked to is</comment>
        <comment>loaded into the warehouse; if it is null, it may or may not be loaded.</comment>
        <comment>Note that if a loader does not know whether a referenced entry will be loaded,</comment>
        <comment>it is free to fill in CrossWID at a later time.</comment>
        <comment>Restrictions: CrossReference only stores keys that point to uniquely identified objects in the
            referenced database.
        </comment>
        <!-- @- 3.0 Changed DatasetName column to DatabaseName -->
        <!-- @- 3.0 Added Type, Version -->
        <!-- @- 3.0 Replaced DatasetWID with CrossWID, made XID nullable -->
        <column name="OtherWID" type="@wid" required="true">
            <comment>Warehouse object we are linking FROM</comment>
            <sdKey name="FK_XREF_OTHER_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_XREF_OTHER_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column name="CrossWID" type="@wid" required="false">
            <comment>Nonnull when the object we are linking TO resides in the warehouse</comment>
            <sdKey name="FK_XREF_CROSS_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_XREF_CROSS_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column length="50" name="XID" type="@varchar" required="false">
            <comment>Unique id used in referenced database of object we are linking TO.</comment>
        </column>
        <column length="20" name="Type" type="@varchar" required="false">
            <comment>Enumeration: Describes the types of identifiers stored in
            XID, namely 'GUID' or 'Accession': GUIDs: ID's of type GUID
            (Globally Unique ID) are associated with database objects with one
            or more invariant aspects, such as a specific DNA sequence. If the
            invariant aspect of the database object is to change, a new GUID is
            assigned, and the old GUID is retired. Example: NCBI GI numbers.
            Accession: Database objects associated with IDs of type 'Accession'
            (for Accession Numbers) can change, but the Accession Number remains
            the same. Accession Numbers are often associated with a Version
            number to reflect such changes. Example: Swiss-Prot's Primary
            Accession Number See Enumeration table for further
            details.</comment>
            <enumeration>
                <restriction value="Accession" description="Type of XID is an accession number (not guaranteed to be unique across datasets)"/>
                <restriction value="GUID" description="Type of XID is a global unique identifier (guaranteed to be unique across datasets for a given database provider)"/>
            </enumeration>
        </column>
        <column length="10" name="Version" type="@varchar" required="false">
            <comment>Further qualifies the values of identifiers stored in XID by
            storing the version number of the identifier for datasets that
            support multiple instances of the same object. For example,
            NCBI Accession Numbers are associated with a version number,
            which are REQUIRED for complete identification (w/o such,
            different records can have the same accession number, albeit
            with different version numbers)</comment>
        </column>
        <column length="50" name="Relationship" type="@varchar" required="false">
            <comment>A short description of the relationship between the objects identified by OtherWID and CrossWID
            </comment>
        </column>
        <column length="255" name="DatabaseName" type="@varchar" required="false">
            <comment>The object we are linking TO resides in an external database of this name</comment>
        </column>

        <index name="CROSS_OTHERWID" columns="OTHERWID"/>
        <index name="CROSS_XID" columns="XID"/>
    </table>
    
    <table name="Description" type="object-descriptor">
        <comment>This table contains a textual description of a warehouse object.</comment>
        <comment>An object will not have more than one description, and the description text</comment>
        <comment>will typically define or otherwise characterize the object.</comment>
        <comment>See the CommentTable table for a more general type of comment.</comment>
        <!-- @string10 chosen for length so that Comm can be indexed.-->
        <column name="OtherWID" type="@wid" required="true">
            <comment>Warehouse id of an object</comment>
            <sdKey name="FK_DESCRIP_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_DESCRIP_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column length="30" name="TableName" type="@varchar" required="true">
            <comment>Name of Warehouse table containing OtherWID</comment>
        </column>
        <column name="Comm" type="@string10" required="false">
            <comment>Description of the object</comment>
        </column>

        <index name="Description_OTHERWID" columns=" OTHERWID "/>
    </table>

    <table name="DBID" type="object-descriptor">
        <comment>Associates a warehouse entity with the identifier(s) used for that entity in its</comment>
        <comment>source dataset. For example, if a protein is loaded from SwissProt into the</comment>
        <comment>warehouse, this table can be used to store the SwissProt accession numbers for</comment>
        <comment>the protein.</comment>
        <comment>Restrictions: DBID only stores keys that point to uniquely identified objects in the referenced
            database.
        </comment>
        <!-- @- 3.0 Added Type, Version -->
        <column name="OtherWID" type="@wid" required="true">
            <comment>Reference to the warehouse entity uniquely identified by this entry</comment>
            <sdKey name="FK_DBID_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_DBID_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_DBID_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_DBID_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_DBID_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_DBID_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_DBID_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_DBID_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_DBID_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_DBID_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_DBID_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_DBID_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_DBID_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_DBID_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_DBID_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_DBID_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_DBID_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_DBID_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_DBID_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_DBID_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_DBID_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_DBID_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_DBID_Support" toTable="Support" toColumn="WID"/>
            <sdKey name="FK_DBID_Spot" toTable="Spot" toColumn="WID"/>
        </column>
        <column length="150" name="XID" type="@varchar" required="true">
            <comment>Unique identifier used in dataset of entity</comment>
        </column>
        <column length="20" name="Type" type="@varchar" required="false">
            <comment>Enumeration: Describes the types of identifiers stored in
            XID, namely 'GUID' or 'Accession': GUIDs: ID's of type GUID
            (Globally Unique ID) are associated with database objects with one
            or more invariant aspects, such as a specific DNA sequence. If the
            invariant aspect of the database object is to change, a new GUID is
            assigned, and the old GUID is retired. Example: NCBI GI numbers.
            Accession: Database objects associated with IDs of type 'Accession'
            (for Accession Numbers) can change, but the Accession Number remains
            the same. Accession Numbers are often associated with a Version
            number to reflect such changes. Example: Swiss-Prot's Primary
            Accession Number See Enumeration table for further
            details.</comment>
            <enumeration>
                <restriction value="Accession" description="Type of XID is an accession number (not guaranteed to be unique across datasets)"/>
                <restriction value="GUID" description="Type of XID is a global unique identifier (guaranteed to be unique across datasets for a given database provider)"/>
            </enumeration>
        </column>
        <column length="10" name="Version" type="@varchar" required="false">
            <comment>Further qualifies the values of identifiers stored in XID by
            storing the version number of the identifier for datasets that
            support multiple instances of the same object. For example,
            NCBI Accession Numbers are associated with a version number,
            which are REQUIRED for complete identification (w/o such,
            different records can have the same accession number, albeit
            with different version numbers)</comment>
        </column>

        <index name="DBID_XID_OTHERWID" columns="XID, OTHERWID" initial="true"/>
        <index name="DBID_OTHERWID" columns="OTHERWID" initial="true"/>
    </table>

    <table name="SynonymTable" type="object-descriptor">
        <comment>Defines one or more synonyms for a warehouse entity such as a protein, a</comment>
        <comment>gene, a small molecule, or a pathway.</comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>Warehouse ID of an entity</comment>
            <sdKey name="FK_SYNONYM_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_SYNONYM_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column length="255" name="Syn" type="@varchar" required="true">
            <comment>Another name for the entity</comment>
        </column>

        <index name="SYNONYM_OTHERWID_SYN" columns="OTHERWID, SYN" initial="true"/>
        <index name="SYNONYM_SYN" columns="Syn"/>
    </table>

    <table name="ToolAdvice" type="object-descriptor">
        <comment>This table captures meta-data that does not have an interpretation in</comment>
        <comment>the warehouse semantics, but is `hints' to various tools that may</comment>
        <comment>operate on, or build pictorial representations of, core elements of the</comment>
        <comment>schema. For example, it may give hints to a particular pathway viewing</comment>
        <comment>tool on how to layout a pathway.</comment>
        <column name="OtherWID" type="@wid" required="true">
            <comment>The entity to which this advice applies</comment>
            <sdKey name="FK_TOOL_Chemical" toTable="Chemical" toColumn="WID"/>
            <sdKey name="FK_TOOL_Reaction" toTable="Reaction" toColumn="WID"/>
            <sdKey name="FK_TOOL_Protein" toTable="Protein" toColumn="WID"/>
            <sdKey name="FK_TOOL_Feature" toTable="Feature" toColumn="WID"/>
            <sdKey name="FK_TOOL_Function" toTable="Function" toColumn="WID"/>
            <sdKey name="FK_TOOL_EnzymaticReaction" toTable="EnzymaticReaction" toColumn="WID"/>
            <sdKey name="FK_TOOL_GeneticCode" toTable="GeneticCode" toColumn="WID"/>
            <sdKey name="FK_TOOL_Division" toTable="Division" toColumn="WID"/>
            <sdKey name="FK_TOOL_Taxon" toTable="Taxon" toColumn="WID"/>
            <sdKey name="FK_TOOL_BioSource" toTable="BioSource" toColumn="WID"/>
            <sdKey name="FK_TOOL_BioSubtype" toTable="BioSubtype" toColumn="WID"/>
            <sdKey name="FK_TOOL_NucleicAcid" toTable="NucleicAcid" toColumn="WID"/>
            <sdKey name="FK_TOOL_Subsequence" toTable="Subsequence" toColumn="WID"/>
            <sdKey name="FK_TOOL_Gene" toTable="Gene" toColumn="WID"/>
            <sdKey name="FK_TOOL_Pathway" toTable="Pathway" toColumn="WID"/>
            <sdKey name="FK_TOOL_Term" toTable="Term" toColumn="WID"/>
            <sdKey name="FK_TOOL_Computation" toTable="Computation" toColumn="WID"/>
            <sdKey name="FK_TOOL_Citation" toTable="Citation" toColumn="WID"/>
            <sdKey name="FK_TOOL_PointOfContact" toTable="Contact" toColumn="WID"/>
            <sdKey name="FK_TOOL_Archive" toTable="Archive" toColumn="WID"/>
            <sdKey name="FK_TOOL_Experiment" toTable="Experiment" toColumn="WID"/>
            <sdKey name="FK_TOOL_ExperimentData" toTable="ExperimentData" toColumn="WID"/>
            <sdKey name="FK_TOOL_Support" toTable="Support" toColumn="WID"/>
        </column>
        <column length="50" name="ToolName" type="@varchar" required="true">
            <comment>The name of the tool</comment>
        </column>
        <column name="Advice" type="@string32" required="false">
            <comment>The advice</comment>
        </column>

        <index name="TOOL_OTHERWID" columns="OtherWID"/>
        <index name="TOOL_NAME" columns="ToolName"/>
    </table>

    <!-- ============================================================================================ -->
    <!-- Tables that (only) link WIDs from two object tables.                                         -->
    <!-- These tables implement many-many relations between Warehouse objects.                        -->
    <!-- Tables are listed in alphabetical order.                                                     -->
    <!-- Naming convention is <table1>WID<table2>WID                                                  -->
    <!-- ============================================================================================ -->

    <table name="BioSourceWIDBioSubtypeWID" type="associative">
        <comment>Linking table which links BioSource and BioSubtype</comment>
        <!-- @- Created by YP 4/27/04 -->
        <!-- @- Added Version 3.0 -->
        <column name="BioSourceWID" type="@wid" required="true">
            <comment>Links to the BioSource associated with this object.</comment>
            <foreignKey name="FK_BioSourceWIDBioSubtypeWID1" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="BioSubtypeWID" type="@wid" required="true">
            <comment>Links to the BioSubtype associated with this object.</comment>
            <foreignKey name="FK_BioSourceWIDBioSubtypeWID2" toTable="BioSubtype" toColumn="WID"/>
        </column>

        <index name="BB_BSWID_BSTWID" columns="BioSourceWID, BioSubtypeWID"/>
        <index name="BB_BSTWID_BSWID" columns="BioSubtypeWID, BioSourceWID"/>
    </table>

    <table name="BioSourceWIDGeneWID" type="associative">
        <comment>Associates a gene with those species, strains, tissues, etc, from which it was derived.</comment>
        <column name="BioSourceWID" type="@wid" required="true">
            <comment>Reference to the BioSource that has this gene.</comment>
            <foreignKey name="FK_BioSourceWIDGeneWID1" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="GeneWID" type="@wid" required="true">
            <comment>Reference to the Gene that is present in the organism.</comment>
            <foreignKey name="FK_BioSourceWIDGeneWID2" toTable="Gene" toColumn="WID"/>
        </column>

        <index name="BG_BIOSOURCEWID_GENEWID" columns="BioSourceWID, GENEWID"/>
        <index name="BG_GENEWID_BIOSOURCEWID" columns="GENEWID, BioSourceWID"/>
    </table>

    <table name="BioSourceWIDProteinWID" type="associative">
        <comment>Associates a protein with those species, strains, tissues, etc, from which it was derived.</comment>
        <column name="BioSourceWID" type="@wid" required="true">
            <comment>Reference to the BioSource that has this protein.</comment>
            <foreignKey name="FK_BioSourceWIDProteinWID1" toTable="BioSource" toColumn="WID"/>
        </column>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>Reference to the Protein that is present in the organism.</comment>
            <foreignKey name="FK_BioSourceWIDProteinWID2" toTable="Protein" toColumn="WID"/>
        </column>

        <index name="BP_BIOSOURCEWID_PROWID" columns="BioSourceWID,PROTEINWID"/>
        <index name="BP_PROWID_BIOSOURCEWID" columns="PROTEINWID, BioSourceWID"/>
    </table>

    <table name="GeneWIDNucleicAcidWID" type="associative">
        <comment>Associates a gene with its nucleic acid product(s).</comment>
        <comment>Note that the nucleic acid (ie. replicon) containing the gene is referenced by
            Gene.NucleicAcidWID,
        </comment>
        <comment>not in this table.</comment>
        <column name="GeneWID" type="@wid" required="true">
            <comment>Reference to the Gene that produces this nucleic acid.</comment>
            <foreignKey name="FK_GeneWIDNucleicAcidWID1" toTable="Gene" toColumn="WID"/>
        </column>
        <column name="NucleicAcidWID" type="@wid" required="true">
            <comment>Reference to the nucleic acid that has this gene.</comment>
            <foreignKey name="FK_GeneWIDNucleicAcidWID2" toTable="NucleicAcid" toColumn="WID"/>
        </column>

        <index name="GN_GENEWID_NAWID" columns="GENEWID,NUCLEICACIDWID"/>
        <index name="GN_NAWID_GENEWID" columns="NUCLEICACIDWID,GENEWID"/>
    </table>

    <table name="GeneWIDProteinWID" type="associative">
        <comment>Associates a gene with its protein product(s).</comment>
        <column name="GeneWID" type="@wid" required="true">
            <comment>Reference to the Gene that produces this protein.</comment>
            <foreignKey name="FK_GeneWIDProteinWID1" toTable="Gene" toColumn="WID"/>
        </column>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>Reference to the protein that has this gene.</comment>
            <foreignKey name="FK_GeneWIDProteinWID2" toTable="Protein" toColumn="WID"/>
        </column>

        <index name="GP_GENEWID_PROWID" columns="GENEWID,PROTEINWID"/>
        <index name="GP_PROWID_GENEWID" columns="PROTEINWID,GENEWID"/>
    </table>

    <table name="ProteinWIDFunctionWID" type="associative">
        <comment>Associates a non-enzymatic function with a protein that has that function.</comment>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>Reference to the protein that has this function.</comment>
            <foreignKey name="FK_ProteinWIDFunctionWID2" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="FunctionWID" type="@wid" required="true">
            <comment>Reference to the function for this protein.</comment>
            <foreignKey name="FK_ProteinWIDFunctionWID3" toTable="Function" toColumn="WID"/>
        </column>

        <index name="PF_FunctionWID_PROWID" columns="FunctionWID,PROTEINWID"/>
        <index name="PF_PROWID_FunctionWID" columns="PROTEINWID,FunctionWID"/>
    </table>

    <!-- ============================================================================================ -->
    <!-- Tables to support 2D Gel Data                                                                -->
    <!-- Tables are listed in alphabetical order.                                                     -->
    <!-- Naming convention is <table1>WID<table2>WID                                                  -->
    <!-- ============================================================================================ -->

    <table name="ExperimentRelationship" type="arbitrary-relation">
        <comment>Relates one experiment to another.</comment>
        <comment>This table supports a many to many relationship.</comment>
        <column name="ExperimentWID" type="@wid" required="true">
            <comment>Experiment entity</comment>
            <foreignKey name="FK_ExpRelationship1" toTable="Experiment" toColumn="WID"/>
        </column>
        <column name="RelatedExperimentWID" type="@wid" required="true">
            <comment>The WID of the experiment the current term is related to</comment>
            <foreignKey name="FK_ExpRelationship2" toTable="Experiment" toColumn="WID"/>
        </column>
    </table>

    <table name="GelLocation" type="object">
        <comment>Describes the location of a spot on a gel.</comment>
        <comment>This tables maps spots to the one or more tables that they are found on.</comment>
        <comment>Describes the X and Y coordinates on the Gel.</comment>
        <comment>Information for the particular gel conditions that the spot was identified</comment>
        <comment>on can be found in the Experiment table.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column name="SpotWID" type="@wid" required="true">
            <comment>The location record is for this spot.</comment>
            <foreignKey name="FK_GelLocSpotWid" toTable="Spot" toColumn="WID"/>
        </column>
        <column name="Xcoord" type="@real32" required="false">
            <comment>The x-coordinate of the spot on the gel.</comment>
        </column>
        <column name="Ycoord" type="@real32" required="false">
            <comment>The y-coordinate of the spot on the gel.</comment>
        </column>
        <column length="1" name="refGel" type="@varchar" required="false">
            <comment>Y or N.</comment>
            <comment>A spot can be identified across multiple gels, so this columnn.</comment>
            <comment>is used to indicate whether the X/Y coords of this particular gel was used to</comment>
            <comment>determine the molecular weight and isolectric point for the spot.</comment>
        </column>
        <column name="ExperimentWID" type="@wid" required="true">
            <comment>Experiment entity</comment>
            <comment>Describes the gel conditions for this particular record.</comment>
            <foreignKey name="FK_GelLocExp" toTable="Experiment" toColumn="WID"/>
        </column>
        <column name="DatasetWID" type="@wid" required="true">
            <comment>The dataset the entity is from</comment>
            <foreignKey name="FK_GelLocDataset" toTable="DataSet" toColumn="WID"/>
        </column>
        <primaryKey name="PK_GelLocation" column="WID"/>
    </table>

    <table name="ProteinWIDSpotWID" type="associative">
        <comment>Associates a spot with a known protein.</comment>
        <comment>Not all spots are associated with proteins since it is not necessarily</comment>
        <comment>known what the protein is for a given spot.</comment>
        <comment>This table supports the ability to have a spot linked to multiple protein,</comment>
        <comment>or a protein linked to multiple spots.</comment>
        <column name="ProteinWID" type="@wid" required="true">
            <comment>Reference to the protein that has been mapped to this spot.</comment>
            <foreignKey name="FK_ProteinWIDSpotWID1" toTable="Protein" toColumn="WID"/>
        </column>
        <column name="SpotWID" type="@wid" required="true">
            <comment>Reference to the Protein that is associated to this spot.</comment>
            <foreignKey name="FK_ProteinWIDSpotWID2" toTable="Spot" toColumn="WID"/>
        </column>
        <index name="PS_PROTEINWID_SPOTWID" columns="ProteinWID, SpotWID"/>
        <index name="PS_SPOTWID_PROTEINWID" columns="SpotWID, ProteinWID"/>
    </table>

    <table name="Spot" type="object">
        <comment>Describes a spot from a 2D Gel experiment.</comment>
        <comment>A spot can be linked to one or more gels and the location on the gel. The</comment>
        <comment>gel location information is stored in the ExperimentData table.</comment>
        <comment>A spot can be identified to be a particluar protein in the protein table</comment>
        <comment>and is associated to proteins via the ProteinWIDSpotWID table</comment>
        <comment>The method used to identify the spot is contained in the SpotWIDSpotIDMethodWID</comment>
        <comment>table and the SpotIDMethod table.</comment>
        <comment>The growth conditions for the protein is found in the ExperimentData tableeh</comment>
        <comment>The Spot Name/ID goes into the SpotId row, but additional names can be stored</comment>
        <comment>as DBID table entry.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column length="25" name="SpotId" type="@varchar" required="false">
            <comment>Name of the spot</comment>
            <comment>Can be null</comment>
        </column>
        <column name="MolecularWeightEst" type="@real32" required="false">
            <comment>Molecular weight estimated from migration on 2D gels.</comment>
            <comment>Units: Daltons.</comment>
        </column>
        <column length="50" name="PIEst" type="@varchar" required="false">
            <comment>Isoelectric point (pI) estimated from migration on 2D gels.</comment>
        </column>
        <column name="DatasetWID" type="@wid" required="true">
            <comment>The dataset the entity is from</comment>
            <foreignKey name="FK_Spot" toTable="DataSet" toColumn="WID"/>
        </column>
        <primaryKey name="PK_Spot" column="WID"/>
    </table>

    <table name="SpotIdMethod" type="object">
        <comment>Describes the method by which a spot was identified as</comment>
        <comment>a particular (known) protein in the protein table.</comment>
        <column name="WID" type="@wid" required="true">
            <comment>Warehouse identifier for this entity</comment>
        </column>
        <column length="100" name="MethodName" type="@varchar" required="true">
            <comment>The name of the method</comment>
            <comment>ex: Co-migration</comment>
        </column>
        <column length="500" name="MethodDesc" type="@varchar" required="false">
            <comment>More detailed description of method.</comment>
            <comment>Ex: Co-migration with purified protein</comment>
        </column>
        <column length="10" name="MethodAbbrev" type="@varchar" required="false">
            <comment>A short abbreviation for the method name.</comment>
            <comment>ex: C</comment>
        </column>
        <column name="DatasetWID" type="@wid" required="true">
            <comment>The dataset the entity is from</comment>
            <foreignKey name="FK_SpotIdMethDataset" toTable="DataSet" toColumn="WID"/>
        </column>
        <primaryKey name="PK_SpotIdMethod" column="WID"/>
    </table>

    <table name="SpotWIDSpotIdMethodWID" type="associative">
        <comment>Associates a spot with a SpotIdMethod,</comment>
        <comment>which is the method used to identify a spot with a particular protein.</comment>
        <comment>A spot can be identified as a particular protein by multiple methods,</comment>
        <comment>so this table supports this many-to-many relationship.</comment>
        <column name="SpotWID" type="@wid" required="true">
            <comment>Reference to the2A Spot record.</comment>
            <foreignKey name="FK_SpotWIDMethWID1" toTable="Spot" toColumn="WID"/>
        </column>
        <column name="SpotIdMethodWID" type="@wid" required="true">
            <comment>Reference to the method that was used to identify a spot as a</comment>
            <comment>particular protein.</comment>
            <foreignKey name="FK_SpotWIDMethWID2" toTable="SpotIdMethod" toColumn="WID"/>
        </column>
        <index name="SM_SPOTWID_IDMETHWID" columns="SpotWID, SpotIdMethodWID"/>
        <index name="SM_IDMETHWID_SPOTWID" columns="SpotIdMethodWID, SpotWID"/>
    </table>

    <!-- todo: add enumerated values to this file, include in schema doc -->
    <!-- todo: replace mutlple sdkey elements with sdkey to table type-->
    <!-- todo: replace version number with variable -->
    <!-- todo: Could make an @enum abstract type.-->
</schema>
