<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:gml="http://www.opengis.net/gml" targetNamespace="http://www.opengis.net/gml"
        xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.2.0">
  <annotation>
    <appinfo source="urn:ogc:specification:gml:schema-xsd:temporalReferenceSystems:3.2.0">
      temporalReferenceSystems.xsd
    </appinfo>
    <documentation>See ISO/DIS 19136 15.5.
      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). The primary temporal reference system for
      use with geographic information is the Gregorian Calendar and 24 hour local or Coordinated
      Universal Time (UTC), but special applications may entail the use of alternative reference
      systems. The Julian day numbering system is a temporal coordinate system that has an origin
      earlier than any known calendar, at noon on 1 January 4713 BC in the Julian proleptic
      calendar, and is useful in transformations between dates in different calendars.
      In GML seven concrete elements are used to describe temporal reference systems:
      gml:TimeReferenceSystem, gml:TimeCoordinateSystem, gml:TimeCalendar, gml:TimeCalendarEra,
      gml:TimeClock, gml:TimeOrdinalReferenceSystem, and gml:TimeOrdinalEra.
    </documentation>
  </annotation>
  <include schemaLocation="temporalTopology.xsd"/>
  <include schemaLocation="dictionary.xsd"/>
  <element name="TimeReferenceSystem" type="gml:TimeReferenceSystemType"
           substitutionGroup="gml:Definition">
    <annotation>
      <documentation>A reference system is characterized in terms of its domain of validity: the
        spatial and temporal extent over which it is applicable. The basic GML element for temporal
        reference systems is gml:TimeReferenceSystem. Its content model extends gml:DefinitionType
        with one additional property, gml:domainOfValidity.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeReferenceSystemType">
    <complexContent>
      <extension base="gml:DefinitionType">
        <sequence>
          <element name="domainOfValidity" type="string"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <element name="TimeCoordinateSystem" type="gml:TimeCoordinateSystemType"
           substitutionGroup="gml:TimeReferenceSystem">
    <annotation>
      <documentation>A temporal coordinate system shall be based on a continuous interval scale
        defined in terms of a single time interval.
        The differences to ISO 19108 TM_CoordinateSystem are:
        - the origin is specified either using the property gml:originPosition whose value is a
        direct time position, or using the property gml:origin whose model is
        gml:TimeInstantPropertyType; this permits more flexibility in representation and also
        supports referring to a value fixed elsewhere;
        - the interval uses gml:TimeIntervalLengthType.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeCoordinateSystemType">
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <choice>
            <element name="originPosition" type="gml:TimePositionType"/>
            <element name="origin" type="gml:TimeInstantPropertyType"/>
          </choice>
          <element name="interval" type="gml:TimeIntervalLengthType"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <element name="TimeCalendar" type="gml:TimeCalendarType"
           substitutionGroup="gml:TimeReferenceSystem">
    <annotation>
      <documentation>A calendar is a discrete temporal reference system that provides a basis for
        defining temporal position to a resolution of one day.
        gml:TimeCalendar adds one property to those inherited from gml:TimeReferenceSystem. A
        gml:referenceFrame provides a link to a gml:TimeCalendarEra that it uses. A gml:TimeCalendar
        may reference more than one calendar era.
        The referenceFrame element follows the standard GML property model, allowing the association
        to be instantiated either using an inline description using the gml:TimeCalendarEra element,
        or a link to a gml:TimeCalendarEra which is explicit elsewhere.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeCalendarType">
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <element name="referenceFrame" type="gml:TimeCalendarEraPropertyType"
                   maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <element name="TimeCalendarEra" type="gml:TimeCalendarEraType">
    <annotation>
      <documentation>gml:TimeCalendarEra inherits basic properties from gml:DefinitionType and has
        the following additional properties:
        - gml:referenceEvent is the name or description of a mythical or historic event which fixes
        the position of the base scale of the calendar era. This is given as text or using a link to
        description held elsewhere.
        - gml:referenceDate specifies the date of the referenceEvent expressed as a date in the
        given calendar. In most calendars, this date is the origin (i.e., the first day) of the
        scale, but this is not always true.
        - gml:julianReference specifies the Julian date that corresponds to the reference date. The
        Julian day number is an integer value; the Julian date is a decimal value that allows
        greater resolution. Transforming calendar dates to and from Julian dates provides a
        relatively simple basis for transforming dates from one calendar to another.
        - gml:epochOfUse is the period for which the calendar era was used as a basis for dating.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeCalendarEraType">
    <complexContent>
      <extension base="gml:DefinitionType">
        <sequence>
          <element name="referenceEvent" type="gml:StringOrRefType"/>
          <element name="referenceDate" type="gml:CalDate"/>
          <element name="julianReference" type="decimal"/>
          <element name="epochOfUse" type="gml:TimePeriodPropertyType"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <complexType name="TimeCalendarPropertyType">
    <annotation>
      <documentation>gml:TimeCalendarPropertyType provides for associating a gml:TimeCalendar with
        an object.
      </documentation>
    </annotation>
    <sequence minOccurs="0">
      <element ref="gml:TimeCalendar"/>
    </sequence>
    <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
  <complexType name="TimeCalendarEraPropertyType">
    <annotation>
      <documentation>gml:TimeCalendarEraPropertyType provides for associating a gml:TimeCalendarEra
        with an object.
      </documentation>
    </annotation>
    <sequence minOccurs="0">
      <element ref="gml:TimeCalendarEra"/>
    </sequence>
    <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
  <element name="TimeClock" type="gml:TimeClockType" substitutionGroup="gml:TimeReferenceSystem">
    <annotation>
      <documentation>A clock provides a basis for defining temporal position within a day. A clock
        shall be used with a calendar in order to provide a complete description of a temporal
        position within a specific day.
        gml:TimeClock adds the following properties to those inherited from
        gml:TimeReferenceSystemType:
        - gml:referenceEvent is the name or description of an event, such as solar noon or sunrise,
        which fixes the position of the base scale of the clock.
        - gml:referenceTime specifies the time of day associated with the reference event expressed
        as a time of day in the given clock. The reference time is usually the origin of the clock
        scale.
        - gml:utcReference specifies the 24 hour local or UTC time that corresponds to the reference
        time.
        - gml:dateBasis contains or references the calendars that use this clock.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeClockType" final="#all">
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <element name="referenceEvent" type="gml:StringOrRefType"/>
          <element name="referenceTime" type="time"/>
          <element name="utcReference" type="time"/>
          <element name="dateBasis" type="gml:TimeCalendarPropertyType" minOccurs="0"
                   maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <complexType name="TimeClockPropertyType">
    <annotation>
      <documentation>gml:TimeClockPropertyType provides for associating a gml:TimeClock with an
        object.
      </documentation>
    </annotation>
    <sequence minOccurs="0">
      <element ref="gml:TimeClock"/>
    </sequence>
    <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
  <element name="TimeOrdinalReferenceSystem" type="gml:TimeOrdinalReferenceSystemType"
           substitutionGroup="gml:TimeReferenceSystem">
    <annotation>
      <documentation>In some applications of geographic information — such as geology and
        archaeology — relative position in time is known more precisely than absolute time or
        duration. The order of events in time can be well established, but the magnitude of the
        intervals between them cannot be accurately determined; in such cases, the use of an ordinal
        temporal reference system is appropriate. An ordinal temporal reference system is composed
        of a sequence of named coterminous eras, which may in turn be composed of sequences of
        member eras at a finer scale, giving the whole a hierarchical structure of eras of verying
        resolution.
        An ordinal temporal reference system whose component eras are not further subdivided is
        effectively a temporal topological complex constrained to be a linear graph. An ordinal
        temporal reference system some or all of whose component eras are subdivided is effectively
        a temporal topological complex with the constraint that parallel branches may only be
        constructed in pairs where one is a single temporal ordinal era and the other is a sequence
        of temporal ordinal eras that are called "members" of the "group". This constraint means
        that within a single temporal ordinal reference system, the relative position of all
        temporal ordinal eras is unambiguous.
        The positions of the beginning and end of a given era may calibrate the relative time scale.
        gml:TimeOrdinalReferenceSystem adds one or more gml:component properties to the generic
        temporal reference system model.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeOrdinalReferenceSystemType">
    <complexContent>
      <extension base="gml:TimeReferenceSystemType">
        <sequence>
          <element name="component" type="gml:TimeOrdinalEraPropertyType" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <element name="TimeOrdinalEra" type="gml:TimeOrdinalEraType">
    <annotation>
      <documentation>Its content model follows the pattern of gml:TimeEdge, inheriting standard
        properties from gml:DefinitionType, and adding gml:start, gml:end and gml:extent properties,
        a set of gml:member properties which indicate ordered gml:TimeOrdinalEra elements, and a
        gml:group property which points to the parent era.
        The recursive inclusion of gml:TimeOrdinalEra elements allow the construction of an
        arbitrary depth hierarchical ordinal reference schema, such that an ordinal era at a given
        level of the hierarchy includes a sequence of shorter, coterminous ordinal eras.
      </documentation>
    </annotation>
  </element>
  <complexType name="TimeOrdinalEraType">
    <complexContent>
      <extension base="gml:DefinitionType">
        <sequence>
          <element name="relatedTime" type="gml:RelatedTimeType" minOccurs="0"
                   maxOccurs="unbounded"/>
          <element name="start" type="gml:TimeNodePropertyType"/>
          <element name="end" type="gml:TimeNodePropertyType"/>
          <element name="extent" type="gml:TimePeriodPropertyType" minOccurs="0"/>
          <element name="member" type="gml:TimeOrdinalEraPropertyType" minOccurs="0"
                   maxOccurs="unbounded"/>
          <element name="group" type="gml:ReferenceType" minOccurs="0"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <complexType name="TimeOrdinalEraPropertyType">
    <annotation>
      <documentation>gml:TimeOrdinalEraPropertyType provides for associating a gml:TimeOrdinalEra
        with an object.
      </documentation>
    </annotation>
    <sequence minOccurs="0">
      <element ref="gml:TimeOrdinalEra"/>
    </sequence>
    <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    <attributeGroup ref="gml:AssociationAttributeGroup"/>
  </complexType>
</schema>
