<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tsml="http://www.opengis.net/timeseriesml/1.3" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:om="http://www.opengis.net/om/2.0" xmlns:sam="http://www.opengis.net/sampling/2.0" xmlns:sams="http://www.opengis.net/samplingSpatial/2.0" elementFormDefault="qualified" targetNamespace="http://www.opengis.net/timeseriesml/1.3" version="1.3.0">
  <xs:annotation>
    <xs:documentation>
      OGC TimeseriesML is an OGC Standard.
      Copyright (c) 2015, 2016, 2019, 2021 Open Geospatial Consortium.
      To obtain additional rights of use, visit http://www.opengeospatial.org/legal/ .
    </xs:documentation>
  </xs:annotation>
  <xs:import namespace="http://www.opengis.net/samplingSpatial/2.0" schemaLocation="http://schemas.opengis.net/samplingSpatial/2.0/spatialSamplingFeature.xsd"/>
  <xs:import namespace="http://www.opengis.net/sampling/2.0" schemaLocation="http://schemas.opengis.net/sampling/2.0/samplingFeature.xsd"/>
  <xs:import namespace="http://www.opengis.net/om/2.0" schemaLocation="http://schemas.opengis.net/om/2.0/observation.xsd"/>
  <xs:import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
  <xs:annotation>
    <xs:documentation>The Collection schema contains a collection element as well as other document specific types.</xs:documentation>
  </xs:annotation>
  <xs:element name="Collection" type="tsml:CollectionType" substitutionGroup="gml:AbstractFeature">
    <xs:annotation>
      <xs:documentation>TimeseriesML defines a generic collection feature type, Collection, to allow the grouping of observations and/or sampling features with metadata to describe the nature of the collection. Such collections are required in a number of data exchange scenarios; whether the underlying transport technology is web services, FTP or other technologies. </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="CollectionType">
  <!-- this is a test comment using configparser-->
  <xs:complexContent>
    <xs:extension base="gml:AbstractFeatureType">
      <xs:sequence>
        <xs:element name="communityExtension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Use this extension point for community-agreed extensions to the schema.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="internalExtension" type="xs:anyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Use this extension point for internal extensions that have not been defined for external use.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="generationDate" type="xs:dateTime">
          <xs:annotation>
            <xs:documentation>The date this data was generated.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="generationSystem" type="xs:string" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>The system from which this data was generated.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="version" type="gml:ReferenceType" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>This version property is distinct from the version of the TimeseriesML schema. It is a version of the whole standards package: schema, vocabularies, used profiles etc. I.e.  a version to allow specific versions associated with usage of a schema version with other components. </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="profile" type="gml:ReferenceType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>This may be used to reference a definition of a conformance class that members of the collection conform to.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="temporalExtent" type="gml:TimePeriodPropertyType" minOccurs="0" maxOccurs="1">
          <xs:annotation>
            <xs:documentation>Describes the temporal extent of the all the timeseries contained within the collection (if they exist). </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="localDictionary" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>A dictionary containing definitions of terms. </xs:documentation>
          </xs:annotation>
          <xs:complexType>
            <xs:complexContent>
              <xs:extension base="gml:AbstractMemberType">
                <xs:sequence>
                  <xs:element ref="gml:Dictionary"/>
                </xs:sequence>
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
        <xs:element name="sourceDefinition" type="gml:ReferenceType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>Provides a context for identification of particular data elements through use of MD_DataIdentification. These can be referenced from individual timeseries values.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="parameter" type="om:NamedValuePropertyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>A soft-typed parameter for extra metadata properties. </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="samplingFeatureMember" type="tsml:SamplingFeatureMemberPropertyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>A sampling feature or group of sampling features.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="observationMember" type="om:OM_ObservationPropertyType" minOccurs="0" maxOccurs="unbounded">
          <xs:annotation>
            <xs:documentation>One or more timeseries observations</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<xs:complexType name="CollectionPropertyType">
    <xs:sequence minOccurs="0">
      <xs:element ref="tsml:Collection"/>
    </xs:sequence>
    <xs:attributeGroup ref="gml:AssociationAttributeGroup"/>
    <xs:attributeGroup ref="gml:OwnershipAttributeGroup"/>
  </xs:complexType>
  <xs:group name="SamplingFeatureMember">
    <xs:annotation>
      <xs:documentation>A choice of defining a single sampling feature, or a grouping.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element ref="sams:SF_SpatialSamplingFeature"/>
      <xs:element ref="sam:SF_SamplingFeatureCollection"/>
    </xs:choice>
  </xs:group>
  <xs:complexType name="SamplingFeatureMemberPropertyType">
    <xs:sequence minOccurs="0">
      <xs:group ref="tsml:SamplingFeatureMember"/>
    </xs:sequence>
    <xs:attributeGroup ref="gml:AssociationAttributeGroup"/>
    <xs:attribute name="unionSemantics" type="tsml:SamplingFeatureMemberUnionSemantics"/>
    <xs:attributeGroup ref="gml:OwnershipAttributeGroup"/>
  </xs:complexType>
  <xs:simpleType name="SamplingFeatureMemberUnionSemantics">
    <xs:restriction base="xs:string">
      <xs:enumeration value="byFeature"/>
      <xs:enumeration value="byGroup"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
