<?xml version="1.0" encoding="UTF-8"?>
<!-- DDBJ JGA Sample object XML specification -->
<!-- version:1.2.0 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:com="JGA.common">
<xs:import schemaLocation="JGA.common.xsd" namespace="JGA.common"/>

  <xs:complexType name="SampleType">
    <xs:annotation>
      <xs:documentation>
        A Sample defines an isolate of material upon which experiments can be based.  The Sample object may be a surrogate for taxonomy
        accession or an anonymized individual identifier.  Or, it may fully specify
        provenance and isolation method of the starting material.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>

      <xs:element name="IDENTIFIERS" type="com:IdentifierType" maxOccurs="1" minOccurs="0">
      </xs:element>
      <xs:element name="TITLE" type="xs:string" minOccurs="0" maxOccurs="1">
       <xs:annotation>
         <xs:documentation>
           Short text that can be used to call out sample records in search results or in displays.
         </xs:documentation>
       </xs:annotation>
      </xs:element>
      <xs:element name="SAMPLE_NAME">
        <xs:complexType>
          <xs:all minOccurs="1">
            <xs:element name="TAXON_ID" minOccurs="1" maxOccurs="1" type="xs:integer">
              <xs:annotation>
                <xs:documentation>
                  NCBI Taxonomy Identifier.  This is appropriate for individual organisms and
                  some environmental samples.
                </xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="SCIENTIFIC_NAME" minOccurs="0" maxOccurs="1" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  Scientific name of sample that distinguishes its taxonomy.  Please use a
                  name or synonym that is tracked in the INSDC Taxonomy database.
                  Also, this field can be used to confirm the TAXON_ID setting.
                </xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="COMMON_NAME" minOccurs="0" maxOccurs="1" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  GenBank common name of the organism.  Examples: human, mouse.
                </xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="ANONYMIZED_NAME" minOccurs="0" maxOccurs="1" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  Anonymous public name of the sample.   For example, HapMap human isolate NA12878.
                </xs:documentation>
              </xs:annotation>
            </xs:element>
            <xs:element name="DONOR_ID" minOccurs="0" maxOccurs="1" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  Anonymised subject identifier.
                </xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:all>
        </xs:complexType>
      </xs:element>
      <xs:element name="SAMPLE_GROUP_TYPE" type="xs:string" minOccurs="1" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
            Free-form text describing the type of sample group, control, case and cancer etc.
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DESCRIPTION" type="xs:string" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
            Free-form text describing the sample, its origin, and its method of isolation.
          </xs:documentation>
        </xs:annotation>
      </xs:element>

      <xs:element name="SAMPLE_LINKS" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
            Links to resources related to this sample or sample set (publication, datasets, online databases).
          </xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence minOccurs="1" maxOccurs="unbounded">
            <xs:element name="SAMPLE_LINK" type="com:LinkType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

      <xs:element name="SAMPLE_ATTRIBUTES" minOccurs="0" maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
            Properties and attributes of the sample.  These can be entered as free-form
            tag-value pairs.
          </xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence maxOccurs="unbounded" minOccurs="1">
            <xs:element name="SAMPLE_ATTRIBUTE" type="com:AttributeType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>



    </xs:sequence>
    <xs:attributeGroup ref="com:NameGroup"/>

  </xs:complexType>


  <xs:complexType name ="SampleSetType" >
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="SAMPLE" type="SampleType"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="SAMPLE_SET" type="SampleSetType">
    <xs:annotation>
      <xs:documentation>
        SAMPLE_SET serves as a container for a set of samples and a name space
        for establishing referential integrity between them.
      </xs:documentation>
    </xs:annotation>

  </xs:element>

  <xs:element name="SAMPLE" type="SampleType"/>

</xs:schema>
