Last modified: 2014-07-31 22:11:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48160, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46160 - Lua: Allow using labels in mw.wikibase.entity.formatPropertyValues
Lua: Allow using labels in mw.wikibase.entity.formatPropertyValues
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataClient (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
: need-volunteer
Depends on:
Blocks: 55920
  Show dependency treegraph
 
Reported: 2013-03-15 13:25 UTC by Daniel Kinzler
Modified: 2014-07-31 22:11 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2013-03-15 13:25:46 UTC
The getEntity() function that provides access to item data in lua returns a Lua table the reflects the structure of the data item as used by the API. This is very inconvenient for getting claims/statements and their values: In order to get all statements about property p123, one would have to loop over all claims and look at the property. Also, one would have to use the property ID.

A helper function getClaims(property) should be added to the entity structure, allowing the list of claims about a given property to be accessed by simply providing the property ID or (localized) property name.
Comment 1 Marius Hoch 2014-02-17 11:18:46 UTC
Can this be considered fixed as we now have:
entity:getProperties() and entity:formatPropertyValues( 'P123' ) ?
Comment 2 Daniel Kinzler 2014-02-17 11:44:31 UTC
Yes, if formatPropertyValues also allows specifying the property by name instead of ID (I don't remember).
Comment 3 Marius Hoch 2014-02-17 13:33:37 UTC
(In reply to Daniel Kinzler from comment #2)
> Yes, if formatPropertyValues also allows specifying the property by name
> instead of ID (I don't remember).

It doesn't (yet)...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links