<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
    targetNamespace="http://www.reactome.org/caBIOWebApp/schema"
    xmlns:reactome="http://www.reactome.org/caBIOWebApp/schema"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:apachesoap="http://xml.apache.org/xml-soap"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <xsd:annotation>
        <xsd:documentation>
            This schema is for the Reactome caBIO extensions model. The
            following defintions are modified from a WSDL file generated
            by Apache Axis web services engine.
        </xsd:documentation>
    </xsd:annotation>
    <!--  Import the following schema definitions -->
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    <import namespace="http://xml.apache.org/xml-soap" schemaLocation="ApacheSoap.xsd" />
    <!--  The following defintions regarding Map are copied from Axis auto-generated schema -->
    <!-- an untyped array. Rig ref="soapenc:arrayType" g this type -->
    <complexType name="ArrayOfAnyType">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType"
                    soapenc:arrayType="xsd:anyType[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfString">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType"
                    soapenc:arrayType="soapenc:string[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfLong">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType"
                    soapenc:arrayType="xsd:long[]" />
            </restriction>
        </complexContent>
    </complexType>
    <!-- Typed arrays used in the caBIO extensions. Although, Lists are used in Java classes,
        arrays have to be used since soap encoding is used for mapping. -->
    <complexType name="ArrayOfCatalystActivity">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:CatalystActivity[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfComplex">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Complex[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfDatabaseCrossReference">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:DatabaseCrossReference[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfEvent">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Event[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfEventEntity">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:EventEntity[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfEventEntitySet">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:EventEntitySet[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfGeneOntology">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:GeneOntology[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfGeneOntologyRelationship">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:GeneOntologyRelationship[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfGenomeEncodedEntity">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:GenomeEncodedEntity[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfModifiedResidue">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ModifiedResidue[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfPathway">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Pathway[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfPolymer">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Polymer[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfPublicationSource">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:PublicationSource[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReaction">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Reaction[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceChemical">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceChemical[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceEntity">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceEntity[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceGene">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceGene[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceProtein">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceProtein[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceRNA">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceRNA[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfReferenceSequence">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:ReferenceSequence[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfRegulation">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Regulation[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfSmallMoleculeEntity">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:SmallMoleculeEntity[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfSummation">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Summation[]" />
            </restriction>
        </complexContent>
    </complexType>
    <complexType name="ArrayOfTaxon">
        <complexContent>
            <restriction base="soapenc:Array">
                <attribute ref="soapenc:arrayType" soapenc:arrayType="reactome:Taxon[]" />
            </restriction>
        </complexContent>
    </complexType>        
    <!-- Actual defintions for caBIO extensions classes -->
    <complexType name="GeneOntology">
        <sequence>
            <element name="childGeneOntologyRelationshipCollection"
                nillable="true"
                type="reactome:ArrayOfGeneOntologyRelationship" />
            <element name="geneCollection" nillable="true"
                type="reactome:ArrayOfGeneOntologyRelationship" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="parentGeneOntologyRelationshipCollection"
                nillable="true" type="reactome:ArrayOfAnyType" />
        </sequence>
    </complexType>
    <complexType name="Taxon">
        <!-- Definitions for caBIO classes are not spelled out for the time being. These
            defintions should be in the caBIO schema, which is not available now. Use
            a generic array instead. -->
        <sequence>
            <element name="abbreviation" nillable="true"
                type="soapenc:string" />
            <element name="chromosomeCollection" nillable="true"
                type="reactome:ArrayOfAnyType" />
            <element name="cloneCollection" nillable="true"
                type="reactome:ArrayOfAnyType" />
            <element name="commonName" nillable="true"
                type="soapenc:string" />
            <element name="ethnicityStrain" nillable="true"
                type="soapenc:string" />
            <element name="geneCollection" nillable="true"
                type="reactome:ArrayOfAnyType" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="pathwayCollection" nillable="true"
                type="reactome:ArrayOfPathway" />
            <element name="proteinCollection" nillable="true"
                type="reactome:ArrayOfAnyType" />
            <element name="scientificName" nillable="true"
                type="soapenc:string" />
            <element name="tissueCollection" nillable="true"
                type="reactome:ArrayOfAnyType" />
        </sequence>
    </complexType>
    <complexType name="EventEntity">
        <sequence>
            <element name="compartment" nillable="true"
                type="reactome:GeneOntology" />
            <element name="crossReference" nillable="true"
                type="reactome:ArrayOfDatabaseCrossReference" />
            <element name="id" type="xsd:long" />
            <element name="literatureReference" nillable="true"
                type="reactome:ArrayOfPublicationSource" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="species" nillable="true" type="xsd:anyType" />
        </sequence>
    </complexType>
    <complexType name="ReferenceEntity">
        <sequence>
            <element name="crossReference" nillable="true"
                type="reactome:ArrayOfDatabaseCrossReference" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="identifier" nillable="true"
                type="soapenc:string" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="referenceDatabase" nillable="true"
                type="soapenc:string" />
        </sequence>
    </complexType>
    <complexType name="ReferenceChemical">
        <complexContent>
            <extension base="reactome:ReferenceEntity">
                <sequence>
                    <element name="formula" nillable="true"
                        type="soapenc:string" />
                    <element name="referenceGroup" nillable="true"
                        type="reactome:ArrayOfReferenceChemical" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="SmallMoleculeEntity">
        <complexContent>
            <extension base="reactome:EventEntity">
                <sequence>
                    <element name="referenceEntity" nillable="true"
                        type="reactome:ReferenceChemical" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="Complex">
        <complexContent>
            <extension base="reactome:EventEntity">
                <sequence>
                    <element name="hasComponent" nillable="true"
                        type="reactome:ArrayOfEventEntity" />
                    <element name="stoichiometry" nillable="true"
                        type="soapenc:string" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="Polymer">
        <complexContent>
            <extension base="reactome:EventEntity">
                <sequence>
                    <element name="maxUnitCount" type="xsd:int" />
                    <element name="minUnitCount" type="xsd:int" />
                    <element name="repeatUnit" nillable="true"
                        type="reactome:ArrayOfEventEntity" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="ReferenceSequence">
        <complexContent>
            <extension base="reactome:ReferenceEntity">
                <sequence>
                    <element name="species" nillable="true"
                        type="reactome:Taxon" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="ReferenceGene">
        <complexContent>
            <extension base="reactome:ReferenceSequence">
                <sequence>
                    <element name="chromosome" nillable="true"
                        type="xsd:anyType" />
                    <element name="clusterId" nillable="true"
                        type="soapenc:long" />
                    <element name="databaseCrossReferenceCollection"
                        nillable="true"
                        type="reactome:ArrayOfDatabaseCrossReference" />
                    <element name="expressionFeatureCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="fullName" nillable="true"
                        type="soapenc:string" />
                    <element name="geneAliasCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="geneOntologyCollection"
                        nillable="true"
                        type="reactome:ArrayOfGeneOntology" />
                    <element name="geneRelativeLocationCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="genericReporterCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="histopathologyCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="homologousAssociationCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="libraryCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="locationCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="nucleicAcidSequenceCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="organOntologyCollection"
                        nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="pathwayCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="proteinCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="symbol" nillable="true"
                        type="soapenc:string" />
                    <element name="targetCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="taxon" nillable="true"
                        type="reactome:Taxon" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="ReferenceRNA">
        <complexContent>
            <extension base="reactome:ReferenceSequence">
                <sequence>
                    <element name="referenceGene" nillable="true"
                        type="reactome:ReferenceGene" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="ReferenceProtein">
        <complexContent>
            <extension base="reactome:ReferenceSequence">
                <sequence>
                    <!-- Some of array types are not defined accurately. However, these
                         properties are not used in the current implemenation. -->
                    <element name="copyrightStatement" nillable="true"
                        type="soapenc:string" />
                    <element name="geneCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="keywords" nillable="true"
                        type="reactome:ArrayOfString" />
                    <element name="primaryAccession" nillable="true"
                        type="soapenc:string" />
                    <element name="proteinAliasCollection"
                        nillable="true"
                        type="reactome:ArrayOfString" />
                    <element name="proteinSequence" nillable="true"
                        type="xsd:anyType" />
                    <element name="secondaryAccession" nillable="true"
                        type="reactome:ArrayOfString" />
                    <element name="taxonCollection" nillable="true"
                        type="reactome:ArrayOfAnyType" />
                    <element name="uniProtCode" nillable="true"
                        type="soapenc:string" />
                    <element name="relatedIdentifiers" nillable="true"
                        type="soapenc:string" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="EventEntitySet">
        <complexContent>
            <extension base="reactome:EventEntity">
                <sequence>
                    <element name="hasMember" nillable="true"
                        type="reactome:ArrayOfEventEntity" />
                    <element name="referenceEntity" nillable="true"
                        type="reactome:ReferenceEntity" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="GenomeEncodedEntity">
        <complexContent>
            <extension base="reactome:EventEntity">
                <sequence>
                    <element name="endCoordinate" type="xsd:int" />
                    <element name="hasModifiedResidue" nillable="true"
                        type="reactome:ArrayOfModifiedResidue" />
                    <element name="referenceEntity" nillable="true"
                        type="reactome:ReferenceSequence" />
                    <element name="startCoordinate" type="xsd:int" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="CatalystActivity">
        <sequence>
            <element name="activeUnit" nillable="true"
                type="reactome:ArrayOfEventEntity" />
            <element name="activity" nillable="true" type="reactome:GeneOntology" />
            <element name="id" type="xsd:long" />
            <element name="literatureReferenece" nillable="true"
                type="reactome:ArrayOfPublicationSource" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="physicalEntity" nillable="true"
                type="reactome:EventEntity" />
        </sequence>
    </complexType>
    <complexType name="DatabaseCrossReference">
        <sequence>
            <element name="crossReferenceId" nillable="true"
                type="soapenc:string" />
            <element name="dataSourceName" nillable="true"
                type="soapenc:string" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="sourceType" nillable="true"
                type="soapenc:string" />
            <element name="summary" nillable="true"
                type="soapenc:string" />
            <element name="type" nillable="true" type="soapenc:string" />
        </sequence>
    </complexType>
    <complexType abstract="true" name="Event">
        <sequence>
            <element name="compartment" nillable="true"
                type="reactome:GeneOntology" />
            <element name="evidenceType" nillable="true"
                type="soapenc:string" />
            <element name="goBiologicalProcess" nillable="true"
                type="reactome:GeneOntology" />
            <element name="id" type="xsd:long" />
            <element name="inferredFrom" nillable="true"
                type="reactome:ArrayOfEvent" />
            <element name="literatureReference" nillable="true"
                type="reactome:ArrayOfPublicationSource" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="orthologousEvent" nillable="true"
                type="reactome:ArrayOfEvent" />
            <element name="precedingEvent" nillable="true"
                type="reactome:ArrayOfEvent" />
            <element name="species" nillable="true"
                type="reactome:Taxon" />
            <element name="summation" nillable="true"
                type="reactome:ArrayOfSummation" />
        </sequence>
    </complexType>
    <complexType name="GeneOntologyRelationship">
        <sequence>
            <element name="childGeneOntology" nillable="true"
                type="reactome:GeneOntology" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="parentGeneOntology" nillable="true"
                type="reactome:GeneOntology" />
            <element name="relationshipType" nillable="true"
                type="soapenc:string" />
        </sequence>
    </complexType>
    <complexType name="ModifiedResidue">
        <sequence>
            <element name="coordinate" type="xsd:int" />
            <element name="id" type="xsd:long" />
            <element name="modification" nillable="true"
                type="reactome:ReferenceChemical" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="residue" nillable="true"
                type="reactome:ReferenceChemical" />
        </sequence>
    </complexType>
    <complexType name="Pathway">
        <complexContent>
            <extension base="reactome:Event">
                <sequence>
                    <element name="hasComponent" nillable="true"
                        type="reactome:ArrayOfEvent" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="PublicationSource">
        <sequence>
            <element name="authors" nillable="true"
                type="soapenc:string" />
            <element name="endPage" nillable="true" type="soapenc:int" />
            <element name="id" nillable="true" type="soapenc:long" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="startPage" nillable="true"
                type="soapenc:int" />
            <element name="title" nillable="true" type="soapenc:string" />
            <element name="volume" nillable="true" type="soapenc:int" />
            <element name="year" nillable="true" type="soapenc:int" />
        </sequence>
    </complexType>
    <complexType name="Reaction">
        <complexContent>
            <extension base="reactome:Event">
                <sequence>
                    <element name="catalystActivity" nillable="true"
                        type="reactome:ArrayOfCatalystActivity" />
                    <element name="input" nillable="true"
                        type="reactome:ArrayOfEventEntity" />
                    <element name="inputStoichiometry" nillable="true"
                        type="soapenc:string" />
                    <element name="output" nillable="true"
                        type="reactome:ArrayOfEventEntity" />
                    <element name="outputStoichiometry" nillable="true"
                        type="soapenc:string" />
                    <element name="regulation" nillable="true"
                        type="reactome:ArrayOfRegulation" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- This is an Interface in the Java model. -->
    <complexType abstract="true" name="Regulator">
        <sequence />
    </complexType>
    <complexType name="Regulation">
        <sequence>
            <element name="id" type="xsd:long" />
            <element name="literatureReference" nillable="true"
                type="reactome:ArrayOfPublicationSource" />
            <element name="name" nillable="true" type="soapenc:string" />
            <element name="regulationType" nillable="true"
                type="reactome:RegulationType" />
            <!-- TODO: Have to figure out how to convert an interface? Or multiple inheritance. -->
            <!-- element name="regulator" nillable="true" type="reactome:Regulator" / -->
            <!-- Since multiple inheritiance is not supporte in the XML schema, have to
                 use anyType. EventEntity, CatalystActvity, and Reaction cannot be extended
                 from Regulator.  -->
            <element name="regulator" nillable="true" type="xsd:anyType" />
            <element name="summation" nillable="true"
                type="reactome:ArrayOfSummation" />
         </sequence>
    </complexType>
    <simpleType name="RegulationType">
        <restriction base="xsd:string">
            <enumeration value="POSITIVE" />
            <enumeration value="NEGATIVE" />
            <enumeration value="REQUIRED" />
        </restriction>
    </simpleType>
    <complexType name="Summation">
        <sequence>
            <element name="id" type="xsd:long" />
            <element name="literatureReference" nillable="true"
                type="reactome:ArrayOfPublicationSource" />
            <element name="text" nillable="true" type="soapenc:string" />
        </sequence>
    </complexType>
    <!-- Exceptions that might be thrown -->
    <complexType name="ReactomeRemoteException">
        <sequence>
            <element name="cause" nillable="true" type="xsd:anyType"/>
            <element name="message" nillable="true" type="soapenc:string"/>
        </sequence>
    </complexType>
    <complexType name="InstanceNotFoundException">
        <complexContent>
            <extension base="reactome:ReactomeRemoteException">
                <sequence>
                    <element name="clsName" nillable="true" type="soapenc:string"/>
                    <element name="dbId" type="xsd:long"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="QueryNotSupportedException">
        <complexContent>
            <extension base="reactome:ReactomeRemoteException" />
        </complexContent>
    </complexType>
</xsd:schema>