0

Parameters in YQL Queries

Hi, I'm trying out some geo queries on the YQL console with mixed success.

I'm trying using MySQL like statements which may be my problem, can anyone tell me what's wrong with the following examples.

// Looking for places called Leeds in the UK
select * from geo.places where text="Leeds" and country_code="GB"

// Looking for towns in Australia
select woeid, name from geo.places.children where parent_woeid = 23424748 and placeTypeName = "Town" limit 10

Thanks in advance

by
3 Replies
  • Hi Chaoley,

    In the first query, there is no "country_code" parameter for geo.places. You can find out the available parameters using the "desc" command on the table, like this:
    http://developer.yahoo.com/yql/console/?q=desc%20geo.places

    Also, if you hover over the link to a table in the "Data Tables" column of the YQL console, a link to run desc on the table will show up.

    For the first query, you might try this instead:
    http://developer.yahoo.com/yql/console/?q=...pe%3D%22town%22

    Regarding the second query, there is no parameter named "placeTypename". Use "placetype" instead. Also, the woeid you are using may not have any children of placetype "town". Here's a similar query that does return a value:
    http://developer.yahoo.com/yql/console/?q=...22%20limit%2010

    Here's a link to a post on the Yahoo! Geo blog, which mentions YQL usage:
    http://www.ygeoblog.com/2008/11/yahoo-geoplanet-and-yql/

    Good luck. Please post back if you have any questions.

    Erik

    QUOTE (Chaoley @ May 1 2009, 05:51 AM) <{POST_SNAPBACK}>
    Hi, I'm trying out some geo queries on the YQL console with mixed success.

    I'm trying using MySQL like statements which may be my problem, can anyone tell me what's wrong with the following examples.

    // Looking for places called Leeds in the UK
    select * from geo.places where text="Leeds" and country_code="GB"

    // Looking for towns in Australia
    select woeid, name from geo.places.children where parent_woeid = 23424748 and placeTypeName = "Town" limit 10

    Thanks in advance
    0
  • Hi Erik

    Thanks very much for that, it's becoming clearer, I'll try out a few queries using your examples.

    I'm sure I'll have more questions in a day or two :-)
    0
  • Hi again

    I'm getting some good results with YQL using some of the examples supplied.

    Is there anywhere I can submit feature requests, eg. searching for all places in a country where placetype='town'

    thanks again for the examples
    0

Recent Posts

in YQL