2018-12-17 16:10:17 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!--
|
|
|
|
/**
|
2019-11-21 17:43:56 +00:00
|
|
|
* This file is part of TETHYS.
|
2018-12-17 16:10:17 +00:00
|
|
|
*
|
|
|
|
* LICENCE
|
2019-11-21 17:43:56 +00:00
|
|
|
* TETHYS is free software; you can redistribute it and/or modify it under the
|
2018-12-17 16:10:17 +00:00
|
|
|
* terms of the GNU General Public License as published by the Free Software
|
|
|
|
* Foundation; either version 2 of the Licence, or any later version.
|
|
|
|
* OPUS is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details. You should have received a copy of the GNU General Public License
|
|
|
|
* along with OPUS; if not, write to the Free Software Foundation, Inc., 51
|
|
|
|
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* @category Application
|
|
|
|
* @package Module_Oai
|
2019-01-07 10:16:18 +00:00
|
|
|
* @author Arno Kaimbacher <arno.kaimbacher@geologie.ac.at>
|
2019-11-21 17:43:56 +00:00
|
|
|
* @copyright Copyright (c) 2018-2019, GBA TETHYS development team
|
2018-12-17 16:10:17 +00:00
|
|
|
* @license http://www.gnu.org/licenses/gpl.html General Public License
|
|
|
|
*/
|
|
|
|
-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
/**
|
2019-11-21 17:43:56 +00:00
|
|
|
* Transforms the xml representation of an TETHYS model dataset to datacite
|
2018-12-17 16:10:17 +00:00
|
|
|
* xml as required by the OAI-PMH protocol.
|
|
|
|
*/
|
|
|
|
-->
|
|
|
|
<xsl:stylesheet version="1.0"
|
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
|
|
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xmlns:php="http://php.net/xsl" exclude-result-prefixes="php">
|
|
|
|
|
|
|
|
<xsl:output method="xml" indent="yes" />
|
|
|
|
|
|
|
|
<xsl:template match="Rdr_Dataset" mode="oai_datacite">
|
|
|
|
<resource xmlns="http://datacite.org/schema/kernel-4"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.1/metadata.xsd">
|
|
|
|
<!-- <isReferenceQuality>true</isReferenceQuality>
|
|
|
|
<schemaVersion>4.1</schemaVersion>
|
|
|
|
<datacentreSymbol>RDR.GBA</datacentreSymbol> -->
|
|
|
|
<identifier>
|
|
|
|
<xsl:text>oai:</xsl:text>
|
|
|
|
<xsl:value-of select="$repIdentifier" />
|
|
|
|
<xsl:text>:</xsl:text>
|
|
|
|
<xsl:value-of select="@Id" />
|
|
|
|
</identifier>
|
|
|
|
<!--<datacite:creator>-->
|
|
|
|
<creators>
|
|
|
|
<xsl:apply-templates select="PersonAuthor" mode="oai_datacite" />
|
|
|
|
</creators>
|
|
|
|
<titles>
|
|
|
|
<xsl:apply-templates select="TitleMain" mode="oai_datacite" />
|
2019-09-19 14:10:15 +00:00
|
|
|
<xsl:apply-templates select="TitleAdditional" mode="oai_datacite" />
|
2018-12-17 16:10:17 +00:00
|
|
|
</titles>
|
|
|
|
<publisher>
|
2020-02-20 10:24:34 +00:00
|
|
|
<!-- <xsl:value-of select="@PublisherName" /> -->
|
|
|
|
<xsl:value-of select="@CreatingCorporation" />
|
2018-12-17 16:10:17 +00:00
|
|
|
</publisher>
|
|
|
|
<publicationYear>
|
|
|
|
<xsl:value-of select="ServerDatePublished/@Year"/>
|
|
|
|
</publicationYear>
|
2019-09-19 14:10:15 +00:00
|
|
|
<subjects>
|
|
|
|
<xsl:apply-templates select="Subject" mode="oai_datacite" />
|
|
|
|
</subjects>
|
2018-12-17 16:10:17 +00:00
|
|
|
<language>
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</language>
|
2019-01-08 13:06:21 +00:00
|
|
|
<contributors>
|
|
|
|
<xsl:apply-templates select="PersonContributor" mode="oai_datacite" />
|
|
|
|
</contributors>
|
2020-04-02 05:50:08 +00:00
|
|
|
<dates>
|
|
|
|
<xsl:call-template name="RdrDate2" mode="oai_datacite" />
|
|
|
|
</dates>
|
2018-12-17 16:10:17 +00:00
|
|
|
<resourceType resourceTypeGeneral="Dataset">
|
2019-01-08 13:06:21 +00:00
|
|
|
<xsl:text>Dataset</xsl:text>
|
2018-12-17 16:10:17 +00:00
|
|
|
<!-- <xsl:value-of select="@Type" /> -->
|
|
|
|
</resourceType>
|
2020-03-05 12:40:09 +00:00
|
|
|
<xsl:if test="Reference">
|
2020-04-02 05:50:08 +00:00
|
|
|
<relatedIdentifiers>
|
|
|
|
<xsl:apply-templates select="Reference" mode="oai_datacite" />
|
|
|
|
</relatedIdentifiers>
|
|
|
|
</xsl:if>
|
2018-12-17 16:10:17 +00:00
|
|
|
<rightsList>
|
|
|
|
<xsl:apply-templates select="Licence" mode="oai_datacite" />
|
|
|
|
</rightsList>
|
|
|
|
<sizes>
|
|
|
|
<size>
|
2019-01-08 13:06:21 +00:00
|
|
|
<xsl:value-of select="count(File)"/>
|
2018-12-17 16:10:17 +00:00
|
|
|
<xsl:text> datasets</xsl:text>
|
|
|
|
</size>
|
|
|
|
</sizes>
|
|
|
|
<formats>
|
|
|
|
<xsl:apply-templates select="File/@MimeType" mode="oai_datacite" />
|
|
|
|
</formats>
|
|
|
|
<descriptions>
|
|
|
|
<xsl:apply-templates select="TitleAbstract" mode="oai_datacite" />
|
2019-09-19 14:10:15 +00:00
|
|
|
<xsl:apply-templates select="TitleAbstractAdditional" mode="oai_datacite" />
|
2018-12-17 16:10:17 +00:00
|
|
|
</descriptions>
|
|
|
|
<geoLocations>
|
2019-03-29 17:29:20 +00:00
|
|
|
<xsl:apply-templates select="Coverage" mode="oai_datacite" />
|
2018-12-17 16:10:17 +00:00
|
|
|
<!-- <geoLocation>
|
|
|
|
<geoLocationBox>
|
|
|
|
<westBoundLongitude>6.58987</westBoundLongitude>
|
|
|
|
<eastBoundLongitude>6.83639</eastBoundLongitude>
|
|
|
|
<southBoundLatitude>50.16</southBoundLatitude>
|
|
|
|
<northBoundLatitude>50.18691</northBoundLatitude>
|
|
|
|
</geoLocationBox>
|
|
|
|
</geoLocation> -->
|
|
|
|
</geoLocations>
|
|
|
|
</resource>
|
|
|
|
</xsl:template>
|
|
|
|
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:template name="RdrDate2" mode="oai_datacite">
|
|
|
|
<xsl:if test="EmbargoDate">
|
|
|
|
<date>
|
|
|
|
<xsl:attribute name="dataType">Available</xsl:attribute>
|
|
|
|
<xsl:variable name="embargoDate" select="concat(
|
|
|
|
EmbargoDate/@Year, '-',
|
|
|
|
format-number(EmbargoDate/@Month,'00'), '-',
|
|
|
|
format-number(EmbargoDate/@Day,'00')
|
|
|
|
)" />
|
|
|
|
<xsl:value-of select="$embargoDate" />
|
|
|
|
</date>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="CreatedAt">
|
|
|
|
<date>
|
|
|
|
<xsl:attribute name="dataType">created</xsl:attribute>
|
|
|
|
<xsl:variable name="createdAt" select="concat(
|
|
|
|
CreatedAt/@Year, '-',
|
|
|
|
format-number(CreatedAt/@Month,'00'), '-',
|
|
|
|
format-number(CreatedAt/@Day,'00')
|
|
|
|
)" />
|
|
|
|
<xsl:value-of select="$createdAt" />
|
|
|
|
</date>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
2019-03-29 17:29:20 +00:00
|
|
|
<xsl:template match="Coverage" mode="oai_datacite">
|
2019-01-07 10:16:18 +00:00
|
|
|
<geoLocation>
|
|
|
|
<geoLocationBox>
|
|
|
|
<westBoundLongitude>
|
2019-09-02 14:58:08 +00:00
|
|
|
<xsl:value-of select="@XMin" />
|
2019-01-07 10:16:18 +00:00
|
|
|
</westBoundLongitude>
|
|
|
|
<eastBoundLongitude>
|
2019-09-02 14:58:08 +00:00
|
|
|
<xsl:value-of select="@XMax" />
|
2019-01-07 10:16:18 +00:00
|
|
|
</eastBoundLongitude>
|
|
|
|
<southBoundLatitude>
|
2019-09-02 14:58:08 +00:00
|
|
|
<xsl:value-of select="@YMin" />
|
2019-01-07 10:16:18 +00:00
|
|
|
</southBoundLatitude>
|
|
|
|
<northBoundLatitude>
|
2019-09-02 14:58:08 +00:00
|
|
|
<xsl:value-of select="@YMax" />
|
2019-01-07 10:16:18 +00:00
|
|
|
</northBoundLatitude>
|
|
|
|
</geoLocationBox>
|
|
|
|
</geoLocation>
|
2018-12-17 16:10:17 +00:00
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="TitleAbstract" mode="oai_datacite">
|
|
|
|
<description>
|
|
|
|
<xsl:attribute name="xml:lang">
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:if test="@Type != ''">
|
|
|
|
<xsl:attribute name="descriptionType">
|
|
|
|
<xsl:value-of select="@Type" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@Value" />
|
|
|
|
</description>
|
|
|
|
</xsl:template>
|
2019-09-19 14:10:15 +00:00
|
|
|
<xsl:template match="TitleAbstractAdditional" mode="oai_datacite">
|
|
|
|
<description>
|
|
|
|
<xsl:attribute name="xml:lang">
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:if test="@Type != ''">
|
|
|
|
<xsl:attribute name="descriptionType">
|
|
|
|
<xsl:value-of select="@Type" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@Value" />
|
|
|
|
</description>
|
|
|
|
</xsl:template>
|
2018-12-17 16:10:17 +00:00
|
|
|
|
|
|
|
<xsl:template match="TitleMain" mode="oai_datacite">
|
|
|
|
<title>
|
|
|
|
<xsl:if test="@Language != ''">
|
|
|
|
<xsl:attribute name="xml:lang">
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
2019-09-16 11:47:30 +00:00
|
|
|
<xsl:if test="@Type != '' and @Type != 'Main'">
|
2018-12-17 16:10:17 +00:00
|
|
|
<xsl:attribute name="titleType">
|
|
|
|
<xsl:value-of select="@Type" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@Value"/>
|
|
|
|
</title>
|
|
|
|
</xsl:template>
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:template match="TitleAdditional" mode="oai_datacite">
|
2019-09-19 14:10:15 +00:00
|
|
|
<title>
|
|
|
|
<xsl:if test="@Language != ''">
|
|
|
|
<xsl:attribute name="xml:lang">
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="@Type != '' and @Type != 'Main'">
|
|
|
|
<xsl:attribute name="titleType">
|
|
|
|
<xsl:value-of select="@Type" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@Value"/>
|
|
|
|
</title>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="Subject" mode="oai_datacite">
|
|
|
|
<subject>
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:if test="@Language != ''">
|
|
|
|
<xsl:attribute name="xml:lang">
|
|
|
|
<xsl:value-of select="@Language" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@Value" />
|
|
|
|
</subject>
|
|
|
|
</xsl:template>
|
2018-12-17 16:10:17 +00:00
|
|
|
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:template match="Reference" mode="oai_datacite">
|
2020-03-05 12:40:09 +00:00
|
|
|
<relatedIdentifier>
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:attribute name="relatedIdentifierType">
|
|
|
|
<xsl:value-of select="@Type" />
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="relationType">
|
|
|
|
<xsl:value-of select="@Relation" />
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:value-of select="@Value" />
|
|
|
|
</relatedIdentifier>
|
|
|
|
</xsl:template>
|
2020-03-05 12:40:09 +00:00
|
|
|
|
2019-01-08 13:06:21 +00:00
|
|
|
<xsl:template match="PersonContributor" mode="oai_datacite">
|
|
|
|
<contributor>
|
|
|
|
<contributorName>
|
2019-09-16 11:47:30 +00:00
|
|
|
<xsl:if test="@NameType != ''">
|
2020-04-02 05:50:08 +00:00
|
|
|
<xsl:attribute name="nameType">
|
|
|
|
<xsl:value-of select="@NameType" />
|
|
|
|
</xsl:attribute>
|
2019-09-16 11:47:30 +00:00
|
|
|
</xsl:if>
|
2019-01-08 13:06:21 +00:00
|
|
|
<xsl:value-of select="@LastName" />
|
|
|
|
</contributorName>
|
|
|
|
</contributor>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
2018-12-17 16:10:17 +00:00
|
|
|
<xsl:template match="PersonAuthor" mode="oai_datacite">
|
|
|
|
<creator>
|
|
|
|
<creatorName>
|
|
|
|
<xsl:if test="@NameType != ''">
|
|
|
|
<xsl:attribute name="nameType">
|
|
|
|
<xsl:value-of select="@NameType" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@LastName" />
|
|
|
|
<xsl:if test="@FirstName != ''">
|
|
|
|
<xsl:text>, </xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@FirstName" />
|
|
|
|
<xsl:if test="@AcademicTitle != ''">
|
|
|
|
<xsl:text> (</xsl:text>
|
|
|
|
<xsl:value-of select="@AcademicTitle" />
|
|
|
|
<xsl:text>)</xsl:text>
|
|
|
|
</xsl:if>
|
|
|
|
</creatorName>
|
|
|
|
<givenName>
|
|
|
|
<xsl:value-of select="@FirstName" />
|
|
|
|
</givenName>
|
|
|
|
<familyName>
|
|
|
|
<xsl:value-of select="@LastName" />
|
|
|
|
</familyName>
|
|
|
|
<xsl:if test="@IdentifierOrcid != ''">
|
|
|
|
<nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">
|
|
|
|
<xsl:value-of select="@IdentifierOrcid" />
|
|
|
|
</nameIdentifier>
|
|
|
|
</xsl:if>
|
|
|
|
<!--
|
|
|
|
<nameType><xsl:value-of select="@NameType" /></nameType>
|
|
|
|
</xsl:if> -->
|
|
|
|
<affiliation>GBA</affiliation>
|
|
|
|
</creator>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="File/@MimeType" mode="oai_datacite">
|
|
|
|
<format>
|
|
|
|
<xsl:value-of select="." />
|
|
|
|
</format>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="Licence" mode="oai_datacite">
|
|
|
|
<rights>
|
|
|
|
<xsl:if test="@LinkLicence != ''">
|
|
|
|
<xsl:attribute name="rightsURI">
|
|
|
|
<xsl:value-of select="@LinkLicence" />
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:value-of select="@NameLong" />
|
|
|
|
</rights>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
</xsl:stylesheet>
|