- apply SortOrder for metadata standard dc, datacite and iso19139

This commit is contained in:
Arno Kaimbacher 2023-04-04 14:39:16 +02:00
parent 2a6a2a6def
commit 5b6f81c34d
4 changed files with 73 additions and 61 deletions

View File

@ -153,10 +153,14 @@
</gmd:identifier> </gmd:identifier>
<!-- gmd:citedResponsibleParty - creator --> <!-- gmd:citedResponsibleParty - creator -->
<xsl:apply-templates select="PersonAuthor" mode="iso19139" /> <xsl:apply-templates select="PersonAuthor" mode="iso19139">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- gmd:citedResponsibleParty - contributor --> <!-- gmd:citedResponsibleParty - contributor -->
<xsl:apply-templates select="PersonContributor" mode="iso19139" /> <xsl:apply-templates select="PersonContributor" mode="iso19139">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- publisher --> <!-- publisher -->
<gmd:citedResponsibleParty> <gmd:citedResponsibleParty>

View File

@ -29,16 +29,16 @@
*/ */
--> -->
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" encoding="utf-8" indent="yes" /> <xsl:output method="xml" encoding="utf-8" indent="yes" />
<xsl:template match="Rdr_Dataset" mode="oai_datacite"> <xsl:template match="Rdr_Dataset" mode="oai_datacite">
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.3/metadata.xsd"> xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.3/metadata.xsd">
<!-- <isReferenceQuality>true</isReferenceQuality> <!-- <isReferenceQuality>true</isReferenceQuality>
<schemaVersion>4.3</schemaVersion> <schemaVersion>4.3</schemaVersion>
<datacentreSymbol>RDR.GBA</datacentreSymbol> --> <datacentreSymbol>RDR.GBA</datacentreSymbol> -->
@ -55,10 +55,12 @@
</identifier> </identifier>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
<!--<datacite:creator>--> <!--<datacite:creator>-->
<creators> <creators>
<xsl:apply-templates select="PersonAuthor" mode="oai_datacite" /> <xsl:apply-templates select="PersonAuthor" mode="oai_datacite">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</creators> </creators>
<titles> <titles>
<xsl:apply-templates select="TitleMain" mode="oai_datacite" /> <xsl:apply-templates select="TitleMain" mode="oai_datacite" />
@ -79,7 +81,9 @@
</language> </language>
<xsl:if test="PersonContributor"> <xsl:if test="PersonContributor">
<contributors> <contributors>
<xsl:apply-templates select="PersonContributor" mode="oai_datacite" /> <xsl:apply-templates select="PersonContributor" mode="oai_datacite">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</contributors> </contributors>
</xsl:if> </xsl:if>
<dates> <dates>
@ -89,11 +93,11 @@
<xsl:text>Dataset</xsl:text> <xsl:text>Dataset</xsl:text>
<!-- <xsl:value-of select="@Type" /> --> <!-- <xsl:value-of select="@Type" /> -->
</resourceType> </resourceType>
<alternateIdentifiers> <alternateIdentifiers>
<xsl:call-template name="AlternateIdentifier" /> <xsl:call-template name="AlternateIdentifier" />
</alternateIdentifiers> </alternateIdentifiers>
<xsl:if test="Reference"> <xsl:if test="Reference">
<relatedIdentifiers> <relatedIdentifiers>
<xsl:apply-templates select="Reference" mode="oai_datacite" /> <xsl:apply-templates select="Reference" mode="oai_datacite" />
@ -125,12 +129,12 @@
<northBoundLatitude>50.18691</northBoundLatitude> <northBoundLatitude>50.18691</northBoundLatitude>
</geoLocationBox> </geoLocationBox>
</geoLocation> --> </geoLocation> -->
</geoLocations> </geoLocations>
</resource> </resource>
</xsl:template> </xsl:template>
<xsl:template name="RdrDate2" <xsl:template name="RdrDate2"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<xsl:if test="EmbargoDate and ($unixTimestamp &lt; EmbargoDate/@UnixTimestamp)"> <xsl:if test="EmbargoDate and ($unixTimestamp &lt; EmbargoDate/@UnixTimestamp)">
<date> <date>
<xsl:attribute name="dateType">Available</xsl:attribute> <xsl:attribute name="dateType">Available</xsl:attribute>
@ -154,9 +158,9 @@
</date> </date>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="Coverage" mode="oai_datacite" <xsl:template match="Coverage" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<geoLocation> <geoLocation>
<geoLocationBox> <geoLocationBox>
<westBoundLongitude> <westBoundLongitude>
@ -174,9 +178,9 @@
</geoLocationBox> </geoLocationBox>
</geoLocation> </geoLocation>
</xsl:template> </xsl:template>
<xsl:template match="TitleAbstract" mode="oai_datacite" <xsl:template match="TitleAbstract" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<description> <description>
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
@ -191,7 +195,7 @@
</description> </description>
</xsl:template> </xsl:template>
<xsl:template match="TitleAbstractAdditional" mode="oai_datacite" <xsl:template match="TitleAbstractAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<description> <description>
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
@ -206,8 +210,8 @@
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</description> </description>
</xsl:template> </xsl:template>
<xsl:template name="CamelCaseWord"> <xsl:template name="CamelCaseWord">
<xsl:param name="text" /> <xsl:param name="text" />
<xsl:param name="firstLower" select="true()" /> <xsl:param name="firstLower" select="true()" />
@ -225,10 +229,10 @@
<xsl:value-of select="substring(.,2,string-length(.))" /> <xsl:value-of select="substring(.,2,string-length(.))" />
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
<xsl:template match="Identifier" mode="oai_datacite" <xsl:template match="Identifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<identifier> <identifier>
<xsl:attribute name="identifierType"> <xsl:attribute name="identifierType">
<xsl:text>DOI</xsl:text> <xsl:text>DOI</xsl:text>
@ -236,9 +240,9 @@
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</identifier> </identifier>
</xsl:template> </xsl:template>
<xsl:template match="TitleMain" mode="oai_datacite" <xsl:template match="TitleMain" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<title> <title>
<xsl:if test="@Language != ''"> <xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
@ -254,7 +258,7 @@
</title> </title>
</xsl:template> </xsl:template>
<xsl:template match="TitleAdditional" mode="oai_datacite" <xsl:template match="TitleAdditional" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<title> <title>
<xsl:if test="@Language != ''"> <xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
@ -278,9 +282,9 @@
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</title> </title>
</xsl:template> </xsl:template>
<xsl:template match="Subject" mode="oai_datacite" <xsl:template match="Subject" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<subject> <subject>
<xsl:if test="@Language != ''"> <xsl:if test="@Language != ''">
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
@ -290,9 +294,9 @@
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</subject> </subject>
</xsl:template> </xsl:template>
<xsl:template name="AlternateIdentifier" match="AlternateIdentifier" mode="oai_datacite" <xsl:template name="AlternateIdentifier" match="AlternateIdentifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<alternateIdentifier> <alternateIdentifier>
<xsl:attribute name="alternateIdentifierType"> <xsl:attribute name="alternateIdentifierType">
<xsl:text>url</xsl:text> <xsl:text>url</xsl:text>
@ -301,9 +305,9 @@
<xsl:value-of select="@landingpage" /> <xsl:value-of select="@landingpage" />
</alternateIdentifier> </alternateIdentifier>
</xsl:template> </xsl:template>
<xsl:template match="Reference" mode="oai_datacite" <xsl:template match="Reference" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<relatedIdentifier> <relatedIdentifier>
<xsl:attribute name="relatedIdentifierType"> <xsl:attribute name="relatedIdentifierType">
<xsl:value-of select="@Type" /> <xsl:value-of select="@Type" />
@ -314,9 +318,9 @@
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</relatedIdentifier> </relatedIdentifier>
</xsl:template> </xsl:template>
<xsl:template match="PersonContributor" mode="oai_datacite" <xsl:template match="PersonContributor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<contributor> <contributor>
<xsl:if test="@ContributorType != ''"> <xsl:if test="@ContributorType != ''">
<xsl:attribute name="contributorType"> <xsl:attribute name="contributorType">
@ -333,9 +337,9 @@
</contributorName> </contributorName>
</contributor> </contributor>
</xsl:template> </xsl:template>
<xsl:template match="PersonAuthor" mode="oai_datacite" <xsl:template match="PersonAuthor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<creator> <creator>
<creatorName> <creatorName>
<xsl:if test="@NameType != ''"> <xsl:if test="@NameType != ''">
@ -354,7 +358,7 @@
<xsl:text>)</xsl:text> <xsl:text>)</xsl:text>
</xsl:if> </xsl:if>
</creatorName> </creatorName>
<xsl:if test="@NameType = 'Personal'"> <xsl:if test="@NameType = 'Personal'">
<givenName> <givenName>
<xsl:value-of select="@FirstName" /> <xsl:value-of select="@FirstName" />
@ -364,7 +368,7 @@
</familyName> </familyName>
<affiliation>GBA</affiliation> <affiliation>GBA</affiliation>
</xsl:if> </xsl:if>
<xsl:if test="@IdentifierOrcid != ''"> <xsl:if test="@IdentifierOrcid != ''">
<nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID"> <nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID">
<xsl:value-of select="@IdentifierOrcid" /> <xsl:value-of select="@IdentifierOrcid" />
@ -373,12 +377,12 @@
<!-- <!--
<nameType><xsl:value-of select="@NameType" /></nameType> <nameType><xsl:value-of select="@NameType" /></nameType>
</xsl:if> --> </xsl:if> -->
</creator> </creator>
</xsl:template> </xsl:template>
<xsl:template match="File/@MimeType" mode="oai_datacite" <xsl:template match="File/@MimeType" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<format> <format>
<xsl:choose> <xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'"> <xsl:when test=". = 'application/x-sqlite3'">
@ -390,9 +394,9 @@
</xsl:choose> </xsl:choose>
</format> </format>
</xsl:template> </xsl:template>
<xsl:template match="Licence" mode="oai_datacite" <xsl:template match="Licence" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<rights> <rights>
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
@ -422,5 +426,5 @@
</rights> </rights>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -418,7 +418,9 @@
<!-- Creator: Autor (falls vorhanden), sonst Herausgeber (falls vorhanden), sonst Urhebende Koerperschaft --> <!-- Creator: Autor (falls vorhanden), sonst Herausgeber (falls vorhanden), sonst Urhebende Koerperschaft -->
<xsl:choose> <xsl:choose>
<xsl:when test="PersonAuthor"> <xsl:when test="PersonAuthor">
<xsl:apply-templates select="PersonAuthor" mode="oai_dc" /> <xsl:apply-templates select="PersonAuthor" mode="oai_dc">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
</xsl:when> </xsl:when>
<xsl:when test="@CreatingCorporation"> <xsl:when test="@CreatingCorporation">
<dc:creator> <dc:creator>
@ -440,7 +442,9 @@
</dc:publisher> </dc:publisher>
<!-- dc:contributor --> <!-- dc:contributor -->
<xsl:apply-templates select="PersonContributor" mode="oai_dc" /> <xsl:apply-templates select="PersonContributor" mode="oai_dc">
<xsl:sort select="@SortOrder"/>
</xsl:apply-templates>
<!-- dc:date (call-template, weil die 'Funktion' nur einmal aufgerufen werden soll, nicht einmal für jedes Date--> <!-- dc:date (call-template, weil die 'Funktion' nur einmal aufgerufen werden soll, nicht einmal für jedes Date-->
<xsl:call-template name="RdrDate" /> <xsl:call-template name="RdrDate" />
<!-- dc:date: embargo date --> <!-- dc:date: embargo date -->
@ -461,9 +465,9 @@
<dc:identifier> <dc:identifier>
<xsl:value-of select="string(@landingpage)" /> <xsl:value-of select="string(@landingpage)" />
<!-- <xsl:call-template name="url-encode"> <!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="@landingpage"/> <xsl:with-param name="str" select="@landingpage"/>
</xsl:call-template> --> </xsl:call-template> -->
</dc:identifier> </dc:identifier>
<!-- dc:language --> <!-- dc:language -->
<xsl:apply-templates select="@Language" mode="oai_dc" /> <xsl:apply-templates select="@Language" mode="oai_dc" />
<!-- dc:relation --> <!-- dc:relation -->
@ -614,9 +618,9 @@
<dc:relation> <dc:relation>
<xsl:value-of select="string(@Value)" /> <xsl:value-of select="string(@Value)" />
<!-- <xsl:call-template name="url-encode"> <!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="@Value"/> <xsl:with-param name="str" select="@Value"/>
</xsl:call-template> --> </xsl:call-template> -->
</dc:relation> </dc:relation>
</xsl:template> </xsl:template>
@ -723,9 +727,9 @@
<!-- <xsl:value-of select="concat($doiLink, @Value)" /> --> <!-- <xsl:value-of select="concat($doiLink, @Value)" /> -->
<xsl:value-of select="concat($doiPrefix, string(@Value))" /> <xsl:value-of select="concat($doiPrefix, string(@Value))" />
<!-- <xsl:call-template name="url-encode"> <!-- <xsl:call-template name="url-encode">
<xsl:with-param name="str" select="concat($doiPrefix, @Value)"/> <xsl:with-param name="str" select="concat($doiPrefix, @Value)"/>
</xsl:call-template> --> </xsl:call-template> -->
</dc:relation> </dc:relation>
</xsl:template> </xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc"> <xsl:template match="@CreatingCorporation" mode="oai_dc">

File diff suppressed because one or more lines are too long