From f7e3f3b97d92d026661230a86feca59d68b2dfc4 Mon Sep 17 00:00:00 2001
From: Fred Atherden <43879983+fred-atherden@users.noreply.github.com>
Date: Mon, 18 Nov 2024 15:40:29 +0000
Subject: [PATCH] RP - check rp version against preprint version
---
src/rp-schematron-base.sch | 9 +
src/rp-schematron.sch | 5 +
src/rp-schematron.xsl | 626 ++++++++++--------
.../article-version-12/article-version-12.sch | 159 +++++
.../article-version-12/fail.xml | 20 +
.../article-version-12/pass.xml | 20 +
test/xspec/rp-schematron.sch | 9 +
test/xspec/rp-schematron.xspec | 12 +
8 files changed, 566 insertions(+), 294 deletions(-)
create mode 100644 test/tests/rp/rp-and-preprint-version-checks/article-version-12/article-version-12.sch
create mode 100644 test/tests/rp/rp-and-preprint-version-checks/article-version-12/fail.xml
create mode 100644 test/tests/rp/rp-and-preprint-version-checks/article-version-12/pass.xml
diff --git a/src/rp-schematron-base.sch b/src/rp-schematron-base.sch
index 51ca076ac5..c2a1701a47 100644
--- a/src/rp-schematron-base.sch
+++ b/src/rp-schematron-base.sch
@@ -1176,6 +1176,15 @@
role="error"
id="article-version-10">article-version-alternatives must contain a <article-version article-version-type="publication-state">.
+
+
+
+
+
+ This is Reviewed Preprint version , but according to the article-version, it's based on preprint version . This cannot be correct.
+
[article-version-9] article-version-alternatives must contain a <article-version article-version-type="preprint-version">.
[article-version-10] article-version-alternatives must contain a <article-version article-version-type="publication-state">.
+
+
+
+
+ [article-version-12] This is Reviewed Preprint version , but according to the article-version, it's based on preprint version . This cannot be correct.
[preprint-pub-date-1] This preprint version was posted in . Is it the correct version that corresponds to the version submitted to eLife?
diff --git a/src/rp-schematron.xsl b/src/rp-schematron.xsl
index 9ede096a7d..71118e01a2 100644
--- a/src/rp-schematron.xsl
+++ b/src/rp-schematron.xsl
@@ -851,6 +851,15 @@
+
+
+
+
+ rp-and-preprint-version-checks-pattern
+ rp-and-preprint-version-checks-pattern
+
+
+
@@ -859,7 +868,7 @@
preprint-pub-checks-pattern
-
+
@@ -868,7 +877,7 @@
contrib-checks-pattern
-
+
@@ -877,7 +886,7 @@
volume-test-pattern
-
+
@@ -886,7 +895,7 @@
elocation-id-test-pattern
-
+
@@ -895,7 +904,7 @@
history-tests-pattern
-
+
@@ -904,7 +913,7 @@
pub-history-tests-pattern
-
+
@@ -913,7 +922,7 @@
event-tests-pattern
-
+
@@ -922,7 +931,7 @@
event-child-tests-pattern
-
+
@@ -931,7 +940,7 @@
rp-event-tests-pattern
-
+
@@ -940,7 +949,7 @@
event-desc-tests-pattern
-
+
@@ -949,7 +958,7 @@
event-date-tests-pattern
-
+
@@ -958,7 +967,7 @@
event-self-uri-tests-pattern
-
+
@@ -967,7 +976,7 @@
abstract-checks-pattern
-
+
@@ -976,7 +985,7 @@
abstract-child-checks-pattern
-
+
@@ -985,7 +994,7 @@
front-permissions-tests-pattern
-
+
@@ -994,7 +1003,7 @@
cc-by-permissions-tests-pattern
-
+
@@ -1003,7 +1012,7 @@
cc-0-permissions-tests-pattern
-
+
@@ -1012,7 +1021,7 @@
license-tests-pattern
-
+
@@ -1021,7 +1030,7 @@
license-p-tests-pattern
-
+
@@ -1030,7 +1039,7 @@
license-link-tests-pattern
-
+
@@ -1039,7 +1048,7 @@
license-ali-ref-link-tests-pattern
-
+
@@ -1048,7 +1057,7 @@
digest-title-checks-pattern
-
+
@@ -1057,7 +1066,7 @@
preformat-checks-pattern
-
+
@@ -1066,7 +1075,7 @@
code-checks-pattern
-
+
@@ -1075,7 +1084,7 @@
uri-checks-pattern
-
+
@@ -1084,7 +1093,7 @@
xref-checks-pattern
-
+
@@ -1093,7 +1102,7 @@
ext-link-tests-pattern
-
+
@@ -1102,7 +1111,7 @@
ext-link-tests-2-pattern
-
+
@@ -1111,7 +1120,7 @@
footnote-checks-pattern
-
+
@@ -1120,7 +1129,7 @@
unallowed-symbol-tests-pattern
-
+
@@ -1129,7 +1138,7 @@
ed-report-front-stub-pattern
-
+
@@ -1138,7 +1147,7 @@
ed-report-kwd-group-pattern
-
+
@@ -1147,7 +1156,7 @@
ed-report-kwds-pattern
-
+
@@ -1156,7 +1165,7 @@
ed-report-claim-kwds-pattern
-
+
@@ -1165,7 +1174,7 @@
ed-report-evidence-kwds-pattern
-
+
@@ -1174,7 +1183,7 @@
ed-report-bold-terms-pattern
-
+
@@ -1183,7 +1192,7 @@
ar-bold-checks-pattern
-
+
@@ -1192,7 +1201,7 @@
arxiv-journal-meta-checks-pattern
-
+
@@ -1201,7 +1210,7 @@
arxiv-doi-checks-pattern
-
+
@@ -1210,7 +1219,7 @@
res-square-journal-meta-checks-pattern
-
+
@@ -1219,7 +1228,7 @@
res-square-doi-checks-pattern
-
+
@@ -1228,7 +1237,7 @@
psyarxiv-journal-meta-checks-pattern
-
+
@@ -1237,7 +1246,7 @@
psyarxiv-doi-checks-pattern
-
+
@@ -1246,7 +1255,7 @@
osf-journal-meta-checks-pattern
-
+
@@ -1255,7 +1264,7 @@
osf-doi-checks-pattern
-
+
@@ -1264,7 +1273,7 @@
ecoevorxiv-journal-meta-checks-pattern
-
+
@@ -1273,7 +1282,7 @@
ecoevorxiv-doi-checks-pattern
-
+
@@ -1282,7 +1291,7 @@
authorea-journal-meta-checks-pattern
-
+
@@ -1291,7 +1300,7 @@
authorea-doi-checks-pattern
-
+
@@ -4637,9 +4646,38 @@
+
+
+
+
+
+
+
+
+
+
+ article-version-12
+ error
+
+
+
+ [article-version-12] This is Reviewed Preprint version
+
+ , but according to the article-version, it's based on preprint version
+
+ . This cannot be correct.
+
+
+
+
+
+
+
+
+
-
+
@@ -4657,15 +4695,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -4715,15 +4753,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -4739,15 +4777,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -4782,15 +4820,15 @@
).
-
+
-
-
-
+
+
+
-
+
@@ -4819,15 +4857,15 @@
date.
-
+
-
-
-
+
+
+
-
+
@@ -4915,15 +4953,15 @@
reviewed preprint event elements, which is unusual. Is this correct?
-
+
-
-
-
+
+
+
-
+
@@ -5003,15 +5041,15 @@
. These values should be the same, so one (or both of them) are incorrect.
-
+
-
-
-
+
+
+
-
+
@@ -5031,15 +5069,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5127,15 +5165,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5184,15 +5222,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -5226,15 +5264,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5427,15 +5465,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -5513,15 +5551,15 @@
', which is a permitted value, but it is not the only abstract with that type. It is very unlikely that two abstracts with the same abstract-type are required.
-
+
-
-
-
+
+
+
-
+
@@ -5539,15 +5577,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5612,15 +5650,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5745,15 +5783,15 @@
). Should it be CC0 instead?
-
+
-
-
-
+
+
+
-
+
@@ -5803,15 +5841,15 @@
) which is not correct.
-
+
-
-
-
+
+
+
-
+
@@ -5843,15 +5881,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5886,15 +5924,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -5915,15 +5953,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5943,15 +5981,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -5968,15 +6006,15 @@
. If this is referring to an plain language summary written by the authors it should be renamed to plain language summary (or similar) in order to not suggest to readers this was written by the features team.
-
+
-
-
-
+
+
+
-
+
@@ -5989,15 +6027,15 @@
[preformat-flag] Please check whether the content in this preformat element has been captured crrectly (and is rendered approriately).
-
+
-
-
-
+
+
+
-
+
@@ -6010,15 +6048,15 @@
[code-flag] Please check whether the content in this code element has been captured crrectly (and is rendered approriately).
-
+
-
-
-
+
+
+
-
+
@@ -6031,15 +6069,15 @@
[uri-flag] The uri element is not permitted. Instead use ext-link with the attribute link-type="uri".
-
+
-
-
-
+
+
+
-
+
@@ -6067,15 +6105,15 @@
' is a child of another xref. Nested xrefs are not supported - it must be either stripped or moved so that it is a child of another element.
-
+
-
-
-
+
+
+
-
+
@@ -6205,15 +6243,15 @@
'.
-
+
-
-
-
+
+
+
-
+
@@ -6232,15 +6270,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6256,15 +6294,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6388,15 +6426,15 @@
element contains what looks like a response from an AI chatbot after it being provided a prompt. Is that correct? Should the content be adjusted?
-
+
-
-
-
+
+
+
-
+
@@ -6426,15 +6464,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6486,15 +6524,15 @@
. This is unusual, please check this is correct.
-
+
-
-
-
+
+
+
-
+
@@ -6542,15 +6580,15 @@
.
-
+
-
-
-
+
+
+
-
+
@@ -6571,15 +6609,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6600,15 +6638,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6661,15 +6699,15 @@
. This is very likely to be incorrect.
-
+
-
-
-
+
+
+
-
+
@@ -6688,15 +6726,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6768,15 +6806,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6794,15 +6832,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6874,15 +6912,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6900,15 +6938,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6966,15 +7004,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -6992,15 +7030,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7058,15 +7096,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7084,15 +7122,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7150,15 +7188,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7176,15 +7214,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7242,15 +7280,15 @@
-
+
-
-
-
+
+
+
-
+
@@ -7268,10 +7306,10 @@
-
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/test/tests/rp/rp-and-preprint-version-checks/article-version-12/article-version-12.sch b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/article-version-12.sch
new file mode 100644
index 0000000000..c50308096a
--- /dev/null
+++ b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/article-version-12.sch
@@ -0,0 +1,159 @@
+
+ eLife reviewed preprint schematron
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [article-version-12] This is Reviewed Preprint version , but according to the article-version, it's based on preprint version . This cannot be correct.
+
+
+
+
+ article/front[journal-meta/journal-id='elife']/article-meta[matches(replace(article-id[@specific-use='version'][1],'^.*\.',''),'^\d\d?$') and matches(descendant::article-version[@article-version-type='preprint-version'][1],'^1\.\d+$')] must be present.
+
+
+
\ No newline at end of file
diff --git a/test/tests/rp/rp-and-preprint-version-checks/article-version-12/fail.xml b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/fail.xml
new file mode 100644
index 0000000000..a4902777b2
--- /dev/null
+++ b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/fail.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ elife
+
+
+ 10.7554/eLife.1234321.2
+
+ reviewed preprint
+ 1.1
+
+
+
+
+
\ No newline at end of file
diff --git a/test/tests/rp/rp-and-preprint-version-checks/article-version-12/pass.xml b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/pass.xml
new file mode 100644
index 0000000000..38bea4d0c3
--- /dev/null
+++ b/test/tests/rp/rp-and-preprint-version-checks/article-version-12/pass.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ elife
+
+
+ 10.7554/eLife.1234321.2
+
+ reviewed preprint
+ 1.2
+
+
+
+
+
\ No newline at end of file
diff --git a/test/xspec/rp-schematron.sch b/test/xspec/rp-schematron.sch
index 32722d9515..2b8708f9d3 100644
--- a/test/xspec/rp-schematron.sch
+++ b/test/xspec/rp-schematron.sch
@@ -869,6 +869,14 @@
article-version-alternatives must contain a <article-version article-version-type="publication-state">.
+
+
+
+
+
+ This is Reviewed Preprint version , but according to the article-version, it's based on preprint version . This cannot be correct.
+
+
This preprint version was posted in . Is it the correct version that corresponds to the version submitted to eLife?
@@ -1512,6 +1520,7 @@
article/front/article-meta/author-notes/fn must be present.
article/front/article-meta//article-version must be present.
article/front/article-meta/article-version-alternatives must be present.
+ article/front[journal-meta/journal-id='elife']/article-meta[matches(replace(article-id[@specific-use='version'][1],'^.*\.',''),'^\d\d?$') and matches(descendant::article-version[@article-version-type='preprint-version'][1],'^1\.\d+$')] must be present.
article/front/article-meta/pub-date[@pub-type='epub']/year must be present.
article/front/article-meta/contrib-group/contrib must be present.
front[journal-meta/lower-case(journal-id[1])='elife']/article-meta/volume must be present.
diff --git a/test/xspec/rp-schematron.xspec b/test/xspec/rp-schematron.xspec
index ef60136e37..7a61541f2f 100644
--- a/test/xspec/rp-schematron.xspec
+++ b/test/xspec/rp-schematron.xspec
@@ -1976,6 +1976,18 @@
+
+
+
+
+
+
+
+
+
+
+
+