|
84 | 84 | xmlns:vcard = "http://www.w3.org/2006/vcard/ns#" |
85 | 85 | xmlns:wdrs = "http://www.w3.org/2007/05/powder-s#" |
86 | 86 | xmlns:xlink = "http://www.w3.org/1999/xlink" |
87 | | - xmlns:xs = "http://www.w3.org/2001/XMLSchema" |
| 87 | + xmlns:xs = "http://www.w3.org/2001/XMLSchema" |
88 | 88 | xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" |
89 | 89 | xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" |
90 | 90 | exclude-result-prefixes="#all" |
|
197 | 197 | This parameter specifies the prefix (can be empty) used in ISO 19139 language tags |
198 | 198 | --> |
199 | 199 |
|
200 | | -<!-- <xsl:param name="locale-prefix">locale-</xsl:param>--> |
201 | | - <!-- GeoNetwork does not set any prefix by default. |
202 | | - Another approach would be to get the language id ref from the metadata language elements. --> |
203 | | - <xsl:param name="locale-prefix"></xsl:param> |
| 200 | + |
| 201 | + <xsl:param name="locale-prefix">locale-</xsl:param> |
204 | 202 |
|
205 | 203 | <!-- Parameter $locale-default-lang --> |
206 | 204 | <!-- |
|
215 | 213 | This parameter specifies whether deprecated mappings must ("yes") or must not |
216 | 214 | ("no") be included in the output. |
217 | 215 | --> |
218 | | - |
219 | 216 | <!-- Uncomment to include deprecated mappings from the output --> |
220 | 217 |
|
221 | 218 | <xsl:param name="include-deprecated">yes</xsl:param> |
|
458 | 455 | <!-- Handle PT_FreeText with LocalisedCharacterStrings --> |
459 | 456 | <xsl:when test="$element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString"> |
460 | 457 | <xsl:choose> |
461 | | -<!-- <xsl:when test="$element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale = $localeId]"> |
462 | | - <xsl:value-of select="normalize-space($element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale = $localeId][1])"/> |
463 | | - </xsl:when>--> |
464 | | - <xsl:when test="$element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale='#locale-en']"> |
465 | | - <xsl:value-of select="normalize-space($element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale='#locale-en'][1])"/> |
| 458 | + <!-- Try to find English locale first --> |
| 459 | + <xsl:when test="$element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale='#{$locale-prefix}{$locale-default-lang}']"> |
| 460 | + <xsl:value-of select="normalize-space($element/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString[@locale='#${locale-prefix}{$locale-default-lang}'][1])"/> |
466 | 461 | </xsl:when> |
467 | 462 | <!-- Otherwise use the first available LocalisedCharacterString --> |
468 | 463 | <xsl:otherwise> |
|
487 | 482 | <xsl:template match="/"> |
488 | 483 | <rdf:RDF> |
489 | 484 | <xsl:apply-templates mode="iso19139-to-dcatap" |
490 | | - select="gmd:MD_Metadata|//gmd:MD_Metadata"/> |
| 485 | + select="gmd:MD_Metadata|//gmd:MD_Metadata"/> |
491 | 486 | </rdf:RDF> |
492 | 487 | </xsl:template> |
493 | 488 |
|
|
499 | 494 | --> |
500 | 495 |
|
501 | 496 | <xsl:template mode="iso19139-to-dcatap" |
502 | | - match="gmd:MD_Metadata|//gmd:MD_Metadata" |
503 | | - priority="10"> |
| 497 | + match="gmd:MD_Metadata|//gmd:MD_Metadata" |
| 498 | + priority="10"> |
504 | 499 |
|
505 | 500 | <!-- |
506 | 501 |
|
|
780 | 775 | </xsl:otherwise> |
781 | 776 | </xsl:choose> |
782 | 777 | </xsl:param> |
783 | | - |
| 778 | + <xsl:param name="ServiceCategory"> |
| 779 | + <xsl:value-of select="gmd:identificationInfo/*/gmd:descriptiveKeywords/gmd:MD_Keywords/gmd:keyword/gmx:Anchor[starts-with(@xlink:href, $SpatialDataServiceCategoryCodelistUri)]/@xlink:href"/> |
| 780 | + </xsl:param> |
784 | 781 | <xsl:param name="ServiceType"> |
785 | 782 | <xsl:value-of select="gmd:identificationInfo/*/srv:serviceType/gco:LocalName"/> |
786 | 783 | </xsl:param> |
|
1251 | 1248 | --> |
1252 | 1249 | <xsl:copy-of select="$ResourceTitle"/> |
1253 | 1250 | <!-- |
1254 | | - <dct:description xml:lang="{$MetadataLanguage}"> |
| 1251 | + <dct:description xml:lang="{$MetadataLanguage}"> |
1255 | 1252 | <xsl:value-of select="$ResourceAbstract"/> |
1256 | | - </dct:description> |
| 1253 | + </dct:description> |
1257 | 1254 | --> |
1258 | 1255 | <xsl:copy-of select="$ResourceAbstract"/> |
1259 | 1256 | <xsl:copy-of select="$ResourcePurpose"/> |
|
1271 | 1268 | <xsl:apply-templates mode="iso19139-to-dcatap" select="gmd:identificationInfo/*/gmd:descriptiveKeywords/gmd:MD_Keywords"> |
1272 | 1269 | <xsl:with-param name="MetadataLanguage" select="$MetadataLanguage"/> |
1273 | 1270 | <xsl:with-param name="ResourceType" select="$ResourceType"/> |
1274 | | - <xsl:with-param name="ServiceType" select="$ServiceType"/> |
1275 | 1271 | </xsl:apply-templates> |
1276 | 1272 | <!-- Identifier, 0..1 --> |
1277 | 1273 | <!-- |
|
1298 | 1294 | <xsl:choose> |
1299 | 1295 | <xsl:when test="$orrlang[1]"> |
1300 | 1296 | <xsl:for-each select="$orrlang"> |
1301 | | - <dct:language> |
1302 | | - <dct:LinguisticSystem rdf:about="{concat($oplang,translate(.,$lowercase,$uppercase))}"/> |
1303 | | - </dct:language> |
| 1297 | + <dct:language> |
| 1298 | + <dct:LinguisticSystem rdf:about="{concat($oplang,translate(.,$lowercase,$uppercase))}"/> |
| 1299 | + </dct:language> |
1304 | 1300 | </xsl:for-each> |
1305 | 1301 | </xsl:when> |
1306 | 1302 | <xsl:otherwise> |
|
1325 | 1321 | <xsl:with-param name="MetadataLanguage" select="$MetadataLanguage"/> |
1326 | 1322 | </xsl:apply-templates> |
1327 | 1323 | --> |
| 1324 | + <xsl:if test="$ServiceCategory != ''"> |
| 1325 | + <geodcatap:serviceCategory rdf:resource="{$ServiceCategory}"/> |
| 1326 | + </xsl:if> |
1328 | 1327 | <geodcatap:serviceType rdf:resource="{$SpatialDataServiceTypeCodelistUri}/{$ServiceType}"/> |
1329 | 1328 | </xsl:if> |
1330 | 1329 | <!-- Spatial extent --> |
|
1344 | 1343 | <dct:provenance> |
1345 | 1344 | <dct:ProvenanceStatement> |
1346 | 1345 | <rdfs:label xml:lang="{$MetadataLanguage}"> |
1347 | | - <xsl:value-of select="$Lineage"/> |
| 1346 | + <xsl:value-of select="$Lineage"/> |
1348 | 1347 | </rdfs:label> |
1349 | 1348 | </dct:ProvenanceStatement> |
1350 | 1349 | </dct:provenance> |
|
1397 | 1396 | <xsl:variable name="DistributionFormat"> |
1398 | 1397 | <xsl:apply-templates mode="iso19139-to-dcatap" select="gmd:distributionFormat/gmd:MD_Format/gmd:name/*"/> |
1399 | 1398 | </xsl:variable> |
1400 | | - <!-- Resource locators (access / download URLs) --> |
| 1399 | +<!-- Resource locators (access / download URLs) --> |
1401 | 1400 | <xsl:for-each select="(gmd:transferOptions | gmd:distributor/gmd:MD_Distributor/gmd:distributorTransferOptions)/*/gmd:onLine/*"> |
1402 | 1401 |
|
1403 | 1402 | <xsl:variable name="DistributorFormat"> |
|
1427 | 1426 | <xsl:variable name="Title"> |
1428 | 1427 | <xsl:for-each select="gmd:name"> |
1429 | 1428 | <dct:title xml:lang="{$MetadataLanguage}"> |
1430 | | - <xsl:value-of select="normalize-space(*)"/> |
| 1429 | + <xsl:value-of select="normalize-space(gco:CharacterString)"/> |
1431 | 1430 | </dct:title> |
1432 | 1431 | <xsl:call-template name="LocalisedString"> |
1433 | 1432 | <xsl:with-param name="term">dct:title</xsl:with-param> |
|
3045 | 3044 | <xsl:template mode="iso19139-to-dcatap" name="Keyword" match="gmd:identificationInfo/*/gmd:descriptiveKeywords/gmd:MD_Keywords"> |
3046 | 3045 | <xsl:param name="MetadataLanguage"/> |
3047 | 3046 | <xsl:param name="ResourceType"/> |
3048 | | - <xsl:param name="ServiceType"/> |
3049 | 3047 | <xsl:param name="OriginatingControlledVocabularyURI" select="normalize-space(gmd:thesaurusName/gmd:CI_Citation/gmd:title/gmx:Anchor/@xlink:href)"/> |
3050 | 3048 | <xsl:param name="OriginatingControlledVocabulary"> |
3051 | 3049 | <!-- |
|
3217 | 3215 |
|
3218 | 3216 | <!-- Regular dcat:theme --> |
3219 | 3217 | <xsl:otherwise> |
3220 | | - <dcat:theme rdf:resource="{gmx:Anchor/@xlink:href}"/> |
| 3218 | + <xsl:if test="not(starts-with(gmx:Anchor/@xlink:href, $SpatialDataServiceCategoryCodelistUri))"> |
| 3219 | + <dcat:theme rdf:resource="{gmx:Anchor/@xlink:href}"/> |
| 3220 | + </xsl:if> |
3221 | 3221 | </xsl:otherwise> |
3222 | 3222 | </xsl:choose> |
3223 | 3223 |
|
|
3226 | 3226 | <!-- Mapping added for compliance with DCAT-AP 2 --> |
3227 | 3227 | <xsl:if test="$profile = $extended"> |
3228 | 3228 | <!-- DEPRECATED: Mapping kept for backward compatibility with GeoDCAT-AP v1.* --> |
3229 | | - <xsl:if test="$include-deprecated = 'yes'"> |
3230 | | - <dct:subject rdf:resource="{gmx:Anchor/@xlink:href}"/> |
| 3229 | + <xsl:if test="$include-deprecated = 'yes'"> |
| 3230 | + <xsl:if test="not(starts-with(gmx:Anchor/@xlink:href, $SpatialDataServiceCategoryCodelistUri))"> |
| 3231 | + <dct:subject rdf:resource="{gmx:Anchor/@xlink:href}"/> |
| 3232 | + </xsl:if> |
3231 | 3233 | </xsl:if> |
3232 | 3234 | </xsl:if> |
3233 | 3235 | </xsl:if> |
|
3479 | 3481 | <!-- Encoding --> |
3480 | 3482 |
|
3481 | 3483 | <xsl:template mode="iso19139-to-dcatap" name="Encoding" |
3482 | | - match="gmd:distributionFormat/gmd:MD_Format/gmd:name/* |
3483 | | - |gmd:distributorFormat/gmd:MD_Format/gmd:name/*"> |
| 3484 | + match="gmd:distributionFormat/gmd:MD_Format/gmd:name/*|gmd:distributorFormat/gmd:MD_Format/gmd:name/*"> |
3484 | 3485 | <xsl:param name="format-label"> |
3485 | 3486 | <xsl:value-of select="normalize-space(.)"/> |
3486 | 3487 | </xsl:param> |
|
0 commit comments