Freebase London meeting

August 18, 2008

I’ll be at the Freebase London meetup on Wednesday night. If you’re interested in mashing-up open data, server-side javascript or just curious about Freebase then do come along and say hi.

One of the topics of conversation is sure to be the awesome prototype Freebase interface that David created, Freebase Parallax. Read the release notes and watch the video, it’s 8 minutes but it really gives you an idea of the power of Freebase.

Advertisements

MQL: Finding the Wikipedia page for a Freebase Topic

November 27, 2007

Freebase contains many articles mined from the Wikipedia. For example, this page about Edinburgh.

You might want to show the Wikipedia page in your own web application. Given the Freebase topic ID, in this case /en/edinburgh

This MQL query will return the Wikipedia ‘curid’

[{
"id" : "/en/edinburgh",
"key" : [{
"namespace" : "/wikipedia/en_id",
"value" : null
}]
}]

Run in Query Editor

Result:
{
"code":"/api/status/ok",
"result":[{
"id":"/en/edinburgh",
"key":[{
"namespace":"/wikipedia/en_id",
"value":"9602"
}]
}]
}

The Wikipedia URL is then:
http://en.wikipedia.org/wiki/index.html?curid=9602

Update: You can find the Wikipedia article name + all the redirect names with this query but as far as I know there’s no way to distinguish between redirects and the current article name.


Tagging demo with Freebase Suggest

November 8, 2007

I whipped up a quick example of tagging with Freebase Suggest.

This is just the client-side user interface. Integration with an existing tagging system is left as an exercise for the reader 😉

Screenshot of Tagging demo


Freebase Suggest demos

October 14, 2007

As an excuse to avoid packing my suitcase (an activity which I detest about as much clothes shopping) I wrote a few examples for Freebase Suggest.

The live demos are on the Freebase Suggest project page.

(Geek note: The 3rd demo includes a first attempt at a Freebase MiniTopic plugin for jQuery. This is a really easy way to generate an infobox or summary of a Freebase topic for your own page)

Freebase Suggest in action


Freebase apps without cookies

August 9, 2007

Freebase just announced that

Within a week or so we will be removing the registration requirement in order to view Freebase.

Soon all my demo apps will work without requiring a Freebase invite. Cool!


Avoiding timeouts – Using MQL cursors with MJT

August 4, 2007

If you start to develop Freebase applications you then at some point you will inevitably see the error message “Query timeout”

For example, if you wanted to get a list of Musical Artists in Freebase you might try this query

{
“query”:[{
“id”:null,
“limit”:0,
“name”:null,
“type”:”/music/artist”
}]
}

But as there are almost 1/3 million artists in the database this query will timeout. That’s just as well, otherwise you would be loading a 30MB JavaScript file!

That was an extreme example, but as more users register with Freebase, my Map of Freebase Users occasionally timeouts. (It’s actually the MJT library which imposes the deadline here, not necessary the database which timeouts). Even if your application isn’t timing out, you find that your browser becomes unresponsive as it loads large JavaScript files from the database.

The solution is to use MQL cursors

I’ve created an example using MQL cursors in MJT which demonstrates a number of concepts:

  • Using MQL cursors
  • Calling MJT templates with arguments
  • Incremental queries (the page updates without reloading)

BBCode – live editor

July 12, 2007

I’m working on a BBCode generating bookmarklet for Freebase data. I didn’t want to pollute online forums with lots of test posts so I whipped up my own BBCode live editor.

Type BBCode into the top textarea and the rendered HTML will appear after a second of inactivity.

There are other live editors on the web but since I’m running my own I can easily configure it to support the different dialects out there.

Will’s live editor in action:

  1. bolded text
  2. italicized text
  3. underlined text
  4. http://wikipedia.org
  5. Wikipedia