Page MenuHomePhabricator

Provide a way to access qualifier-specific values on Wikidata
Closed, DeclinedPublic

Description

Right now, the property parser function allows one to fetch the corresponding value of a claim/statement on Wikidata. However, this is not enough for cases like accessing qualifier-specific data (e.g. metropolitan and rural population of a location).

Considering this item on Wikidata, that would be good to have a new parser function to fetch different population figures, so

{{#property:P1082|from=Q2674064|q1=P585|v1=2014|q2=P518|v2=rural area}}

would yield the value 12877.

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 19 2016, 7:27 PM
Superyetkin triaged this task as Normal priority.May 22 2016, 3:35 PM
Superyetkin added a project: ParserFunctions.
matej_suchanek raised the priority of this task from Normal to Needs Triage.May 22 2016, 4:59 PM
hoo closed this task as Declined.Aug 11 2016, 5:15 PM
hoo added a subscriber: hoo.

The parser function is only supposed for simple straight-forward data access. Complex selectors like this should be expressed in Lua.

I am not sure the desired functionality can be achieved via Lua. What would be the steps to take for implementing such a module?

hoo added a comment.Aug 12 2016, 12:36 PM

@Superyetkin With Lua (mw.wikibase.getEntity) you can load a mw.wikibase.entity table (with a structure as described on mw:Wikibase/DataModel/JSON). That table contains the full entity, including all qualifiers, which can be programmatically extracted and filtered.