Lucas_Werkmeister_WMDE created this task.
Lucas_Werkmeister_WMDE added projects: Wikidata Lexicographical data, Wikidata, 
Special:NewLexeme revival (Special:NewLexeme revival - sprint 5), 
MediaWiki-extensions-WikibaseRepository.

TASK DESCRIPTION
  As a developer using the Wikibase Action API, I want to be able to easily 
access best-rank statements, in order to follow the same logic as SPARQL 
queries (`wdt:`) or Lua modules (`getBestStatements()`).
  
  **Problem:**
  The `wbgetclaims` action has a `rank` parameter, but it only lets you filter 
by preferred, normal, or deprecated rank. If you want to use best-rank 
statements (i.e. preferred-rank if any, else normal-rank, never 
deprecated-rank), you have to implement that logic yourself, at the risk of 
getting it wrong; this also requires getting the statements for all ranks, or 
potentially making two network requests (first with `rank=preferred`, then with 
`rank=normal`), adding some network overhead either way. (For certain 
properties, it’s not uncommon to have tons of non-best-rank statements.)
  
  **Example:**
  
  **Screenshots/mockups:**
  
  **BDD**
  GIVEN an Item with some preferred-rank, normal-rank and deprecated-rank 
Statements for the same Property
  WHEN I call `wbgetclaims` with the given Item ID, Property ID, and `rank=best`
  THEN only the preferred-rank Statements are returned
  
  GIVEN an Item with some normal-rank and deprecated-rank Statements for the 
same Property
  WHEN I call `wbgetclaims` with the given Item ID, Property ID, and `rank=best`
  THEN only the normal-rank Statements are returned
  
  GIVEN an Item with some deprecated-rank Statements for the same Property
  WHEN I call `wbgetclaims` with the given Item ID, Property ID, and `rank=best`
  THEN no Statements are returned
  
  **Acceptance criteria:**
  
  - the `wbgetclaims` `rank` parameter accepts a fourth value, `best`, which 
causes the API to only return best-rank statements
  - the documentation of the API parameter values makes it clear that unlike 
`preferred`/`normal`/`deprecated`, this is not a rank that an individual 
statement can have
    - (nevertheless, I think adding this to the `rank` parameter makes more 
sense than having it as a separate parameter, because it can’t be meaningfully 
combined with any other `rank` value)
  
  **Open questions:**

TASK DETAIL
  https://phabricator.wikimedia.org/T305535

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lydia_Pintscher, Aklapper, Nikki, Mahir256, Bugreporter, 
Erdinc_Ciftci_WMDE, guergana.tzatchkova, ItamarWMDE, noarave, Michael, 
Lucas_Werkmeister_WMDE, Astuthiodit_1, karapayneWMDE, Invadibot, maantietaja, 
Akuckartz, Nandana, lucamauri, Lahi, Gq86, GoranSMilovanovic, QZanden, 
LawExplorer, _jensen, rosalieper, Bodhisattwa, Scott_WUaS, Wikidata-bugs, aude, 
Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to