<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
            targetNamespace="http://lifemapper.org" 
            xmlns:lm="http://lifemapper.org" 
            elementFormDefault="qualified">
   <xsd:annotation>
      <xsd:documentation>
         Schema definition for Lifemapper service POST requests.
         Version: 1.0
         Author: CJ Grady
         Contact: lifemapper@ku.edu
      </xsd:documentation>
   </xsd:annotation>
   <xsd:element name="request" type="lm:requestType" />
   <xsd:complexType name="requestType">
      <xsd:annotation>
         <xsd:documentation>
            The type of post request, the options are:
               * algoParamSet
               * experiment
               * occurrenceSet
         </xsd:documentation>
      </xsd:annotation>
      <xsd:choice>
         <xsd:element name="algoParamsSet" 
                      type="lm:algoParamsSetType" 
                      maxOccurs="1" 
                      minOccurs="0" />
                      
         <xsd:element name="experiment" 
                      type="lm:experimentType" 
                      maxOccurs="1" 
                      minOccurs="0" />
                      
         <xsd:element name="occurrenceSet" 
                      type="lm:occurrenceSetType" 
                      maxOccurs="1" 
                      minOccurs="0" />
      </xsd:choice>
   </xsd:complexType>
   <xsd:complexType name="occurrenceSetType">
      <xsd:sequence>
         <xsd:element name="displayName" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="1" />

         <xsd:element name="points" 
                      type="lm:pointsType" 
                      maxOccurs="1" 
                      minOccurs="1" />
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="experimentType">
      <xsd:annotation>
         <xsd:documentation>
            Schema for Lifemapper Experiments requests.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:all>
         <xsd:element name="algorithmParametersId" 
                      type="xsd:string"
                      maxOccurs="1" 
                      minOccurs="1" >
            <xsd:annotation>
               <xsd:documentation>
                  The id for a Lifemapper algorithm parameter set.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
         <xsd:element name="modelScenario" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="1" >
            <xsd:annotation>
               <xsd:documentation>
                  This is the id number of the Lifemapper model scenario.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
         <xsd:element name="occurrenceSetId" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="1" >
            <xsd:annotation>
               <xsd:documentation>
                  This is the id number of the Lifemapper occurrence set.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
         <xsd:element name="projectionScenarios" 
                      type="lm:projectionScenariosType" 
                      maxOccurs="1" 
                      minOccurs="1">
            <xsd:annotation>
               <xsd:documentation>
                  This is a group of Lifemapper projection scenarios.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
      </xsd:all>
   </xsd:complexType>
   <xsd:complexType name="algoParamsSetType">
      <xsd:sequence>
          <xsd:element name="algorithmCode" 
                       type="xsd:string" 
                       maxOccurs="1" 
                       minOccurs="1" />
          <xsd:element name="parameters" 
                       type="lm:algoParametersType" 
                       maxOccurs="1" 
                       minOccurs="0" />
      </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="pointsType">
       <xsd:sequence>
          <xsd:element name="point" 
                       type="lm:pointType" 
                       maxOccurs="unbounded" 
                       minOccurs="0" />
       </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="pointType">
      <xsd:attribute name="localId"         type="xsd:string" />
      <xsd:attribute name="longitude"       type="xsd:float" />
      <xsd:attribute name="latitude"        type="xsd:float" />
      <xsd:attribute name="canonicalName"   type="xsd:string" />
      <xsd:attribute name="catalogNum"      type="xsd:string" />
      <xsd:attribute name="collectionCode"  type="xsd:string" />
      <xsd:attribute name="collectionDate"  type="xsd:string" />
      <xsd:attribute name="collector"       type="xsd:string" />
      <xsd:attribute name="guid"            type="xsd:string" />
      <xsd:attribute name="institutionCode" type="xsd:string" />
      <xsd:attribute name="modTime"         type="xsd:string" />
      <xsd:attribute name="providerName"    type="xsd:string" />
      <xsd:attribute name="resourceName"    type="xsd:string" />
   </xsd:complexType>
   <xsd:complexType name="algoParametersType">
      <xsd:all>
         <xsd:element name="choice" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />
                      
         <xsd:element name="coef0" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="commissionsamplesize" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="commissionthreshold" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="convergencelimit" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="cost" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="degree" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="distance" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="distancetype" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="epoch" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="gamma" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="gaussianpriorsmoothingcoeficient" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="hardomissionthreshold" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="hiddenlayerneurons" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="hingefeature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="kerneltype" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="learningrate" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="linearfeature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="maxgenerations" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="maxthreads" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="mincomponents" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="minimumerror" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="modelsunderomissionthreshold" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="momentum" 
                      type="xsd:string" 
                      maxOccurs="1"
                      minOccurs="0" />

         <xsd:element name="nearpointstogetmean" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="nu" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="numberofiterations" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="numberofpseudoabsences" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="populationsize" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="probabilisticoutput" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="productfeature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="quadraticfeature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="randomisations" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="resamples" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="standarddeviationcutoff" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="standarddeviations" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="svmtype" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="thresholdfeature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="terminatetolerance" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="totalruns" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="trainingmethod" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="trainingproportion" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="usedepthrange" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="usedistancetoland" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="useiceconcentration" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="useprimaryproduction" 
                      type="xsd:string"
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="usesalinity" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="usesurfacelayers" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="usetemperature" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

         <xsd:element name="verbosedebugging" 
                      type="xsd:string" 
                      maxOccurs="1" 
                      minOccurs="0" />

      </xsd:all>
   </xsd:complexType>
   <xsd:complexType name="projectionScenariosType">
      <xsd:sequence>
         <xsd:element name="projectionScenario" 
                      type="xsd:string" 
                      maxOccurs="unbounded" 
                      minOccurs="0" >
            <xsd:annotation>
               <xsd:documentation>
                  This is the id number of the Lifemapper projection scenario.
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>
</xsd:schema>