Skip to content

Commit

Permalink
Merge pull request #750 from elifesciences/pr-750
Browse files Browse the repository at this point in the history
Update abstract checks for Reviewed preprints
  • Loading branch information
fred-atherden authored Nov 21, 2024
2 parents 6bc7947 + 71d899d commit 53e1802
Show file tree
Hide file tree
Showing 18 changed files with 52,650 additions and 223 deletions.
25,955 changes: 25,955 additions & 0 deletions src/languages.xml

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions src/rp-schematron-base.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1418,9 +1418,9 @@
<pattern id="abstracts">
<rule context="abstract[parent::article-meta]" id="abstract-checks">
<let name="allowed-types" value="('structured','plain-language-summary','teaser','summary','graphical')"/>
<report test="preceding::abstract[not(@abstract-type)] and not(@abstract-type)"
<report test="preceding::abstract[not(@abstract-type) and not(@xml:lang)] and not(@abstract-type) and not(@xml:lang)"
role="error"
id="abstract-test-1">There should only be one abstract without an abstract-type (for the common-garden abstract). This asbtract does not have an abstract-type, but there is also a preceding abstract without an abstract-type. One of these needs to be given an abstract-type with the allowed values ('structured' for a syrctured abstract with sections; 'plain-language-summary' for a digest or author provided plain summary; 'teaser' for an impact statement; 'summary' for a general summary that's in addition to the common-garden abstract; 'graphical' for a graphical abstract).</report>
id="abstract-test-1">There should only be one abstract without an abstract-type attribute (for the common-garden abstract) or xml:lang attirbute (for common-garden abstract in a language other than english). This asbtract does not have an abstract-type, but there is also a preceding abstract without an abstract-type or xml:lang. One of these needs to be given an abstract-type with the allowed values ('structured' for a syrctured abstract with sections; 'plain-language-summary' for a digest or author provided plain summary; 'teaser' for an impact statement; 'summary' for a general summary that's in addition to the common-garden abstract; 'graphical' for a graphical abstract).</report>

<report test="@abstract-type and not(@abstract-type=$allowed-types)"
role="error"
Expand Down Expand Up @@ -1449,6 +1449,19 @@
role="error"
id="abstract-child-test-1"><name/> is not permitted within abstract.</assert>
</rule>

<rule context="abstract[@xml:lang]" id="abstract-lang-checks">
<let name="xml-lang-value" value="@xml:lang"/>
<let name="languages" value="'languages.xml'"/>
<let name="subtag-description" value="string-join(document($languages)//*:item[@subtag=$xml-lang-value]/*:description,' / ')"/>
<assert test="$subtag-description!=''"
role="error"
id="abstract-lang-test-1">The xml:lang attribute on <name/> must contain one of the IETF RFC 5646 subtags. '<value-of select="@xml:lang"/>' is not one of these values.</assert>

<report test="$subtag-description!=''"
role="warning"
id="abstract-lang-test-2"><name/> has an xml:lang attribute with the value '<value-of select="$xml-lang-value"/>', which corresponds to the following language: <value-of select="$subtag-description"/>. Please check this is correct.</report>
</rule>
</pattern>

<pattern id="permissions">
Expand Down
9 changes: 8 additions & 1 deletion src/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@

<pattern id="abstract-checks-pattern"><rule context="abstract[parent::article-meta]" id="abstract-checks">
<let name="allowed-types" value="('structured','plain-language-summary','teaser','summary','graphical')"/>
<report test="preceding::abstract[not(@abstract-type)] and not(@abstract-type)" role="error" id="abstract-test-1">[abstract-test-1] There should only be one abstract without an abstract-type (for the common-garden abstract). This asbtract does not have an abstract-type, but there is also a preceding abstract without an abstract-type. One of these needs to be given an abstract-type with the allowed values ('structured' for a syrctured abstract with sections; 'plain-language-summary' for a digest or author provided plain summary; 'teaser' for an impact statement; 'summary' for a general summary that's in addition to the common-garden abstract; 'graphical' for a graphical abstract).</report>
<report test="preceding::abstract[not(@abstract-type) and not(@xml:lang)] and not(@abstract-type) and not(@xml:lang)" role="error" id="abstract-test-1">[abstract-test-1] There should only be one abstract without an abstract-type attribute (for the common-garden abstract) or xml:lang attirbute (for common-garden abstract in a language other than english). This asbtract does not have an abstract-type, but there is also a preceding abstract without an abstract-type or xml:lang. One of these needs to be given an abstract-type with the allowed values ('structured' for a syrctured abstract with sections; 'plain-language-summary' for a digest or author provided plain summary; 'teaser' for an impact statement; 'summary' for a general summary that's in addition to the common-garden abstract; 'graphical' for a graphical abstract).</report>

<report test="@abstract-type and not(@abstract-type=$allowed-types)" role="error" id="abstract-test-2">[abstract-test-2] abstract has an abstract-type (<value-of select="@abstract-type"/>), but it's not one of the permiited values: <value-of select="string-join($allowed-types,'; ')"/>.</report>

Expand All @@ -790,6 +790,13 @@
</rule></pattern><pattern id="abstract-child-checks-pattern"><rule context="abstract[parent::article-meta]/*" id="abstract-child-checks">
<let name="allowed-children" value="('label','title','sec','p','fig','list')"/>
<assert test="name()=$allowed-children" role="error" id="abstract-child-test-1">[abstract-child-test-1] <name/> is not permitted within abstract.</assert>
</rule></pattern><pattern id="abstract-lang-checks-pattern"><rule context="abstract[@xml:lang]" id="abstract-lang-checks">
<let name="xml-lang-value" value="@xml:lang"/>
<let name="languages" value="'languages.xml'"/>
<let name="subtag-description" value="string-join(document($languages)//*:item[@subtag=$xml-lang-value]/*:description,' / ')"/>
<assert test="$subtag-description!=''" role="error" id="abstract-lang-test-1">[abstract-lang-test-1] The xml:lang attribute on <name/> must contain one of the IETF RFC 5646 subtags. '<value-of select="@xml:lang"/>' is not one of these values.</assert>

<report test="$subtag-description!=''" role="warning" id="abstract-lang-test-2">[abstract-lang-test-2] <name/> has an xml:lang attribute with the value '<value-of select="$xml-lang-value"/>', which corresponds to the following language: <value-of select="$subtag-description"/>. Please check this is correct.</report>
</rule></pattern>

<pattern id="front-permissions-tests-pattern"><rule context="front[journal-meta/lower-case(journal-id[1])='elife']//permissions" id="front-permissions-tests">
Expand Down
Loading

0 comments on commit 53e1802

Please sign in to comment.