Skip to content

Commit

Permalink
RP - conference checks and more 'In ' type ref checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-atherden committed Dec 9, 2024
1 parent ea9ab5b commit c5063d6
Show file tree
Hide file tree
Showing 28 changed files with 1,401 additions and 706 deletions.
36 changes: 27 additions & 9 deletions src/rp-schematron-base.sch
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@

<report test="matches(lower-case(.),'^in[^a-z]')"
role="warning"
id="journal-source-4">Journal reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source? And is it a different type of reference?</report>
id="journal-source-4">Journal 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>
</rule>
</pattern>

Expand All @@ -514,9 +514,9 @@
</rule>

<rule context="mixed-citation[@publication-type='preprint']/source" id="preprint-source-checks">
<report test="matches(lower-case(.),'^in[^a-z]')"
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')"
role="warning"
id="preprint-source">Preprint reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source? And is it a different type of reference?</report>
id="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>
</rule>
</pattern>

Expand Down Expand Up @@ -545,19 +545,37 @@
role="warning"
id="book-source-1">The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) contains 'chapter' - <value-of select="."/>. Are the details captured correctly?</report>

<report test="matches(lower-case(.),'\.\s+in:\s+')"
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')"
role="warning"
id="book-source-2">The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) contains '. In: ' - <value-of select="."/>. Are the details captured correctly?</report>
id="book-source-2">The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) starts with 'In: ' - <value-of select="."/>. Are the details captured correctly?</report>

<report test="matches(lower-case(.),'^(symposium|conference|proc\.?|proceeding|meeting|workshop)|\s?(symposium|conference|proc\.?|proceeding|meeting|workshop)\s?|(symposium|conference|proc\.?|proceeding|meeting|workshop)$')"
role="warning"
id="book-source-3">Book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has the following source, '<value-of select="."/>'. Should it be captured as a conference proceeding instead?</report>

<report test="matches(lower-case(.),'^in[^a-z]')"
role="warning"
id="book-source-4">Book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source?</report>
</rule>
</pattern>

<pattern id="confproc-ref">
<rule context="mixed-citation[@publication-type='confproc']" id="confproc-ref-checks">
<assert test="conf-name"
role="error"
id="confproc-ref-conf-name">This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has no conf-name element.</assert>

<report test="count(conf-name) gt 1"
role="error"
id="confproc-ref-conf-name-2">This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has more than 1 conf-name element.</report>

<assert test="article-title"
role="warning"
id="confproc-ref-article-title">This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has no article-title element.</assert>
</rule>

<rule context="mixed-citation[@publication-type='confproc']/conf-name" id="confproc-conf-name-checks">
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')"
role="warning"
id="confproc-conf-name">The conf-name in conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) starts with 'In: ' - <value-of select="."/>. Are the details captured correctly?</report>
</rule>
</pattern>

<pattern id="ref-labels">
<rule context="ref-list" id="ref-list-checks">
Expand Down
18 changes: 13 additions & 5 deletions src/rp-schematron.sch
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@

<report test="matches(lower-case(.),'^(symposium|conference|meeting|workshop)\s|\s?(symposium|conference|meeting|workshop)\s?|\s(symposium|conference|meeting|workshop)$')" role="warning" id="journal-source-3">[journal-source-3] Journal reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has the following source, '<value-of select="."/>'. Should it be captured as a conference proceeding instead?</report>

<report test="matches(lower-case(.),'^in[^a-z]')" role="warning" id="journal-source-4">[journal-source-4] Journal reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source? And is it a different type of reference?</report>
<report test="matches(lower-case(.),'^in[^a-z]')" role="warning" id="journal-source-4">[journal-source-4] Journal 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>
</rule></pattern>

<pattern id="preprint-ref-checks-pattern"><rule context="mixed-citation[@publication-type='preprint']" id="preprint-ref-checks">
Expand All @@ -326,7 +326,7 @@

<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>
</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(.),'^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 beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source? And is it a different type of reference?</report>
<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>
</rule></pattern>

<pattern id="book-ref-checks-pattern"><rule context="mixed-citation[@publication-type='book']" id="book-ref-checks">
Expand All @@ -341,12 +341,20 @@

<report test="matches(lower-case(.),'^chapter\s|\s+chapter\s+')" role="warning" id="book-source-1">[book-source-1] The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) contains 'chapter' - <value-of select="."/>. Are the details captured correctly?</report>

<report test="matches(lower-case(.),'\.\s+in:\s+')" role="warning" id="book-source-2">[book-source-2] The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) contains '. In: ' - <value-of select="."/>. Are the details captured correctly?</report>
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')" role="warning" id="book-source-2">[book-source-2] The source in book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) starts with 'In: ' - <value-of select="."/>. Are the details captured correctly?</report>

<report test="matches(lower-case(.),'^(symposium|conference|proc\.?|proceeding|meeting|workshop)|\s?(symposium|conference|proc\.?|proceeding|meeting|workshop)\s?|(symposium|conference|proc\.?|proceeding|meeting|workshop)$')" role="warning" id="book-source-3">[book-source-3] Book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has the following source, '<value-of select="."/>'. Should it be captured as a conference proceeding instead?</report>

<report test="matches(lower-case(.),'^in[^a-z]')" role="warning" id="book-source-4">[book-source-4] Book reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has a source that beginds with 'In ', '<value-of select="."/>'. Should that text be moved out of the source?</report>
</rule></pattern>

<pattern id="confproc-ref-checks-pattern"><rule context="mixed-citation[@publication-type='confproc']" id="confproc-ref-checks">
<assert test="conf-name" role="error" id="confproc-ref-conf-name">[confproc-ref-conf-name] This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has no conf-name element.</assert>

<report test="count(conf-name) gt 1" role="error" id="confproc-ref-conf-name-2">[confproc-ref-conf-name-2] This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has more than 1 conf-name element.</report>

<assert test="article-title" role="warning" id="confproc-ref-article-title">[confproc-ref-article-title] This conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) has no article-title element.</assert>
</rule></pattern><pattern id="confproc-conf-name-checks-pattern"><rule context="mixed-citation[@publication-type='confproc']/conf-name" id="confproc-conf-name-checks">
<report test="matches(lower-case(.),'^(\.\s*)?in[^a-z]')" role="warning" id="confproc-conf-name">[confproc-conf-name] The conf-name in conference reference (<value-of select="if (ancestor::ref/@id) then concat('id ',ancestor::ref/@id) else 'no id'"/>) starts with 'In: ' - <value-of select="."/>. Are the details captured correctly?</report>
</rule></pattern>

<pattern id="ref-list-checks-pattern"><rule context="ref-list" id="ref-list-checks">
<let name="labels" value="./ref/label"/>
Expand Down
Loading

0 comments on commit c5063d6

Please sign in to comment.