Wikidata:Requests for permissions/Bot/DifoolBot 9
- The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
Approved--Ymblanter (talk) 19:34, 5 September 2026 (UTC)reply
DifoolBot (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: Difool (talk • contribs • logs)
Task/s: (1) Fix VIAF cluster ID (P214) statements deprecated for conflation (Q14946528) once VIAF has split the cluster. (2) Deprecate VIAF ID values that VIAF has since redirected or abandoned, and add the redirect target if it is not already on another Wikidata item.
Code: At github
Function details:
When a VIAF cluster ID (P214) points to a cluster that conflates two or more people, Wikidata marks it as deprecated with reason for deprecated rank (P2241) = conflation (Q14946528). This bot revisits those deprecated statements, checks whether VIAF has updated the cluster, and if so fixes them. It complements the VIAF add-bot, which skips items that already carry a VIAF cluster ID (P214), leaving these cases untouched.
VIAF also redirects or abandons clusters. A normal- or preferred-rank VIAF cluster ID (P214) pointing to such a cluster is outdated. The bot checks these VIAF cluster ID (P214) values and deprecates them:
- Redirect: reason for deprecated rank (P2241) = redirect (Q45403344), adding the target unless it is already on another item.
- Abandoned: reason for deprecated rank (P2241) = withdrawn identifier value (Q21441764).
Candidates
- human (Q5) items with a VIAF ID statement deprecated for conflation (Q14946528): ~13,200 items. Those flagged less than a year ago (by retrieved (P813) date) are skipped.
- human (Q5) items with two or more non-deprecated VIAF IDs: ~6,400 items.
- human (Q5) items with a long-format (19-22 digit) VIAF ID, which VIAF may have redirected to a shorter one: ~63,000 items.
Process
For a conflation candidate, the bot:
- Queries VIAF using the item's VIAF-linked authority IDs (GND ID (P227), Library of Congress Authorities ID (P244) etc.) and also fetches the old, deprecated cluster.
- Determines what has happened to the old cluster and acts:
- Authority IDs now sit in a different, unused cluster: add that cluster as a normal-rank VIAF cluster ID (P214) with a reference, and change the old statement's reason to refers to different person (Q35773207). (example)
- IDs sit in a cluster the item already has: change the old statement's reason to refers to different person (Q35773207). (example)
- Old cluster now holds only this item's IDs: un-deprecate it. (example)
- Old cluster still holds another person's records: leave it deprecated (refresh retrieved (P813)). (example)
- Adds or refreshes a retrieved (P813) date on every statement touched.
- Adds any VIAF cluster that contains only this person and is linked to no other Wikidata item, as a normal-rank VIAF cluster ID (P214).
- Fixes outdated non-deprecated VIAF cluster ID (P214):
- Redirects: deprecate with reason for deprecated rank (P2241) = redirect (Q45403344), add target unless already on another item (example).
- Abandoned: deprecate with reason for deprecated rank (P2241) = withdrawn identifier value (Q21441764) (example, with a redirect).
- Flags unclear cases for human review; see User:Difool/viaf deconflation.
Items selected only for outdated-value checks (multiple VIAF IDs or long-format IDs) run step 5 only; if values are valid, they are left unchanged.
Test edits can be found here, via editgroups. If approved I will run the script a few times per year.
--Difool (talk) 14:42, 29 August 2026 (UTC)reply
- Discussion
- Thank you for your hard work! This all makes sense to me. The only question I have is the first point of the Candidates section. I don't tend to put a retrieved (P813) qualifier when I deprecated conflated VIAF cluster ID (P214) statements. Does this mean that all of those would be skipped unless someone goes back and adds a retrieved (P813)? Mcampany (talk) 18:31, 31 August 2026 (UTC)reply
- @Mcampany: no, for the ones not having retrieved (P813) the bot will add the value of the day it checks it, so they will not be skipped, don't worry. Anyway, for future cases, if you deprecate VIAF clusters using "DeprecateConflatedID" (presently lines 95-96 of User:Epìdosis/common.js) it adds P813 automatically. Epìdosis 18:43, 31 August 2026 (UTC)reply
- Yes, I've change the wording a bit. The script executes this query and then processes items with an empty or old retrieved (P813) value. So the VIAF ID must be deprecated and have a reason for deprecated rank (P2241) = conflation (Q14946528), but the retrieved (P813) is optional. Difool (talk) 02:13, 1 September 2026 (UTC)reply
- @Mcampany: no, for the ones not having retrieved (P813) the bot will add the value of the day it checks it, so they will not be skipped, don't worry. Anyway, for future cases, if you deprecate VIAF clusters using "DeprecateConflatedID" (presently lines 95-96 of User:Epìdosis/common.js) it adds P813 automatically. Epìdosis 18:43, 31 August 2026 (UTC)reply
Support of course! --Epìdosis 18:44, 31 August 2026 (UTC)reply
- The above discussion is preserved as an archive. Please do not modify it. Subsequent comments should be made in a new section.