Page MenuHomePhabricator

wbsearch parameter wbstype lists “form” and “sense” types twice
Closed, ResolvedPublic

Description

As a developer working with the Wikibase API, I want to get helpful and sensible information about the API, e.g. in the API sandbox.

Problem:
The wbstype parameter to the wbsearch API (class QuerySearchEntities) lists the “form” and “sense” entity types twice on Wikidata. This seems pointless and confusing.

Example:
https://www.wikidata.org/w/api.php?action=help&modules=query%2Bwbsearch

Screenshots/mockups:

Screenshot_2021-03-04 API sandbox - Wikidata.png (278×1 px, 18 KB)

BDD
GIVEN
AND
WHEN
AND
THEN
AND

Acceptance criteria:

  • Each entity type is only listed once.

Open questions:

Event Timeline

Change 951845 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/WikibaseLexeme@master] Add EnabledEntityTypesTest

https://gerrit.wikimedia.org/r/951845

Change 949080 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Wikibase@master] Simplify the "WikibaseRepo.EnabledEntityTypes" service

https://gerrit.wikimedia.org/r/949080

Change 951845 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Add EnabledEntityTypesTest

https://gerrit.wikimedia.org/r/951845

Change 949080 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Simplify the "WikibaseRepo.EnabledEntityTypes" service

https://gerrit.wikimedia.org/r/949080

Should be testable in production next week:

$ curl -s 'https://www.wikidata.org/w/api.php?action=paraminfo&modules=wbsearchentities&format=json&formatversion=2' | jq -r '.paraminfo.modules | .[] | select(.name == "wbsearchentities") | .parameters | .[] | select(.name == "type") | .type | .[]'
form
form
item
lexeme
property
sense
sense
Lucas_Werkmeister_WMDE assigned this task to hoo.
$ curl -s 'https://www.wikidata.org/w/api.php?action=paraminfo&modules=wbsearchentities&format=json&formatversion=2' | jq -r '.paraminfo.modules | .[] | select(.name == "wbsearchentities") | .parameters | .[] | select(.name == "type") | .type | .[]'
form
item
lexeme
property
sense

Presto!