Skip to content

Commit

Permalink
Merge pull request #140 from MaRDI4NFDI/Datacite-adjustments
Browse files Browse the repository at this point in the history
Datacite  articles-adjustments
  • Loading branch information
Mazztok45 authored Dec 17, 2024
2 parents fad571f + 79ef3f5 commit 121259e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 76 deletions.
72 changes: 36 additions & 36 deletions test/data/articles/Test_Reference-Datacite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<relatedItems>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="URL">https://zbmath.org/3377327</relatedItemIdentifier>
<titles>
<title>A conjecture in prime number theory</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Elliott, Peter</creatorName>
<givenName>Peter</givenName>
Expand All @@ -73,14 +70,14 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Halberstam</familyName>
</creator>
</creators>
<titles>
<title>A conjecture in prime number theory</title>
</titles>
<publicationYear>1970</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.2307/1971450</relatedItemIdentifier>
<titles>
<title>Limitations to the equi-distribution of primes I</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Friedlander, John</creatorName>
<givenName>John</givenName>
Expand All @@ -92,14 +89,14 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Granville</familyName>
</creator>
</creators>
<titles>
<title>Limitations to the equi-distribution of primes I</title>
</titles>
<publicationYear>1989</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.1112/plms/pdn046</relatedItemIdentifier>
<titles>
<title>Small gaps between products of two primes</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Graham, Sidney</creatorName>
<givenName>Sidney</givenName>
Expand All @@ -121,14 +118,14 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Pintz</familyName>
</creator>
</creators>
<titles>
<title>Small gaps between products of two primes</title>
</titles>
<publicationYear>2009</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.7169/facm/1229442618</relatedItemIdentifier>
<titles>
<title>Primes in tuples III On the difference \(p_{n+\nu}-p_n\)</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Yildirim, Cem</creatorName>
<givenName>Cem</givenName>
Expand All @@ -145,14 +142,14 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Goldston</familyName>
</creator>
</creators>
<titles>
<title>Primes in tuples III On the difference \(p_{n+\nu}-p_n\)</title>
</titles>
<publicationYear>2006</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.4007/annals.2009.170.819</relatedItemIdentifier>
<titles>
<title>Primes in tuples I</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Yildirim, Cem</creatorName>
<givenName>Cem</givenName>
Expand All @@ -169,14 +166,14 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Goldston</familyName>
</creator>
</creators>
<titles>
<title>Primes in tuples I</title>
</titles>
<publicationYear>2009</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.1112/plms/pdm010</relatedItemIdentifier>
<titles>
<title>Higher correlations of divisor sums related to primes III Small gaps between primes</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Yildirim, Cem</creatorName>
<givenName>Cem</givenName>
Expand All @@ -188,48 +185,51 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or
<familyName>Goldston</familyName>
</creator>
</creators>
<titles>
<title>Higher correlations of divisor sums related to primes III Small gaps between primes</title>
</titles>
<publicationYear>2007</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="URL">https://zbmath.org/6587992</relatedItemIdentifier>
<titles>
<title>New equidistribution estimates of Zhang type and bounded gaps between primes</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Polymath, D</creatorName>
<givenName>D</givenName>
<familyName>Polymath</familyName>
</creator>
</creators>
<titles>
<title>New equidistribution estimates of Zhang type and bounded gaps between primes</title>
</titles>
<publicationYear>2014</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="URL">https://zbmath.org/195021</relatedItemIdentifier>
<titles>
<title>Collected Papers Vol II New York: Springer-Verlag</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Selberg, Atle</creatorName>
<givenName>Atle</givenName>
<familyName>Selberg</familyName>
</creator>
</creators>
<titles>
<title>Collected Papers Vol II New York: Springer-Verlag</title>
</titles>
<publicationYear>1991</publicationYear>
</relatedItem>
<relatedItem relatedItemType="JournalArticle" relationType="Cites">
<relatedItemIdentifier relatedItemIdentifierType="DOI">10.4007/annals.2014.179.3.7</relatedItemIdentifier>
<titles>
<title>Bounded gaps between primes</title>
</titles>
<creators>
<creators>
<creator>
<creatorName nameType="Personal">Zhang, Yitang</creatorName>
<givenName>Yitang</givenName>
<familyName>Zhang</familyName>
</creator>
</creators>
<titles>
<title>Bounded gaps between primes</title>
</titles>
<publicationYear>2014</publicationYear>
</relatedItem>
<relatedItem relationType="IsPublishedIn" relatedItemType="Book">
Expand Down
78 changes: 38 additions & 40 deletions xslt/articles/xslt-article-Datacite.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -257,46 +257,6 @@ each reference has its own relatedItem node and all of its values goes under thi
</xsl:otherwise>
</xsl:choose>
</relatedItemIdentifier>
<!-- the title extracted from a long text to the main shortcut -->
<titles>
<xsl:choose>
<xsl:when test="contains(text, &quot;''&quot;)">
<!-- Extract text between quotes -->
<title>
<xsl:variable name="text" select="text"/>
<xsl:variable name="title-text" select="substring-before(substring-after($text, &quot;''&quot;), &quot;''&quot;)"/>
<!-- Remove digits and trailing punctuation -->
<xsl:variable name="title-no-digits" select="translate($title-text, '0123456789', '')"/>
<xsl:value-of select="normalize-space(
translate(
$title-no-digits,
',.',
''
)
)"/>
</title>
</xsl:when>
<xsl:otherwise>
<!-- Extract text after the first comma and before the last comma, excluding digits and removing trailing commas/periods -->
<title>
<xsl:variable name="text" select="text"/>
<xsl:variable name="text-no-digits" select="translate($text, '0123456789', '')"/>
<xsl:variable name="first-comma" select="substring-after($text-no-digits, ',')"/>
<xsl:variable name="last-part" select="substring-before($text-no-digits, substring-after($text-no-digits, ', '))"/>
<xsl:variable name="last-comma" select="substring-before($last-part, ',')"/>
<xsl:variable name="result-text" select="normalize-space(concat(substring-before($first-comma, substring-after($first-comma, ', ')), substring-after($first-comma, ', ')))"/>
<xsl:value-of select="normalize-space(
translate(
$result-text,
',.',
''
)
)"/>
</title>
</xsl:otherwise>
</xsl:choose>
</titles>
<!-- authors name is separted to given and family name , also adding the properties of creator to it -->
<creators>
<xsl:for-each select="zbmath/author_codes">
<creator>
Expand Down Expand Up @@ -351,6 +311,44 @@ each reference has its own relatedItem node and all of its values goes under thi
</creator>
</xsl:for-each>
</creators>
<titles>
<xsl:choose>
<xsl:when test="contains(text, &quot;''&quot;)">
<!-- Extract text between quotes -->
<title>
<xsl:variable name="text" select="text"/>
<xsl:variable name="title-text" select="substring-before(substring-after($text, &quot;''&quot;), &quot;''&quot;)"/>
<!-- Remove digits and trailing punctuation -->
<xsl:variable name="title-no-digits" select="translate($title-text, '0123456789', '')"/>
<xsl:value-of select="normalize-space(
translate(
$title-no-digits,
',.',
''
)
)"/>
</title>
</xsl:when>
<xsl:otherwise>
<!-- Extract text after the first comma and before the last comma, excluding digits and removing trailing commas/periods -->
<title>
<xsl:variable name="text" select="text"/>
<xsl:variable name="text-no-digits" select="translate($text, '0123456789', '')"/>
<xsl:variable name="first-comma" select="substring-after($text-no-digits, ',')"/>
<xsl:variable name="last-part" select="substring-before($text-no-digits, substring-after($text-no-digits, ', '))"/>
<xsl:variable name="last-comma" select="substring-before($last-part, ',')"/>
<xsl:variable name="result-text" select="normalize-space(concat(substring-before($first-comma, substring-after($first-comma, ', ')), substring-after($first-comma, ', ')))"/>
<xsl:value-of select="normalize-space(
translate(
$result-text,
',.',
''
)
)"/>
</title>
</xsl:otherwise>
</xsl:choose>
</titles>
<publicationYear>
<xsl:value-of select="zbmath/year"/>
</publicationYear>
Expand Down

0 comments on commit 121259e

Please sign in to comment.