diff --git a/test/data/articles/Test_Reference-Datacite.xml b/test/data/articles/Test_Reference-Datacite.xml index 4e10dd1d..e121890e 100644 --- a/test/data/articles/Test_Reference-Datacite.xml +++ b/test/data/articles/Test_Reference-Datacite.xml @@ -20,8 +20,8 @@ The prime \(k\)-tuples and small gaps between prime numbers are considered. Using a refinement of the Goldston-Pintz-Yildirim sieve method [\textit{D. A. Goldston} et al., Ann. Math. (2) 170, No. 2, 819--862 (2009; Zbl 1207.11096)] the author proves, for instance, the following estimates \[ \liminf_{n\to\infty}\,(p_{n+m}-p_n)\ll m^3\text{{e}}^{4m}, \quad \liminf_{n\to\infty}\,(p_{n+1}-p_n)\leq 600 \] with an absolute constant in sign \(\ll\). Here \(m\) is a natural number, and \(p_{\,l}\) denote the \(l\)-th prime number. - Small gaps between primes - + Small gaps between primes + Princeton University, Mathematics Department, Princeton, NJ 2015 @@ -39,17 +39,17 @@ English journal article + https://zbmath.org/3377327 10.2307/1971450 10.1112/plms/pdn046 10.7169/facm/1229442618 10.4007/annals.2009.170.819 10.1112/plms/pdm010 - 10.4007/annals.2014.179.3.7 - https://zbmath.org/3377327 - https://zbmath.org/6587992 + https://zbmath.org/6587992 https://zbmath.org/195021 + 10.4007/annals.2014.179.3.7 - + The zbMATH Open OAI-PMH API is subject to the Terms and Conditions for the zbMATH Open API Service of FIZ Karlsruhe – Leibniz-Institut für Informationsinfrastruktur GmbH. Content generated by zbMATH Open, such as reviews, classifications, software, or author disambiguation data, are distributed under CC-BY-SA 4.0. This defines the license for the whole dataset, which also contains non-copyrighted bibliographic metadata and reference data derived from I4OC (CC0). Note that the API only provides a subset of the data in the zbMATH Open Web interface. In several cases, third-party information, such as abstracts, cannot be made available under a suitable license through the API. In those cases, we replaced the data with the string diff --git a/test/data/articles/invalid_chr.xml b/test/data/articles/invalid_chr.xml index 45bc769b..399f246e 100644 --- a/test/data/articles/invalid_chr.xml +++ b/test/data/articles/invalid_chr.xml @@ -61,12 +61,12 @@ 1310.6466 arxiv - + https://arxiv.org/abs/1310.6466 - + www.combinatorics.org/ojs/index.php/eljc/article/view/v21i4p42 http - www.combinatorics.org/ojs/index.php/eljc/article/view/v21i4p42 + http://www.combinatorics.org/ojs/index.php/eljc/article/view/v21i4p42 05C55 diff --git a/test/data/articles/plain.xml b/test/data/articles/plain.xml index ee89c013..d5a2b500 100644 --- a/test/data/articles/plain.xml +++ b/test/data/articles/plain.xml @@ -49,42 +49,42 @@ 10.4007/annals.2015.181.1.7 doi - + https://doi.org/10.4007/annals.2015.181.1.7 1311.4600 arxiv - + https://arxiv.org/abs/1311.4600 A1097 oeis - + https://oeis.org/A1097 A38664 oeis - + https://oeis.org/A38664 A46133 oeis - + https://oeis.org/A46133 A231607 oeis - + https://oeis.org/A231607 A235686 oeis - + https://oeis.org/A235686 A244368 oeis - + https://oeis.org/A244368 11N05 diff --git a/test/test_zbMATH_API_version.py b/test/test_zbMATH_API_version.py index 90ed75f5..fbb9080c 100644 --- a/test/test_zbMATH_API_version.py +++ b/test/test_zbMATH_API_version.py @@ -17,7 +17,7 @@ def get_api_version(url): class TestAPIVersion(unittest.TestCase): def test_api_version_matches(self): url = "https://api.zbmath.org/openapi.json" - expected_version = "1.5.8" + expected_version = "1.7.0" actual_version = get_api_version(url) self.assertEqual(actual_version, expected_version, f"Expected API version {expected_version}, but got {actual_version}") diff --git a/xslt/articles/xslt-article-Datacite.xslt b/xslt/articles/xslt-article-Datacite.xslt index ed826437..13f3a490 100644 --- a/xslt/articles/xslt-article-Datacite.xslt +++ b/xslt/articles/xslt-article-Datacite.xslt @@ -21,24 +21,42 @@ Made by Shiraz Malla Mohamad member of zbmath Team--> - + + - - + + + - + + + - - - - - + + + + + - :unav + :unav @@ -111,7 +129,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or - :unav + :unav @@ -120,7 +138,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or - :unav + :unav @@ -129,7 +147,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or - :unav + :unav @@ -144,7 +162,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'">:unkn</xsl:when> + <xsl:when test="normalize-space(.) = '' or normalize-space(.) = 'None' or normalize-space(.) = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')">:unav</xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space(.)"/> </xsl:otherwise> @@ -157,7 +175,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <xsl:template match="publisher"> <publisher xml:lang="en"> <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'">:unav</xsl:when> + <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')">:unav</xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> @@ -168,7 +186,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <xsl:template match="year"> <publicationYear> <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'">:unav</xsl:when> + <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none' or not(number(.))">:unav</xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> @@ -178,13 +196,20 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <!-- Template for processing the language of the document --> + <xsl:template match="languages"> - <xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'"> - <language> - <xsl:value-of select="."/> - </language> - </xsl:if> - </xsl:template> + <language> + <xsl:choose> + <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> + <xsl:text>:unkn</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(.)"/> + </xsl:otherwise> + </xsl:choose> + </language> + </xsl:template> + <!-- Template for processing the document type which can be various and needs to be properly handeld --> <xsl:template match="description"> <resourceType> @@ -204,19 +229,23 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <xsl:value-of select="."/> </resourceType> </xsl:template> - <!-- Template for processing source as relatedItem --> + <xsl:template match="source"> + <xsl:if test="normalize-space(.) != ''"> <relatedItem relationType="IsPublishedIn" relatedItemType="Book"> - <!-- Select ISSN with type 'print' --> - <relatedItemIdentifier relatedItemIdentifierType="ISSN"> - <xsl:value-of select="descendant::issn[type='print']/number"/> - </relatedItemIdentifier> - <!-- Process title --> + <xsl:variable name="issnValue" select="descendant::issn[type='print']/number"/> + <xsl:if test="normalize-space($issnValue) != '' + and $issnValue != 'None' + and $issnValue != 'none' + and not(contains($issnValue, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))"> + <relatedItemIdentifier relatedItemIdentifierType="ISSN"> + <xsl:value-of select="$issnValue"/> + </relatedItemIdentifier> + </xsl:if> <titles> <title> <xsl:choose> - <xsl:when - test="normalize-space(series/title) = '' or series/title = 'None' or series/title = 'none'"> + <xsl:when test="normalize-space(series/title) = '' or series/title = 'None' or series/title = 'none' or contains(series/title, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -227,7 +256,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </titles> <publicationYear> <xsl:choose> - <xsl:when test="normalize-space(series/year) = '' or series/year = 'None' or series/year = 'none'"> + <xsl:when test="normalize-space(series/year) = '' or series/year = 'None' or series/year = 'none' or contains(series/year, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses') or not(number(series/year))"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -269,8 +298,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <!-- Process publisher --> <publisher> <xsl:choose> - <xsl:when - test="normalize-space(series/publisher) = '' or series/publisher = 'None' or series/publisher = 'none'"> + <xsl:when test="normalize-space(series/publisher) = '' or series/publisher = 'None' or series/publisher = 'none' or contains(series/publisher, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -279,11 +307,12 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </xsl:choose> </publisher> </relatedItem> + </xsl:if> </xsl:template> <!-- Template for processing text node into description text with its subproperty --> <xsl:template match="text"> - <xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'"> + <xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none' and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))"> <description xml:lang="en" descriptionType="Abstract"> <xsl:value-of select="normalize-space(.)"/> @@ -309,7 +338,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or <xsl:template match="keywords"> - <xsl:if test="normalize-space(.) != '' and . != 'None'and . != 'none'"> + <xsl:if test="normalize-space(.) != '' and . != 'None' and . != 'none'"> <subject subjectScheme="keyword"> <xsl:value-of select="."/> @@ -318,43 +347,67 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </xsl:template> - <xsl:template match="doi[normalize-space()]"> - <relatedIdentifier relatedIdentifierType="DOI" relationType="Cites" resourceTypeGeneral="JournalArticle"> - <xsl:value-of select="normalize-space(.)"/> - </relatedIdentifier> - </xsl:template> - - - <xsl:template match="references[not(doi[normalize-space()])]"> - <relatedIdentifier relatedIdentifierType="URL" relationType="IsCitedBy"> - <xsl:value-of select="concat('https://zbmath.org/', zbmath/document_id)"/> - </relatedIdentifier> + <xsl:template match="references"> + <xsl:choose> + <!-- If DOI is valid, use DOI --> + <xsl:when test="normalize-space(doi) != '' + and doi != 'None' + and doi != 'none' + and not(contains(doi, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))"> + <relatedIdentifier relatedIdentifierType="DOI" relationType="Cites" resourceTypeGeneral="JournalArticle"> + <xsl:value-of select="normalize-space(doi)"/> + </relatedIdentifier> + </xsl:when> + + <!-- Otherwise, check zbmath/document_id --> + <xsl:when test="zbmath/document_id[normalize-space() + and . != 'None' + and . != 'none' + and not(contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))]"> + <relatedIdentifier relatedIdentifierType="URL" relationType="IsCitedBy"> + <xsl:value-of select="concat('https://zbmath.org/', zbmath/document_id)"/> + </relatedIdentifier> + </xsl:when> + </xsl:choose> </xsl:template> <!-- Template to match references and transform into relatedItems each reference has its own relatedItem node and all of its values goes under this node --> <xsl:template match="references" mode="relatedItems"> + <xsl:if test="(normalize-space(doi) != '' + and doi != 'None' + and doi != 'none' + and not(contains(doi, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))) + or + (normalize-space(zbmath/document_id) != '' + and zbmath/document_id != 'None' + and zbmath/document_id != 'none' + and not(contains(zbmath/document_id, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')))"> <relatedItem relatedItemType="JournalArticle" relationType="Cites"> - <!-- the relatedItemIdentifier should have the same value of identifier as they are in the relatedIdentifiers --> - <relatedItemIdentifier> - <xsl:choose> - <xsl:when test="doi[normalize-space()]"> - <xsl:attribute name="relatedItemIdentifierType">DOI</xsl:attribute> - <xsl:value-of select="doi"/> + + <relatedItemIdentifier> + <xsl:choose> + <xsl:when test="normalize-space(doi) != '' + and doi != 'None' + and doi != 'none' + and not(contains(doi, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses'))"> + <xsl:attribute name="relatedItemIdentifierType">DOI</xsl:attribute> + <xsl:value-of select="doi"/> </xsl:when> - <xsl:otherwise> - <xsl:attribute name="relatedItemIdentifierType">URL</xsl:attribute> - <xsl:value-of select="concat('https://zbmath.org/', zbmath/document_id)"/> + <xsl:otherwise> + <xsl:attribute name="relatedItemIdentifierType">URL</xsl:attribute> + <xsl:value-of select="concat('https://zbmath.org/', zbmath/document_id)"/> </xsl:otherwise> - </xsl:choose> - </relatedItemIdentifier> + </xsl:choose> + </relatedItemIdentifier> + <creators> <xsl:for-each select="zbmath/author_codes"> <creator> <creatorName nameType="Personal"> <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'"> + <xsl:when test="normalize-space(.) = '' or normalize-space(.) = 'None' or normalize-space(.) = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -387,7 +440,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </creatorName> <givenName> <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'"> + <xsl:when test="normalize-space(.) = '' or normalize-space(.) = 'None' or normalize-space(.) = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -412,7 +465,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </givenName> <familyName> <xsl:choose> - <xsl:when test="normalize-space(.) = '' or . = 'None' or . = 'none'"> + <xsl:when test="normalize-space(.) = '' or normalize-space(.) = 'None' or normalize-space(.) = 'none' or contains(., 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <xsl:text>:unav</xsl:text> </xsl:when> <xsl:otherwise> @@ -428,7 +481,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or </creators> <titles> <xsl:choose> - <xsl:when test="normalize-space(text) = '' or text = 'None' or text = 'none'"> + <xsl:when test="normalize-space(text) = '' or text = 'None' or text = 'none' or contains(text, 'zbMATH Open Web Interface contents unavailable due to conflicting licenses')"> <title>:unav @@ -472,7 +525,7 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or - + :unav @@ -481,5 +534,6 @@ Content generated by zbMATH Open, such as reviews, classifications, software, or +