18.Jan.2009
Again on web APIs, Yahoo launched in late 2008 its own data query language, YQL. It is similar to SQL, where the tables are Yahoo’s APIs: flickr, mybloglog, upcoming and many other services. As a quick example, this is how you query for 10 flickr photos with cats:
SELECT * FROM flickr.photos.search WHERE text="Cat" LIMIT 10
The queries still have to go through a REST API, so in the end you’ll be doing this request:
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20 flickr.photos.search%20where%20text%3D%22Cat%22%20limit%2010&format=xml
This query language is however very limited when comparing to SQL. It only supports WHERE, OFFSET, LIMIT and IN statements with sub-selects inside, and no modifying queries like INSERT, UPDATE or DELETE. More recently, support for microformats was added.
Seriously, I don’t believe this kind of API will get widely used. It increases the barrier for non-programmer folks and the final query result is everything but a pretty url. However, I find the idea of adopting an existing standard important and SQL has it’s advantages. You don’t have to find out how to iterate through all those different APIs, you just have to use LIMIT and OFFSET. And the sub-selects seem to be an interesting concept for a role usually played by a tool like Yahoo Pipes:
SELECT * FROM social.profile WHERE guid IN (SELECT guid FROM social.connections WHERE owner_guid=me)
For more information, check out the YQL documentation.
If you enjoyed this post, consider subscribing to my RSS FeedSérgio Santos | Creative Commons | Powered by mephisto & micro theme | I like you :)
1 Comment
Sorry, comments are closed for this article.
Follow this post comments with this RSS feed.