Wikidata/Development/wbsearchentity

wbsearchentity is a module that will be used for searching for entities. It is defined as follows:

Input

edit

A module that takes as parameters:

  • Text
  • Language
  • Entitytype (defaults to item)
  • Limit (integer, defaults to 7)
  • Continue (integer, defaults to 0) (use continuation mechanism for that)

Output

edit

It returns:

  • A sorted array of hits, where every hit has a
    • ID
    • label with language (if it exists)
    • description with language (if it exists)
    • alias with language (optional and if hit on the given alias)
    • score (numeric between 0 and 1 about the hit score)
  • Continue (integer that can be used for offset, or 0 if no more results exist) (use continuation mechanism for that)

Behavior

edit
  • in general, the module returns the best Limit hits for a search using Text
  • for now, if the requested language is not offered, no fallback is made. This is left for later (but the structure should accommodate that already, as above)