Freebase, the Semantic Web, and the Metaweb Query API

As I discussed in my article on the Semantic Web for our Crackpot Tech feature on February 19th, the standard Web was originally designed for document distribution, and has yet to realize its full potential for distributing data. The Semantic Web is an effort to relate information by classifying it and linking the classifications. Some of the efforts related to the Semantic Web concentrate on ontologies, or

Some of the efforts related to the Semantic Web concentrate on ontologies, or systems of classification. As useful as ontologies can be, they often seem dry and academic to me.

Once ontologies are turned into database schemas, they often make more sense, at least to me. And once the database is implemented and the application built, it all falls into place.

Imagine my delight, then, to find that the new Freebase site is something like a modifiable database already integrated with a Web application, or as the FAQ puts it: is home to a global knowledge base: a structured, searchable, writeable and editable database built by a community of contributors, and open to everyone.  It could be described as a data commons.

How is that different from Wikipedia? There's a FAQ for that, too:

It's an apple versus an orange: each is deliciously different. Wikipedia is an encyclopedia with information arranged in the form of articles. Freebase is more of an almanac, organized like a database, and readable by people or software. Wikipedia and Freebase both appeal to people who love to use and organize information. In fact, many of the founding contributors to Freebase are also active in the Wikipedia community. Whenever Freebase and Wikipedia cover the same topic, Freebase will link to the Wikipedia article to make it easy for users to access the best of both sites.

The Freebase type system is basically a flexible, editable ontology. For example, in the computer domain are types about computer hardware, software, computer science and theory, for example Programming Language. If you're browsing the Programming Language type, you can filter the 94 currently listed languages by the properties of the type: Name, Parent Language, Language Paradigms, Influenced By, Influenced, Dialects, Language Designers.

If I type "Gui" into the Language Designers filter entry, I get a drop-down completion of Guido van Rossum, along with a pop-up entry about Guido of type Programming Language Designer. If I filter by his name, I of course get an entry for Python (in this case, a description based on a Wikipedia article), which has the type Software as well as the type Programming Language.

Get it?

There's more. Freebase has an open API, the Metaweb Query API. Here's a sample read query, broken into two lines so that you can see it all:{"albums":{"query":{
"type":"/music/artist","name":"The Police","album":[]}}}

If you have a Freebase account and have used it on the browser running the query, this will most likely return a JSON-format response giving a list of albums by The Police, which you can save as a text file and view with an editor. Otherwise, it will probably give you an Error 401. It will not give you back articles about police in law enforcement, because we have restricted the queried record type to musical artists and asked to be given a list of albums.

Now, getting back a text file is not exactly stimulating stuff, but this API can easily be turned into an application using some fairly simple code like the freely available JavaScript for parsing JSON format. It would not necessarily have to be an application that interrogates Freebase. And there, eventually, is how Metaweb, the company behind Freebase, expects to make its money: by licensing commercial applications using its technology.

Want to give it a try? It's currently still in Alpha test, and by invitation only. You can try entering your email address at; I don't know how quickly you'll get a response. On the other hand, if you know someone who has Freebase invitations to give out, you can probably get on in a matter of minutes.

At this point, I have five invitations to give out. They will go to people I actually know, so please don't ask me for one if we haven't already met.

Copyright © 2007 IDG Communications, Inc.