Skip to content

Commit

Permalink
Merge pull request #765 from elifesciences/pr-766
Browse files Browse the repository at this point in the history
VOR - account for sub-articles in dupe orcid tests
  • Loading branch information
fred-atherden authored Dec 10, 2024
2 parents ff2e8b5 + 9d6a0e2 commit e5955c9
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@



<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)" role="error" id="final-orcid-test-3">[final-orcid-test-3] <value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</report>
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1" role="error" id="final-orcid-test-3">[final-orcid-test-3] <value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</assert>

</rule></pattern><pattern id="email-tests-pattern"><rule context="article-meta//email" id="email-tests">

Expand Down
33 changes: 18 additions & 15 deletions src/final-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9143,21 +9143,24 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<!--REPORT error-->
<xsl:if test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)">
<xsl:attribute name="id">final-orcid-test-3</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[final-orcid-test-3] <xsl:text/>
<xsl:value-of select="e:get-name(parent::*/name[1])"/>
<xsl:text/>'s ORCiD is the same as another author's - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</svrl:text>
</svrl:successful-report>
</xsl:if>
<!--ASSERT error-->
<xsl:choose>
<xsl:when test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1">
<xsl:attribute name="id">final-orcid-test-3</xsl:attribute>
<xsl:attribute name="role">error</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[final-orcid-test-3] <xsl:text/>
<xsl:value-of select="e:get-name(parent::*/name[1])"/>
<xsl:text/>'s ORCiD is the same as another author's - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*" mode="M107"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M107"/>
Expand Down
2 changes: 1 addition & 1 deletion src/final-package-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@



<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)" role="error" id="final-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</report>
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1" role="error" id="final-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</assert>

</rule></pattern><pattern id="email-tests-pattern"><rule context="article-meta//email" id="email-tests">

Expand Down
2 changes: 1 addition & 1 deletion src/pre-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@
<!-- Needs updating to only allow https when this is implemented -->
<assert test="matches(.,'^http[s]?://orcid.org/[\d]{4}-[\d]{4}-[\d]{4}-[\d]{3}[0-9X]$')" role="error" id="orcid-test-2">[orcid-test-2] contrib-id[@contrib-id-type="orcid"] must contain a valid ORCID URL in the format 'https://orcid.org/0000-0000-0000-0000'</assert>

<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)" role="warning" id="pre-orcid-test-3">[pre-orcid-test-3] <value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(preceding::contrib-id[@contrib-id-type='orcid' and text()=$text]) + count(following::contrib-id[@contrib-id-type='orcid' and text()=$text]) + 1"/> authors. Please confirm which author this ORCiD belongs to.'.</report>
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1" role="warning" id="pre-orcid-test-3">[pre-orcid-test-3] <value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text])"/> authors. Please confirm which author this ORCiD belongs to.'.</assert>



Expand Down
41 changes: 22 additions & 19 deletions src/pre-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9034,25 +9034,28 @@
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<!--REPORT warning-->
<xsl:if test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)">
<xsl:attribute name="id">pre-orcid-test-3</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[pre-orcid-test-3] <xsl:text/>
<xsl:value-of select="e:get-name(parent::*/name[1])"/>
<xsl:text/>'s ORCiD is the same as another author's - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/> - is associated with <xsl:text/>
<xsl:value-of select="count(preceding::contrib-id[@contrib-id-type='orcid' and text()=$text]) + count(following::contrib-id[@contrib-id-type='orcid' and text()=$text]) + 1"/>
<xsl:text/> authors. Please confirm which author this ORCiD belongs to.'.</svrl:text>
</svrl:successful-report>
</xsl:if>
<!--ASSERT warning-->
<xsl:choose>
<xsl:when test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1"/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1">
<xsl:attribute name="id">pre-orcid-test-3</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
<xsl:apply-templates select="." mode="schematron-select-full-path"/>
</xsl:attribute>
<svrl:text>[pre-orcid-test-3] <xsl:text/>
<xsl:value-of select="e:get-name(parent::*/name[1])"/>
<xsl:text/>'s ORCiD is the same as another author's - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/> - is associated with <xsl:text/>
<xsl:value-of select="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text])"/>
<xsl:text/> authors. Please confirm which author this ORCiD belongs to.'.</svrl:text>
</svrl:failed-assert>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*" mode="M105"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M105"/>
Expand Down
8 changes: 4 additions & 4 deletions src/schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2551,13 +2551,13 @@
role="error"
id="orcid-test-2">contrib-id[@contrib-id-type="orcid"] must contain a valid ORCID URL in the format 'https://orcid.org/0000-0000-0000-0000'</assert>

<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)"
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1"
role="warning"
id="pre-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(preceding::contrib-id[@contrib-id-type='orcid' and text()=$text]) + count(following::contrib-id[@contrib-id-type='orcid' and text()=$text]) + 1"/> authors. Please confirm which author this ORCiD belongs to.'.</report>
id="pre-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text])"/> authors. Please confirm which author this ORCiD belongs to.'.</assert>

<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)"
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1"
role="error"
id="final-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</report>
id="final-orcid-test-3"><value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</assert>

</rule>

Expand Down
2 changes: 1 addition & 1 deletion test/tests/gen/orcid-tests/final-orcid-test-3/fail.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="final-orcid-test-3.sch"?>
<!--Context: contrib-id[@contrib-id-type='orcid']
Test: report (preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)
Test: assert count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1
Message: 's ORCiD is the same as another author's - . Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,8 @@
<pattern id="article-metadata">
<rule context="contrib-id[@contrib-id-type='orcid']" id="orcid-tests">
<let name="text" value="."/>
<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)" role="error" id="final-orcid-test-3">
<value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</report>
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1" role="error" id="final-orcid-test-3">
<value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors.</assert>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
2 changes: 1 addition & 1 deletion test/tests/gen/orcid-tests/final-orcid-test-3/pass.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="final-orcid-test-3.sch"?>
<!--Context: contrib-id[@contrib-id-type='orcid']
Test: report (preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)
Test: assert count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1
Message: 's ORCiD is the same as another author's - . Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please raise a query with production so that they can raise it with the authors. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/gen/orcid-tests/pre-orcid-test-3/fail.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="pre-orcid-test-3.sch"?>
<!--Context: contrib-id[@contrib-id-type='orcid']
Test: report (preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)
Test: assert count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1
Message: 's ORCiD is the same as another author's - . Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - - is associated with authors. Please confirm which author this ORCiD belongs to.'. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/gen/orcid-tests/pre-orcid-test-3/pass.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?oxygen SCHSchema="pre-orcid-test-3.sch"?>
<!--Context: contrib-id[@contrib-id-type='orcid']
Test: report (preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)
Test: assert count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1
Message: 's ORCiD is the same as another author's - . Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - - is associated with authors. Please confirm which author this ORCiD belongs to.'. -->
<root xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<article>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1363,8 +1363,8 @@
<pattern id="article-metadata">
<rule context="contrib-id[@contrib-id-type='orcid']" id="orcid-tests">
<let name="text" value="."/>
<report test="(preceding::contrib-id[@contrib-id-type='orcid']/text() = $text) or (following::contrib-id[@contrib-id-type='orcid']/text() = $text)" role="warning" id="pre-orcid-test-3">
<value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(preceding::contrib-id[@contrib-id-type='orcid' and text()=$text]) + count(following::contrib-id[@contrib-id-type='orcid' and text()=$text]) + 1"/> authors. Please confirm which author this ORCiD belongs to.'.</report>
<assert test="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text]) = 1" role="warning" id="pre-orcid-test-3">
<value-of select="e:get-name(parent::*/name[1])"/>'s ORCiD is the same as another author's - <value-of select="."/>. Duplicated ORCiDs are not allowed. If it is clear who the ORCiD belongs to, remove the duplicate. If it is not clear please add an author query - 'This ORCiD - <value-of select="."/> - is associated with <value-of select="count(ancestor::contrib-group//contrib-id[@contrib-id-type='orcid' and .=$text])"/> authors. Please confirm which author this ORCiD belongs to.'.</assert>
</rule>
</pattern>
<pattern id="root-pattern">
Expand Down
Loading

0 comments on commit e5955c9

Please sign in to comment.