R – Freebase MQL query for topic summary and image

freebasemql

I'm trying to write an MQL query to be executed using Freebase API's. I would like to retrieve the topic summary and the image for the topic.

I have been able to work out the below query which will get me the images associated with the Bill Gates topic.

MQL:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/people/person"
  }
]

Results:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "name" : "Bill Gates",
    "type" : "/people/person"
  }
]

For those that may have not run into MQL in the past but are interested in playing around with it. Check out the Freebase MQL Query Editor.

billg profile page http://i.friendfeed.com/c31a22d9e439eb67b0feeb4ffd64c3b5ed9a8e16

UPDATE

Query that I ended up using:

[
  {
    "/common/topic/image" : [
      {
        "id" : null
      }
    ],
    "article" : [
      {
        "content" : null
      }
    ],
    "name" : "bill gates",
    "type" : "/common/topic"
  }
]

These results can be combined with narphorium's answer to retrieve the actual data:

[
  {
    "/common/topic/image" : [
      {
        "id" : "/guid/9202a8c04000641f8000000004fb4c01"
      },
      {
        "id" : "/wikipedia/images/commons_id/4486276"
      }
    ],
    "article" : [
      {
        "content" : null
      },
      {
        "content" : "/guid/9202a8c04000641f800000000903535d"
      }
    ],
    "name" : "Bill Gates",
    "type" : "/common/topic"
  }
]

Best Solution

The images and topic summaries are stored separately in the content store and are accessible via another web service API.

For example, Bill Gates' image can be accessed like this:

http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000004fb4c01

Similarly, the GUID for the topic summary can be found by replacing /common/topic/image with /common/topic/article in your query. The results can be accessed again like this:

http://www.freebase.com/api/trans/raw/guid/9202a8c04000641f8000000008bfed35

You can read more about the content store here.

Related Question