Skip to content

Commit

Permalink
Merge pull request #819 from elifesciences/pr-819
Browse files Browse the repository at this point in the history
Pr 819
  • Loading branch information
fred-atherden authored Feb 17, 2025
2 parents 4f099fc + 489f2b9 commit 19bbc75
Show file tree
Hide file tree
Showing 27 changed files with 467 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/final-JATS-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,7 @@

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-7" test="@xlink:href[not(matches(.,'\p{Zs}'))]" role="error" id="clintrial-related-object-7">[clintrial-related-object-7] <name/> must have an @xlink:href with a value that does not contain a space character.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="contains(.,@document-id/string())" role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not in the text, which is likely incorrect - <value-of select="."/>.</assert>
<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="@document-id = ." role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not the text of the related-object, which is likely incorrect - <value-of select="."/>.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-9" test="matches(@id,'^RO[1-9]')" role="error" id="clintrial-related-object-9">[clintrial-related-object-9] <name/> must have an @id in the format 'RO1'. '<value-of select="@id"/>' does not conform to this convention.</assert>

Expand Down
6 changes: 3 additions & 3 deletions src/final-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11110,9 +11110,9 @@
</xsl:choose>
<!--ASSERT warning-->
<xsl:choose>
<xsl:when test="contains(.,@document-id/string())"/>
<xsl:when test="@document-id = ."/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,@document-id/string())">
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@document-id = .">
<xsl:attribute name="id">clintrial-related-object-8</xsl:attribute>
<xsl:attribute name="see">https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
Expand All @@ -11123,7 +11123,7 @@
<xsl:value-of select="name(.)"/>
<xsl:text/> has an @document-id '<xsl:text/>
<xsl:value-of select="@document-id"/>
<xsl:text/>'. But this is not in the text, which is likely incorrect - <xsl:text/>
<xsl:text/>'. But this is not the text of the related-object, which is likely incorrect - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>.</svrl:text>
</svrl:failed-assert>
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 @@ -2262,7 +2262,7 @@

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-7" test="@xlink:href[not(matches(.,'\p{Zs}'))]" role="error" id="clintrial-related-object-7"><name/> must have an @xlink:href with a value that does not contain a space character.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="contains(.,@document-id/string())" role="warning" id="clintrial-related-object-8"><name/> has an @document-id '<value-of select="@document-id"/>'. But this is not in the text, which is likely incorrect - <value-of select="."/>.</assert>
<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="@document-id = ." role="warning" id="clintrial-related-object-8"><name/> has an @document-id '<value-of select="@document-id"/>'. But this is not the text of the related-object, which is likely incorrect - <value-of select="."/>.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-9" test="matches(@id,'^RO[1-9]')" role="error" id="clintrial-related-object-9"><name/> must have an @id in the format 'RO1'. '<value-of select="@id"/>' does not conform to this convention.</assert>

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 @@ -2201,7 +2201,7 @@

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-7" test="@xlink:href[not(matches(.,'\p{Zs}'))]" role="error" id="clintrial-related-object-7">[clintrial-related-object-7] <name/> must have an @xlink:href with a value that does not contain a space character.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="contains(.,@document-id/string())" role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not in the text, which is likely incorrect - <value-of select="."/>.</assert>
<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8" test="@document-id = ." role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not the text of the related-object, which is likely incorrect - <value-of select="."/>.</assert>

<assert see="https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-9" test="matches(@id,'^RO[1-9]')" role="error" id="clintrial-related-object-9">[clintrial-related-object-9] <name/> must have an @id in the format 'RO1'. '<value-of select="@id"/>' does not conform to this convention.</assert>

Expand Down
6 changes: 3 additions & 3 deletions src/pre-JATS-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10957,9 +10957,9 @@
</xsl:choose>
<!--ASSERT warning-->
<xsl:choose>
<xsl:when test="contains(.,@document-id/string())"/>
<xsl:when test="@document-id = ."/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,@document-id/string())">
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@document-id = .">
<xsl:attribute name="id">clintrial-related-object-8</xsl:attribute>
<xsl:attribute name="see">https://elifeproduction.slab.com/posts/abstracts-digests-and-impact-statements-tiau2k6x#clintrial-related-object-8</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
Expand All @@ -10970,7 +10970,7 @@
<xsl:value-of select="name(.)"/>
<xsl:text/> has an @document-id '<xsl:text/>
<xsl:value-of select="@document-id"/>
<xsl:text/>'. But this is not in the text, which is likely incorrect - <xsl:text/>
<xsl:text/>'. But this is not the text of the related-object, which is likely incorrect - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>.</svrl:text>
</svrl:failed-assert>
Expand Down
7 changes: 7 additions & 0 deletions src/preprint-changes.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,13 @@
<!-- Fixes mistagged and all caps source elements -->
<xsl:template xml:id="ref-source-fixes" match="mixed-citation//source">
<xsl:choose>
<!-- Fix casing for eLife -->
<xsl:when test="matches(lower-case(.),'^\s*elife\s*$') and not(matches(.,'^\s*eLife\s*$'))">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:text>eLife</xsl:text>
</xsl:copy>
</xsl:when>
<xsl:when test="matches(lower-case(.),'^in\s')">
<xsl:choose>
<xsl:when test="(ancestor::mixed-citation/@publication-type=('preprint','journal','other')) and upper-case(.)=.">
Expand Down
12 changes: 10 additions & 2 deletions src/rp-schematron-base.sch
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@
<report test="text()[matches(.,'\p{L}') and not(matches(lower-case(.),'^[\p{Z}\p{P}]+(doi|pmid|and|pp?)[:\.]?'))]"
role="warning"
id="preprint-ref-text-content">This preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has untagged textual content - <value-of select="string-join(text()[matches(.,'\p{L}') and not(matches(lower-case(.),'^[\p{Z}\p{P}]+(doi|pmid|and|pp?)[:\.]?'))],'; ')"/>. Is it tagged correctly?</report>

<report test="volume"
role="error"
id="preprint-ref-volume">This preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a volume - <value-of select="volume"/>. That information is either tagged incorrectly, or the publication-type is wrong.</report>
</rule>

<rule context="mixed-citation[@publication-type='preprint']/source" id="preprint-source-checks">
Expand Down Expand Up @@ -784,6 +788,10 @@
<report test="ancestor::mixed-citation[@publication-type='web']"
role="error"
id="pub-id-check-5">Web reference (with id <value-of select="ancestor::ref/@id"/>) has a <name/> <value-of select="if (@pub-id-type) then concat('with a pub-id-type ',@pub-id-type) else 'with no pub-id-type'"/> (<value-of select="."/>). This must be incorrect. Either the publication-type for the reference needs changing, or the pub-id should be changed to another element.</report>

<report test="@pub-id-type='doi' and ancestor::mixed-citation[@publication-type=('journal','book','preprint')] and matches(following-sibling::text()[1],'^[\.\s]?[\.\s]?[/&lt;&gt;:\d\+\-]')"
role="warning"
id="pub-id-check-6">doi in <value-of select="ancestor::mixed-citation/@publication-type"/> ref is followd by text - '<value-of select="following-sibling::text()[1]"/>'. Should that text be part of the DOI or tagged in some other way?</report>
</rule>

<rule context="ref//pub-id[@pub-id-type='isbn']|isbn" id="isbn-conformity">
Expand Down Expand Up @@ -2022,9 +2030,9 @@
role="error"
id="clintrial-related-object-7"><name/> must have an @xlink:href with a value that does not contain a space character.</assert>

<assert test="contains(.,@document-id/string())"
<assert test="@document-id = ."
role="warning"
id="clintrial-related-object-8"><name/> has an @document-id '<value-of select="@document-id"/>'. But this is not in the text, which is likely incorrect - <value-of select="."/>.</assert>
id="clintrial-related-object-8"><name/> has an @document-id '<value-of select="@document-id"/>'. But this is not the text of the related-object, which is likely incorrect - <value-of select="."/>.</assert>

<assert test="some $x in document($registries)/registries/registry satisfies ($x/subtitle/string()=@source-id)"
role="warning"
Expand Down
6 changes: 5 additions & 1 deletion src/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@
<assert test="article-title" role="error" id="preprint-ref-article-title">[preprint-ref-article-title] This preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has no article-title element.</assert>

<report test="text()[matches(.,'\p{L}') and not(matches(lower-case(.),'^[\p{Z}\p{P}]+(doi|pmid|and|pp?)[:\.]?'))]" role="warning" id="preprint-ref-text-content">[preprint-ref-text-content] This preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has untagged textual content - <value-of select="string-join(text()[matches(.,'\p{L}') and not(matches(lower-case(.),'^[\p{Z}\p{P}]+(doi|pmid|and|pp?)[:\.]?'))],'; ')"/>. Is it tagged correctly?</report>

<report test="volume" role="error" id="preprint-ref-volume">[preprint-ref-volume] This preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a volume - <value-of select="volume"/>. That information is either tagged incorrectly, or the publication-type is wrong.</report>
</rule></pattern><pattern id="preprint-source-checks-pattern"><rule context="mixed-citation[@publication-type='preprint']/source" id="preprint-source-checks">
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')" role="warning" id="preprint-source">[preprint-source] Preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that starts with 'In ', '<value-of select="."/>'. Should that text be moved out of the source? And is it a different type of reference?</report>

Expand Down Expand Up @@ -462,6 +464,8 @@
<report test="ancestor::mixed-citation[@publication-type='preprint'] and not(@pub-id-type=('doi','pmid','pmcid','arxiv'))" role="error" id="pub-id-check-4">[pub-id-check-4] <name/> is within a journal reference, but it does not have one of the following permitted @pub-id-type values: 'doi','pmid','pmcid','arxiv'.</report>

<report test="ancestor::mixed-citation[@publication-type='web']" role="error" id="pub-id-check-5">[pub-id-check-5] Web reference (with id <value-of select="ancestor::ref/@id"/>) has a <name/> <value-of select="if (@pub-id-type) then concat('with a pub-id-type ',@pub-id-type) else 'with no pub-id-type'"/> (<value-of select="."/>). This must be incorrect. Either the publication-type for the reference needs changing, or the pub-id should be changed to another element.</report>

<report test="@pub-id-type='doi' and ancestor::mixed-citation[@publication-type=('journal','book','preprint')] and matches(following-sibling::text()[1],'^[\.\s]?[\.\s]?[/&lt;&gt;:\d\+\-]')" role="warning" id="pub-id-check-6">[pub-id-check-6] doi in <value-of select="ancestor::mixed-citation/@publication-type"/> ref is followd by text - '<value-of select="following-sibling::text()[1]"/>'. Should that text be part of the DOI or tagged in some other way?</report>
</rule></pattern><pattern id="isbn-conformity-pattern"><rule context="ref//pub-id[@pub-id-type='isbn']|isbn" id="isbn-conformity">
<let name="t" value="translate(.,'-','')"/>
<let name="sum" value="e:isbn-sum($t)"/>
Expand Down Expand Up @@ -1069,7 +1073,7 @@

<assert test="@xlink:href[not(matches(.,'\p{Zs}'))]" role="error" id="clintrial-related-object-7">[clintrial-related-object-7] <name/> must have an @xlink:href with a value that does not contain a space character.</assert>

<assert test="contains(.,@document-id/string())" role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not in the text, which is likely incorrect - <value-of select="."/>.</assert>
<assert test="@document-id = ." role="warning" id="clintrial-related-object-8">[clintrial-related-object-8] <name/> has an @document-id '<value-of select="@document-id"/>'. But this is not the text of the related-object, which is likely incorrect - <value-of select="."/>.</assert>

<assert test="some $x in document($registries)/registries/registry satisfies ($x/subtitle/string()=@source-id)" role="warning" id="clintrial-related-object-11">[clintrial-related-object-11] <name/> @source-id value should almost always be one of the subtitles of the Crossref clinical trial registries. "<value-of select="@source-id"/>" is not one of the following <value-of select="string-join(for $x in document($registries)/registries/registry return concat('&quot;',$x/subtitle/string(),'&quot; (',$x/doi/string(),')'),', ')"/>. Is that correct?</assert>

Expand Down
36 changes: 33 additions & 3 deletions src/rp-schematron.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,21 @@
<xsl:text/>. Is it tagged correctly?</svrl:text>
</svrl:successful-report>
</xsl:if>
<!--REPORT error-->
<xsl:if test="volume">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="volume">
<xsl:attribute name="id">preprint-ref-volume</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>[preprint-ref-volume] This preprint reference (<xsl:text/>
<xsl:value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>
<xsl:text/>) has a volume - <xsl:text/>
<xsl:value-of select="volume"/>
<xsl:text/>. That information is either tagged incorrectly, or the publication-type is wrong.</svrl:text>
</svrl:successful-report>
</xsl:if>
<xsl:apply-templates select="*" mode="M35"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M35"/>
Expand Down Expand Up @@ -3611,6 +3626,21 @@
<xsl:text/>). This must be incorrect. Either the publication-type for the reference needs changing, or the pub-id should be changed to another element.</svrl:text>
</svrl:successful-report>
</xsl:if>
<!--REPORT warning-->
<xsl:if test="@pub-id-type='doi' and ancestor::mixed-citation[@publication-type=('journal','book','preprint')] and matches(following-sibling::text()[1],'^[\.\s]?[\.\s]?[/&lt;&gt;:\d\+\-]')">
<svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@pub-id-type='doi' and ancestor::mixed-citation[@publication-type=('journal','book','preprint')] and matches(following-sibling::text()[1],'^[\.\s]?[\.\s]?[/&lt;&gt;:\d\+\-]')">
<xsl:attribute name="id">pub-id-check-6</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>[pub-id-check-6] doi in <xsl:text/>
<xsl:value-of select="ancestor::mixed-citation/@publication-type"/>
<xsl:text/> ref is followd by text - '<xsl:text/>
<xsl:value-of select="following-sibling::text()[1]"/>
<xsl:text/>'. Should that text be part of the DOI or tagged in some other way?</svrl:text>
</svrl:successful-report>
</xsl:if>
<xsl:apply-templates select="*" mode="M50"/>
</xsl:template>
<xsl:template match="text()" priority="-1" mode="M50"/>
Expand Down Expand Up @@ -7630,9 +7660,9 @@
</xsl:choose>
<!--ASSERT warning-->
<xsl:choose>
<xsl:when test="contains(.,@document-id/string())"/>
<xsl:when test="@document-id = ."/>
<xsl:otherwise>
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="contains(.,@document-id/string())">
<svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@document-id = .">
<xsl:attribute name="id">clintrial-related-object-8</xsl:attribute>
<xsl:attribute name="role">warning</xsl:attribute>
<xsl:attribute name="location">
Expand All @@ -7642,7 +7672,7 @@
<xsl:value-of select="name(.)"/>
<xsl:text/> has an @document-id '<xsl:text/>
<xsl:value-of select="@document-id"/>
<xsl:text/>'. But this is not in the text, which is likely incorrect - <xsl:text/>
<xsl:text/>'. But this is not the text of the related-object, which is likely incorrect - <xsl:text/>
<xsl:value-of select="."/>
<xsl:text/>.</svrl:text>
</svrl:failed-assert>
Expand Down
Loading

0 comments on commit 19bbc75

Please sign in to comment.