Amir,

thank you for your feedback! But after checking the Wikidata API, I don't know how to get around the API limitations. PWB seems to simply call two API commands: wbremoveclaims (https://www.wikidata.org/w/api.php?action=help&modules=wbremoveclaims ) and wbsetclaim (https://www.wikidata.org/w/api.php?action=help&modules=wbsetclaim ) - so it seems that the API itself doesn't allow setting more than one claim with one command. But I've seen other bots doing multiple property changes within one edit (so I think one API call), for example https://commons.wikimedia.org/w/index.php?title=File%3AGasteinertal_vom_Zitterauer_Tisch.jpg&diff=873602126&oldid=863453684 so there must be a different way besides MediaInfo.addClaim().

Greetings,
Florian

Am 09.09.24 um 15:24 schrieb Amir Sarabadani:
Hi,
From reading the source code, I can't find anything that would allow it but adding a patch to make it happen shouldn't be hard.
On top of that, you can introduce it in your script directly and hit the API from there. I know it's not great but it would work.

HTH

Am So., 8. Sept. 2024 um 13:34 Uhr schrieb tohuuu <th@tohuuu.de>:
Hi all,

i'm working on a bot whose task is to add some SDC claims to the
mediainfo of Commons file pages. While there's a method removeClaims()
(see
https://doc.wikimedia.org/pywikibot/master/api_ref/pywikibot.html#pywikibot.MediaInfo.removeClaims)
to remove multiple claims in one step, its counterpart addClaim() (see
https://doc.wikimedia.org/pywikibot/master/api_ref/pywikibot.html#pywikibot.MediaInfo.addClaim)
doesn't accept a list of claims to add. This results in separate API
calls (?) for each single claim top add. Is there a factual reason for
that difference? Is there a different way to add multiple SDC claims in
one edit step?

Thanks in advance!

Florian

_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/ELXJJ4GGAJXP6JROEZPLCAGGQZBJL2W6/
To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org


--
Amir (he/him)


_______________________________________________
pywikibot mailing list -- pywikibot@lists.wikimedia.org
Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/REHCEWI2Y5N3ZAUYMTKIJNT4NEITGRCQ/
To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org