rBase
I’ve written about Freebase before, when I wanted an invite. Now I’m writing about it again because I have had an invite for about a week, and I’m enjoying the experience, as a user, but also as a developer. Freebase is a developers wet dream. Data is structured, the API works (although I’d prefer XML over json), and best of all, not everything you can think of has been done yet! So I gave it a go myself
I tried to implement Freebase in Ruby as a class, which automatically interfaces with Freebase throught some easy activerecord-like commands. Example:
1 2 3 4 5 6 |
metallica = Freebase.find(:first, :name => 'Metallica', :type => '/music/artist') metallica.album.first(5) => ["Kill 'Em All", "Ride the Lightning", "Garage Days Re-Revisited", "...and Justice for All", "Harvester of Sorrow"] metallica.genre => ["Metal"] |
Its a first draft, just to see what I can do. The great thing about Freebase is it’s very young. Although Will pointed out that a lot of data still needed to be added/sorted, I think it’s great that there are only 2,632 users, because that means you can implement your ideas first!
TODO for my little project
- Pluralization (so I can say metallica.albumS)
- Error Handling (Its really sad right now)
- Relationships (So I can say metaillica.albums.first.tracks)
- find a good name (please help me with that, I took rBase because it sounds cool, but I want something better)
Comments
-
Sweet! I put a link on my "blog":http://hamstersoup.wordpress.com/2007/05/11/freebase-ruby/
I feel obliged to defend JSON. I find it a really elegant format, I can parse it for free (in Javascript) and I love the symmetry with the query language MQL.
I imagine the Freebase guys will add other API formats. In the end it's all just data.
Is your code available somewhere?
-
Nice. You're on my radar now :-)
I want to try Freebase too (got the invite yesterday), and with 99% certainty I will use Ruby to do it (though I still consider Java to be my mother tongue). So this effort looks interesting. If you're interested in getting a bit more involvement from me, let me know.
urbase? (as in 'all urbase are belong to us') ;-)