From a7c0dee3e84cf815264a1b1c4a505674964f4235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Prunayre?= Date: Fri, 27 Oct 2023 07:25:29 +0200 Subject: [PATCH] Standard / Formatter / Citation improvements (#7434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Standard / Formatter / Citation improvements * Improve list of contact (when multiple individual names or when same contact with multiple roles) * Cleanup layout (avoid extra space/add missing ones) * Add formatter parameter to customize author and publisher roles (eg. http://localhost:8080/geonetwork/srv/api/records/uuid/formatters/citation?format=text&authorRoles=author,processor&publisherRoles=publisher,custodian) * Add test * Update services/src/test/java/org/fao/geonet/api/records/formatters/FormatterApiTest.java Co-authored-by: Jose García * Jose's feedbacks. --------- Co-authored-by: Jose García --- .../geonet/AbstractCoreIntegrationTest.java | 16 +- .../fao/geonet/kernel/metadata.iso19115-3.xml | 1555 +++++++++++++++++ .../fao/geonet/kernel/metadata.iso19139.xml | 1054 +++++++++++ .../formatter/citation/base.xsl | 92 +- .../formatter/citation/common.xsl | 54 +- .../iso19139/formatter/citation/base.xsl | 70 +- .../geonet/api/records/MetadataApiTest.java | 13 +- .../records/formatters/FormatterApiTest.java | 172 ++ .../iso19115-3.2018-citation-bibtex.txt | 7 + .../iso19115-3.2018-citation-formats.txt | 1 + .../iso19115-3.2018-citation-html.html | 20 + .../iso19115-3.2018-citation-ris.txt | 23 + ...19115-3.2018-citation-text-custom-role.txt | 1 + .../iso19115-3.2018-citation-text.txt | 1 + .../formatters/iso19139-citation-bibtex.txt | 7 + .../formatters/iso19139-citation-formats.txt | 1 + .../formatters/iso19139-citation-html.html | 19 + .../formatters/iso19139-citation-ris.txt | 17 + .../formatters/iso19139-citation-text.txt | 1 + 19 files changed, 3000 insertions(+), 124 deletions(-) create mode 100644 core/src/test/resources/org/fao/geonet/kernel/metadata.iso19115-3.xml create mode 100644 core/src/test/resources/org/fao/geonet/kernel/metadata.iso19139.xml create mode 100644 services/src/test/java/org/fao/geonet/api/records/formatters/FormatterApiTest.java create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-bibtex.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-formats.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-html.html create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-ris.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text-custom-role.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-bibtex.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-formats.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-html.html create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-ris.txt create mode 100644 services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-text.txt diff --git a/core/src/test/java/org/fao/geonet/AbstractCoreIntegrationTest.java b/core/src/test/java/org/fao/geonet/AbstractCoreIntegrationTest.java index c32bc8a1825..33460b70042 100644 --- a/core/src/test/java/org/fao/geonet/AbstractCoreIntegrationTest.java +++ b/core/src/test/java/org/fao/geonet/AbstractCoreIntegrationTest.java @@ -294,9 +294,21 @@ public MockHttpSession loginAsAnonymous() { } + private static Element getSample(String resource) throws IOException, JDOMException { + final URL resourceUrl = AbstractCoreIntegrationTest.class.getResource(resource); + return Xml.loadStream(resourceUrl.openStream()); + } + public Element getSampleMetadataXml() throws IOException, JDOMException { - final URL resource = AbstractCoreIntegrationTest.class.getResource("kernel/valid-metadata.iso19139.xml"); - return Xml.loadStream(resource.openStream()); + return getSample("kernel/valid-metadata.iso19139.xml"); + } + + public Element getSampleISO19139MetadataXml() throws IOException, JDOMException { + return getSample("kernel/metadata.iso19139.xml"); + } + + public Element getSampleISO19115MetadataXml() throws IOException, JDOMException { + return getSample("kernel/metadata.iso19115-3.xml"); } /** diff --git a/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19115-3.xml b/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19115-3.xml new file mode 100644 index 00000000000..78aa4c939de --- /dev/null +++ b/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19115-3.xml @@ -0,0 +1,1555 @@ + + + + + + {uuid} + + + urn:uuid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital + - Département Données transversales - Production géomatique et traitement de données) + + + + + + + + geometrologie@spw.wallonie.be + + + + + + + + + + + + + 2023-07-04T07:51:35.236Z + + + + + + + + + + 2019-01-10T12:00:00 + + + + + + + + + + ISO 19115 + + + 2003/Cor 1:2006 + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c + + + + + + + + + + + + + EPSG:3812 + + + ETRS89 / Belgian Lambert 2008 (EPSG:3812) + + + + + + + + + + + + + + Utilisation du Sol en Wallonie - WALOUS 2018 + + + WALOUS_UTS__2018 + + + + + 2020-09-28 + + + + + + + + + + 2020-10-30 + + + + + + + + + + fafb9fc7-4e32-4a40-8163-c64966cb573c + + + http://geodata.wallonie.be/id/ + + + + + + + WALOUS__WAL_UTS__2018 + + + BE.SPW.INFRASIG.CARTON + + + + + + + Cette couche de données reprend la cartographie de l’utilisation du sol de l’ensemble du + territoire wallon pour l’année 2018 (WAL_UTS__2018). + + La cartographie de l’utilisation du sol de l’ensemble du territoire wallon pour l’année 2018 (WAL_UTS__2018) + est complémentaire de la cartographie de l'occupation du sol (WAL_OCS__2018) produite conjointement dans le + cadre de la subvention de recherche WALlonie Occupation et Utilisation du Sol (WALOUS). + + L’utilisation du sol représentée dans la donnée WAL_UTS__2018 se définit comme le « Territoire caractérisé + selon sa dimension fonctionnelle ou son objet socioéconomique actuel (par exemple, résidentiel, industriel, + commercial, agricole, forestier, récréatif) » (directive européenne INSPIRE 2007/2/CE). + La donnée WAL_UTS__2018 fournit donc une information sur l’usage des sols par parcelle cadastrale et pour les + espaces non-cadastrés. + Prochainement, cette information sera consolidée par géométrie métier (voir ressources associées). + + Les spécifications techniques de la donnée WAL_UTS__2018 résultent d’une procédure d’analyse des besoins et de + co-constructions avec un panel d’acteurs wallons. + Une vingtaine de géodonnées sont intégrées pour la construction de la donnée WAL_UTS__2018 . La géométrie de + représentation est définie par le croisement entre : + - Le plan parcellaire cadastral (v. 01/01/2019, © SPF-Finance) ; + - Le squelette vectoriel construit par intégration des données du réseau routier et délinéation du bâti du + PICC 2018 (© SPW) et des cours d’eau navigables et des chemins de fer de l’IGN TOP10vGIS (© IGN) ; + - La Carte d’Occupation des Sols de Wallonie (WAL_OCS__2018) produite dans le cadre de la subvention de + recherche WALOUS ; + - La matrice cadastrale définissant la nature déclarée pour chaque parcelle cadastrale (v. 01/01/2019, © + SPF-Finance) ; + - Le Registre national des Personnes Physiques 2018 géocodé au point adresse (RNPP, Source : Statbel + (Direction générale statistique – Statistics Belgium)) ; + - Le répertoire d’entreprises DBRIS 2018 géolocalisées à la parcelle cadastrale (Source : Statbel (Direction + générale statistique – Statistics Belgium)) ; + - Le parcellaire agricole anonyme 2018 (© SPW) ; + - L’inventaire des sites à réaménager de droit 2018 (© SPW) ; + - Le parcellaire forestier public 2018 (© SPW) ; + - L’inventaire des recyparcs (© SPW) ; + - La base de données « conservation de la nature » (© SPW) ; + - Le Réseau Natura 2000 en vigueur 2018 (© SPW) ; + - Le Plan de Secteur 2018 (© SPW) ; + - La carte des écoles de Wallonie 2019 (© ISSeP/SPW) ; + - L’inventaire géolocalisé des établissements pour ainés 2018 (© SPW) ; + - Les sites SEVESO 2018 (© SPW) ; + - L’inventaire des campings 2018 (© SPW) ; + - L’inventaire consolidé des éoliennes 2020 (© ISSeP/SPW) ; + - L’inventaire ponctuel (centroïde) des carrières actives 2010 (inventaire POTY) (© SPW) ; + - L’IGN Top-10vGIS 2017-2020 (© IGN) ; + - Les plantations de sapins de noël 2015 (© SPW) ; + - Le Projet Informatique de Cartographie Continue (v5.2019, © SPW). + + Au sein d’une approche automatisée par base de données spatiales (PostgreSQL, PostGIS, Python, Jupyter + Notebook), l’ensemble des données d’entrée (bases de données alphanumériques, polygones et raster) sont + traduites dans les différentes légendes. + Par parcelle cadastrale (unité de cartographie), ces données ainsi que l’occupation du sol sont synthétisées + par une série d’indicateurs statistiques (présence/absence, nombre d’éléments, proportions, mode, + recouvrement). Ces indicateurs alimentent les règles de classification qui attribuent plusieurs codes : + • L’ensemble des classes rencontrées (avec critères de superficie et de recouvrement) dans cette parcelle + cadastrale : reprise dans l’attribut « all_hilucs » ; + • Une classe reprenant un code unique identifiant la principale utilisation par nos règles : représentée par « + walousmaj », générée dans une volonté de représentation. Walousmaj est donc une représentation simplifiée et + n'est dès lors pas le reflet de l'ensemble des utilisations pouvant être rencontrées dans cette parcelle + cadastrale. L’attribut « walousmaj » présente l’utilisation du sol principale selon un amendement de la + légende INSPIRE résultant de la procédure de co-construction avec les utilisateurs wallons ; Elle se décline + en 3 niveaux de détails; + • La classification compatible INSPIRE selon les scénarios 1 et 2 (attributs « hilucsLandUse » - légende « + Hierarchical Land Use Classification System (HILUCS) ».) : la parcelle cadastrale est caractérisée par une ou + plusieurs utilisations du sol listées de manière non ordonnée et non-proportionnée. + + Etant issue du croisement automatisé d'une vingtaine de géodonnées, la qualité de la donnée WAL_UTS est + dépendante de la qualité (géométrique, complétude, …) des géodonnées utilisées au sein de cette approche + automatisée. + De plus, ce croisement est régi par un ensemble de règles (voir rapport disponible sur le Géoportail). L'ordre + d'application de ces règles a un impact sur la classe considérée comme "principale utilisation" (représentée + par la symbologie du webservice). Pour une utilisation complète de la donnée WAL_UTS, il est conseillé de se + rapporter au champ "all_HILUCS" + + Néanmoins, la donnée WAL_UTS__2018 a été consolidée via une procédure de contrôle à laquelle un groupe + d’experts wallons a participé. WAL_UTS__2018 a été enfin validée au moyen d’un set de validation de 1200 + parcelles par un expert. Sur base de cette validation, l’exactitude de la carte est de 83% au niveau 1 de la + légende INSPIRE HILUCS. Ces deux procédures ont permis de renforcer l’analyse critique des résultats et + contribuer à l’élaboration de recommandations d’usage et de mise à jour. + + L’information sur l’utilisation du sol est fournie, pour les deux types de représentation spatiale, dans le + système de projection Lambert Belge 2008 (EPSG : 3812 – Pour usage en LB72, voir information sur la grille + NTV2 - http://geoportail.wallonie.be/home/ressources/outils/Lambert-belge-2008-LB08.html). + + La mise en œuvre de la donnée WAL_UTS__2018 s’inscrit dans le cadre du projet WALOUS (2017-2020) subventionné + par la Région wallonne et réalisé par un consortium de deux universités (UCLouvain, ULB) et d’un centre de + recherche public de type UAP (ISSeP). De ce fait, la source à mentionner lors de l'utilisation de cette donnée + est "SPW - UCLouvain/ULB/ISSeP". + + + + + + + + + + + Production géomatique et traitement de données (SPW - Secrétariat général - SPW + Digital - Département Données transversales - Production géomatique et traitement de données) + + + + + + + + geometrologie@spw.wallonie.be + + + + + + + + + + + + + + + + + + Service public de Wallonie (SPW) + + + + + + + helpdesk.carto@spw.wallonie.be + + + + + + + https://geoportail.wallonie.be + + + WWW:LINK + + + Géoportail de la Wallonie + + + Géoportail de la Wallonie + + + + + + + + + + + + + + + + + + + + + Université Libre de Bruxelles (ULB) + + + + + + + ewolff@ulb.ac.be + + + + + + + + + + + + + + + + + + Université catholique de Louvain (UCL) + + + + + + + pierre.Defouny@uclouvain.be + + + + + + + + + + + + + + + + + + Institut Scientifique de Service Public (ISSeP) + + + + + + + ctg@issep.be + + + + + + + + + + + + + + + + + + Université Libre de Bruxelles (ULB) + + + + + + + ewolff@ulb.ac.be + + + + + + + + + Taïs Grippa + + + + + + + Moritz Lennert + + + + + + + Augustin Martinet + + + + + + + Sabine Vanhuysse + + + + + + + Eléonore Wolff + + + + + + + + + + + + + + + + Université catholique de Louvain (UCL) + + + + + + + pierre.Defouny@uclouvain.be + + + + + + + + + Céline Bassine + + + + + + + Céline Champagne + + + + + + + Pierre Defourny + + + + + + + Julien Radoux + + + + + + + + + + + + + + + + Institut Scientifique de Service Public (ISSeP) + + + + + + + ctg@issep.be + + + + + + + + + Benjamin Beaumont + + + + + + + Eric Hallot + + + + + + + Gérard Swinnen + + + + + + + Laura Van de Vyvere + + + + + + + + + + + + + + + + Production géomatique et traitement de données (SPW - Secrétariat général - SPW + Digital - Département Données transversales - Production géomatique et traitement de données) + + + + + + + + geometrologie@spw.wallonie.be + + + + + + + + + + + + + + + + 1 + + + + + imageryBaseMapsEarthCover + + + + + Région wallonne + + + + + 2.75 + + + 6.50 + + + 49.45 + + + 50.85 + + + + + + + + + + + + 2018-01-01 + 2018-12-31 + + + + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/WAL_UTS__2018_niv1.png + + + + WAL_UTS__2018_niv1.png + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/WAL_UTS__2018.png + + + + WAL_UTS__2018.png + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/WAL_UTS__2018_niv3.png + + + + WAL_UTS__2018_niv3.png + + + + + + + + Données de base + + + + + Nature et environnement + + + + + Aménagement du territoire + + + + + Sol et sous-sol + + + + + + + + + Thèmes du + géoportail wallon + + + + + + 2014-01-01 + + + + + + + + + + 2014-06-26 + + + + + + + + + + + geonetwork.thesaurus.external.theme.Themes_geoportail_wallon_hierarchy + + + + + + + + + + + + WalOnMap + + + BDInfraSIG + + + Reporting INSPIRENO + + + Open Data + + + PanierTelechargementGeoportail + + + + + + + + Mots-clés InfraSIG + + + + + 2022-10-03 + + + + + + + + + + 2022-10-03 + + + + + + + + + + + geonetwork.thesaurus.external.theme.infraSIG + + + + + + + + + + + + Régional + + + + + + + + Champ géographique + + + + + + 2019-01-01 + + + + + + + + + + 2019-05-22 + + + + + + + + + + + geonetwork.thesaurus.external.theme.httpinspireeceuropaeumetadatacodelistSpatialScope-SpatialScope + + + + + + + + + + + + Utilisation du sol + + + Usage du sol + + + WALOUS + + + Télédétection + + + Aménagement du territoire + + + UTS + + + COSW + + + + + + + + + + No + limitations to public access + + + + + + + + Conditions d'accès et d'utilisation spécifiques + + + + + + Les + conditions générales d'utilisation s'appliquent. + + + + Les + conditions générales d'accès s’appliquent. + + + + + Les conditions générales d'utilisation s'appliquent et sont étendues par les conditions particulières de + type C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modèle de la donnée Utilisation du Sol en Wallonie - WALOUS 2018 + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/MODELE%20WALOUS_WAL_UTS.vsd.pdf + + + + Modèle de la donnée Utilisation du Sol en Wallonie - WALOUS 2018 + + + + Structure de la couche WALOUS 2018 - Utilisation du sol [WAL_UTS__2018] + + + + + + + + + + + + + + + + ESRI File + Geodatabase (.fgdb) + + + + + + + + + + + + OGC + GeoPackage (.gpkg) + + + + + + + + + + + + + + + + + Service public de Wallonie (SPW) + + + + + + + helpdesk.carto@spw.wallonie.be + + + + + + + + + + + + + Les instructions pour obtenir une copie physique d’une donnée sont détaillées sur + https://geoportail.wallonie.be/telecharger. + + Sources à mentionner : SPW - UCLouvain/ULB/ISSeP. + + + + + + + + + + + + + https://geoportail.wallonie.be/walonmap/#ADU=https://geoservices.wallonie.be/arcgis/rest/services/SOL_SOUS_SOL/WALOUS_UTILISATION_SOL/MapServer + + + + WWW:LINK + + + Application WalOnMap - Toute la Wallonie à la carte + + + Application cartographique du Geoportail (WalOnMap) qui permet de découvrir les + données géographiques de la Wallonie. + + + + + + + + + + + + https://geoservices.wallonie.be/arcgis/rest/services/SOL_SOUS_SOL/WALOUS_UTILISATION_SOL/MapServer + + + + ESRI:REST + + + Service de visualisation ESRI-REST + + + Adresse de connexion au service de visualisation ESRI-REST de la couche de données + "Utilisation du Sol en Wallonie - WALOUS 2018" + + + + + + + + + + + + https://geoservices.wallonie.be/arcgis/services/SOL_SOUS_SOL/WALOUS_UTILISATION_SOL/MapServer/WMSServer?request=GetCapabilities&service=WMS + + + + OGC:WMS + + + Service de visualisation WMS + + + Adresse de connexion au service de visualisation WMS de la couche de données + "Utilisation du Sol en Wallonie - WALOUS 2018" + + + + + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Symbologie_WALOUS_UTS_2018.pdf + + + + WWW:LINK + + + application/pdf + + + Document reprenant la symbologie utilisée dans WALOUS_UTS_2018 + + + + + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Table_symbologie_WALOUS_UTS.xlsx + + + + WWW:LINK + + + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + + Table_symbologie_WALOUS_UTS.xlsx + + + + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Description_legende_WALOUS_UTS_2018.pdf + + + + WWW:LINK + + + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + + + Description_legende_WALOUS_UTS_2018.pdf + + + + + + + + + + http://geoportail.wallonie.be/walous + + + WWW:LINK + + + Walous sur le Géoportail + + + Page du Géoportail présentant WALOUS + + + + + + + + + + https://storymaps.arcgis.com/stories/11231ee7e2004d5aad12496a85a5fc15 + + + + WWW:LINK + + + Story Map de présentation de WALOUS + + + Story map présentant WALOUS + + + + + + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Correspondance_COSW2007_Walousmaj2018.xlsx + + + + WWW:DOWNLOAD-1.0-http--download + + + Correspondance COSW2007 Walousmaj2018 + + + Tableau de correspondance entre les classes de WALOUS 2018 et celles de la + COSW2007 + + + + + + + + + + + + + + + + + + + + + + + + + + + + RÈGLEMENT (UE) N o 1089/2010 DE LA + COMMISSION du 23 novembre 2010 portant modalités d'application de la directive 2007/2/CE du + Parlement européen et du Conseil en ce qui concerne l'interopérabilité des séries et des services + de données géographiques + + + + + + 2010-12-08 + + + + + + + + + + Voir la spécification référencée + + + true + + + + + + + + + + + Les étapes principales de production de la donnée WAL_UTS__2018 sont les suivantes : + - Acquisition des données d’entrée et prétraitements ; + - Calculs de statistiques zonales par parcelles cadastrales ; + - Classification sur bases de règles SQL automatisées ; + - Contrôle de qualité ; + - Publication. + + + + + + + + + + + + + + + + + Légende du webservice + + + + + + https://geoservices.wallonie.be/arcgis/rest/services/SOL_SOUS_SOL/WALOUS_UTILISATION_SOL/MapServer/legend + + + + + + + + + + + + + + Légende pour QGIS + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/WALOUS_UTS.qml + + + + + + + + + + + + + + Légende pour AcrGIS - Niveau 1 + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Utilisation%20majoritaire%20-%20Niveau%201.lyr + + + + + + + + + + + + + + Légende pour AcrGIS - Niveau 2 + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Utilisation%20majoritaire%20-%20Niveau%202.lyr + + + + + + + + + + + + + + Légende pour AcrGIS - Niveau 3 + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Utilisation%20majoritaire%20-%20Niveau%203.lyr + + + + + + + + + + + + + + Légende pour AcrGIS - Niveau 3 enrichi + + + + + + https://metawal.wallonie.be/geonetwork/srv/api/records/fafb9fc7-4e32-4a40-8163-c64966cb573c/attachments/Utilisation%20majoritaire%20-%20Niveau%203%20WALOUSMAJ.lyr + + + + + + + + + diff --git a/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19139.xml b/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19139.xml new file mode 100644 index 00000000000..691a6fbf4db --- /dev/null +++ b/core/src/test/resources/org/fao/geonet/kernel/metadata.iso19139.xml @@ -0,0 +1,1054 @@ + + + + {uuid} + + + + + + + + + + + + + + European Environment Agency + + + + + + + Kongens Nytorv 6 + + + Copenhagen + + + K + + + 1050 + + + Denmark + + + sdi@eea.europa.eu + + + + + + + + + + + + 2023-08-15T13:50:02.44Z + + + ISO 19115/19139 + + + 1.0 + + + + + + + EPSG:3035 + + + + + + + + + + + CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May + 2020 + + + + + + 2019-06-14 + + + + + + + + + + 2019-06-14 + + + + + + + + + + 2020-05-13 + + + + + + + + 20.01 + + + + + copernicus_v_3035_100_m_cha-2012-2018_p_2011-2018_v20_r01 + + + + + + + DAT-49-en + + + + + + + DAT-38-en + + + + + + + + 10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24 + + + + + + + + Corine Land Cover Change 2012-2018 (CHA1218) is one of the Corine Land Cover (CLC) datasets + produced within the frame the Copernicus Land Monitoring Service referring to changes in land cover / land use + status between the years 2012 and 2018. + + CLC service has a long-time heritage (formerly known as "CORINE Land Cover Programme"), coordinated by the + European Environment Agency (EEA). It provides consistent and thematically detailed information on land cover + and land cover changes across Europe. + + CLC datasets are based on the classification of satellite images produced by the national teams of the + participating countries - the EEA members and cooperating countries (EEA39). National CLC inventories are then + further integrated into a seamless land cover map of Europe. The resulting European database relies on + standard methodology and nomenclature with following base parameters: 44 classes in the hierarchical 3-level + CLC nomenclature; minimum mapping unit (MMU) for status layers is 25 hectares; minimum width of linear + elements is 100 metres. Change layers have higher resolution, i.e. minimum mapping unit (MMU) is 5 hectares + for Land Cover Changes (CHA), and the minimum width of linear elements is 100 metres. + + The CLC service delivers important data sets supporting the implementation of key priority areas of the + Environment Action Programmes of the European Union as e.g. protecting ecosystems, halting the loss of + biological diversity, tracking the impacts of climate change, monitoring urban land take, assessing + developments in agriculture or dealing with water resources directives. CLC belongs to the Pan-European + component of the Copernicus Land Monitoring Service (https://land.copernicus.eu/), part of the European + Copernicus Programme coordinated by the European Environment Agency, providing environmental information from + a combination of air- and space-based observation systems and in-situ monitoring. + + Additional information about CLC product description including mapping guides can be found at + https://land.copernicus.eu/user-corner/technical-library/. CLC class descriptions can be found at + https://land.copernicus.eu/user-corner/technical-library/corine-land-cover-nomenclature-guidelines/html/. + + + + + + + + + + + + + + + + + + https://sdi.eea.europa.eu/public/catalogue-graphic-overview/f30f1000-7cf8-43bb-872c-5eb093911b24.png + + + + + + + + Land cover + + + + + + + + GEMET - INSPIRE themes, version 1.0 + + + + + 2008-06-01 + + + + + + + + + + + geonetwork.thesaurus.external.theme.httpinspireeceuropaeutheme-theme + + + + + + + + + + + + + EEA39 + + + + + + + + Continents, countries, sea regions of the world. + + + + + 2015-07-17T12:00:00 + + + + + + + + + + + geonetwork.thesaurus.external.place.regions + + + + + + + + + + + + + landscape + + + landscape alteration + + + land use + + + land cover + + + land + + + + + + + + GEMET + + + + + 2021-11-30 + + + + + + + + + + + geonetwork.thesaurus.external.theme.gemet + + + + + + + + + + + + European + + + + + + + + + Spatial scope + + + + + + 2019-05-22 + + + + + + + + + + + geonetwork.thesaurus.external.theme.httpinspireeceuropaeumetadatacodelistSpatialScope-SpatialScope + + + + + + + + + + + + 2016 2.6.1 + + + + + + + + EEA Management Plan + + + + + 2021-08-25 + + + + + + + + + + + geonetwork.thesaurus.local.theme.eea-mp + + + + + + + + + + + + Land use + + + Water + + + + + + + + EEA topics + + + + + 2020-09-24 + + + + + + + + + + + geonetwork.thesaurus.external.theme.eea-topics + + + + + + + + + + + + + + + no + limitations to public access + + + + + + + + + + + Access to data is based on a principle of full, open and free access as established by + the Copernicus data and information policy Regulation (EU) No 1159/2013 of 12 July 2013. This regulation + establishes registration and licensing conditions for GMES/Copernicus users. + + Free, full and open access to this data set is made on the conditions that: + + 1. When distributing or communicating Copernicus dedicated data and Copernicus service information to the + public, users shall inform the public of the source of that data and information. + + 2. Users shall make sure not to convey the impression to the public that the user's activities are + officially endorsed by the Union. + + 3. Where that data or information has been adapted or modified, the user shall clearly state this. + + 4. The data remain the sole property of the European Union. Any information and data produced in the + framework of the action shall be the sole property of the European Union. Any communication and + publication by the beneficiary shall acknowledge that the data were produced “with funding by the European + Union”. + + + + + + + + + + 68e79f63-d64a-463a-895c-0a15a2adfee0 + + + + + + + + + + + + + + + 100 + + + + + + + + + + + environment + + + imageryBaseMapsEarthCover + + + + + + + -31.561261 + + + 44.820775 + + + 27.405827 + + + 71.409109 + + + + + + + -61.906047 + + + -60.905616 + + + 15.736333 + + + 16.607552 + + + + + + + -54.268239 + + + -51.621253 + + + 3.772692 + + + 5.851958 + + + + + + + -61.326095 + + + -60.711516 + + + 14.29692 + + + 14.970484 + + + + + + + 44.927382 + + + 45.390135 + + + -13.089579 + + + -12.546691 + + + + + + + 55.114983 + + + 55.935919 + + + -21.482245 + + + -20.77811 + + + + + + + + 2017-01-01 + 2018-12-31 + + + + + + + + + + + + + + GDB + + + 1.0 + + + + + + + Spatialite + + + + + + + + + + + + https://land.copernicus.eu/pan-european/corine-land-cover/lcc-2012-2018 + + + WWW:LINK-1.0-http--link + + + + + + + + + + https://image.discomap.eea.europa.eu/arcgis/rest/services/Corine/CHA2012_2018_WM/MapServer + + + + ESRI:REST + + + + + + + + + + + https://image.discomap.eea.europa.eu/arcgis/services/Corine/CHA2012_2018_WM/MapServer/WMSServer?service=WMS&request=GetCapabilities&version=1.3.0 + + + + OGC:WMS + + + CHA2012_2018 + + + + + + + + + + + + + + + + + https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24 + + + DOI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing + Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of + spatial data sets and services + + + + + + 2010-12-08 + + + + + + + + + + See the referenced specification + + + + + + + + + + Version 2020_20u1 + + Release date: 24-02-2020 + File naming conventions simplified and better described. New file naming convention has been introduced + based on user feedback on version 20. Filename is composed of combination of information about update + campaign, data theme and reference year and version specification (including release year and release + number). + + The French DOMs are provided in separate databases (files both for vector and raster version of data). + + All raster layers are back in 8 bit GeoTIFF. Modification is introduced based on the user feedback on + version 20. In order to keep 8 bit resolution for raster change layers, they are divided into two files - + representing consumption (from) and formation (to) part of change. + + Version 20 + Release date: 14-06-2019 + Vector CLC database was provided by National Teams within original CLC1990, I&CLC2000 update, + FTSP/CLC2006 update, CLC2012 update and CLC2018 update projects. All features in original vector database + were classified and digitised based on satellite images with 100 m positional accuracy (according to CLC + specifications) and 25 ha minimum mapping unit into the standardized CLC nomenclature (44 CLC classes). + + European Corine Land Cover seamless DBs represent the final product of European data integration. The + process of data integration started when national deliveries have been accepted and the Database + Acceptance Report (DBTA) delivered . Delivered national data were produced in local national systems of + all participating countries. Each national Coordinate Reference System (CRS) definition had to be known + precisely together with its geometric relationship to a standard system in order to accurately transfer + all national data into a standard European coordinate reference - ETRS89/LAEA1052. + Mostly, the process itself was carried out by global equation-based transformation to ETRS89 (e.g. + seven-parameters Bursa-Wolf methods). The accuracy of a particular transformation ranges from centimetres + to meters depending on the method and the quality and number of control points available to define the + transformation parameters, but, in any case, the accuracy is far above the actual CLC data resolution (for + more details see the DBTA reports for particular country). National data, when transformed into the common + European reference, are introduced into tiled pan-European structure and as final step seamless dataset is + produced. + + In order to achieve production of the real seamless European database, the integration step includes also + harmonization of database along country borders. It consists from edge-matching of land cover polygons + from the national databases across national borders done by a verification / re-interpretation of the + satellite images in the border regions (2 km wide strip along borders). The satellite images from + IMAGE2000. CLC1990, CHA9000 and CLC2000 database were harmonized this way, but the order to priority was + as following: CLC2000, both geometric and thematic adaptations of all polygons in a 2 km strip along + national boundary lines; CHA9000 database to ensure that + changes in CLC2000 are consistent with the change database; corrected CLC90 (if provided by the MS); + corrections were focused to geometric adaptations in semi-automatical way based on CLC00 and CHA00 + databases. Border harmonization step has been skipped for CHA0006, CHA0612, CLC2012 and CLC2018 datasets. + Simplified border harmonization step for CLC2006 dataset has been created for these countries: CH, NO, KO, + TR, IE. + A simplified border matching has been applied: + - <25 ha polygons are NOT systematically removed (see next bullet). + - Sliver-like polygons (area < cca. 5 ha - soft limit) are generalised to largest or thematically most + similar neighbour. + - CLC-code differences in polygons along two sides of the border are NOT changed + Only polygons with area <= 0,1ha were eliminated in CHA0006, CHA0612, CLC2012 and for CLC2018 datasets + and CLC2006 dataset (besides the above-mentioned cases) and in parts newly added in campaigns 2006 and + 2012 too + + Note: Some artificial lines (dividing polygons with the same code) can be still present in database due to + technical constraints of current ArcGIS technology, but has no impact for dataset contents and can be + dissolved for data extracts. + + Version 18 (V18) + Release date: 19-09-2016 (see V18_5_1) + Main purpose of the release: Publication of the final, corrected CLC 2012 data. + The 4th CLC inventory for the reference year of 2012 was produced under the Copernicus Initial Operations + (GIO). It has the shortest production time in history of CLC. Two high-resolution satellite image + coverages (IRS Resourcesat-1/2, SPOT-4/5, RapidEye constellation) taken in 2011-2012 provided + multi-temporal information to support the update. Computer Assisted Photointerpretation (CAPI) was the + prevailing methodology applied in interpreting of satellite images. FI, DE, IC, IE, NO, ES and SE applied + a semi-automatic methodology. UK has turned from semiautomatic processing to CAPI because no national + hi-res dataset was available for 2012. Most of the QC was conducted in remote verifications. IT and ES + were verified by regions. In producing the European products, a simplified border matching was applied + (see Version 15). An independent validation of CLC and CLCC for CLC 2012 was carried out in 2016 and the + results are available at + https://land.copernicus.eu/user-corner/technical-library/clc-2012-validation-report-1. + Changes from previous main release (Version 17): + • Inclusion of CLC 2012 layers for all the EEA39 countries. + • Production of CLC 2006 for Greece (in V18_3) and all CLCs for Channel Islands (V18_1). + • Revised CLC 2000 and CLC 2006 layers were made available (V18_5). + • Change in rasterization algorithm (V18_2). + Known problems: + • Some redundant lines between neighbouring polygons with the same code are still present, but only as + result of persisting ‘adaptive tilling’ procedure (limitation of ESRI ArcGIS technology for large + datasets). + • Polygons <25 ha can be present along national borders and along 'adaptive tilling' tiles boundaries. + + See https://land.copernicus.eu/user-corner/technical-library/clc-country-coverage-v18.5 for full + information about the coverage of this version. + + See https://land.copernicus.eu/user-corner/technical-library/clc-and-clcc-release-lineage for full + information about all sub-versions of this version. + + Version 17 (V17) + Release date: 02-12-2013 + Main purpose of the release: Maintenance / Increased European coverage of CLC time series data. + Changes from previous release (V16): + • Full CLC and CLCC data time series (from CLC 1990 to CLC 2006 including all CLCC datasets) has been + included for the Autonomous Region of the Azores (PT). + + Version 16 (V16) + Release date: 15-04-2012 + Main purpose: Maintenance / Increased and improved European coverage of CLC time series data. + Changes from previous release (V15): + • CLC 1990 coverage: TR has been delivered CLC 1990 and CLCC (1990, 2000) data. Still missing CLC 1990 + data: AL, BA, CH, CY, FI, IS, MK, NO, SE, UK and the XK. + • CLC 2000_revised layer covering 27 countries was included (CLC 2000 data revised during production of + CLC 2006). + • Shift in MT geographic position has been corrected. All CLC layers for MT have been re-projected. + • A few coding inconsistences were corrected. + + Version 15 (V5) + Release date: 20-07-2011 + Main purpose: Publication of final CLC2 006 data. + The 3rd CLC inventory for the reference year of 2006 was produced under GMES Fast Track Service on Land + Monitoring. The CLCC database was considered as the primary product, and a uniform change mapping + methodology was agreed. Dual date satellite imagery (SPOT-4/5 and IRS P6) taken in 2005-2007 provided + enhanced change mapping capabilities. Some of the countries newly entering CLC have produced CLC 2000 + datasets also during the project time frame. Scanned topographic maps and digital aerial ortho-imagery + have become commonly available. CAPI was the prevailing method applied in interpreting of satellite + images. Nevertheless, FI, IS, NO, SE and the UK applied a semiautomatic methodology. Most of the European + QC was conducted by visiting national teams (see Version 2). In some cases, remote verification was + applied (without mission to countries). ES and IT were verified by regions. + Changes from previous release (V14 (V4)): + • CLC 2006 data covering Great Britain (part of UK) and TR were delivered. Thus, CLC 2006 European + coverage includes 38 countries of the EEA39. Still missing CLC 2006 data for Greece. + • A simplified border matching was applied for countries new in CLC: XK, NO, CH and Türkiye: 1) <25 ha + polygons along the borders are not removed systematically; 2) sliver-like polygons (area < cca. 5 ha) + are generalised to largest or thematically most similar neighbour. + • For the rest of CLC 2006 countries a simple border-matching was applied. Code differences along two + sides of borders are not changed. Only polygons with area ≤ 0,1 ha (sliver polygons) are eliminated. + • Data dissemination: CLC data become freely accessible from the EEA to any person or legal entity. + + Version 14 (V4) + Release date: 25-10-2010 + Main purpose: Maintenance / Increased European coverage of CLC 2006 and CLC 2000 data. + Changes from previous release (V13 (V3)): + • CLC 2006 European coverage includes 37 full countries of EEA39. New data for Northern Ireland (part of + the UK), Madeira Islands (part of PT), CH, IS and TR were added to CLC 2006 data. Still missing CLC 2006: + GR and the UK (except Northern Ireland). + • New data for Madeira Islands (PT), CH and IS were added into the European CLC 2000 coverage, which + includes already the EE39. However, CLCC (1990, 2000) is available for 28 countries only. + • New data for Madeira Islands (PT) were added into CLC 1990 and CLCC (1990, 2000). Still missing CLC 1990 + data: AL, BA, CH, CY, FI, IS, MK, NO, SE, TR, UK and XK. + + The seamless European database has been further improved addressing feedback from the EEA on V13 (V3): + • No-data buffer (code 999) outside of valid data area was deleted. + • Small gaps identified in V13 were corrected by tolerance adaptation in ArcGIS v10 geodatabase. + • Remaining neighbour polygons with the same code were resolved by additional dissolve operation. + + Version 13 (V3) + Release date: 02/2010 + Main purpose: Publication of initial European coverage of CLC 2006 data. + Changes from previous release (V2): + • Version numbering was changed to harmonise vector data (V3) and derived raster data (V13) releases. + • First seamless release in ESRI Geodatabase format. + • Initial coverage of CLC 2006 including 35 countries and Northern Ireland (part of the UK). Missing + countries in CLC 2006: GR, CH, TR and the UK (except Northern Ireland). + • Two updates added to CLC 2000: a new version for NO and the first CLC dataset for TR. + • Sea buffer around land has been introduced (15 km as proxy to 12 nautical miles’ sea zone). + + Version 2 (V2) + Release date: 09/2009 + Main purpose: Publication of final CLC 2000 coverages. + The 2nd CLC inventory for the reference year of 2000 (CLC 2000) was carried out in the frames of I&CLC + 2000 project. A single date Landsat-7 ETM satellite imagery taken in 1999-2001 was provided by JRC. The + technology of drawing the interpretation on transparencies was discarded and replaced by CAPI + (computer-assisted photo-interpretation). Prior to mapping changes CLC 1990 data had to be corrected: 1) + bulk geometric mistakes removed and residual geometric errors >100 m and coding mistakes were + corrected; 2) polygons smaller than the 25 ha MMU were generalised. European QC was conducted by visiting + national teams (usually at the start and towards the end of the project). Computer-assisted verification + has provided written, geo-located explanations regarding the mistakes and supported harmonized production + of the database all over Europe. + Changes from previous release (V1): + • It was to deliver a single seamless layer, but was not feasible in ESRI environment. Therefore, seamless + ESRI ArcInfo Librarian map tiles were produced again (but free of tiling artefacts reported in V1). + • New country deliveries integrated into European CLC 2000 ME, RS (incl. XK), IS and NO. Simple + harmonization along national borders of these countries was done (small artefacts cleaned only). + • CLC 2000 data for MT have been updated to reflect changed geometry in CLC 2006 delivery. + • The dissemination and use of products was defined in an agreement between the EEA, the EC and the + participating countries. + + Version 1 (V1) + Release date: 08/2005 + Main purpose: Publication of initial European coverage of CLC 2000 and CLCC (1990, 2000) data. + Changes from previous release (V0): + • The first consolidated version of European CLC data have been produced as integrated and harmonised + seamless layer in ESRI ArcInfo Workstation Librarian map tiles. + • The production of the first CLCC database has started, but no consolidated methodology was available. + • Initial CLC 2000 coverage included 32 countries: AL, AT, BE, BA, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GR, + HR, HU, IE, IT, LV, LI, LT, LU, MK, MT, NL, PL, PT, RO, SI, SK, SE and the UK. Missing countries in CLC + 2000: CH, IS, ME, NO, RS (including XK) and TR. + • CLC 1990 for most of the countries has been replaced by revised CLC 1990. Some additional countries have + produced CLC 1990. Still missing in CLC 1990 European coverage: CY, LI, MT, SE and UK. + • Full harmonization (visual re-interpretation by keeping the 25 ha MMU) inside a 5-km wide strip along + national borders was done including 32 countries for CLC 2000 and 24 countries for CLCC (1990, 2000). + • Semi-automatic harmonisation of 2-km wide strip along national borders was done for CLC 1990. + • Vector to raster conversion: “cell centre” method was applied. + • The 25 ha MMU is considered as hard limit. Polygons <25 ha were generalised. + • Dual ownership of CLC and CLCC data (EEA and the country) was introduced. + + Version 0 (V0) + Release dates: up to 12/2000 + Main purpose: Distribution of country-level CLC 1990 data and creation of European raster products. + The period of the first CLC inventory was rather long (1985-1996) and 1990 is considered as reference + year. CLC 1990 data delivered by countries became part of GISCO database. Releases were provided + bi-annually. Following political changes in Central and Eastern Europe 10 additional countries joined. The + methodology was visual photointerpretation by drawing the CLC map on transparency, placed on top of + satellite image hardcopy at scale 1:100.000. + • CLC 1990 vector and raster data were initially available for 12 countries: AT, BE, DE, DK, ES, FR, GR, + IE, IT, LU, NL and PT. Raster only data were available for FI and UK. + • The EC Phare programme supported the implementation of CLC 1990 in 11 countries of Central and Eastern + Europe between 1992 and 1998: BG, CZ and SK, EE, LV, LT, HU, PL, RO and SI. + • Integrated European vector dataset was available as ESRI ArcInfo Librarian and derived raster products + as ESRI grids in 100m and 250m resolution. + • Data dissemination policy was unclear. + + + + + + + + + + + + + + diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/citation/base.xsl b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/citation/base.xsl index 2408170f582..eac4257ad87 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/citation/base.xsl +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/formatter/citation/base.xsl @@ -18,41 +18,57 @@ - - - - - + + + - - - - + - - - - - - - ( + select=".//cit:individual/*/cit:name"/> + + + + + + + , + + + + + ( - ) + ) + + + + + + + + + + + + + + + @@ -84,36 +100,12 @@ - - - - - - - - - - - - - - - - ( - - - - - - ) - - - + *[cit:role/*/@codeListValue = $publisherRolesList]"/> + + + + + + + + + @@ -36,20 +48,22 @@ select="count(authorsNameAndOrgList/*) > 0"/> - - + if (doiUrl != '') then doiUrl else landingPageUrl))"/> @@ -57,12 +71,12 @@ @data{, - author = {}, - publisher = {}, - title = {}, - year = {}, - doi = {}, - url = {} + author = {}, + publisher = {}, + title = {}, + year = {}, + doi = {}, + url = {} } @@ -73,12 +87,12 @@ TY - - AU - + AU - - TI - + TI - - PB - + PB - KW - @@ -114,23 +128,24 @@ else if ($hasAuthor) then '.' else ''"/> -
.
+ . -
+

+ -
+

-
+

-
+

@@ -150,6 +165,7 @@
, +  
diff --git a/schemas/iso19139/src/main/plugin/iso19139/formatter/citation/base.xsl b/schemas/iso19139/src/main/plugin/iso19139/formatter/citation/base.xsl index ac5a5a7c37a..923ef672057 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/formatter/citation/base.xsl +++ b/schemas/iso19139/src/main/plugin/iso19139/formatter/citation/base.xsl @@ -22,21 +22,12 @@ - - - - - + + + - - - - - + + + + + + + + + + + + + + + + @@ -90,35 +100,11 @@ - - - - - - - - - - - - - - ( - - - - - - ) - - - - + *[gmd:role/*/@codeListValue = $publisherRolesList]"/> + + select="'(DOI|WWW:LINK-1.0-http--metadata-URL)'"/> testDataUuidBySchema = new HashMap<>(); + + private ServiceContext context; + + public static Collection data() throws Exception { + ArrayList data = new ArrayList<>(); + data.add(new String[]{"citation", "?format=?", "iso19139", "formats.txt"}); + data.add(new String[]{"citation", "?format=ris", "iso19139", "ris.txt"}); + data.add(new String[]{"citation", "?format=bibtex", "iso19139", "bibtex.txt"}); + data.add(new String[]{"citation", "?format=text", "iso19139", "text.txt"}); + data.add(new String[]{"citation", "?format=html", "iso19139", "html.html"}); + data.add(new String[]{"citation", "?format=?", "iso19115-3.2018", "formats.txt"}); + data.add(new String[]{"citation", "?format=ris", "iso19115-3.2018", "ris.txt"}); + data.add(new String[]{"citation", "?format=bibtex", "iso19115-3.2018", "bibtex.txt"}); + data.add(new String[]{"citation", "?format=text", "iso19115-3.2018", "text.txt"}); + data.add(new String[]{"citation", "?format=html", "iso19115-3.2018", "html.html"}); + data.add(new String[]{"citation", "?format=text&authorRoles=processor&publisherRoles=owner,custodian", "iso19115-3.2018", "text-custom-role.txt"}); + return data; + } + + @Before + public void setUp() throws Exception { + this.context = createServiceContext(); + createTestData(); + } + + private void createTestData() throws Exception { + loginAsAdmin(context); + loadFile(getSampleISO19139MetadataXml()); + loadFile(getSampleISO19115MetadataXml()); + } + + private void loadFile(Element sampleMetadataXml) throws Exception { + String uuid = UUID.randomUUID().toString(); + String schema = schemaManager.autodetectSchema(sampleMetadataXml); + Xml.selectElement(sampleMetadataXml, + "iso19139".equals(schema) + ? "gmd:fileIdentifier/gco:CharacterString" + : "mdb:metadataIdentifier/*/mcc:code/*", + "iso19139".equals(schema) + ? ISO19139SchemaPlugin.allNamespaces.asList() + : ISO19115_3_2018SchemaPlugin.allNamespaces.asList()) + .setText(uuid); + + String source = sourceRepository.findAll().get(0).getUuid(); + final Metadata metadata = new Metadata(); + metadata + .setDataAndFixCR(sampleMetadataXml) + .setUuid(uuid); + metadata.getDataInfo() + .setRoot(sampleMetadataXml.getQualifiedName()) + .setSchemaId(schema) + .setType(MetadataType.METADATA) + .setPopularity(1000); + metadata.getSourceInfo() + .setOwner(1) + .setSourceId(source); + metadata.getHarvestInfo() + .setHarvested(false); + + dataManager.insertMetadata(context, metadata, sampleMetadataXml, IndexingMode.none, false, UpdateDatestamp.NO, + false, false); + + testDataUuidBySchema.put(schema, uuid); + } + + @Test + public void checkFormatter() throws Exception { + MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + MockHttpSession mockHttpSession = loginAsAdmin(); + + for (String[] testParameter : data()) { + String formatter = testParameter[0]; + String urlParams = testParameter[1]; + String schema = testParameter[2]; + String checkfile = testParameter[3]; + String url = "/srv/api/records/" + + testDataUuidBySchema.get(schema) + + "/formatters/" + formatter + urlParams; + try { + MvcResult result = mockMvc.perform(get(url) + .session(mockHttpSession) + .accept(MediaType.ALL_VALUE)) + .andExpect(status().isOk()) + .andReturn(); + + assertEquals( + url, + StreamUtils.copyToString( + FormatterApiTest.class.getResourceAsStream( + String.format("%s-%s-%s", + schema, formatter, checkfile) + ), + StandardCharsets.UTF_8) + .trim() + .replace("{uuid}", testDataUuidBySchema.get(schema)), + result.getResponse().getContentAsString() + .replaceAll("\\r\\n?", "\n") + ); + } catch (Exception e) { + fail(url); + } + } + } +} diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-bibtex.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-bibtex.txt new file mode 100644 index 00000000000..8a3dc5166ba --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-bibtex.txt @@ -0,0 +1,7 @@ +@data{{uuid}, + author = {Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données)}, + publisher = {}, + title = {Utilisation du Sol en Wallonie - WALOUS 2018}, + year = {2020}, + url = {http://localhost:8080/srv/api/records/{uuid}} + } diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-formats.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-formats.txt new file mode 100644 index 00000000000..e5a91ffdfcb --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-formats.txt @@ -0,0 +1 @@ +["html","text","ris","bibtex"] diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-html.html b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-html.html new file mode 100644 index 00000000000..71f10dcdb51 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-html.html @@ -0,0 +1,20 @@ +
+
+
+ + + +
+
+

+ Production géomatique et traitement de données (SPW - Secrétariat général - SPW + Digital - Département Données transversales - Production géomatique et traitement de données) +  (2020). + Utilisation du Sol en Wallonie - WALOUS 2018. +
+ http://localhost:8080/srv/api/records/{uuid} +
+

+
+
+
diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-ris.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-ris.txt new file mode 100644 index 00000000000..c75cd953af7 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-ris.txt @@ -0,0 +1,23 @@ +TY - DATA +AU - Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données) +TI - Utilisation du Sol en Wallonie - WALOUS 2018 +KW - Données de base +KW - Nature et environnement +KW - Aménagement du territoire +KW - Sol et sous-sol +KW - WalOnMap +KW - BDInfraSIG +KW - Reporting INSPIRENO +KW - Open Data +KW - PanierTelechargementGeoportail +KW - Régional +KW - Utilisation du sol +KW - Usage du sol +KW - WALOUS +KW - Télédétection +KW - Aménagement du territoire +KW - UTS +KW - COSW +UR - http://localhost:8080/srv/api/records/{uuid} +ID - {uuid} +ER - diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text-custom-role.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text-custom-role.txt new file mode 100644 index 00000000000..8214e632bbd --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text-custom-role.txt @@ -0,0 +1 @@ +Taïs Grippa, Moritz Lennert, Augustin Martinet, Sabine Vanhuysse, Eléonore Wolff (Université Libre de Bruxelles (ULB)), Céline Bassine, Céline Champagne, Pierre Defourny, Julien Radoux (Université catholique de Louvain (UCL)), Benjamin Beaumont, Eric Hallot, Gérard Swinnen, Laura Van de Vyvere (Institut Scientifique de Service Public (ISSeP)) (2020). Utilisation du Sol en Wallonie - WALOUS 2018. Service public de Wallonie (SPW), Université Libre de Bruxelles (ULB), Université catholique de Louvain (UCL), Institut Scientifique de Service Public (ISSeP), Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données). http://localhost:8080/srv/api/records/{uuid} diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text.txt new file mode 100644 index 00000000000..00418fd21c1 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19115-3.2018-citation-text.txt @@ -0,0 +1 @@ +Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données) (2020). Utilisation du Sol en Wallonie - WALOUS 2018. http://localhost:8080/srv/api/records/{uuid} diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-bibtex.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-bibtex.txt new file mode 100644 index 00000000000..19795817363 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-bibtex.txt @@ -0,0 +1,7 @@ +@data{{uuid}, + author = {}, + publisher = {}, + title = {CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May 2020}, + year = {2020},doi = {10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24}, + url = {https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24} + } diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-formats.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-formats.txt new file mode 100644 index 00000000000..e5a91ffdfcb --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-formats.txt @@ -0,0 +1 @@ +["html","text","ris","bibtex"] diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-html.html b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-html.html new file mode 100644 index 00000000000..076b54a8be6 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-html.html @@ -0,0 +1,19 @@ +
+
+
+ + + +
+
+

+ (2020). + CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May + 2020. +
+ https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24 +
+

+
+
+
diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-ris.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-ris.txt new file mode 100644 index 00000000000..c5e58f435c6 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-ris.txt @@ -0,0 +1,17 @@ +TY - DATA +TI - CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May 2020 +KW - Land cover +KW - EEA39 +KW - landscape +KW - landscape alteration +KW - land use +KW - land cover +KW - land +KW - European +KW - 2016 2.6.1 +KW - Land use +KW - Water +UR - https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24 +DO - 10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24 +ID - {uuid} +ER - diff --git a/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-text.txt b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-text.txt new file mode 100644 index 00000000000..354023b8909 --- /dev/null +++ b/services/src/test/resources/org/fao/geonet/api/records/formatters/iso19139-citation-text.txt @@ -0,0 +1 @@ +(2020). CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May 2020. https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24