<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.0.1">
  <annotation>
    <appinfo source="urn:opengis:specification:gml:schema-xsd:temporal:v3.0.1"/>
    <documentation xml:lang="en">
    The temporal schema for GML 3.0 provides constructs for handling time-varying spatial 
    data. This schema reflects a partial yet consistent implementation of the model described 
    in ISO 19108 (topological complexes and feature succession are not included). 
    Copyright (c) 2002 OGC, All Rights Reserved.    
    </documentation>
  </annotation>
  <!-- ================================================================== -->
  <include schemaLocation="units.xsd"/>
  <!-- ================================================================== -->
  <element name="_TimeObject" type="gml:AbstractTimeType" abstract="true" substitutionGroup="gml:_GML">
    <annotation>
      <documentation xml:lang="en">
      This abstract element acts as the head of the substitution group for temporal primitives and complexes.  
      </documentation>
    </annotation>
  </element>
  <!-- ===================================== -->
  <complexType name="AbstractTimeType" abstract="true">
    <annotation>
      <documentation xml:lang="en">
       A temporal object must be associated with a temporal reference system via URI. 
       The Gregorian calendar with UTC is the default reference system, following ISO 
       8601. Other reference systems in common use include the GPS calendar and the 
       Julian calendar.
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:AbstractGMLType">
        <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="_TimePrimitive" type="gml:TimePrimitiveType" abstract="true" substitutionGroup="gml:_TimeObject">
    <annotation>
      <documentation xml:lang="en">
      This abstract element acts as the head of the substitution group for temporal primitives.  
      </documentation>
    </annotation>
  </element>
  <!-- ===================================== -->
  <complexType name="TimePrimitiveType" abstract="true">
    <annotation>
      <documentation xml:lang="en">
      The abstract supertype for temporal and topological primitives.
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:AbstractTimeType"/>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="TimeInstant" type="gml:TimeInstantType" substitutionGroup="gml:_TimePrimitive"/>
  <!-- ===================================== -->
  <complexType name="TimeInstantType" final="#all">
    <complexContent>
      <extension base="gml:TimePrimitiveType">
        <sequence>
          <element ref="gml:timePosition"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="begin" type="gml:TimeInstantPropertyType"/>
  <element name="end" type="gml:TimeInstantPropertyType"/>
  <!-- ===================================== -->
  <complexType name="TimeInstantPropertyType">
    <annotation>
      <documentation xml:lang="en">
       An association with a gml:TimeInstant element at the end.
      </documentation>
    </annotation>
    <sequence>
      <element ref="gml:TimeInstant" minOccurs="0"/>
    </sequence>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
  <!-- ================================================================== -->
  <element name="TimePeriod" type="gml:TimePeriodType" substitutionGroup="gml:_TimePrimitive"/>
  <!-- ===================================== -->
  <complexType name="TimePeriodType">
    <complexContent>
      <extension base="gml:TimePrimitiveType">
        <sequence>
          <element ref="gml:begin"/>
          <element ref="gml:end"/>
          <element ref="gml:_duration" minOccurs="0"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="_duration" type="gml:TimeDurationType" abstract="true">
    <annotation>
      <documentation xml:lang="en">
      This abstract element serves as the head of the substitution group for elements used 
      to indicate temporal length or distance (duration, interval). 
     </documentation>
    </annotation>
  </element>
  <!-- ===================================== -->
  <simpleType name="TimeDurationType">
    <annotation>
      <documentation xml:lang="en">
      Base type for describing temporal length or distance. The value space is further 
      constrained by subtypes that conform to the ISO 8601 or ISO 11404 standards.
      </documentation>
    </annotation>
    <union memberTypes="duration decimal"/>
  </simpleType>
  <!-- ================================================================== -->
  <element name="duration" type="duration" substitutionGroup="gml:_duration">
    <annotation>
      <documentation xml:lang="en">
      This element is an instance of the primitive xsd:duration simple type to 
      enable use of the ISO 8601 syntax for temporal length (e.g. P5DT4H30M). 
      It is a valid subtype of TimeDurationType according to section 3.14.6, 
      rule 2.2.4 in XML Schema, Part 1.
      </documentation>
    </annotation>
  </element>
  <!-- ================================================================== -->
  <simpleType name="TemporalPositionType">
    <annotation>
      <documentation xml:lang="en">
      Here we have collapsed the hierarchy of subtypes for temporal position in 19108 
      by defining a union of simple types for indicating temporal position relative to a 
      specific reference system. 
      Date and time may be indicated with varying degrees of precision:
      year, year-month, date, or dateTime (all ISO 8601 format). Note 
      that the dateTime type does not allow right-truncation (i.e. omitting 
      seconds). An ordinal era may be referenced via URI, and a decimal value
      can be used to indicate the distance from the scale origin (e.g. UNIX time,  
      GPS calendar).
      </documentation>
    </annotation>
    <union memberTypes="dateTime date gYearMonth gYear anyURI decimal"/>
  </simpleType>
  <!-- ================================================================== -->
  <element name="timePosition" type="gml:TimePositionType">
    <annotation>
      <documentation>Direct representation of a temporal position. </documentation>
    </annotation>
  </element>
  <!-- ===================================== -->
  <complexType name="TimePositionType" final="#all">
    <annotation>
      <documentation xml:lang="en">
      Indeterminate time values are also allowed, as described in ISO 19108. The indeterminatePosition 
      attribute can be used alone or it can qualify a specific value for temporal position (e.g. before 
      2002-12, after 1019624400). For time values that identify position within a calendar, the 
      calendarEraName attribute provides the name of the calendar era to which the date is 
      referenced (e.g. the Meiji era of the Japanese calendar).
      </documentation>
    </annotation>
    <simpleContent>
      <extension base="gml:TemporalPositionType">
        <attribute name="indeterminatePosition" type="gml:TimeIndeterminateValueType" use="optional"/>
        <attribute name="calendarEraName" type="string" use="optional"/>
        <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601"/>
      </extension>
    </simpleContent>
  </complexType>
  <!-- ================================================================== -->
  <simpleType name="TimeIndeterminateValueType">
    <annotation>
      <documentation xml:lang="en">
        This enumerated data type specifies values for indeterminate positions.
      </documentation>
    </annotation>
    <restriction base="string">
      <enumeration value="after"/>
      <enumeration value="before"/>
      <enumeration value="now"/>
      <enumeration value="unknown"/>
    </restriction>
  </simpleType>
  <!-- ================================================================== -->
  <element name="interval" type="gml:TimeIntervalLengthType" substitutionGroup="gml:_duration">
    <annotation>
      <documentation>
			This element is a valid subtype of TimeDurationType according to section 3.14.6, 
			rule 2.2.4 in XML Schema, Part 1.
			</documentation>
    </annotation>
  </element>
  <!-- ===================================== -->
  <complexType name="TimeIntervalLengthType" final="#all">
    <annotation>
      <documentation xml:lang="en">
      This type extends the built-in xsd:decimal simple type to allow floating-point 
      values for temporal length. According to  the ISO 11404 model you have to use 
      positiveInteger together with appropriate values for radix and factor. The 
      resolution of the time interval is to one radix ^(-factor) of the specified 
      time unit (e.g. unit="second", radix="10", factor="3" specifices a resolution 
      of milliseconds). It is a subtype of TimeDurationType.
      </documentation>
    </annotation>
    <simpleContent>
      <extension base="decimal">
        <attribute name="unit" type="gml:TimeUnitType" use="required"/>
        <attribute name="radix" type="positiveInteger" use="optional"/>
        <attribute name="factor" type="integer" use="optional"/>
      </extension>
    </simpleContent>
  </complexType>
  <!-- ================================================================== -->
  <simpleType name="TimeUnitType">
    <annotation>
      <documentation xml:lang="en">
        This enumerated data type indicates standard units for measuring time.
      </documentation>
    </annotation>
    <restriction base="string">
      <enumeration value="year"/>
      <enumeration value="month"/>
      <enumeration value="day"/>
      <enumeration value="hour"/>
      <enumeration value="minute"/>
      <enumeration value="second"/>
    </restriction>
  </simpleType>
  <!-- ================================================================== -->
  <element name="timePrimitiveProperty" type="gml:TimePrimitivePropertyType"/>
  <element name="timeStamp" type="gml:TimePrimitivePropertyType" substitutionGroup="gml:timePrimitiveProperty"/>
  <!-- ===================================== -->
  <complexType name="TimePrimitivePropertyType">
    <annotation>
      <documentation xml:lang="en">
        A timestamp property associates an element with a temporal primitive.
      </documentation>
    </annotation>
    <sequence>
      <element ref="gml:_TimePrimitive" minOccurs="0"/>
    </sequence>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
  <!-- ================ types for defining temporal reference systems ============ -->
  <element name="TimeReferenceSystem" type="gml:TimeReferenceSystemType" substitutionGroup="gml:_GML"/>
  <!-- ===================================== -->
  <complexType name="TimeReferenceSystemType">
    <annotation>
      <documentation xml:lang="en">
        A value in the time domain is measured relative to a temporal reference system. Common 
        types of reference systems include calendars, ordinal temporal reference systems, and 
        temporal coordinate systems (time elapsed since some epoch, e.g. UNIX time).
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:DefinitionType">
        <sequence>
          <element name="domainOfValidity" type="string"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="TimeCoordinateSystem" type="gml:TimeCoordinateSystemType" substitutionGroup="gml:TimeReferenceSystem"/>
  <!-- ===================================== -->
  <complexType name="TimeCoordinateSystemType" final="#all">
    <annotation>
      <documentation xml:lang="en">
      A temporal coordinate system is based on a continuous interval scale defined in terms of a single time interval.
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <element name="origin" type="gml:TimeInstantPropertyType"/>
          <element name="interval" type="gml:UnitOfMeasureType"/>
          <element name="incrementDirection" type="gml:SignType" default="+" minOccurs="0"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <element name="TimeOrdinalReferenceSystem" type="gml:TimeOrdinalReferenceSystemType" substitutionGroup="gml:TimeReferenceSystem"/>
  <!-- ===================================== -->
  <complexType name="TimeOrdinalReferenceSystemType" final="#all">
    <annotation>
      <documentation xml:lang="en">
      In an ordinal reference system the order of events in time can be well 
      established, but the magnitude of the intervals between them can not be 
      accurately determined (e.g. a stratigraphic sequence).
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <element name="component" type="gml:TimeOrdinalReferenceSystemMemberType" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
  <complexType name="TimeOrdinalReferenceSystemMemberType">
    <sequence>
      <element ref="gml:TimeOrdinalEra"/>
    </sequence>
  </complexType>
  <!-- ================================================================== -->
  <element name="TimeOrdinalEra" type="gml:TimeOrdinalEraType" substitutionGroup="gml:_GML"/>
  <!-- ===================================== -->
  <complexType name="TimeOrdinalEraType">
    <annotation>
      <documentation xml:lang="en">
      Ordinal temporal reference systems are often hierarchically structured 
      such that an ordinal era at a given level of the hierarchy includes a 
      sequence of shorter, coterminous ordinal eras.
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:AbstractGMLType">
        <sequence>
          <element ref="gml:begin" minOccurs="0"/>
          <element ref="gml:end" minOccurs="0"/>
          <element name="member" type="gml:TimeOrdinalReferenceSystemMemberType" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ================================================================== -->
</schema>
