Skip to content

Commit

Permalink
cleaning / synchronizing schema 'base dir'
Browse files Browse the repository at this point in the history
  • Loading branch information
cmangeat committed Feb 12, 2025
1 parent 2ce6355 commit 3a580b8
Show file tree
Hide file tree
Showing 18 changed files with 364 additions and 99 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2001-2023 Food and Agriculture Organization of the
~ 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)
~
Expand Down
26 changes: 25 additions & 1 deletion iso19139.che/src/main/plugin/iso19139.che/extract-atom-feed.xsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
<?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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:che="http://www.geocat.ch/2008/che"
version="2.0"
>
Expand All @@ -16,7 +40,7 @@
<!-- Get first element -->
<atomfeed>
<xsl:value-of
select="gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource[lower-case(gmd:protocol/gco:CharacterString) = lower-case($atomProtocol)]/gmd:linkage/gmd:URL"/>
select="gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource[lower-case(gmd:protocol/*/text()) = lower-case($atomProtocol)]/gmd:linkage/gmd:URL"/>
</atomfeed>

</xsl:template>
Expand Down
28 changes: 26 additions & 2 deletions iso19139.che/src/main/plugin/iso19139.che/extract-datasetid.xsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:che="http://www.geocat.ch/2008/che"
<!--
~ 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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:che="http://www.geocat.ch/2008/che"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
version="1.0">

<xsl:template match="che:CHE_MD_Metadata">
<identifier>
<xsl:value-of
select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString"/>
select="gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/*/text()|gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/*/text()"/>
</identifier>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
<?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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:inspire_dls="http://inspire.ec.europa.eu/schemas/inspire_dls/1.0"
version="2.0"
>
<xsl:template match="atom:feed">
<datasets>
<xsl:for-each select="atom:entry[inspire_dls:spatial_dataset_identifier_code]">
<dataset>
<identifier>
<xsl:value-of select="inspire_dls:spatial_dataset_identifier_code"/>
</identifier>
<namespace>
<xsl:value-of select="inspire_dls:spatial_dataset_identifier_namespace"/>
</namespace>
</dataset>
</xsl:for-each>
</datasets>
</xsl:template>
<xsl:import href="../iso19139/extract-datasetinfo-from-service-feed.xsl"/>
</xsl:stylesheet>
38 changes: 35 additions & 3 deletions iso19139.che/src/main/plugin/iso19139.che/extract-datasets.xsl
Original file line number Diff line number Diff line change
@@ -1,13 +1,45 @@
<?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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:che="http://www.geocat.ch/2008/che"
version="2.0"
>
version="2.0">
<xsl:template match="che:CHE_MD_Metadata">
<datasets>
<xsl:for-each select="gmd:identificationInfo/srv:SV_ServiceIdentification/srv:operatesOn">
<dataset>
<xsl:value-of select="@uuidref"/>
<xsl:choose>
<xsl:when test="@uuidref!=''">
<xsl:value-of select="@uuidref"/>
</xsl:when>
<xsl:otherwise>
<!-- works only for csw requests for now -->
<xsl:value-of select="tokenize(tokenize(string(@xlink:href),'id=')[2],'&amp;')[1]"/>
</xsl:otherwise>
</xsl:choose>
</dataset>
</xsl:for-each>
</datasets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:che="http://www.geocat.ch/2008/che"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
<!--
~ 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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:che="http://www.geocat.ch/2008/che"
version="1.0">

<xsl:template match="che:CHE_MD_Metadata">
Expand Down
4 changes: 0 additions & 4 deletions iso19139.che/src/main/plugin/iso19139.che/extract-gml.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
~ Rome - Italy. email: [email protected]
-->

<!--
Stylesheet used to update metadata for a service and
attached it to the metadata for data.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0" exclude-result-prefixes="#all">
<xsl:import href="../iso19139/extract-gml.xsl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<xsl:variable name="mainLanguage">
<xsl:call-template name="langId_from_gmdlanguage19139">
<xsl:with-param name="gmdlanguage" select="ancestor::metadata/*[@gco:isoType='gmd:MD_Metadata' or name()='gmd:MD_Metadata']/gmd:language"/>
<xsl:with-param name="gmdlanguage" select="ancestor::metadata/*[@gco:isoType='che:CHE_MD_Metadata' or name()='che:CHE_MD_Metadata']/gmd:language"/>
</xsl:call-template>
</xsl:variable>

Expand All @@ -56,7 +56,7 @@
select="substring-after(@locale, '#')"/>

<value lang="{if (@locale)
then ancestor::metadata/*[@gco:isoType='gmd:MD_Metadata' or name()='gmd:MD_Metadata']/gmd:locale/*[@id = $localeId]/gmd:languageCode/*/@codeListValue
then ancestor::metadata/*[@gco:isoType='che:CHE_MD_Metadata' or name()='che:CHE_MD_Metadata']/gmd:locale/*[@id = $localeId]/gmd:languageCode/*/@codeListValue
else if ($mainLanguage) then $mainLanguage else $lang}">
<xsl:copy-of select="@xlink:href"/>
<xsl:value-of select="."/>
Expand All @@ -69,7 +69,7 @@
<xsl:template mode="get-iso19139-localized-url" match="*">

<xsl:variable name="metadata"
select="ancestor::metadata/*[@gco:isoType='gmd:MD_Metadata' or name()='gmd:MD_Metadata']"/>
select="ancestor::metadata/*[@gco:isoType='che:CHE_MD_Metadata' or name()='che:CHE_MD_Metadata']"/>
<xsl:variable name="mainLanguage"
select="string($metadata/gmd:language/gco:CharacterString|
$metadata/gmd:language/gmd:LanguageCode/@codeListValue)"/>
Expand Down Expand Up @@ -97,7 +97,7 @@
It could be a document or thumbnails
-->
<xsl:template mode="relation"
match="metadata[gmd:MD_Metadata or *[contains(@gco:isoType, 'MD_Metadata')]]"
match="metadata[che:CHE_MD_Metadata or *[contains(@gco:isoType, 'che:CHE_MD_Metadata')]]"
priority="299">

<xsl:variable name="mainLanguage">
Expand Down
47 changes: 0 additions & 47 deletions iso19139.che/src/main/plugin/iso19139.che/extract-serviceInfo.xsl

This file was deleted.

11 changes: 0 additions & 11 deletions iso19139.che/src/main/plugin/iso19139.che/extract-type.xsl

This file was deleted.

28 changes: 25 additions & 3 deletions iso19139.che/src/main/plugin/iso19139.che/extract-uuid.xsl
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
<?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: [email protected]
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:che="http://www.geocat.ch/2008/che"
version="1.0"
>
version="1.0">

<xsl:template match="che:CHE_MD_Metadata|gmd:MD_Metadata|*[@gco:isoType='gmd:MD_Metadata']">
<xsl:template match="che:CHE_MD_Metadata|gmd:MD_Metadata|*[@gco:isoType='gmd:MD_Metadata']|*[@gco:isoType='che:CHE_MD_Metadata']">
<uuid>
<xsl:value-of select="gmd:fileIdentifier/gco:CharacterString"/>
</uuid>
Expand Down
Loading

0 comments on commit 3a580b8

Please sign in to comment.