Skip to content

Commit

Permalink
Metadata citation improvements:
Browse files Browse the repository at this point in the history
- BibTex: change data entry type to misc (data seems not valid: https://en.wikipedia.org/wiki/BibTeX\#Entry_types).
- RIS: add support for PY (publication year), DA (publication date) LA (language) fields.
  • Loading branch information
josegar74 committed Jan 20, 2025
1 parent f4890d5 commit 892e45e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:mdb="http://standards.iso.org/iso/19115/-3/mdb/2.0"
xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0"
xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0"
xmlns:lan="http://standards.iso.org/iso/19115/-3/lan/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gn-fn-iso19115-3.2018="http://geonetwork-opensource.org/xsl/functions/profiles/iso19115-3.2018"
Expand Down Expand Up @@ -92,6 +93,10 @@
('publication', 'revision')]/
cit:date/gco:*[. != '']"/>


<xsl:variable name="datasetLanguage"
select="$metadata/mdb:identificationInfo/*/mri:defaultLocale/*/lan:language/*/@codeListValue"/>

<xsl:variable name="publicationDates" as="node()*">
<xsl:perform-sort select="$dates">
<xsl:sort select="." order="descending"/>
Expand Down Expand Up @@ -163,6 +168,7 @@
<doiUrl><xsl:value-of select="$doiUrl"/></doiUrl>
<xsl:copy-of select="$translatedKeywords"/>
<additionalCitation><xsl:value-of select="$additionalCitation"/></additionalCitation>
<language><xsl:value-of select="$datasetLanguage" /></language>
</citation>

</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<xsl:template mode="citation" match="citation[lower-case($format) = 'bibtex']">
<!-- https://en.wikipedia.org/wiki/BibTeX -->
<textResponse>@data{<xsl:value-of select="uuid"/>,
<textResponse>@misc{<xsl:value-of select="uuid"/>,
author = {<xsl:value-of select="normalize-space(string-join(authorsNameAndOrgList/*, ', '))"/>},
publisher = {<xsl:value-of select="normalize-space(string-join(publishersNameAndOrgList/*, ', '))"/>},
title = {<xsl:value-of select="normalize-space(translatedTitle)"/>},
Expand All @@ -91,7 +91,10 @@
<xsl:text>AU - </xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text>&#13;&#10;</xsl:text>
</xsl:for-each>
<xsl:text>TI - </xsl:text><xsl:value-of select="normalize-space(translatedTitle)"/><xsl:text>&#13;&#10;</xsl:text>
<!-- TODO: LA, ET -->
<!-- TODO: ET -->
<xsl:if test="language != ''">
<xsl:text>LA - </xsl:text><xsl:value-of select="language"/><xsl:text>&#13;&#10;</xsl:text>
</xsl:if>
<xsl:for-each select="publishersNameAndOrgList/*[. != '']">
<xsl:text>PB - </xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:text>&#13;&#10;</xsl:text>
</xsl:for-each>
Expand All @@ -103,6 +106,10 @@
<xsl:text>DO - </xsl:text><xsl:value-of select="doi"/><xsl:text>&#13;&#10;</xsl:text>
</xsl:if>
<xsl:text>ID - </xsl:text><xsl:value-of select="uuid"/><xsl:text>&#13;&#10;</xsl:text>
<xsl:if test="lastPublicationDate != ''">
<xsl:text>DA - </xsl:text><xsl:value-of select="concat(replace(substring(lastPublicationDate, 1, 12), '-', '/'), '/')" /><xsl:text>&#13;&#10;</xsl:text>
<xsl:text>PY - </xsl:text><xsl:value-of select="substring(lastPublicationDate, 1, 4)" /><xsl:text>&#13;&#10;</xsl:text>
</xsl:if>
<xsl:text>ER -</xsl:text>
</textResponse>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<xsl:variable name="langId"
select="gn-fn-iso19139:getLangId($metadata, $language)"/>

<xsl:variable name="datasetLanguage"
select="$metadata/gmd:identificationInfo/*/gmd:language/*/@codeListValue"/>

<xsl:variable name="authors"
select="$metadata/gmd:identificationInfo/*/gmd:pointOfContact/
*[gmd:role/*/@codeListValue = $authorRolesList]"/>
Expand Down Expand Up @@ -167,6 +170,7 @@
<doiUrl><xsl:value-of select="$doiUrl"/></doiUrl>
<xsl:copy-of select="$translatedKeywords"/>
<additionalCitation><xsl:value-of select="$additionalCitation"/></additionalCitation>
<language><xsl:value-of select="$datasetLanguage" /></language>
</citation>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@data{{uuid},
@misc{{uuid},
author = {Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données)},
publisher = {},
title = {Utilisation du Sol en Wallonie - WALOUS 2018},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TY - DATA
AU - Production géomatique et traitement de données (SPW - Secrétariat général - SPW Digital - Département Données transversales - Production géomatique et traitement de données)
TI - Utilisation du Sol en Wallonie - WALOUS 2018
LA - fre
KW - Données de base
KW - Nature et environnement
KW - Aménagement du territoire
Expand All @@ -20,4 +21,6 @@ KW - UTS
KW - COSW
UR - http://localhost:8080/srv/api/records/{uuid}
ID - {uuid}
DA - 2020/10/30/
PY - 2020
ER -
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@data{{uuid},
@misc{{uuid},
author = {},
publisher = {},
title = {CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May 2020},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
TY - DATA
TI - CORINE Land Cover Change 2012-2018 (vector), Europe, 6-yearly - version 2020_20u1, May 2020
LA - eng
KW - Land cover
KW - EEA39
KW - landscape
Expand All @@ -14,4 +15,6 @@ KW - Water
UR - https://doi.org/10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24
DO - 10.2909/f30f1000-7cf8-43bb-872c-5eb093911b24
ID - {uuid}
DA - 2020/05/13/
PY - 2020
ER -

0 comments on commit 892e45e

Please sign in to comment.