<?xml version="1.0" encoding="UTF-8"?>
<schema
    targetNamespace="http://xml.fmi.fi/namespace/meteorology/conceptual-model/meteorological-objects/2009/11/09"
    xmlns:metobj="http://xml.fmi.fi/namespace/meteorology/conceptual-model/meteorological-objects/2009/11/09"
    xmlns="http://www.w3.org/2001/XMLSchema" 
    xmlns:gml="http://www.opengis.net/gml"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:sch="http://www.ascc.net/xml/schematron" 
    elementFormDefault="qualified" 
    version="1.0">

    <annotation>
        <appinfo>
            <sch:title>Schematron validation</sch:title>
            <sch:ns prefix="gml" uri="http://www.opengis.net/gml" />
            <sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink" />
            <sch:pattern name="Check either href or content not both">
                <sch:rule abstract="true" id="hrefOrContent">
                    <sch:report test="@xlink:href and (*|text())"
                        >Property element may not carry both a reference to an object and contain an object.</sch:report>
                    <sch:assert test="@xlink:href | (*|text())"
                        >Property element must either carry a reference to an object or contain an object.</sch:assert>
                </sch:rule>
            </sch:pattern>
        </appinfo>
        <documentation>
            <html:div xmlns="http://www.w3.org/1999/xhtml">
                <p>Point-based Conceptual Model objects
                    (a.k.a Meteorological Objects) used at Finnish Meteorological Institute as GML 3.2.1
                    Features.</p>
                
                <p>For detailed info see <a href="http://xml.fmi.fi/namespace/meteorology/conceptual-model/meteorological-objects/2009/11/09/">documentation</a></p>
                
                <p>Author: Ilkka Rinne / FMI 2009.</p>
            </html:div>
        </documentation>
    </annotation>

    <import namespace="http://www.opengis.net/gml" schemaLocation="gml311-part.xsd" />

    <include schemaLocation="metobjects-base.xsd" />

    <!-- ======================================================================================================== -->
    <element name="PointMeteorologicalSymbol" type="metobj:PointMeteorologicalSymbolType"
        substitutionGroup="metobj:AbstractPointObject" />
    <!-- ======================================================================================================== -->
    <complexType name="PointMeteorologicalSymbolType">
        <annotation>
            <documentation>A single meteorological symbol fixed at a geospatial point or
                point-like location.</documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractPointObjectType">
                <sequence>
                    <element ref="metobj:meteorologicalSymbolProperty" minOccurs="1"
                        maxOccurs="1" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>


    <!-- ======================================================================================================== -->
    <element name="DirectionalMeteorologicalSymbol"
        type="metobj:DirectionalMeteorologicalSymbolType"
        substitutionGroup="metobj:PointMeteorologicalSymbol" />
    <!-- ======================================================================================================== -->
    <complexType name="DirectionalMeteorologicalSymbolType">
        <annotation>
            <documentation />
        </annotation>
        <complexContent>
            <extension base="metobj:PointMeteorologicalSymbolType">
                <sequence>
                    <element name="direction" type="gml:VectorType" minOccurs="0" maxOccurs="1"
                     />
                </sequence>
            </extension>
        </complexContent>
    </complexType>

    <!-- ======================================================================================================== -->
    <element name="PointGeophysicalParameterValueSet"
        type="metobj:PointGeophysicalParameterValueSetType" substitutionGroup="metobj:AbstractPointObject" />
    <!-- ======================================================================================================== -->
    <complexType name="PointGeophysicalParameterValueSetType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Value of a geophysical parameter (temperature, pressure, humidity,..)
                        at some point-like location and at a specific time. The truth value of this
                        statement is not considered here, value may be speculative (forecast). The main
                        intention for objects of this type is to represent observed and forecast parameter
                        values on a map.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractPointObjectType">
                <sequence>
                    <element name="parameterValueSet" type="metobj:GeophysicalParameterValueSetPropertyType"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    
    <!-- ======================================================================================================== -->
    <element name="PointNote"
        type="metobj:PointNoteType" substitutionGroup="metobj:AbstractPointObject" />
    <!-- ======================================================================================================== -->
    <complexType name="PointNoteType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>A general note regarding a single location and time.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractPointObjectType">
                <sequence>
                    <element name="noteText" type="metobj:longLocalizedStringType" minOccurs="0" maxOccurs="unbounded"/>
                    <element ref="metobj:GraphicSymbol" minOccurs="0" maxOccurs="unbounded"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>

</schema>