[Mapbender-commits] r9337 - trunk/mapbender/http/geoportal/xslt

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 16 08:48:02 PST 2015


Author: armin11
Date: 2015-12-16 08:48:02 -0800 (Wed, 16 Dec 2015)
New Revision: 9337

Modified:
   trunk/mapbender/http/geoportal/xslt/iso-19139-to-dcat-ap.xsl
Log:
New version of xslt from 2015-11-21, see https://webgate.ec.europa.eu/CITnet/stash/projects/ODCKAN/repos/iso-19139-to-dcat-ap/commits

Modified: trunk/mapbender/http/geoportal/xslt/iso-19139-to-dcat-ap.xsl
===================================================================
--- trunk/mapbender/http/geoportal/xslt/iso-19139-to-dcat-ap.xsl	2015-12-11 11:13:45 UTC (rev 9336)
+++ trunk/mapbender/http/geoportal/xslt/iso-19139-to-dcat-ap.xsl	2015-12-16 16:48:02 UTC (rev 9337)
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!--  
 
   Copyright 2015 EUROPEAN UNION
@@ -24,6 +25,7 @@
   (http://ec.europa.eu/isa/actions/01-trusted-information-exchange/1-17action_en.htm).
 
 -->
+
 <!--
 
   PURPOSE AND USAGE
@@ -39,10 +41,43 @@
   related work in the framework of INSPIRE and the EU ISA Programme.
   
 -->
-<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:cnt="http://www.w3.org/2011/content#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:dcam="http://purl.org/dc/dcam/" xmlns:time="http://www.w3.org/2006/time#" xmlns:earl="http://www.w3.org/ns/earl#" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:wdrs="http://www.w3.org/2007/05/powder-s#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:gsp="http://www.opengis.net/ont/geosparql#" xmlns:ecodp="http://ec.europa.eu/open-data/ontologies/ec-odp#" xmlns:locn="http://www.w3.org/ns/locn#" xmlns:gmd="http://www.isotc211.org
 /2005/gmd" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ns9="http://inspire.ec.europa.eu/schemas/geoportal/1.0" xmlns:i="http://inspire.ec.europa.eu/schemas/common/1.0" xmlns:schema="http://schema.org/" version="1.0">
 
-  <xsl:output method="xml" indent="yes" encoding="utf-8" cdata-section-elements="locn:geometry"/>
+<xsl:transform
+    xmlns:xsl    = "http://www.w3.org/1999/XSL/Transform"
+    xmlns:rdf    = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:rdfs   = "http://www.w3.org/2000/01/rdf-schema#"
+    xmlns:owl    = "http://www.w3.org/2002/07/owl#"
+    xmlns:skos   = "http://www.w3.org/2004/02/skos/core#"
+    xmlns:cnt    = "http://www.w3.org/2011/content#"
+    xmlns:dc     = "http://purl.org/dc/elements/1.1/" 
+    xmlns:dct    = "http://purl.org/dc/terms/"
+    xmlns:dctype = "http://purl.org/dc/dcmitype/"
+    xmlns:earl   = "http://www.w3.org/ns/earl#"
+    xmlns:dcat   = "http://www.w3.org/ns/dcat#"
+    xmlns:foaf   = "http://xmlns.com/foaf/0.1/"
+    xmlns:wdrs   = "http://www.w3.org/2007/05/powder-s#"
+    xmlns:prov   = "http://www.w3.org/ns/prov#"
+    xmlns:vcard  = "http://www.w3.org/2006/vcard/ns#"
+    xmlns:adms   = "http://www.w3.org/ns/adms#"
+    xmlns:gsp    = "http://www.opengis.net/ont/geosparql#"
+    xmlns:locn   = "http://www.w3.org/ns/locn#"
+    xmlns:gmd    = "http://www.isotc211.org/2005/gmd" 
+    xmlns:gmx    = "http://www.isotc211.org/2005/gmx" 
+    xmlns:gco    = "http://www.isotc211.org/2005/gco" 
+    xmlns:srv    = "http://www.isotc211.org/2005/srv"
+    xmlns:xsi    = "http://www.w3.org/2001/XMLSchema-instance" 
+    xmlns:gml    = "http://www.opengis.net/gml" 
+    xmlns:xlink  = "http://www.w3.org/1999/xlink" 
+    xmlns:ns9    = "http://inspire.ec.europa.eu/schemas/geoportal/1.0"
+    xmlns:i      = "http://inspire.ec.europa.eu/schemas/common/1.0"
+    xmlns:schema = "http://schema.org/"
+    version="1.0">
 
+  <xsl:output method="xml"
+              indent="yes"
+              encoding="utf-8"
+              cdata-section-elements="locn:geometry" />
+
 <!--
 
   Mapping parameters
@@ -66,11 +101,10 @@
 -->
 
 <!-- Uncomment to use GeoDCAT-AP Core -->
-
-<!--   <xsl:param name="profile">core</xsl:param> -->
-
+<!--
+  <xsl:param name="profile">core</xsl:param>
+-->
 <!-- Uncomment to use GeoDCAT-AP Extended -->
-
   <xsl:param name="profile">extended</xsl:param>
 
 <!--
@@ -79,18 +113,37 @@
   =======================
   
 -->  
+
+<!-- Variables to be used to convert strings into lower/uppercase by using the translate() function. -->
+
+  <xsl:variable name="lowercase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
+  <xsl:variable name="uppercase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
+
+<!-- URIs and URNs for spatial reference system registers. -->
   
+  <xsl:param name="EpsgSrsBaseUri">http://www.opengis.net/def/crs/EPSG/0/</xsl:param>
+  <xsl:param name="EpsgSrsBaseUrn">urn:ogc:def:crs:EPSG</xsl:param>
+  <xsl:param name="OgcSrsBaseUri">http://www.opengis.net/def/crs/OGC/</xsl:param>
+  <xsl:param name="OgcSrsBaseUrn">urn:ogc:def:crs:OGC</xsl:param>
+  
+<!-- URI and URN for CRS84. -->
+
+  <xsl:param name="Crs84Uri" select="concat($OgcSrsBaseUri,'1.3/CRS84')"/>
+  <xsl:param name="Crs84Urn" select="concat($OgcSrsBaseUrn,':1.3:CRS84')"/>
+
+<!-- URI and URN for ETRS89. -->
+
+  <xsl:param name="Etrs89Uri" select="concat($EpsgSrsBaseUri,'4258')"/>
+  <xsl:param name="Etrs89Urn" select="concat($EpsgSrsBaseUrn,'::4258')"/>
+
 <!-- URI and URN of the spatial reference system (SRS) used in the bounding box.
      The default SRS is CRS84. If a different SRS is used, also parameter 
      $SrsAxisOrder must be specified. -->
 
-<!-- Old param
-  <xsl:param name="srid">4326</xsl:param>
--->  
 <!-- The SRS URI is used in the WKT and GML encodings of the bounding box. -->
-  <xsl:param name="SrsUri">http://www.opengis.net/def/crs/OGC/1.3/CRS84</xsl:param>
+  <xsl:param name="SrsUri" select="$Crs84Uri"/>
 <!-- The SRS URN is used in the GeoJSON encoding of the bounding box. -->
-  <xsl:param name="SrsUrn">urn:ogc:def:crs:OGC:1.3:CRS84</xsl:param>
+  <xsl:param name="SrsUrn" select="$Crs84Urn"/>
 
 <!-- Axis order for the reference SRS: 
      - "LonLat": longitude / latitude
@@ -151,6 +204,10 @@
   <xsl:param name="SpatialRepresentationTypeCodelistUri" select="concat($INSPIRECodelistUri,'SpatialRepresentationTypeCode')"/>
   <xsl:param name="MaintenanceFrequencyCodelistUri" select="concat($INSPIRECodelistUri,'MaintenanceFrequencyCode')"/>
 
+<!-- INSPIRE glossary URI -->  
+  
+  <xsl:param name="INSPIREGlossaryUri">http://inspire.ec.europa.eu/glossary/</xsl:param>
+
 <!-- 
 
   Master template     
@@ -247,6 +304,9 @@
         <xsl:when test="$ormlang = 'gle'">
           <xsl:text>ga</xsl:text>
         </xsl:when>
+        <xsl:when test="$ormlang = 'hrv'">
+          <xsl:text>hr</xsl:text>
+        </xsl:when>
         <xsl:when test="$ormlang = 'ita'">
           <xsl:text>it</xsl:text>
         </xsl:when>
@@ -329,6 +389,9 @@
         <xsl:when test="$orrlang = 'gle'">
           <xsl:text>ga</xsl:text>
         </xsl:when>
+        <xsl:when test="$orrlang = 'hrv'">
+          <xsl:text>hr</xsl:text>
+        </xsl:when>
         <xsl:when test="$orrlang = 'ita'">
           <xsl:text>it</xsl:text>
         </xsl:when>
@@ -372,7 +435,7 @@
     </xsl:param>
 
     <xsl:param name="ResourceType">
-      <xsl:value-of select="gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:scope/gmd:DQ_Scope/gmd:level/gmd:MD_ScopeCode/@codeListValue"/>
+      <xsl:value-of select="gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue"/>
     </xsl:param>
     
     <xsl:param name="ServiceType">
@@ -509,6 +572,7 @@
         <xsl:variable name="explanation">
           <xsl:value-of select="../../gmd:explanation/gco:CharacterString"/>
         </xsl:variable>
+        <xsl:variable name="Activity">
         <prov:Activity>
           <xsl:if test="$ResourceUri != ''">
             <prov:used rdf:resource="{$ResourceUri}"/>
@@ -541,6 +605,17 @@
             </xsl:if>
           </prov:generated>
         </prov:Activity>
+        </xsl:variable>
+        <xsl:choose>
+          <xsl:when test="$ResourceUri != ''">
+            <xsl:copy-of select="$Activity"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <prov:wasUsedBy>
+              <xsl:copy-of select="$Activity"/>
+            </prov:wasUsedBy>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:for-each>
     </xsl:param>
 
@@ -559,13 +634,16 @@
 <!-- Metadata description (metadata on metadata) -->    
     
     <xsl:param name="MetadataDescription">
-      <rdf:type rdf:resource="{$dcat}CatalogRecord"/>
 <!-- Metadata language -->
-      <dct:language rdf:resource="{concat($oplang,translate($ormlang,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))}"/>
+      <xsl:if test="$ormlang != ''">
+        <dct:language rdf:resource="{concat($oplang,translate($ormlang,$lowercase,$uppercase))}"/>
+      </xsl:if>
 <!-- Metadata date -->
-      <dct:modified rdf:datatype="{$xsd}date">
-        <xsl:value-of select="$MetadataDate"/>
-      </dct:modified>
+      <xsl:if test="$MetadataDate != ''">
+        <dct:modified rdf:datatype="{$xsd}date">
+          <xsl:value-of select="$MetadataDate"/>
+        </dct:modified>
+      </xsl:if>
 <!-- Metadata point of contact: only for the extended profile -->
       <xsl:if test="$profile = 'extended'">
         <xsl:apply-templates select="gmd:contact/gmd:CI_ResponsibleParty">
@@ -698,13 +776,13 @@
       <xsl:if test="$ResourceType = 'dataset' or $ResourceType = 'series'">
         <xsl:choose>
           <xsl:when test="$orrlang != ''">
-            <dct:language rdf:resource="{concat($oplang,translate($orrlang,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))}"/>
+            <dct:language rdf:resource="{concat($oplang,translate($orrlang,$lowercase,$uppercase))}"/>
           </xsl:when>
           <xsl:otherwise>
 <!-- To be decided (when the resource language is not specified, it defaults to the metadata language): -->
 <!-- 
              <xsl:if test="$ormlang != ''">
-               <dct:language rdf:resource="{concat($oplang,translate($ormlang,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'))}"/>
+               <dct:language rdf:resource="{concat($oplang,translate($ormlang,$lowercase,$uppercase))}"/>
              </xsl:if>
 -->            
           </xsl:otherwise>
@@ -732,7 +810,7 @@
 <!-- Creation date, publication date, date of last revision -->
       <xsl:apply-templates select="gmd:identificationInfo/*/gmd:citation/gmd:CI_Citation"/>
 <!-- Lineage -->
-      <xsl:if test="$ResourceType != 'service'">
+      <xsl:if test="$ResourceType != 'service' and $Lineage != ''">
         <dct:provenance>
           <dct:ProvenanceStatement>
             <rdfs:label xml:lang="{$MetadataLanguage}">
@@ -844,15 +922,19 @@
           <xsl:choose>
             <xsl:when test="$MetadataUri != ''">
               <rdf:Description rdf:about="{$MetadataUri}">
+                <rdf:type rdf:resource="{$dcat}CatalogRecord"/>
                 <foaf:primaryTopic rdf:resource="{$ResourceUri}"/>
                 <xsl:copy-of select="$MetadataDescription"/>
               </rdf:Description>
             </xsl:when>
             <xsl:otherwise>
-              <rdf:Description>
-                <foaf:primaryTopic rdf:resource="{$ResourceUri}"/>
-                <xsl:copy-of select="$MetadataDescription"/>
-              </rdf:Description>
+              <xsl:if test="normalize-space($MetadataDescription)">
+                <rdf:Description>
+                  <rdf:type rdf:resource="{$dcat}CatalogRecord"/>
+                  <foaf:primaryTopic rdf:resource="{$ResourceUri}"/>
+                  <xsl:copy-of select="$MetadataDescription"/>
+                </rdf:Description>
+              </xsl:if>
             </xsl:otherwise>
           </xsl:choose>
 <!--          
@@ -864,17 +946,14 @@
       </xsl:when>
       <xsl:otherwise>
         <rdf:Description>
-<!--        
-          <xsl:if test="$profile = 'extended'">
--->          
+          <xsl:if test="normalize-space($MetadataDescription)">
             <foaf:isPrimaryTopicOf>
               <rdf:Description>
+                <rdf:type rdf:resource="{$dcat}CatalogRecord"/>
                 <xsl:copy-of select="$MetadataDescription"/>
               </rdf:Description>
             </foaf:isPrimaryTopicOf>
-<!--            
           </xsl:if>
--->          
           <xsl:copy-of select="$ResourceDescription"/>
         </rdf:Description>
       </xsl:otherwise>
@@ -1141,7 +1220,18 @@
 <!--  
     <dcat:dataset rdf:resource="{@xlink:href}"/>
 -->    
-    <dct:hasPart rdf:resource="{@xlink:href}"/>
+    <xsl:choose>
+      <xsl:when test="@uriref">
+        <dct:hasPart rdf:resource="{@uriref}"/>
+      </xsl:when>
+      <xsl:when test="@xlink:href">
+        <dct:hasPart rdf:parseType="Resource">
+          <foaf:isPrimaryTopicOf>
+            <dcat:CatalogRecord rdf:about="{@xlink:href}"/>
+          </foaf:isPrimaryTopicOf>
+        </dct:hasPart>
+      </xsl:when>
+    </xsl:choose>
   </xsl:template>
   
 <!-- Spatial data service type -->  
@@ -1204,9 +1294,7 @@
     </xsl:if>
     <xsl:if test="$profile = 'extended'">
       <xsl:if test="$Conformity != '' and $ResourceUri = ''">
-        <prov:wasUsedBy>
-          <xsl:copy-of select="$Conformity"/>
-        </prov:wasUsedBy>
+        <xsl:copy-of select="$Conformity"/>
       </xsl:if>
 <!--    
       <xsl:choose>
@@ -1360,20 +1448,24 @@
   <xsl:template name="GeographicBoundingBox" match="gmd:identificationInfo[1]/*/*[self::gmd:extent|self::srv:extent]/*/gmd:geographicElement/gmd:EX_GeographicBoundingBox">
 -->  
   <xsl:template name="GeographicBoundingBox" match="gmd:EX_GeographicBoundingBox">
+    <xsl:param name="north" select="gmd:northBoundLatitude/gco:Decimal"/>
+    <xsl:param name="east"  select="gmd:eastBoundLongitude/gco:Decimal"/>
+    <xsl:param name="south" select="gmd:southBoundLatitude/gco:Decimal"/>
+    <xsl:param name="west"  select="gmd:westBoundLongitude/gco:Decimal"/>
 
 <!-- Bbox as a dct:Box -->
 <!-- Need to check whether this is correct - in particular, the "projection" parameter -->
 <!--    
-    <xsl:param name="DCTBox">northlimit=<xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>; eastlimit=<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>; southlimit=<xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>; westlimit=<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>; projection=EPSG:<xsl:value-of select="$srid"/></xsl:param>
+    <xsl:param name="DCTBox">northlimit=<xsl:value-of select="$north"/>; eastlimit=<xsl:value-of select="$east"/>; southlimit=<xsl:value-of select="$south"/>; westlimit=<xsl:value-of select="$west"/>; projection=EPSG:<xsl:value-of select="$srid"/></xsl:param>
 -->
 
 <!-- Bbox as GML (GeoSPARQL) -->
 
     <xsl:param name="GMLLiteral">
       <xsl:choose>
-        <xsl:when test="$SrsUri = 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/></gml:upperCorner></gml:Envelope></xsl:when>
-        <xsl:when test="$SrsAxisOrder = 'LonLat'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/></gml:upperCorner></gml:Envelope></xsl:when>
-        <xsl:when test="$SrsAxisOrder = 'LatLon'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/></gml:upperCorner></gml:Envelope></xsl:when>
+        <xsl:when test="$SrsUri = 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$south"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$north"/></gml:upperCorner></gml:Envelope></xsl:when>
+        <xsl:when test="$SrsAxisOrder = 'LonLat'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$south"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$north"/></gml:upperCorner></gml:Envelope></xsl:when>
+        <xsl:when test="$SrsAxisOrder = 'LatLon'"><gml:Envelope srsName="<xsl:value-of select="$SrsUri"/>"><gml:lowerCorner><xsl:value-of select="$south"/><xsl:text> </xsl:text><xsl:value-of select="$west"/></gml:lowerCorner><gml:upperCorner><xsl:value-of select="$north"/><xsl:text> </xsl:text><xsl:value-of select="$east"/></gml:upperCorner></gml:Envelope></xsl:when>
       </xsl:choose>
     </xsl:param>
 
@@ -1381,15 +1473,15 @@
 
     <xsl:param name="WKTLiteral">
       <xsl:choose>
-        <xsl:when test="$SrsUri = 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'">POLYGON((<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>))</xsl:when>
-        <xsl:when test="$SrsAxisOrder = 'LonLat'"><<xsl:value-of select="$SrsUri"/>> POLYGON((<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>,<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>))</xsl:when>
-        <xsl:when test="$SrsAxisOrder = 'LatLon'"><<xsl:value-of select="$SrsUri"/>> POLYGON((<xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>,<xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>,<xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/>,<xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>,<xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/><xsl:text> </xsl:text><xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/>))</xsl:when>
+        <xsl:when test="$SrsUri = 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'">POLYGON((<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>,<xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>,<xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$south"/>,<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$south"/>,<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>))</xsl:when>
+        <xsl:when test="$SrsAxisOrder = 'LonLat'"><<xsl:value-of select="$SrsUri"/>> POLYGON((<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>,<xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>,<xsl:value-of select="$east"/><xsl:text> </xsl:text><xsl:value-of select="$south"/>,<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$south"/>,<xsl:value-of select="$west"/><xsl:text> </xsl:text><xsl:value-of select="$north"/>))</xsl:when>
+        <xsl:when test="$SrsAxisOrder = 'LatLon'"><<xsl:value-of select="$SrsUri"/>> POLYGON((<xsl:value-of select="$north"/><xsl:text> </xsl:text><xsl:value-of select="$west"/>,<xsl:value-of select="$north"/><xsl:text> </xsl:text><xsl:value-of select="$east"/>,<xsl:value-of select="$south"/><xsl:text> </xsl:text><xsl:value-of select="$east"/>,<xsl:value-of select="$south"/><xsl:text> </xsl:text><xsl:value-of select="$west"/>,<xsl:value-of select="$north"/><xsl:text> </xsl:text><xsl:value-of select="$west"/>))</xsl:when>
         </xsl:choose>
     </xsl:param>
 
 <!-- Bbox as GeoJSON -->
 
-    <xsl:param name="GeoJSONLiteral">{"type":"Polygon","crs":{"type":"name","properties":{"name":"<xsl:value-of select="$SrsUrn"/>"}},"coordinates":[[[<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text>,</xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>],[<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text>,</xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>],[<xsl:value-of select="gmd:eastBoundLongitude/gco:Decimal"/><xsl:text>,</xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>],[<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text>,</xsl:text><xsl:value-of select="gmd:southBoundLatitude/gco:Decimal"/>],[<xsl:value-of select="gmd:westBoundLongitude/gco:Decimal"/><xsl:text>,</xsl:text><xsl:value-of select="gmd:northBoundLatitude/gco:Decimal"/>]]]}</xsl:param>
+    <xsl:param name="GeoJSONLiteral">{"type":"Polygon","crs":{"type":"name","properties":{"name":"<xsl:value-of select="$SrsUrn"/>"}},"coordinates":[[[<xsl:value-of select="$west"/><xsl:text>,</xsl:text><xsl:value-of select="$north"/>],[<xsl:value-of select="$east"/><xsl:text>,</xsl:text><xsl:value-of select="$north"/>],[<xsl:value-of select="$east"/><xsl:text>,</xsl:text><xsl:value-of select="$south"/>],[<xsl:value-of select="$west"/><xsl:text>,</xsl:text><xsl:value-of select="$south"/>],[<xsl:value-of select="$west"/><xsl:text>,</xsl:text><xsl:value-of select="$north"/>]]]}</xsl:param>
     <dct:spatial rdf:parseType="Resource">
 <!-- Recommended geometry encodings -->
       <locn:geometry rdf:datatype="{$gsp}wktLiteral"><xsl:value-of select="$WKTLiteral"/></locn:geometry>
@@ -1484,7 +1576,7 @@
         <xsl:when test="gco:CharacterString">
           <dct:license>
             <dct:LicenseDocument>
-              <rdfs:label xml:lang="{$MetadataLanguage}"><xsl:value-of select="normalize-space(gmx:Anchor)"/></rdfs:label>
+              <rdfs:label xml:lang="{$MetadataLanguage}"><xsl:value-of select="normalize-space(gco:CharacterString)"/></rdfs:label>
             </dct:LicenseDocument>
           </dct:license>
 <!--                                                                               
@@ -1542,7 +1634,7 @@
       </xsl:for-each>
     </xsl:param>
     <xsl:for-each select="gmd:keyword">
-      <xsl:variable name="lckw" select="translate(gco:CharacterString,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
+      <xsl:variable name="lckw" select="translate(gco:CharacterString,$uppercase,$lowercase)"/>
       <xsl:choose>
         <xsl:when test="$OriginatingControlledVocabulary = ''">
           <xsl:choose>
@@ -1654,7 +1746,7 @@
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
-      <rdfs:comment xml:lang="en">Spatial resolution (distance): <xsl:value-of select="."/> <xsl:value-of select="$UoM"/></rdfs:comment>
+      <rdfs:comment xml:lang="en">Spatial resolution (distance): <xsl:value-of select="."/> <xsl:value-of select="$UoM"/></rdfs:comment>
     </xsl:for-each>
     <xsl:for-each select="gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator">
       <rdfs:comment xml:lang="en">Spatial resolution (equivalent scale): 1:<xsl:value-of select="gco:Integer"/></rdfs:comment>
@@ -1880,37 +1972,119 @@
     <xsl:param name="version" select="gmd:version/gco:CharacterString"/>
     <xsl:choose>
       <xsl:when test="starts-with($code, 'http://') or starts-with($code, 'https://')">
-        <dct:conformsTo rdf:resource="{$code}"/>
+        <dct:conformsTo>
+          <rdf:Description rdf:about="{$code}">
+            <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+          </rdf:Description>
+        </dct:conformsTo>
       </xsl:when>
       <xsl:when test="starts-with($code, 'urn:')">
-        <dct:conformsTo rdf:parseType="Resource">
-          <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="$code"/></dct:identifier>
-          <xsl:if test="$codespace != ''">
-            <skos:inScheme>
-              <skos:ConceptScheme>
-                <dct:title xml:lang="{$MetadataLanguage}"><xsl:value-of select="$codespace"/></dct:title>
-              </skos:ConceptScheme>
-            </skos:inScheme>
-          </xsl:if>
-          <xsl:if test="$version != ''">
-            <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
-          </xsl:if>
-        </dct:conformsTo>
+        <xsl:choose>
+          <xsl:when test="starts-with(translate($code,$uppercase,$lowercase), translate($EpsgSrsBaseUrn,$uppercase,$lowercase))">
+            <xsl:variable name="srid" select="substring-after(substring-after(substring-after(substring-after(substring-after(substring-after($code,':'),':'),':'),':'),':'),':')"/>
+            <xsl:variable name="sridVersion" select="substring-before(substring-after(substring-after(substring-after(substring-after(substring-after($code,':'),':'),':'),':'),':'),':')"/>
+            <dct:conformsTo>
+              <rdf:Description rdf:about="{$EpsgSrsBaseUri}{$srid}">
+                <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+                <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="$code"/></dct:identifier>
+                <skos:inScheme>
+                  <skos:ConceptScheme rdf:about="{$EpsgSrsBaseUri}">
+                    <dct:title xml:lang="en">EPSG</dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+                <xsl:if test="$sridVersion != ''">
+                  <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$sridVersion"/></owl:versionInfo>
+                </xsl:if>
+              </rdf:Description>
+            </dct:conformsTo>
+          </xsl:when>
+          <xsl:otherwise>
+            <dct:conformsTo rdf:parseType="Resource">
+              <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+              <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="$code"/></dct:identifier>
+              <xsl:if test="$codespace != ''">
+                <skos:inScheme>
+                  <skos:ConceptScheme>
+                    <dct:title xml:lang="{$MetadataLanguage}"><xsl:value-of select="$codespace"/></dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+              </xsl:if>
+              <xsl:if test="$version != ''">
+                <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
+              </xsl:if>
+            </dct:conformsTo>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:when>
       <xsl:otherwise>
-        <dct:conformsTo rdf:parseType="Resource">
-          <skos:prefLabel xml:lang="{$MetadataLanguage}"><xsl:value-of select="$code"/></skos:prefLabel>
-          <xsl:if test="$codespace != ''">
-            <skos:inScheme>
-              <skos:ConceptScheme>
-                <dct:title xml:lang="{$MetadataLanguage}"><xsl:value-of select="$codespace"/></dct:title>
-              </skos:ConceptScheme>
-            </skos:inScheme>
-          </xsl:if>
-          <xsl:if test="$version != ''">
-            <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
-          </xsl:if>
-        </dct:conformsTo>
+        <xsl:choose>
+          <xsl:when test="$code = number($code) and (translate($codespace,$uppercase,$lowercase) = 'epsg' or starts-with(translate($codespace,$uppercase,$lowercase),translate($EpsgSrsBaseUrn,$uppercase,$lowercase)))">
+            <dct:conformsTo>
+              <rdf:Description rdf:about="{$EpsgSrsBaseUri}{$code}">
+                <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+                <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="concat($EpsgSrsBaseUrn,':',$version,':',$code)"/></dct:identifier>
+                <skos:inScheme>
+                  <skos:ConceptScheme rdf:about="{$EpsgSrsBaseUri}">
+                    <dct:title xml:lang="en">EPSG</dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+                <xsl:if test="$version != ''">
+                  <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
+                </xsl:if>
+              </rdf:Description>
+            </dct:conformsTo>
+          </xsl:when>
+          <xsl:when test="translate(normalize-space(translate($code,$uppercase,$lowercase)),': ','') = 'etrs89'">
+            <dct:conformsTo>
+              <rdf:Description rdf:about="{$Etrs89Uri}">
+                <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+                <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="$Etrs89Urn"/></dct:identifier>
+                <skos:prefLabel xml:lang="en">ETRS89 - European Terrestrial Reference System 1989</skos:prefLabel>
+                <skos:inScheme>
+                  <skos:ConceptScheme rdf:about="{$EpsgSrsBaseUri}">
+                    <dct:title xml:lang="en">EPSG</dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+                <xsl:if test="$version != ''">
+                  <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
+                </xsl:if>
+              </rdf:Description>
+            </dct:conformsTo>
+          </xsl:when>
+          <xsl:when test="translate(normalize-space(translate($code,$uppercase,$lowercase)),': ','') = 'crs84'">
+            <dct:conformsTo>
+              <rdf:Description rdf:about="{$Crs84Uri}">
+                <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+                <dct:identifier rdf:datatype="{$xsd}anyURI"><xsl:value-of select="$Crs84Urn"/></dct:identifier>
+                <skos:prefLabel xml:lang="en">CRS84</skos:prefLabel>
+                <skos:inScheme>
+                  <skos:ConceptScheme rdf:about="{$OgcSrsBaseUri}">
+                    <dct:title xml:lang="en">OGC</dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+                <xsl:if test="$version != ''">
+                  <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
+                </xsl:if>
+              </rdf:Description>
+            </dct:conformsTo>
+          </xsl:when>
+          <xsl:otherwise>
+            <dct:conformsTo rdf:parseType="Resource">
+              <dct:type rdf:resource="{$INSPIREGlossaryUri}SpatialReferenceSystem"/>
+              <skos:prefLabel xml:lang="{$MetadataLanguage}"><xsl:value-of select="$code"/></skos:prefLabel>
+              <xsl:if test="$codespace != ''">
+                <skos:inScheme>
+                  <skos:ConceptScheme>
+                    <dct:title xml:lang="{$MetadataLanguage}"><xsl:value-of select="$codespace"/></dct:title>
+                  </skos:ConceptScheme>
+                </skos:inScheme>
+              </xsl:if>
+              <xsl:if test="$version != ''">
+                <owl:versionInfo xml:lang="{$MetadataLanguage}"><xsl:value-of select="$version"/></owl:versionInfo>
+              </xsl:if>
+            </dct:conformsTo>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>



More information about the Mapbender_commits mailing list