2

Using JSON as an Open Data Table source

I'm trying to create Open Data Table definitions to enable the use of data from Freebase in YQL queries. I think I have everything working except for choosing a itemPath for the select element.

Here's a sample YQL query that uses this Open Data Table definition which results in results that look like this.

As you can see from the sample results, the Freebase query returns an array of JSON objects under the path "result". When I use that as my "itemPath", YQL returns an empty set of results.

What "itemPath" should I be using to get YQL to actually return results?

2 Replies
  • Two problems. One is that freebase is returning a malformed charset: charset="utf-8" vs charset=utf-8 [1]. The other would be apparent once we put out some code to be much more lenient in what we accept.

    Due to some of the vagaries of how YQL is processed internally -- the way it normalizes data -- we unfortunately have to put an additional top level element into the result named 'json' for this case. So your itemPath will end up being 'json.result'. I'm sorry that this doesn't yet work because of our strict charset handling.

    Sam

    [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
    0
  • Thanks, Sam! That fixed me right up. I'll post back to here once I have an interesting mashup working.
    0

Recent Posts

in YQL