On Fri, Jun 13, 2014 at 9:34 AM, Ricordisamoa
<ricordisamoa(a)openmailbox.org> wrote:
I still can't find a way to query only some item
properties (e.g. claims)
from the Wikibase API using pywikibot.
I've tried all of them:
.get('claims')
.get(True, 'claims')
.get(force=True, 'claims')
.get('claims', force=True)
.get('claims', True)
but without success.
Bots often don't need all of the items' data, so such feature should be
implemented (or, if present, documented better!)
Are the claims a large part of the network traffic for items you are
processing? Some client time might be saved by lazy loading the claim
objects from _content. The claims data is even smaller when using raw
revisions instead of the API JSON.
Often a large and unnecessary part of the item download is the labels
and sitelinks, which are often full of duplicated information.
Most of them time the bot doesnt need every label and sitelink. What
it does need is _one_ printable label to use in the user interface,
and it wants 'the label closest to the UI language'.
For one of my tasks, I wrote a function to extract the 'most latin
label' , but that depends on having all of the labels and sitelinks.
It would be great if the API could provide something like this, so we
could request that and not fetch every label and sitelink.
--
John Vandenberg