<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
  ~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
  ~ and United Nations Environment Programme (UNEP)
  ~
  ~ This program is free software; you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 2 of the License, or (at
  ~ your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but
  ~ WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program; if not, write to the Free Software
  ~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  ~
  ~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
  ~ Rome - Italy. email: geonetwork@osgeo.org
  -->

<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://geonetwork-opensource.org/schemas/schema-ident"
        xsi:schemaLocation="http://geonetwork-opensource.org/schemas/schema-ident http://geonetwork-opensource.org/schemas/schema-ident/schema-ident.xsd">
  <name>iso19139</name>
  <id>3f95190a-dde4-11df-8626-001c2346de4c</id>
  <version>1.0</version>
  <appMinorVersionSupported>4.4.0</appMinorVersionSupported>
  <title xml:lang="en">Geographic information -- Metadata (iso19139:2007)</title>
  <title xml:lang="fr">Information géographique -- Métadonnées (iso19139:2007)</title>
  <description xml:lang="en"><![CDATA[
ISO 19115 defines the schema required for describing geographic information and services by
means of metadata. It provides information about the identification, the extent, the quality,
the spatial and temporal aspects, the content, the spatial reference, the portrayal,
distribution, and other properties of digital geographic data and services.

ISO 19115 is applicable to:

- the cataloguing of all types of resources, clearinghouse activities, and the full description of datasets and services;

- geographic services, geographic datasets, dataset series, and individual geographic features and feature properties.

ISO 19115 defines:

- mandatory and conditional metadata sections, metadata entities, and metadata elements;

- the minimum set of metadata required to serve most metadata applications (data discovery,
  determining data fitness for use, data access, data transfer, and use of digital data and
  services);

- optional metadata elements to allow for a more extensive standard description of resources, if
  required;

- a method for extending metadata to fit specialized needs.

Though ISO 19115 is applicable to digital data and services, its principles can be extended to
many other types of resources such as maps, charts, and textual documents as well as
non-geographic data. Certain conditional metadata elements might not apply to these other forms
of data.]]>
  </description>
  <standardUrl>https://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=53798
  </standardUrl>
  <!-- 19139:2007 version -->
  <schemaLocation>http://www.isotc211.org/2005/gmd http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd</schemaLocation>
  <!-- 19139:2005 version
  <schemaLocation>http://www.isotc211.org/2005/gmd https://www.isotc211.org/2005/gmd/gmd.xsd
                  http://www.isotc211.org/2005/gmx https://www.isotc211.org/2005/gmx/gmx.xsd
                  http://www.isotc211.org/2005/srv http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd
  </schemaLocation>-->
  <autodetect xmlns:gmd="http://www.isotc211.org/2005/gmd"
              xmlns:gco="http://www.isotc211.org/2005/gco">
    <elements type="root">
      <gmd:MD_Metadata/>
      <!-- Identify responsible party subtemplate as ISO19139 -->
      <gmd:CI_ResponsibleParty/>
      <gmd:DQ_DomainConsistency/>
      <gmd:MD_Format/>
      <gmd:EX_Extent/>
    </elements>
  </autodetect>
  <filters xmlns:gco="http://www.isotc211.org/2005/gco">
    <filter xpath=".//*[@gco:nilReason='withheld']"
            jsonpath="$.*[?(@.nilReason == 'withheld')]"
            ifNotOperation="editing">
      <keepMarkedElement gco:nilReason="withheld"/>
    </filter>
    <filter
      xpath=".//gmd:onLine[*/gmd:protocol/gco:CharacterString = 'WWW:DOWNLOAD-1.0-http--download']"
      jsonpath="$['link'][?(@.protocol == 'WWW:DOWNLOAD-1.0-http--download')]"
      ifNotOperation="download"/>
    <filter xpath=".//gmd:onLine[starts-with(*/gmd:protocol/gco:CharacterString, 'OGC:WMS')]"
            jsonpath="$['link'][?(@.protocol =~ /OGC:WMS.*?/i)]"
            ifNotOperation="dynamic"/>
  </filters>
</schema>
