SlideShare a Scribd company logo
1 of 26
Yahoo Query Language: select * from internet Derek Gathright
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon );  map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c YQL YQL stmt
Why YQL? Thousands of Web Services and sources that provide valuable data Require Developers to read documentation and form URLs/queries. Data is isolated Needs filtering, combining, tweaking, shaping even after it gets to the developer.
What is YQL? Cloud web service and SQL-Like Language  Familiar to developers Synonymous with Data access Expressive enough to get the right data. Self describing - show, desc table Allows you to query, filter, join and update data across any structured data on the web / web services And Yahoo’s sherpa cloud storage Real time engine
YQL Statement Basics show: lists the supported tables desc: describes the structure of a table select: fetches data insert/update/delete: modify data use: use an Open Data Table set: define key-values across Open Data Tables
Insert / Update / Delete With INSERT/ UPDATE/ DELETESQL verbs you can modify data on the internet or cloud create tweets, add blog entries, update DBs etc store tables or pieces of code in sherpa Some tables with I/U/D Twitter, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
Demo: developer.yahoo.com/yql/
Get any data: Open Data Tables
Open Data Tables ,[object Object]
datatables.orgmirrors the master and builds a single environment with all tables (faster serving)
Console with community tables
Brings the power of the table model to new APIs
Schema defines mapping between YQL and Endpoint
Keys can either be query, path or matrix parameters
Keys can be marked as required
YQL Compiler validates existence of required keys,[object Object]
Open Data Table example
Open Data Table example
ODT <execute> element Extends Open Data Tables with server-side code Javascript server-side scripting No DOM, events etc, pure JS scripting E4X support - XML literals, filtering ... YQL no longer performs a GET request to the table binding URL YQL provides additional useful global objects request, response, y.rest, y.include, y.query... Execute tag must return the data that will be the output of the YQL select Move business logic of your application to the cloud
What you can do with <execute> access APIs that require authentication Netflix OAuth, FlickrAuth, Google AuthSub join data across services grab New York Times article tags and generate find associated flickr photos combine multiple searches into a single result (twitter, web, news and images) augment data: city/state to APIs that just return zip code create APIs from web page celebrity birthdays scraped from imdb, caltrain data transformation convert the result from xml to Google's kml format
hello world <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta>     <sampleQuery>select * from {table} where a=’hello' and b=’world';</sampleQuery> </meta> <bindings> <select itemPath="" produces="XML"> <urls><url>http://fake.url/{a}</url></urls> <inputs> <key id='a' type='xs:string' paramType='path' required="true" /> <key id='b' type='xs:string' paramType='variable' required="true" /> </inputs> <execute><![CDATA[ // Your javascript goes here. We will run it on our servers response.object = <item> <url>{request.url}</url> <a>{a}</a>                    <b>{b}</b>                 </item>;       ]]></execute>    </select>   </bindings> </table>
Scraping a page <select produces="XML" itemPath="deals.deal">       <urls><url>http://deals.yahoo.com</url></urls>       <execute><![CDATA[ vardealhtml = y.query("select * from html where url='http://deals.yahoo.com' and xpath='//div[contains(@class, quot;product-displayquot;)]'").results; var deals = <deals/>; function compress(object) {     if (!object) return "";     return object.toString().replace(/+/, " ") } for each (var div in dealhtml.div) { var deal = <deal/>; deal.name += <name>{compress(div.h3.a.text())}</name>; deal.link += <link>{div.div[0].a.@href}</link>; … deal.description += <description>{compress(div.p[0].*)}</description>; deal.logo += <logo>{compress(div.div[1].*)}</logo>; deals.deal += deal; } response.object = deals;       ]]></execute>     </select>
Twitter Select select *from twitter.statuswhere id="2108869549"andusername="xxx"and password="yyy” <select itemPath="" produces="XML"> 	<urls><url>http://twitter.com/statuses/show/{id}.xml</url></urls> 	<inputs> 		<key id="username" type="xs:string" required="false" paramType="variable"/> 		<key id="password" type="xs:string" required="false" paramType="variable"/> 		<key id="id" type="xs:integer" required="true" paramType="path"/> 	</inputs> 	<execute><![CDATA[ varr = null;      	if (username && password) {          		y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); r = request.header("Authorization",authheader).get().response;       	} else { r = request.get().response;       	} response.object = r; 	]]></execute> </select>

More Related Content

Viewers also liked

Edisi 6 Des Nas
Edisi 6 Des NasEdisi 6 Des Nas
Edisi 6 Des Nasepaper
 
Edisi 6 Des 2009 Nas
Edisi 6 Des 2009 NasEdisi 6 Des 2009 Nas
Edisi 6 Des 2009 Nasepaper
 
TIGHITCO Presentation
TIGHITCO PresentationTIGHITCO Presentation
TIGHITCO Presentationpriley4rsa
 
Project UpCity - Local Phase Report
Project UpCity - Local Phase ReportProject UpCity - Local Phase Report
Project UpCity - Local Phase ReportAdi Buzgar
 
Vim Cards - Keynote Format
Vim Cards - Keynote FormatVim Cards - Keynote Format
Vim Cards - Keynote FormatAdam Lowe
 
Frdm
FrdmFrdm
FrdmFRDM
 
Empower, engage, enrich pcca 2016
Empower, engage, enrich   pcca 2016Empower, engage, enrich   pcca 2016
Empower, engage, enrich pcca 2016Tim Richardson
 
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Deepak Ravindran
 
Aiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAnastasiya Avdeyeva
 
Edisi16oktnasional
Edisi16oktnasionalEdisi16oktnasional
Edisi16oktnasionalepaper
 
Edisi4novnas
Edisi4novnasEdisi4novnas
Edisi4novnasepaper
 
6juni nas
6juni nas6juni nas
6juni nasepaper
 
The case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationThe case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationJavier Ruiz
 
Edisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruEdisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruepaper
 
Edisi 18 Nov Nas
Edisi 18 Nov NasEdisi 18 Nov Nas
Edisi 18 Nov Nasepaper
 
Почему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапПочему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапMax Ischenko
 
GXYSearch: job seeking advice
GXYSearch: job seeking adviceGXYSearch: job seeking advice
GXYSearch: job seeking adviceJoanne Spain
 

Viewers also liked (20)

TESTANDO
TESTANDOTESTANDO
TESTANDO
 
Kilifi Pictures
Kilifi  PicturesKilifi  Pictures
Kilifi Pictures
 
Edisi 6 Des Nas
Edisi 6 Des NasEdisi 6 Des Nas
Edisi 6 Des Nas
 
Edisi 6 Des 2009 Nas
Edisi 6 Des 2009 NasEdisi 6 Des 2009 Nas
Edisi 6 Des 2009 Nas
 
TIGHITCO Presentation
TIGHITCO PresentationTIGHITCO Presentation
TIGHITCO Presentation
 
Project UpCity - Local Phase Report
Project UpCity - Local Phase ReportProject UpCity - Local Phase Report
Project UpCity - Local Phase Report
 
Vim Cards - Keynote Format
Vim Cards - Keynote FormatVim Cards - Keynote Format
Vim Cards - Keynote Format
 
Frdm
FrdmFrdm
Frdm
 
Empower, engage, enrich pcca 2016
Empower, engage, enrich   pcca 2016Empower, engage, enrich   pcca 2016
Empower, engage, enrich pcca 2016
 
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
Innoz Presentation on SMSGYAN at MIT-EmTech 2011,Bangalore.
 
Aiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For SandoraAiesec 2008 2009 Report For Sandora
Aiesec 2008 2009 Report For Sandora
 
Edisi16oktnasional
Edisi16oktnasionalEdisi16oktnasional
Edisi16oktnasional
 
Ecommerce 2k9
Ecommerce 2k9Ecommerce 2k9
Ecommerce 2k9
 
Edisi4novnas
Edisi4novnasEdisi4novnas
Edisi4novnas
 
6juni nas
6juni nas6juni nas
6juni nas
 
The case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organizationThe case of Labein Tecnalia technology institute as learning organization
The case of Labein Tecnalia technology institute as learning organization
 
Edisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baruEdisi aceh 26 07 10 baru
Edisi aceh 26 07 10 baru
 
Edisi 18 Nov Nas
Edisi 18 Nov NasEdisi 18 Nov Nas
Edisi 18 Nov Nas
 
Почему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартапПочему проджект менеджеры убьют ваш стартап
Почему проджект менеджеры убьют ваш стартап
 
GXYSearch: job seeking advice
GXYSearch: job seeking adviceGXYSearch: job seeking advice
GXYSearch: job seeking advice
 

Similar to Yahoo Query Language: Select * from Internet

Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2tonvanbart
 
Dynamic Struts Forms
Dynamic Struts FormsDynamic Struts Forms
Dynamic Struts Formsscacharya
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWRSweNz FixEd
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiBalaji Narayanan
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rob
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop NotesPamela Fox
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.Nerd Tzanetopoulos
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and DashboardsAtlassian
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration{item:foo}
 

Similar to Yahoo Query Language: Select * from Internet (20)

Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
 
Dynamic Struts Forms
Dynamic Struts FormsDynamic Struts Forms
Dynamic Struts Forms
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWR
 
Introduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT ChennaiIntroduction to YQL - Talk at HackU 2010, IIT Chennai
Introduction to YQL - Talk at HackU 2010, IIT Chennai
 
GWT
GWTGWT
GWT
 
Gooogle Web Toolkit
Gooogle Web ToolkitGooogle Web Toolkit
Gooogle Web Toolkit
 
Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008Rugalytics | Ruby Manor Nov 2008
Rugalytics | Ruby Manor Nov 2008
 
Hacking with YUI
Hacking with YUIHacking with YUI
Hacking with YUI
 
AJAX Workshop Notes
AJAX Workshop NotesAJAX Workshop Notes
AJAX Workshop Notes
 
Struts2
Struts2Struts2
Struts2
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Ajax for dummies, and not only.
Ajax for dummies, and not only.Ajax for dummies, and not only.
Ajax for dummies, and not only.
 
Ajax
AjaxAjax
Ajax
 
Ajax
AjaxAjax
Ajax
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
Opensocial Codelab
Opensocial CodelabOpensocial Codelab
Opensocial Codelab
 
Itemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integrationItemscript, a specification for RESTful JSON integration
Itemscript, a specification for RESTful JSON integration
 

Recently uploaded

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Yahoo Query Language: Select * from Internet

  • 1. Yahoo Query Language: select * from internet Derek Gathright
  • 2.
  • 3. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
  • 4. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c
  • 5. var map = new YMap(document.getElementById('map'));…varcurrentGeoPoint = new YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint);… … if (flickcurl_prepare(fc, "flickr.photos.geo.correctLocation", parameters, count)) { … } … http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/forecastrss?p=FRXX0076&u=c YQL YQL stmt
  • 6. Why YQL? Thousands of Web Services and sources that provide valuable data Require Developers to read documentation and form URLs/queries. Data is isolated Needs filtering, combining, tweaking, shaping even after it gets to the developer.
  • 7. What is YQL? Cloud web service and SQL-Like Language Familiar to developers Synonymous with Data access Expressive enough to get the right data. Self describing - show, desc table Allows you to query, filter, join and update data across any structured data on the web / web services And Yahoo’s sherpa cloud storage Real time engine
  • 8. YQL Statement Basics show: lists the supported tables desc: describes the structure of a table select: fetches data insert/update/delete: modify data use: use an Open Data Table set: define key-values across Open Data Tables
  • 9. Insert / Update / Delete With INSERT/ UPDATE/ DELETESQL verbs you can modify data on the internet or cloud create tweets, add blog entries, update DBs etc store tables or pieces of code in sherpa Some tables with I/U/D Twitter, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
  • 11. Get any data: Open Data Tables
  • 12.
  • 13. datatables.orgmirrors the master and builds a single environment with all tables (faster serving)
  • 15. Brings the power of the table model to new APIs
  • 16. Schema defines mapping between YQL and Endpoint
  • 17. Keys can either be query, path or matrix parameters
  • 18. Keys can be marked as required
  • 19.
  • 20. Open Data Table example
  • 21. Open Data Table example
  • 22. ODT <execute> element Extends Open Data Tables with server-side code Javascript server-side scripting No DOM, events etc, pure JS scripting E4X support - XML literals, filtering ... YQL no longer performs a GET request to the table binding URL YQL provides additional useful global objects request, response, y.rest, y.include, y.query... Execute tag must return the data that will be the output of the YQL select Move business logic of your application to the cloud
  • 23. What you can do with <execute> access APIs that require authentication Netflix OAuth, FlickrAuth, Google AuthSub join data across services grab New York Times article tags and generate find associated flickr photos combine multiple searches into a single result (twitter, web, news and images) augment data: city/state to APIs that just return zip code create APIs from web page celebrity birthdays scraped from imdb, caltrain data transformation convert the result from xml to Google's kml format
  • 24. hello world <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <sampleQuery>select * from {table} where a=’hello' and b=’world';</sampleQuery> </meta> <bindings> <select itemPath="" produces="XML"> <urls><url>http://fake.url/{a}</url></urls> <inputs> <key id='a' type='xs:string' paramType='path' required="true" /> <key id='b' type='xs:string' paramType='variable' required="true" /> </inputs> <execute><![CDATA[ // Your javascript goes here. We will run it on our servers response.object = <item> <url>{request.url}</url> <a>{a}</a> <b>{b}</b> </item>; ]]></execute> </select> </bindings> </table>
  • 25. Scraping a page <select produces="XML" itemPath="deals.deal"> <urls><url>http://deals.yahoo.com</url></urls> <execute><![CDATA[ vardealhtml = y.query("select * from html where url='http://deals.yahoo.com' and xpath='//div[contains(@class, quot;product-displayquot;)]'").results; var deals = <deals/>; function compress(object) { if (!object) return ""; return object.toString().replace(/+/, " ") } for each (var div in dealhtml.div) { var deal = <deal/>; deal.name += <name>{compress(div.h3.a.text())}</name>; deal.link += <link>{div.div[0].a.@href}</link>; … deal.description += <description>{compress(div.p[0].*)}</description>; deal.logo += <logo>{compress(div.div[1].*)}</logo>; deals.deal += deal; } response.object = deals; ]]></execute> </select>
  • 26. Twitter Select select *from twitter.statuswhere id="2108869549"andusername="xxx"and password="yyy” <select itemPath="" produces="XML"> <urls><url>http://twitter.com/statuses/show/{id}.xml</url></urls> <inputs> <key id="username" type="xs:string" required="false" paramType="variable"/> <key id="password" type="xs:string" required="false" paramType="variable"/> <key id="id" type="xs:integer" required="true" paramType="path"/> </inputs> <execute><![CDATA[ varr = null; if (username && password) { y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); r = request.header("Authorization",authheader).get().response; } else { r = request.get().response; } response.object = r; ]]></execute> </select>
  • 27. Twitter Update insert into twitter.status(status,username,password)values ("new tweet from YQL",”xxx”,”yyy”); <insert itemPath="" produces="XML"> <urls> <url>http://twitter.com/statuses/update.xml</url> </urls> <inputs> <value id="username" type="xs:string" required="true" paramType="variable"/> <value id="password" type="xs:string" required="true" paramType="variable"/> <value id="status" type="xs:string" required="true" paramType="variable"/> </inputs> <execute><![CDATA[ y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); var content = "status="+status; response.object = request.header("Authorization",authheader).post(content).response; ]]></execute> </insert>
  • 28. Twitter Delete delete from twitter.statuswhere id="2108869549"and username="xxx"and password="yyy” <delete itemPath="" produces="XML"> <urls> <url>http://twitter.com/statuses/destroy/{id}.xml</url> </urls> <inputs> <key id="username" type="xs:string" required="true" paramType="variable"/> <key id="password" type="xs:string" required="true" paramType="variable"/> <key id="id" type="xs:string" required="true" paramType="path"/> </inputs> <execute><![CDATA[ y.include("http://yqlblog.net/samples/base64.js"); varauthheader = "Basic "+Base64.encode(username+":"+password); response.object = request.header("Authorization",authheader).del().response; ]]></execute> </delete>
  • 29. Conclusion More easily build applications fewer lines of code data processing done away from app consistent and familiar syntax for all data access
  • 30.
  • 31. store tables, environments, js, text files…
  • 32. conversion, filtering, parallel requests...With smaller network footprint fewer (client) calls smaller data amounts closer to the data, fatter pipes
  • 33.
  • 35.