Wikidata:Requests for permissions/Bot/William Avery Bot 10
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:27, 7 October 2022 (UTC)[reply]
William Avery Bot 10[edit]
William Avery Bot (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: William Avery (talk • contribs • logs)
Task/s:
- Fix instances of imported from Wikimedia project (P143)Minor Planet Center (Q522039) to stated in (P248)Minor Planet Center Database (Q106600690) as requested at Wikidata:Bot requests § Request to fix certain instances of imported from Wikimedia project (P143) (2022-09-25)
Code:
Function details:
Items in need of attention can be found with a SPARQL query such as the following:
SELECT DISTINCT ?item ?itemLabel ?property ?object
WHERE
{
?item ?property ?object .
?object prov:wasDerivedFrom ?provenance .
?provenance pr:P143 wd:Q522039 .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
The item's properties are scanned to find references with imported from Wikimedia project (P143)Minor Planet Center (Q522039)
If a reference has more than one value for property imported from Wikimedia project (P143), a warning is output and the reference is not processed.
If the reference has no property stated in (P248), a stated in (P248)Minor Planet Center Database (Q106600690) is added.
If the reference now has a statement stated in (P248)Minor Planet Center Database (Q106600690), the imported from Wikimedia project (P143) statement is removed from it.
After all the item's properties have been processed, if changes have been made, the changes are saved.
Testing: Contributions log for the test run of 50 edits can be found here.
As far as I can see the results are as expected. William Avery (talk) 18:32, 3 October 2022 (UTC)[reply]
Discussion:
I have used the script to make a single edit under my own account, here.
If there are no objections on will do a test run of 50 edits using the bot account on 3 Oct 2022.
- Makes sense to me. I assume these mostly date back to when P143 just said "imported from" without mentioning Wikimedia? ArthurPSmith (talk) 17:12, 30 September 2022 (UTC)[reply]
- Interesting. I didn't know about that history. William Avery (talk) 18:32, 3 October 2022 (UTC)[reply]
- sounds good BrokenSegue (talk) 14:36, 6 October 2022 (UTC)[reply]