Internationalization in Freebase

A few people have asked about multi-lingual data in Freebase, and as our user base grows, a few people have started posting data in languages other than English.

Freebase is in a bit of a weird state right now: the data is fully internationalized (if not fully populated), but the UI is not. As a result, users may think that there is no non-English data, and they may enter non-English data with the implicit assertion that it is actually English.

So how can users read and write internationalized data? “Very carefully,” as the joke goes. Right now, the only access is via MQL.

Take a look at Moscow in the UI. As of this writing, it only has the display name of “Moscow,” as well as some interesting aliases: the English “Moscow, Russia,” but also stuff in Cyrillic writing (“Москва, Россия” and “Москва”). But now take a look at the query editor. This query:

{
  "query":{
    "/common/topic/alias":[{}],
    “id”:”/topic/en/moscow”,
    “name”:[{}]
  }
}

will show this (abridged) result:

{
  "code":"/api/status/ok",
  "result":{
    "/common/topic/alias":[{
      "lang":"/lang/en",
      "type":"/type/text",
      "value":"Moscow, Russia"
    },
    ...],
    “id”:”/topic/en/moscow”,
    “name”:[{
      "lang":"/lang/en",
      "type":"/type/text",
      "value":"Moscow"
    },{
      "lang":"/lang/ru",
      "type":"/type/text",
      "value":"Москва"
    },
    ...]
  }
}

You can see that because {} was used in the name and alias properties, the values are expanded to give us the value and the language. This is true of any property whose expected type is “Text.” Similarly, creating or deleting text values uses this syntax.

You may also note (if it’s still true when you read this) that the Cyrillic aliases are explicitly tagged as being English:

    "/common/topic/alias":[{
      "lang":"/lang/en",
      "type":"/type/text",
      "value":"Москва"
    },{
      "lang":"/lang/en",
      "type":"/type/text",
      "value":"Москва, Россия"
    }],

We can fix that by deleting and rewriting them. (If you try this yourself, please run it on sandbox so that others can still see the result of the query.) We don’t actually need to rewrite “Москва” since that’s already the Russian display name; however, we will add the longer one.

{
  "query" : {
    "/common/topic/alias" : [
      {
        "connect" : "delete",
        "lang" : "/lang/en",
        "type" : "/type/text",
        "value" : "Москва"
      },
      {
        "connect" : "delete",
        "lang" : "/lang/en",
        "type" : "/type/text",
        "value" : "Москва, Россия"
      },
      {
        "connect" : "insert",
        "lang" : "/lang/ru",
        "type" : "/type/text",
        "value" : "Москва, Россия"
      }
    ],
    “id” : “/topic/en/moscow”
  }
}

The Moscow topic now still shows the Russian alias. At some point, the client will present multilingual information more intelligently, and allow users to set their default languages to something other than English, but for now it is possible, though not simple, to read and write information in languages other than English.

We have populated the names of many topics in multiple other languages (as the full result of the Moscow query shows) using information from Wikipedia linking equivalent topics in other languages. However, if you are comfortable with MQL and speak a language other than English, you might entertain yourself adding names in other languages to a few topics.

You can also help us set our implementation priorities by telling us how important multilingual access is to you, and what languages are most important.

Tags: , , , ,

2 Responses to “Internationalization in Freebase”

  1. philip Says:

    Hi,

    I used MJT template library, but it doesn’t seem to work in Opera browser. Works in FF and IE.
    Are you aware of this? can you confirm is it true?

    Thanks, Philip

  2. Brendan Says:

    I know that the freebase.com site officially supports IE6+ and FF1.5+ (not Safari or Opera at this time)

    I believe mjt is supports IE, FF, and Safari 2. I don’t think Opera is currently supported. By supported, I mean, tested and targeted for bug fixing.

    I know that’s probably not the answer you were hoping for, but I think that is the current status.

Leave a Reply

About

Freebase is a free database of the world's information. This is the official Freebase blog.