Hello,
I am using my bot to get information on people from linked sites to Wikidata. I think it's a fun and useful thing to do, but one problem I find is that I often find myself doing dozens of edits to the same page in a row, which takes a considerable amount of time, and also seems to put more pressure on the database than seems necessary. Because of this my question:
Is it possible with the pywikibot to make multiple changes to Wikidata (or a similar data site) and have them saved as a single edit? If so, where in the code can I find it, if not, would it be possible to create it?
Thanks in advance,
Hoi Andre,
Yes and no. The current implementation of Pywikibot is to push out each edit to the API using wbcreateclaim causing the behavior you describe. It's possible to locally do the modifications and push them out in one go, but the page level implementation for that is missing so you have to locally keep track of your data in json format and push it out with WikibaseEntity.editEntity(). Of course this is not the right way to go. Our current Wikibase implementation is aging and incomplete. Editing on Commons (mediainfo) is currently also only possible with some horrible hacks.
For your issue it would be nice to have a version of addClaim that just the local modification(s) and something like Page.save() that pushes out the changes using WikibaseEntity.editEntity() . I'm not sure what task that is in Phabricator.
Maarten
On 01-08-2021 08:44, Andre Engels wrote:
Hello,
I am using my bot to get information on people from linked sites to Wikidata. I think it's a fun and useful thing to do, but one problem I find is that I often find myself doing dozens of edits to the same page in a row, which takes a considerable amount of time, and also seems to put more pressure on the database than seems necessary. Because of this my question:
Is it possible with the pywikibot to make multiple changes to Wikidata (or a similar data site) and have them saved as a single edit? If so, where in the code can I find it, if not, would it be possible to create it?
Thanks in advance,