Just FYI - I have proposed Wikidata to adjust their API to match the rest of the MW API - https://www.mediawiki.org/wiki/Requests_for_comment/Wikidata_API

Wikidata thinks that generally it's a good approach, but don't have any extra hands on deck to actually do it, and are looking for volunteers :)

On Thu, May 28, 2015 at 12:46 AM, Mixter,Jeff <mixterj@oclc.org> wrote:

I am trying to query the Wikidata api using the following action: action=query&generator=search&gsrsearch. The query works but what I want back as a result is  human readable data about the entity. See below results:


https://www.wikidata.org/w/api.php?action=query&generator=search&gsrsearch=world%20war%20one&gsrlimit=10&prop=extracts&redirects=&format=json


I was expecting it to work that same a the wikipedia api. I can ask for various properties from the Wikipedia page. See below:


http://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrsearch=world%20war%20one&gsrlimit=10&prop=pageimages|pageprops|extracts&pilimit=max&exintro&explaintext&exsentences=5&exlimit=max&redirects=


So what I would expect is to get back human readable labels and descriptions (when applicable) from the api (the same way you do with a wbsearchentities query). I wanted to just use the wbsearchentities action but the index seems to be acting odd (it looks like it is a prefix search or something like that).


For example if I do a entity search for 'columbus' one of the results is Columbus Ohio and the results include human readable strings:


https://www.wikidata.org/w/api.php?action=wbsearchentities&search=columbus&language=en&type=item&format=json


But if I add Ohio to the search query the only result is for "Columbus Ohio Temple".


https://www.wikidata.org/w/api.php?action=wbsearchentities&search=columbus%20ohio&language=en&type=item&format=json


The issue that I am running into is that I am trying to match oddly formatted entity labels (It's library authority data...) to entities in Wikidata and I really do not want to do much string manipulation on the original entity label.


Does anyone have any solutions or suggestions?


Thanks,

Jeff Mixter
Software Engineer
OCLC Research

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api