Monday, May 12, 2008

Freebase

To help promote awareness and use of Freebase, I have made a search plugin for use with Firefox. You can install it from this link [Updated] link.

For those of you who have not been introduced to Freebase, you may find this FAQ really useful. But in a nutshell, Freebase is a public collaboration to build a structured knowledge base akin to Wikipedia. Other similar projects include DBPedia and OpenCyc. You can find my profile here.

15 comments:

Will Moffat said...

Great idea to make a search plugin for Freebase.

This plugin would be even more cool if it used the Freebase Search Api to provide suggestions (similar to how the Google search plugin works).

Fuzziebrain said...

Hi Will,

Definitely! I'll work on it ASAP.

Cheers,
Adrian

Will Moffat said...

Great! I'd really like to see this happen. Please let me know if you hit any roadblocks where I might be able to help.

Fuzziebrain said...

Sure and thanks! Will keep you updated on my progress.

Fuzziebrain said...

Done. Please remove the old plugin and reinstall the new version from here.

I will update my blog later with details and issues. Any feedback will be appreciated.

Will Moffat said...

This looks very promising, some feedback on the current version:

* Suggestions don't appear all the time
Example, if I type "ll" in the Firefox search box then I don't get any suggestions. If I type the same into the Freebase.com search box then I get plenty of suggestions.

* Go directly to topic page?
If I actually select an item from the suggestions then it's strange to go to the search page. Couldn't we just go straight to the topic page on freebase?

* Is it possible to show the type information?
So if you search for "will", you would see:
Will (Legal Document)
Will (Idea)
Will (User)
Will Oldham (Person, Musical Group Member, Film actor...)

Fuzziebrain said...

1. For now I've set the minimum number of characters (3) before a query is executed. I can change that. But I have experienced occasions when the plugin doesn't submit a request even when there are sufficient number of characters. I haven't quite figured this one out.

2. I have tried link the results directly to a Freebase topic, e.g. http://www.freebase.com/view/linux. , but it has issues with spaces. They get rendered as plus signs and that url won't work http://www.freebase.com/view/linux+distribution.

3. I probably could do that (I was trying) but chose to create a unique list of terms since a search result page is generated instead of returning the user to a topic page.

I'll create an additional search plugin to implement items (2) and (3). That way users can have a choice of which approach they wish to search Freebase. I will also remove the limits highlight in (1).

Will Moffat said...

Hi Adrian,

> 2. I have tried link the results directly to a Freebase topic

There's no reliable way to link the topic name (query string) to the topic page. You have to use the topic's unique id to build the url:

http://www.freebase.com/view + topic_id

Example topic_ids:
"Linux" = /en/linux
"Linux distribution" = /en/linux_distribution
"Fedora (Operating System)" = /guid/9202a8c04000641f80000000055e6fc1

Fuzziebrain said...

Thanks for the tip Will. I wanted to use the GUIDs to link directly to topics, but apparently, Firefox doesn't support descriptions and query URLs.

So I'm now working on a second script that would parse the search term and redirect users to either search results page (if no topic information is found, i.e. user is performing a Freebase search), or directly to a topic view page. I'll let you know how that goes.

Btw, I've removed the minimum number of characters required to initiate a suggestions request.

Alec said...

Hey, I'm the lead for the freebase.com frontend, and I could easily add soemthing so that the search url like
/search?q=/guid/920.... would redirect to that topic, if it would make it easier to write this...

Will Moffat said...

Note to anybody interested in Freebase search plugins. Here's gromul's search plugin.

Fuzziebrain said...

Thanks Alec and Will. Sorry for the late reply as I was travelling on the long weekend. :)

Alec, the search interface you proposed will be extremely useful. It can be used as a "Query URL" defined by the OpenSearch specifications.

Unfortunately Firefox doesn't support this in its current versions and I'm not too sure if they ever will. I'm currently thinking of alternative ways to support direct topic linking.

Btw, I was wondering if Freebase could support an additional parameter in its search API that lets developers specify the JSON format returned. One format choice would be OpenSearch compatible. I currently use a PHP script to convert Freebase query results to OpenSearch format (see example).

Fuzziebrain said...

The search plugin was recently updated with the following changes:
1. The search term is now forwarded to a script that then queries Freebase, and decides whether to return a topic or search results page.

2. The number of suggestions returned has been limited with a default value of 5. This is necessary to improve the performance of the type-ahead. If you feel this is insufficient, you may wish to customise the search plugin on your computer.

In the next update, I hope to display the types alongside suggestions. That way, every suggestion will link directly to a topic.

To ensure you get the latest version of the plugin, please remove the search plugin and clear your browser cache before re-installing the plugin.

Again, please feel free to feedback any bugs or improvements you find necessary.

Will Moffat said...

Hi, I like the new plug-in.

It's a real pity that Firefox doesn't support the full OpenSearch standard.

Btw, I was wondering if Freebase could support an additional parameter in its search API that lets developers specify the JSON format returned


We're working on a server-side Javascript engine for Freebase that would allow you to write your own Freebase services. Stay tuned to the Developers List for an announcement in the next month or so.

Fuzziebrain said...

Thanks Will. I will definitely have my ears peeled for the announcement. It's a good step forward!

Yes, it's a pity that Firefox doesn't support the extensions fully. It'll be great if they do. But at least there's some support. I haven't got it to work with IE7 or Opera yet. Once that's done, I might move it to Mycroft and also publish a Freebase topic for it.

I'm also considering moving the scripts used to make the plugin work, over to Google AppEngine. But the have to be ported to Python, so there's a bit of a learning curve for me before that gets done.