Wikidata search plugins

Today I had some fun creating a Wikidata search plugin for Firefox, and a similar extension for Chrome.

The Chrome extension

searchStart

The Chrome extension adds search capabilities in the “omnibox”, which is what the url bar is called nowadays. (At least in Chrome – Firefox has an “awesome bar”.) When trying “wd”, followed by a tab or space, you can then type a search term, and up to 3 suggestions will be shown. In the screenshot above “Wikipedia” is entered as search term.

It is a small JS script that feeds the search terms to the search entities API module of the Wikibase chromeSearchRepo software, and then turns the result into a list of suggestions to show in the omnibox.

Only items are searched against, and only their English labels and descriptions. The suggestions shown are the English label, plus a description, if one is available for the item. The obvious next step to take is allowing searching in multiple languages.

I had some “fun” trying to find out why the HTTP request I was making to the API was returning something weird. After half an hour or so it occurred to me the extension might not have sufficient rights, and indeed, this turned out to be the culprit. Some helpful error in the result would have been nice!

If you are a Chrome user, get the plugin from the Chrome web store, and start searching! You can get the source of this extension on GitHub.

The Firefox plugin

wikidata-search

This plugin was very simple to create. It’s just an OpenSearch XML file. When installed, it allows you to select “Wikidata” as search engine in the Firefox search field. When searching, you will get the same results as when entering the search terms in the wikidata.org search field. Currently the suggestions for this search engine are not working. This is due to the OpenSearch support of wikidata.org being broken, something I discovered while writing this plugin.

If you are a Firefox user, get the plugin from the addons site, and start searching! You can get the source of this plugin on GitHub.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.