[Developers] Another Ruby API

Christopher R. Maden crism at metaweb.com
Tue Jan 1 17:51:50 UTC 2008


Chris Eppstein <chris at eppsteins.net> wrote:
> I'm starting work on a new freebase-enabled web application using ruby  
> on rails

Cool news, Chris.  Thanks for sharing it.  One comment here:

>    # I don't know why, but I'm getting some random nils here that  
> makes this code a little awkward.
>    # It's probably a bug in my code.

It’s not a bug in your code; it’s because not all albums have English titles.  When you ask for

  "name":null

on a topic, you are asking for the name in the default language (English).  Since many of the albums we imported do not have titles that would be useful to an English speaker (all kanji or Cyrillic characters, for example), we didn’t give them English titles.  You can ask for

  "name":[{"value":null,"lang":null}]

instead, or just be prepared for null names in your code.  See <URL: http://blog.freebase.com/?p=58 > for more details on internationalization in Freebase.

~Chris
-- 
Christopher R. Maden
Data Architect
Metaweb Technologies, Inc.
<URL: http://www.metaweb.com/ >


More information about the Developers mailing list