An Introduction to Freebase Application Development

You're a web developer, you've seen some cool apps that use Freebase but you can do better ... where do you start?

Get friendly with the apps page 

The Make page is the central resource for developers.  Here you'll find links to documentation, discussions, sample applications, and more.

Learn MQL

To access Freebase you need to learn MQL , the Metaweb Query Language.  It's documented in MQL Reference Guide.

You can experiment with MQL, and see some simple examples, in the Query Editor.

If you view any of our Freebase queries, there's also an option on the left hand side to show the original MQL.

There's also Query Builder - a visual query builder, fantastic if you don't dream in MQL.

You may also find it useful to use the dev toolbar while working on MQL queries.  On any topic page you can show the dev toolbar by pressing F8 and scrolling down. This lets you access the explore view (a Gray's Anatomy example) which shows all the data on a topic (compare to normal view) Don't waste time writing MQL queries for data that doesn't exist.

Develop apps in Javascript

Javascript is currently our best supported development language, though you can also write Freebase apps in any other language which can make HTTP requests (i.e. just about all of them.) 

Since Freebase provides a JSON API  it's easy to write complete applications that run entirely inside a web browser, no server-side programming required.

  • Hello World. This List of Countries is generated with only a few lines of Javascript. You might want to read about mqlread in the API docs.

Create hosted web applications with Acre and App Editor

Acre is a hosted Freebase application server that includes an App Editor. With Acre you can create and run Freebase applications in your own namespace, and App Editor provides not only an easy way to create them, but access to applications created by others that you can use to build your own applications.

Be more productive with Mjt 

You can increase your productivity by using mjt, Metaweb's Javascript templating tool.

The mjt intro tour is a great way to learn about mjt. This O’Reilly shortcut about mjt and this one about mjt apps are definitely worth reading.

Tips: 

  • Link to mjt.js on mjtemplate.org for improved cache performance.
  • You might need your own server side code to store private data. All data on Freebase is public and should (in theory) be interesting to at least some percentage of the planet.
  • To preserve your sanity when debugging we recommend Firefox + Firebug and a text editor that can validate XHTML.

Develop apps in Python

Most of the examples in our API manual are written in Python.  A Python library is also available on Google Code: freebase-python.

Publicize your application

Once your app is created, tell the world about it! 

  1. Create a new topic for it of type Freebase Application (or Metaweb Framework if you're working on a framework, library, module, etc.)
  2. When your app or framework is ready for public consumption co-type it Freebase Listing and fill in the newly created properties.
  3. Make sure you attribute Freebase as your data-source with a link to Freebase.com
  4. Tell the world, well at least the developers mailing list if you'd like feedback. You could also apply for a job ;-)
Get help from the Freebase community

For further info, tips and help:

Search Help Center

Discussions

searching for propertys

"thanks philg, that was a great help :) what i've managed to do is print out the value of the..."

10 posts

mqlread link broken

"Ah, thanks, fixed! "

4 posts

links to sample apps are http//todo

"Thanks for that catch, I've updated it with a link to the JavaScript applications view of the..."

2 posts

What's missing from this guide?

"What did you wish somebody had told you when you started developing with Freebase? "

1 post
Join the Discussion »