Search code examples
wikidatawikidata-api

Omit disambiguation results from wbsearchentities


I'm looking to do a fuzzy text search for entities in wikidata and would like to prevent the "disambiguation" results from being returned by the server.

http://www.wikidata.org/w/api.php?action=wbsearchentities&search=abc&language=en&limit=3&format=jsonfm

Is there an undocumented parameter or endpoint better suited to this?


Solution

  • not that I'm aware of, so the solution I use on my project is to filter on the instance of (P31) property.

    You may already be doing that, but for the record, that gives the following workflow

    1. find relevant entities with wbsearchentities
    2. find their claims with wbgetentities
    3. keep only entities that don't have Q4167410 (Wikimedia disambiguation page) in their P31 claims

    In my case, at 3, I do the opposite: I only keep instances of Q571 (books) or a few other relevant entities