|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | + |
| 3 | +<!-- |
| 4 | + ~ Copyright (C) 2001-2016 Food and Agriculture Organization of the |
| 5 | + ~ United Nations (FAO-UN), United Nations World Food Programme (WFP) |
| 6 | + ~ and United Nations Environment Programme (UNEP) |
| 7 | + ~ |
| 8 | + ~ This program is free software; you can redistribute it and/or modify |
| 9 | + ~ it under the terms of the GNU General Public License as published by |
| 10 | + ~ the Free Software Foundation; either version 2 of the License, or (at |
| 11 | + ~ your option) any later version. |
| 12 | + ~ |
| 13 | + ~ This program is distributed in the hope that it will be useful, but |
| 14 | + ~ WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | + ~ General Public License for more details. |
| 17 | + ~ |
| 18 | + ~ You should have received a copy of the GNU General Public License |
| 19 | + ~ along with this program; if not, write to the Free Software |
| 20 | + ~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA |
| 21 | + ~ |
| 22 | + ~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2, |
| 23 | + ~ Rome - Italy. email: geonetwork@osgeo.org |
| 24 | + --> |
| 25 | + |
| 26 | +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 27 | + xmlns:gmd="http://www.isotc211.org/2005/gmd" |
| 28 | + xmlns:skos="http://www.w3.org/2004/02/skos/core#" |
| 29 | + xmlns:dcat="http://www.w3.org/ns/dcat#" |
| 30 | + xmlns:dct="http://purl.org/dc/terms/" |
| 31 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 32 | + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" |
| 33 | + xmlns:foaf="http://xmlns.com/foaf/0.1/" |
| 34 | + xmlns:void="http://www.w3.org/TR/void/" |
| 35 | + xmlns:xslUtils="java:org.fao.geonet.util.XslUtil" |
| 36 | + xmlns:gco="http://www.isotc211.org/2005/gco" |
| 37 | + version="1.0"> |
| 38 | + |
| 39 | + <xsl:import href="../../../iso19139/layout/tpl-rdf.xsl"/> |
| 40 | + |
| 41 | + <xsl:variable name="url" select="xslUtils:getSiteUrl()"/> |
| 42 | + <xsl:variable name="language" select="xslUtils:getLanguage()"/> |
| 43 | + <xsl:variable name="iso2letterLanguageCode" select="xslUtils:twoCharLangCode($language)"/> |
| 44 | + |
| 45 | + <xsl:template match="gmd:MD_Metadata|*[@gco:isoType='gmd:MD_Metadata']"> |
| 46 | + <rdf:RDF xmlns:dct="http://purl.org/dc/terms/" |
| 47 | + xmlns:skos="http://www.w3.org/2004/02/skos/core#" |
| 48 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 49 | + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" |
| 50 | + xmlns:foaf="http://xmlns.com/foaf/0.1/" |
| 51 | + xmlns:void="http://www.w3.org/TR/void/" |
| 52 | + xmlns:dcat="http://www.w3.org/ns/dcat#"> |
| 53 | + <xsl:apply-templates select="." mode="to-dcat"/> |
| 54 | + <xsl:apply-templates select="." mode="references"/> |
| 55 | + </rdf:RDF> |
| 56 | + </xsl:template> |
| 57 | + |
| 58 | + <xsl:template name="catalogue"> |
| 59 | + <!-- First, the local catalog description using dcat:Catalog. |
| 60 | + "Typically, a web-based data catalog is represented as a single instance of this class." |
| 61 | + ... also describe harvested catalogues if harvested records are in the current dump. |
| 62 | + --> |
| 63 | + <dcat:Catalog rdf:about="{$url}"> |
| 64 | + |
| 65 | + <!-- A name given to the catalog. --> |
| 66 | + <dct:title xml:lang="{$iso2letterLanguageCode}"> |
| 67 | + <xsl:value-of select="/root/gui/env/site/name"/> |
| 68 | + </dct:title> |
| 69 | + |
| 70 | + <!-- free-text account of the catalog. --> |
| 71 | + <dct:description/> |
| 72 | + |
| 73 | + <rdfs:label xml:lang="{$iso2letterLanguageCode}"> |
| 74 | + <xsl:value-of select="/root/gui/env/site/name"/> (<xsl:value-of |
| 75 | + select="/root/gui/env/site/organization"/>) |
| 76 | + </rdfs:label> |
| 77 | + |
| 78 | + <!-- The homepage of the catalog --> |
| 79 | + <foaf:homepage> |
| 80 | + <xsl:value-of select="$url"/> |
| 81 | + </foaf:homepage> |
| 82 | + |
| 83 | + <!-- FIXME : void:Dataset --> |
| 84 | + <void:openSearchDescription><xsl:value-of select="$url"/>/srv/eng/portal.opensearch |
| 85 | + </void:openSearchDescription> |
| 86 | + <void:uriLookupEndpoint><xsl:value-of select="$url"/>/srv/eng/rdf.search?any= |
| 87 | + </void:uriLookupEndpoint> |
| 88 | + |
| 89 | + |
| 90 | + <!-- The entity responsible for making the catalog online. --> |
| 91 | + <dct:publisher rdf:resource="{$url}/organization/0"/> |
| 92 | + |
| 93 | + <!-- The knowledge organization system (KOS) used to classify catalog's datasets. |
| 94 | + --> |
| 95 | + <xsl:for-each select="/root/gui/thesaurus/thesauri/thesaurus"> |
| 96 | + <dcat:themes rdf:resource="{$url}/thesaurus/{key}"/> |
| 97 | + </xsl:for-each> |
| 98 | + |
| 99 | + |
| 100 | + <!-- The language of the catalog. This refers to the language used |
| 101 | + in the textual metadata describing titles, descriptions, etc. |
| 102 | + of the datasets in the catalog. |
| 103 | + http://www.ietf.org/rfc/rfc3066.txt |
| 104 | + Multiple values can be used. The publisher might also choose to describe |
| 105 | + the language on the dataset level (see dataset language). |
| 106 | + --> |
| 107 | + <dct:language> |
| 108 | + <xsl:value-of select="$language"/> |
| 109 | + </dct:language> |
| 110 | + |
| 111 | + |
| 112 | + <!-- This describes the license under which the catalog can be used/reused and not the datasets. |
| 113 | + Even if the license of the catalog applies to all of its datasets it should be |
| 114 | + replicated on each dataset.--> |
| 115 | + |
| 116 | + <!-- TODO using VoIDx |
| 117 | + <dct:license> |
| 118 | + </dct:license> |
| 119 | + --> |
| 120 | + |
| 121 | + |
| 122 | + <!-- The geographical area covered by the catalog. |
| 123 | + <dct:Location> |
| 124 | + </dct:Location> --> |
| 125 | + |
| 126 | + <!-- List all catalogue records |
| 127 | + <dcat:dataset rdf:resource="http://localhost:8080/geonetwork/dataset/1"/> |
| 128 | + <dcat:record rdf:resource="http://localhost:8080/geonetwork/metadata/1"/> |
| 129 | + --> |
| 130 | + <xsl:apply-templates mode="record-reference" select="/root/*"/> |
| 131 | + </dcat:Catalog> |
| 132 | + |
| 133 | + <!-- Organization in charge of the catalogue defined in the administration |
| 134 | + > system configuration --> |
| 135 | + <foaf:Organization rdf:about="{$url}/organization/0"> |
| 136 | + <foaf:name> |
| 137 | + <xsl:value-of select="/root/gui/env/site/organization"></xsl:value-of> |
| 138 | + </foaf:name> |
| 139 | + </foaf:Organization> |
| 140 | + |
| 141 | + <!-- ConceptScheme describes all thesaurus available in the catalogue |
| 142 | + * Resource identifier is a local identifier for local thesaurus or public URI if external |
| 143 | + --> |
| 144 | + <xsl:for-each select="/root/gui/thesaurus/thesauri/thesaurus"> |
| 145 | + <skos:ConceptScheme rdf:about="{$url}/thesaurus/{key}"> |
| 146 | + <dct:title> |
| 147 | + <xsl:value-of select="title"/> |
| 148 | + </dct:title> |
| 149 | + <!-- TODO : add conceptSchemes |
| 150 | + <dc:description>Thesaurus name.</dc:description> |
| 151 | + <dc:creator> |
| 152 | + <foaf:Organization> |
| 153 | + <foaf:name>Thesaurus org</foaf:name> |
| 154 | + </foaf:Organization> |
| 155 | + </dc:creator>--> |
| 156 | + <dct:uri><xsl:value-of select="$url"/>/srv/api/registries/vocabularies/<xsl:value-of |
| 157 | + select="key"/> |
| 158 | + </dct:uri> |
| 159 | + <!-- |
| 160 | + <dct:issued>2008-06-01</dct:issued> |
| 161 | + <dct:modified>2008-06-01</dct:modified>--> |
| 162 | + </skos:ConceptScheme> |
| 163 | + </xsl:for-each> |
| 164 | + </xsl:template> |
| 165 | + |
| 166 | + <xsl:template match="*"> |
| 167 | + <xsl:apply-templates select="*"/> |
| 168 | + </xsl:template> |
| 169 | +</xsl:stylesheet> |
0 commit comments