[Developers] Freebase and Yahoo Pipes

Shawn Simister narphorium at gmail.com
Sat Jan 19 00:22:11 UTC 2008


I'd like to use Freebase data in a Yahoo pipes mashup but Pipes seems to 
be having trouble passing a valid query envelope to the read service. In 
my pipe, I'd like to execute the following query on Freebase.

{"query":[{"alias":"CPU","name":null,"type":"/common/topic"}]}

So I build a URL that points to the read service and passes the query 
envelope via the queries parameter. This gives me the following URL in 
Yahoo Pipes.

http://www.freebase.com/api/service/mqlread?queries=%7B%22query%22%3A%5B%7B%22alias%22%3A%22CPU%22%2C%22name%22%3Anull%2C%22type%22%3A%22%2Fcommon%2Ftopic%22%7D%5D%7D

When I try to fetch that URL, Freebase returns the following error.

{
  "status": "200 OK", 
  "query": {
    "code": "/api/status/error", 
    "messages": [
      {
        "info": {}, 
        "message": "Query envelope must be a dictionary", 
        "code": "/api/status/error/envelope/parse"
      }
    ]
  }, 
  "code": "/api/status/ok"
}

I suspect that this is happening because Freebase doesn't like having 
all the non-alphanumeric characters escaped. This is reinforced by the 
fact that I can get the desired results by fetching the following URL 
directly from my web browser.

http://www.freebase.com/api/service/mqlread?queries={%22query%22%20:%20[{%22alias%22%20:%20%22CPU%22,%22name%22%20:%20null,%22type%22%20:%20%22/common/topic%22}]}

Unfortunately, Yahoo Pipes seems to insist on escaping everything in the 
URLs that it fetches so I'm stuck. Would it be possible for Freebase to 
support fully escaped query envelopes? Alternately, is there anyone who 
has been able to successfully mashup Freebase data in Pipes?

Thanks,
Shawn


More information about the Developers mailing list