That change was introduced by Legoktm in gerrit:80328
<https://gerrit.wikimedia.org/r/80328/>, which caused some tests to
fail, and thus was reverted by Merlijn van Deen in gerrit:80765
<https://gerrit.wikimedia.org/r/80765/>.
It implemented a Claim._buildMainSnak() method and some serialization
logic in DataSite.setClaim().
gerrit:138285 <https://gerrit.wikimedia.org/r/138285/> implements an
improved version of Claim._buildMainSnak(), as _formatDataValue(),
while gerrit:125575 <https://gerrit.wikimedia.org/r/125575/> contains
advanced serialization methods for claims, sitelinks, labels,
descriptions and aliases.
They're both currently in-review, but chances are that they will be
merged soon.
After that, since the wbsetclaim feature is indeed useful, I may file
another patch using the new Claim.toJSON() method.
Its usage could look like this:
item = pywikibot.ItemPage(repo, 'Q123')
claim = item.claims['P123'][0]
claim.update(index=0) // move the whole subgroup of 'P123' claims at the
top
Il 10/06/2014 12:28, Frank Wein ha scritto:
Hi,
do I see it correctly that there is no function in pywikibot-core (yet?)
to call the Wikidata API function "wbsetclaim" (see
http://www.wikidata.org/w/api.php for some docu)? I wanted to use that
function to insert a new claim at a certain index position when a claim
with the same property already exists. I found out there was(?) a patch
for a setClaim function, but looks like it was backed out again
(
http://www.gossamer-threads.com/lists/wiki/mediawiki-cvs/384671?do=post_vie…
Someone on IRC said I could use
https://gerrit.wikimedia.org/r/#/c/125575/ as soon as it has been
checked in to overwrite the whole item/entity with editEntity as some
kind of workaround (not sure yet what the overhead of this compared to
using wbsetclaim would be).
Frank