Page MenuHomePhabricator

Add a convenience function to filter a list of statements by qualifier-value
Open, Needs TriagePublic

Description

Add a convenience function to filter a list of statements (as obtained by [[https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.getBestStatements|mw.wikibase.getBestStatements]]) by qualifier-value. This function would probably look like filterByQualifier( statements, qualifierPropertyId, qualifierDataValue ), where qualifierDataValue is either the full data value… or we special case this for entity ids, so that filterByQualifier( statements, qualifierPropertyId, 'Q123' ) would work.

Alternatively (or additionally) this could itself fetch the statements to filter: filterByQualifier( entityId, qualifierPropertyId, qualifierDataValue ), where the question regarding qualifierDataValue from above remains.

Maybe put this into a new mw.wikibase.filter library.

(This was discussed at the Barcelona Hackathon)

Event Timeline

Vvjjkkii renamed this task from Add a convenience function to filter a list of statements by qualifier-value to sbcaaaaaaa.Jul 1 2018, 1:08 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from sbcaaaaaaa to Add a convenience function to filter a list of statements by qualifier-value.Jul 2 2018, 3:49 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.