Page MenuHomePhabricator

Allow searching in GraphQL by best rank
Open, Stalled, Needs TriagePublic

Description

Background:

As a user I want to be able to get only relevant and reliable items when I search for a specific property value pair. By building in best rank, we'd be able to successfully refine the results.

For example, if I search for instance = geographic location, I would not get Earth in the search results.

Implementation possibilities:

  • We can make this the default type of search in haswbstatement and also GraphQL if we change it in CirrusSearch but would need coordination and acceptance across our team, Wikidata Omega and the Search team at WMF
  • We can add a parameter to GraphQL search where a user can specify if they want only items with best ranked statements meeting this criteria

Notes:
Statements on wikidata entities can have different ranks, they are as follows:

  • Preferred: Assigned to the most current statement or statement that best represent consensus
  • Normal: Assigned by default to any statement
  • Deprecated: Assigned to statements known to be erroneous
  • Best: A statement with best rank is a statement with preferred rank and if there is none, then a statement with normal rank.

Also associated:

  • Truthy: Similar to best statement but only showing the value (throwing away additional information like qualifiers and references)

More information: https://www.wikidata.org/wiki/Help:Ranking

Event Timeline

Note: it is not a practice to mark statement as "preferred" if there are only statements with preferred rank. So we usually need to search normal rank statement if there are no preferred rank statement. The union of both is called "truthy" statements.

Small correction: those are best ranked statements

Ifrahkhanyaree_WMDE renamed this task from Allow searching in GraphQL by preferred rank to Allow searching in GraphQL by best rank.Jun 5 2026, 7:24 AM
Ifrahkhanyaree_WMDE changed the task status from Open to Stalled.Jun 9 2026, 2:07 PM
Ifrahkhanyaree_WMDE updated the task description. (Show Details)

Marking this as stalled until we figure out which out of the two implementations we can move forward with