Operator: Samwalton9 (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 22:43, Sunday, April 21, 2019 (UTC)
Function overview: This bot maintains a database of retracted sources from the CrossRef API (and in the future also from PubMed) and would update references citing those sources with the {{Retracted}} template, marking them for review.
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python
Source code available: https://github.com/Samwalton9/RetractionBot
Links to relevant discussions (where appropriate): Wikipedia talk:WikiProject Medicine/Archive 118#Med article retractions and Wikipedia talk:WikiProject Medicine/Archive 26#Creating a bot to search Wikipedia for retracted papers
Edit period(s): Daily
Estimated number of pages affected: 169 on first run. It's hard to estimate beyond the first run, but the number isn't likely to be higher than a few edits per month.
Namespace(s): Mainspace
Exclusion compliant (Yes/No): Please correct me if I'm wrong, I'm quite new to making bots, but I believe Pywikibot does this automatically unless overridden, so yes.
Function details: This bot maintains a database of retracted papers - at the time of writing it only considers those flagged as retracted or withdrawn by CrossRef using their API. At the time of writing the database contains 3974 entries, and in the future I plan to expand it with entries from the PubMed API. I'm also currently using quite a conservative search for retracted papers - we could also look for other publication types like errata, but a little more research is required there.
On each run, the bot loads a list of retracted papers, searching Wikipedia (mainspace only) for the original DOI. If it finds pages containing this DOI, it looks to see if that DOI is inside a <ref> tag. If so, it then checks if the Retracted template is present in this citation. If not, it appends the template, with the retraction DOI filled out, to the citation, and saves the page.
On its first run the bot detects 169 citations which need tagging - a full table can be checked at User:RetractionBot/results. A spot check implies that everything should be functioning as intended. The only edge cases I found were articles like Frontiers Media where the citation is flagged as retracted but doesn't use the correct template.
With just shy of 4000 entries in the database and 169 edits to make, a dummy run took ~10 minutes to process. I would plan to update the database and run the bot daily, any more than that would probably be overkill.
The bot has both a local killswitch User:RetractionBot/run, which will stop it running on the English Wikipedia, and a global killswitch User:RetractionBot/run, which will stop it running on any Wiki.
Approved for trial (25 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Headbomb {t · c · p · b} 00:23, 22 April 2019 (UTC)[reply]
@Samwalton9: looks good. Three things.
|pmc=
/|pmcid=
?{{cite journal}}
: Check |doi=
value (help){{cite journal}}
: Check |doi=
value (help) (Retracted, see doi:10.5555/24242424x ignored DOI errors (link). If this is an intentional citation to a retracted paper, please replace {{retracted|...}}
with {{retracted|...|intentional=yes}}
.)I don't mean cross-referencing the existing citation. I mean adding this. You have the retraction DOI, but you could query pubmed relatively easily to figure out the retraction PMID/PMC when they exist. As for 2, those would cover things specifically on their own line. Maybe it could be expanded to cover things like
* {{cite journal |last=.. |first=.. |... }} {{retracted |doi=...}}
but there will be a point where the complexity gets too complex, so I'll let you figure out where that threshold is. Headbomb {t · c · p · b} 20:51, 22 April 2019 (UTC)[reply]
Article | Original | Retraction | {{Retracted}} present ? |
---|---|---|---|
Example | doi:10.5555/12345678 ignored DOI errors (link) | doi:10.5555/24242424x ignored DOI errors (link) | No |
However, this isn't something that needs to be part of this BRFA (or would need one, since it would operate in its own userspace), just an idea to increase the usefulness of the bot. Headbomb {t · c · p · b} 21:31, 22 April 2019 (UTC)[reply]
Approved. If amendments to - or clarifications regarding - this approval are needed, please start a discussion on the talk page and ping. --TheSandDoctor Talk 16:45, 28 April 2019 (UTC)[reply]