<?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>Linear Conceptual Model objects
                    (a.k.a Meteorological Objects) used at Finnish Meteorological Institute as GML 3.1.1
                    Features.</p>
                
                <p>For detailed info see <a href="http://xml.fmi.fi/namespace/meteorology/conceptual-model/meteorological-objects/2009/11/09/metobjects-linear.xsd.html">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="ColdFront" type="metobj:ColdFrontObjectType"
        substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ======================================================================================== -->
    <complexType name="ColdFrontObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for cold fronts.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType" />
        </complexContent>
    </complexType>
    

    <!-- ======================================================================================== -->
    <element name="WarmFront" type="metobj:WarmFrontObjectType"
        substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ======================================================================================== -->
    <complexType name="WarmFrontObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for warm fronts.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType" />
        </complexContent>
    </complexType>
    

    <!-- ================================================================================================ -->
    <element name="OccludedFront" type="metobj:OccludedFrontObjectType"
        substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ================================================================================================ -->
    <complexType name="OccludedFrontObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for occluded fronts. Extends the AbstractLineObjectType
                        by introducing "stationary" element for stationary occluded fronts.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType">
                <sequence>
                    <element name="stationary" type="boolean" minOccurs="0" maxOccurs="1" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
   
    <!-- ============================================================================ -->
    <element name="Jet" type="metobj:JetObjectType" substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ============================================================================ -->
    <complexType name="JetObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for jets. Extends the AbstractLineObjectType
                        by introducing "windStrength" element.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType">
                <sequence>
                    <element name="windStrength" type="gml:MeasureType" minOccurs="0"
                        maxOccurs="1" />
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    

    <!-- ============================================================================ -->
    <element name="Trough" type="metobj:TroughObjectType" substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ============================================================================ -->
    <complexType name="TroughObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for troughs ("matalapaineen sola" in Finnish).</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType" />
        </complexContent>
    </complexType>
    

    <!-- ============================================================================ -->
    <element name="UpperTrough" type="metobj:UpperTroughObjectType"
        substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ============================================================================ -->
    <complexType name="UpperTroughObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for upper or high-level troughs ("yläsola" in Finnish).</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType" />
        </complexContent>
    </complexType>
    
    <!-- ============================================================================ -->
    <element name="CloudAreaBorder" type="metobj:CloudAreaBorderObjectType"
        substitutionGroup="metobj:AbstractLineObject"/>
    <!-- ============================================================================ -->
    <complexType name="CloudAreaBorderObjectType">
        <annotation>
            <documentation>
                <html:div xmlns="http://www.w3.org/1999/xhtml">
                    <p>Concrete Met Object type for cloud area border, use when the complete cloud area
                        cannot be used (the area is partly unknown). Created for Significant Weather Charts.</p>
                </html:div>
            </documentation>
        </annotation>
        <complexContent>
            <extension base="metobj:AbstractLineObjectType" />
        </complexContent>
    </complexType>

</schema>