<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2"
        xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:om="http://www.opengis.net/om/2.0"
        xmlns:espas="http://schemas.espas-fp7.eu/2.1" targetNamespace="http://schemas.espas-fp7.eu/2.1"
        elementFormDefault="qualified" attributeFormDefault="unqualified"
        version="1.0"><!-- Schema auto-generated by FullMoon, applying rule suite xmi11ea -->
    <annotation>
        <documentation>[WARN-A001] - No package description in UML model</documentation>
    </annotation>
    <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
    <import namespace="http://www.isotc211.org/2005/gmd" schemaLocation="http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd"/>
    <import namespace="http://www.opengis.net/om/2.0" schemaLocation="http://schemas.opengis.net/om/2.0/observation.xsd"/>
    <include schemaLocation="process.xsd"/>
    <include schemaLocation="utilities.xsd"/>

    <!-- ESPAS_Result -->
    <element name="ESPAS_Result" substitutionGroup="gml:AbstractObject" type="espas:ESPAS_ResultType">
        <annotation>
            <documentation>-- Definition --
                List of resources for on line access to the observation result.

                -- Description --
                The result can be accessed as a whole or partly.

                NOTE The result may be consisted of segments accessible with their own resources.
            </documentation>
        </annotation>
    </element>
    <complexType name="ESPAS_ResultType">
        <sequence>
            <element maxOccurs="1" minOccurs="0" name="source" type="espas:ESPAS_OnlineResourcePropertyType">
                <annotation>
                    <documentation>-- Definition --
                        Resource where the observation result ( as a whole or partly ) can be accessed.
                    </documentation>
                </annotation>
            </element>
            <!-- new start -->
            <element maxOccurs="unbounded" minOccurs="0" name="usedProcessCapability"
                     type="espas:xlinkHref_PropertyType"/>
            <!-- new end -->
            <element maxOccurs="unbounded" minOccurs="0" name="sample" type="espas:ESPAS_OnlineResource_ExtendedPropertyType">
                <annotation>
                    <documentation>-- Definition --
                        Resource where a sample of observation result can be accessed.
                    </documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="segmentPhenomenonTime" type="om:TimeObjectPropertyType">
                <annotation>
                    <documentation>-- Definition --
                        Information about the temporal extent of the particular segment of the result.
                    </documentation>
                </annotation>
            </element>
            <element maxOccurs="unbounded" minOccurs="0" name="segmentGeographicExtent"
                     type="espas:EX_GeographicExtent_ExtendedPropertyType">
                <annotation>
                    <documentation>-- Definition --
                        Information about the geographic extent of the particular segment of the result.
                    </documentation>
                </annotation>
            </element>
            <element maxOccurs="unbounded" minOccurs="0" name="segment" type="espas:ESPAS_Result_ExtendedPropertyType"/>
        </sequence>
        <attribute name="deleted" type="espas:deleteType"/><!-- is it necessary ? -->
    </complexType>
    <complexType name="ESPAS_ResultPropertyType">
        <sequence minOccurs="0">
            <element ref="espas:ESPAS_Result"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>

    <!-- ESPAS_OnlineResource -->
    <element name="ESPAS_OnlineResource" substitutionGroup="gml:AbstractObject" type="espas:ESPAS_OnlineResourceType">
        <annotation>
            <documentation>-- Definition --
                Information about online sources.
            </documentation>
        </annotation>
    </element>
    <complexType name="ESPAS_OnlineResourceType">
        <sequence>
            <element maxOccurs="1" minOccurs="0" name="serviceFunction" type="gml:ReferenceType">
                <annotation>
                    <documentation>-- Definition --
                        The function performed by the online resource.Values of the attribute &lt;i&gt;ESPAS_ServiceFunctionValue&lt;/i&gt;
                        , e.g. download, are obtained from a controlled vocabulary.
                    </documentation>
                </annotation>
            </element>
            <element name="linkage" type="gmd:URL_PropertyType">
                <annotation>
                    <documentation>-- Definition --
                        A location (adress) for on line acess using a Uniform Resource Locator/Uniform Resource
                        Identifier adress.
                    </documentation>
                </annotation>
            </element>
            <element name="name" type="string">
                <annotation>
                    <documentation>-- Definition --
                        Name of the online resource.
                    </documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="protocol" type="string">
                <annotation>
                    <documentation>-- Definition --
                        The connection protocol e.g., http, ftp, file.
                    </documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="description" type="string">
                <annotation>
                    <documentation>-- Definition --
                        A text description of what the online resource is/does.
                    </documentation>
                </annotation>
            </element>
            <element name="dataFormat" type="gml:ReferenceType">
                <annotation>
                    <documentation>-- Definition --
                        The format of the strored result accessible from the online resource. This property references a
                        term, e.g. NetCDF, from a controlled vocabulary.
                    </documentation>
                </annotation>
            </element>
        </sequence>
    </complexType>
    <complexType name="ESPAS_OnlineResourcePropertyType">
        <sequence>
            <element ref="espas:ESPAS_OnlineResource"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>

    <simpleType name="ESPAS_ApplicationProfileValueType">
        <union memberTypes="espas:ESPAS_ApplicationProfileValueEnumerationType espas:ESPAS_ApplicationProfileValueOtherType"/>
    </simpleType>
    <simpleType name="ESPAS_ApplicationProfileValueEnumerationType">
        <restriction base="string"/>
    </simpleType>
    <simpleType name="ESPAS_ApplicationProfileValueOtherType">
        <restriction base="string">
            <pattern value="other: \w{2,}"/>
        </restriction>
    </simpleType>

    <!-- Extensions -->
    <complexType name="ESPAS_OnlineResource_ExtendedPropertyType">
        <complexContent>
            <extension base="espas:ESPAS_OnlineResourcePropertyType">
                <attribute name="deleted" type="espas:deleteType"/>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="ESPAS_Result_ExtendedPropertyType">
        <complexContent>
            <extension base="espas:ESPAS_ResultPropertyType">
                <attribute name="deleted" type="espas:deleteType"/>
            </extension>
        </complexContent>
    </complexType>
</schema>