Ricordisamoa wrote:
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
Ah, that sounds great!
Frank