1 / 33

YQL Overview

This overview will cover:- YQL SELECT, INSERT, UPDATE and DELETE query Syntax- Open Data Tables- YQL Execute

jcleblanc
Download Presentation

YQL Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Jonathan LeBlanc – Technology Evangelist Yahoo! Developer Network Twitter: @jcleblanc 1

  2. 2

  3. YQL Query Structure SELECT * FROM Internet 3

  4. YQL Test Console Available At: http://developer.yahoo.com/yql/console 4

  5. Running Queries - SELECT Query Structure SELECTmyColumn, myTitle FROM myTable(0, 50) WHEREmyColumn = 'value' ANDmyTitle = 'title„ LIMIT3 OFFSET 10 | sort(field='myColumn') | reverse() 5

  6. Running Queries - INSERT Query Structure INSERT INTObitly.shorten (login, apiKey, longUrl) VALUES (‟ME', 'API_KEY', 'http://yahoo.com') 6

  7. Running Queries - UPDATE Query Structure UPDATE social.profile.status SETstatus="Using YQL UPDATE" WHEREguid=“NJFIDHVPVVISDXZKT7UKED2WHU” 7

  8. Running Queries - DELETE Query Structure DELETE FROM twittertable WHERE tweetid="12345" AND username="twitter_username" AND password="twitter_password 8

  9. Running Queries– Sub-selects with the IN clause SELECT * FROM table WHERE field IN (SELECT * FROM table) SELECT * FROM flickr.photos.search WHERE (lat, lon) IN (SELECT centroid.latitude, centroid.longitude FROM geo.places WHERE text="SFO") 9

  10. Running Queries – Available Tables YQL Command: SHOW Tables Number of Standard Tables: 108 Number of Community Tables: 521 Total Number of Tables: 629 Contribute Tables to: http://www.github.com/yql/yql-tables/ 10

  11. Running Queries – Table Syntax YQL Command: DESC tablename 11

  12. Running Queries– URL Format http://query.yahooapis.com/v1/yql?[params] http://query.yahooapis.com/v1/public/yql?[params] Params • q=[QUERY] • format=[XML / JSON] • diagnostics=[true / false] • debug=[true / false] • env=[.env file link] • callback=[function name] 12

  13. Running Queries– URL Format http://query.yahooapis.com/v1/yql?[params] http://query.yahooapis.com/v1/public/yql?[params] Params • q=[QUERY] • format=[XML / JSON / JSONP / JSONP-X] • diagnostics=[true / false] • debug=[true / false] • env=[.env file link] • callback=[function name] 13

  14. Running Queries– XML to JSON LossyConversion 14

  15. YQL Open Data Tables Wrap Your Own API or Data Source 15

  16. Open Data Tables – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/tabl e.xsd"> <meta></meta> <bindings></bindings> </table> 16

  17. Open Data Tables – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/tabl e.xsd"> <meta></meta> <bindings></bindings> </table> 17

  18. Open Data Tables – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <author>Jonathan LeBlanc</author> <description>My Table</description> <documentationURL>www.site.com</documentationURL> <sampleQuery>SELECT * FROM {table} </sampleQuery> </meta> <bindings></bindings> </table> 18

  19. Open Data Tables – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/tabl e.xsd"> <meta></meta> <bindings></bindings> </table> 19

  20. Open Data Tables – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta></meta> <bindings> <select itemPath="" produces="XML" > <urls> <urlenv="all”>http://www.site.com/{user}</url> </urls> <inputs> <key id="user" type="xs:string" paramType="path" required="true" /></inputs> </select> </bindings> </table> 20

  21. Google Buzz Table Available At: http://github.com/yql/yql-tables

  22. Open Data Tables – Invoking a Table Definition The USE clause USE 'http://github.com/yql/yql- tables/raw/master/google/google.buzz.upd ates.xml' AS buzz.updates; SELECT * FROM buzz.updates WHERE user='nakedtechnologist' 22

  23. Open Data Tables – .env Files http://datatables.org/alltables.env USE 'http://www.datatables.org/amazon/amazon.ecs.xml' AS amazon.ecs; USE 'http://www.datatables.org/bitly/bit.ly.shorten.xml' AS bit.ly.shorten; USE 'http://www.datatables.org/dopplr/dopplr.auth.xml' AS dopplr.auth; USE 'http://www.datatables.org/dopplr/dopplr.city.info.xml' AS dopplr.city.info; 23

  24. YQL Execute Extending Open Data Tables 24

  25. YQL Execute – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" > <meta></meta> <bindings> <select itemPath="" produces="XML" > <urls></urls> <inputs></inputs> </select> </bindings> </table> 25

  26. YQL Execute – XML File Syntax <?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" > <meta></meta> <bindings> <select itemPath="" produces="XML" > <urls></urls> <inputs></inputs> <execute></execute> </select> </bindings> </table> 26

  27. Global Disaster Alert and Coordination System Table Available At: http://github.com/yql/yql-tables

  28. YQL Execute – OAuth Support

  29. Netflix Movie Search Table Available At: http://github.com/yql/yql-tables

  30. http://events.carsonified.com/fowa/2010/miami Session Information Time: 9:00am – 12:30pm Session: Hands on workshop on how to build applications using YQL Free YQL Workshop Date: 02/24/2010 Address: Adrienne Arsht Centre 1300 Biscayne Blvd Miami, Florida 33132

  31. This Presentation http://www.slideshare.net/jcleblanc YQL Documentation http://developer.yahoo.com/yql YQL Console http://developer.yahoo.com/yql/console YQLGithub Account (Contribute Tables) http://github.com/yql/yql-tables

  32. Thank You Questions? 33

More Related