Hello,
I have a list of place names and want to find the according wikidata item with this name. The list includes "Köln, "Düsseldorf" but also parts of towns which are recorded as compounds of the superior administrative entity and the district like "Schmallenberg-Westernbödefeld" or "Kerpen-Manheim".
If I lookup these via the Wikidata API with the wbsearchentities action I get no problems with "Köln" and the like [1] but won't get any results for compounds, see e.g. [2] although both strings are part of the label and the description of a wikidata item.
Via the wikidata interface I get the right result, though.[3]
I have looked quite some time but couldn't find a way to query wikidata programatically and get results similar to the website search. Thus, my question is:
Is there a way to query wikidata via an API over both the label fields and the description?
Background
I am working at the North Rhine-Westphalian Library Service Center (hbz)and we are currently building a new website for the Northrhine-Westphalian bibliography. [4] This bibliography collects articles, books and other media about places in the German federal state of Northrhine- Westphalia. Each record contains a string which indicates which place a resource is about. As soon as we have those links to Wikidata we will think about how to link to a list of bibliographic resources about a place from the place's wikipedia page. See the GitHub issue on this particular problem at [5].
All the best Adrian
[1] https://www.wikidata.org/w/api.php?action=wbsearchentities&search=K%C3%B...
[2] https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Kerpen...
[3] https://www.wikidata.org/w/index.php?search=Kerpen+Manheim
[5] https://github.com/hbz/nwbib/issues/42
Hi Adrian!
On Wed, Nov 5, 2014 at 11:41 AM, Adrian Pohl pohl@hbz-nrw.de wrote:
Hello,
I have a list of place names and want to find the according wikidata item with this name. The list includes "Köln, "Düsseldorf" but also parts of towns which are recorded as compounds of the superior administrative entity and the district like "Schmallenberg-Westernbödefeld" or "Kerpen-Manheim".
If I lookup these via the Wikidata API with the wbsearchentities action I get no problems with "Köln" and the like [1] but won't get any results for compounds, see e.g. [2] although both strings are part of the label and the description of a wikidata item.
The Wikidata wbsearchentities API is currently a prefix-search only.
Via the wikidata interface I get the right result, though.[3]
I have looked quite some time but couldn't find a way to query wikidata programatically and get results similar to the website search. Thus, my question is:
Is there a way to query wikidata via an API over both the label fields and the description?
You could use the mediawiki search module, that should give you the same results that you got on the website search:
e.g. http://www.wikidata.org/w/api.php?action=query&list=search&format=js...
Background
I am working at the North Rhine-Westphalian Library Service Center (hbz)and we are currently building a new website for the Northrhine-Westphalian bibliography. [4] This bibliography collects articles, books and other media about places in the German federal state of Northrhine- Westphalia. Each record contains a string which indicates which place a resource is about. As soon as we have those links to Wikidata we will think about how to link to a list of bibliographic resources about a place from the place's wikipedia page. See the GitHub issue on this particular problem at [5].
All the best Adrian
Hope that helps! Good luck with your project!
cheers, tobi
[1] https://www.wikidata.org/w/api.php?action=wbsearchentities&search=K%C3%B...
[2] https://www.wikidata.org/w/api.php?action=wbsearchentities&search=Kerpen...
[3] https://www.wikidata.org/w/index.php?search=Kerpen+Manheim
[5] https://github.com/hbz/nwbib/issues/42
Adrian Pohl hbz - Hochschulbibliothekszentrum des Landes NRW Tel: (+49)(0)221 - 400 75 235 http://www.hbz-nrw.de
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
wikidata-tech@lists.wikimedia.org