SlideShare ist ein Scribd-Unternehmen logo
1 von 39
select * from internet Yahoo Query Language: Jonathan Trevor
Application ?
+ data visualization data manipulation Application =
data
data
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 Bindings YQL YQL stmt select desc show
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.
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
Demo: developer.yahoo.com/yql/
Get any data: Open Data Tables
Open Data Tables Bindings YQL
Open Data Tables Map YQL to Endpoint YQL
USE Verb and environment files use ‘http://url-to-def.xml’ as tableName; select * from tableNamewhere key=‘value’... Imports the Open Data Table definition  Makes it available as tableName Acts just like other YQL Tables Open tables can be collected together into environment files
Open Developer Community Leverage the work of others github repository http://github.com/yql/yql-tables/tree/master datatables.orgmirrors the master and builds a single environment with all tables (faster serving) Console with community 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 Status, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
INSERT INTO Cloud
yql.storage / yql.storage.admin tables Allow developers to store and work with data in YQL itself 	share tables, environments and JavaScript with anyone 	hosted by YQL  Layered on Yahoo! Sherpa DHT cloud storage platform 	globally available, quick everywhere Storage mapped to INSERT/UPDATE/DELETE
yql.storage / yql.storage.admin tables insert into yql.storage.admin(url) values ("http://dom.com/table.xml") Token based capabilities and access control Using a stored piece of data <inserted>    <execute>store://4cd56a99-7xxx-4600-ade1-3bf7f5a11193</execute>    <select>store://08fd2c74-dxxx-48c4-9ee1-3bf7e5a1ec92</select>    <update>store://3cc85a99-6xxx-4600-ade1-f7f83ecc4b83</update> </inserted>  use “store://4cd56a99-7xxx-4600-ade1-3bf7f5a11193” as mytable;select * from mytable where …
Building your own open data tables
Open Data 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
YQL Open Data Table example
Open Data Table example
Open Data Table example
<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
YQL <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='cat' and b='dog';</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, amp;quot;product-displayamp;quot;)]'").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>
Inner join (unified web+image search) <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">     <bindings>         <select itemPath="results.result" produces="XML">             <inputs>                 <key id="query" type="xs:string" paramType="query" required="true"/>             </inputs>             <execute><![CDATA[ varqs = query; var search = y.query('select * from search.web(50) where query=@query', {query: qs}).results; var images = [];             default xml namespace='http://www.inktomi.com/';             for each (var result in search.result) { images.push(y.query('select * from search.images(1) where query=@query and url=@url', {url:result.url, query:qs}));             } vari = 0;             for each (var result in search.result) { var image = images[i++].results.result;               if (image) { result.image = <image>{image}</image>; }             } response.object =  search;             ]]></execute>         </select>      </bindings> </table>
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>
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>
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>
Conclusion More easily build applications fewer lines of code data processing done away from app consistent and familiar syntax for all data access iterative environment for developing the query
Conclusion Build applications that run faster ,[object Object]
store tables, environments, js, text files…
conversion, filtering, parallel requests...With smaller network footprint fewer (client) calls smaller data amounts closer to the data, fatter pipes

Weitere ähnliche Inhalte

Mehr von Yahoo Developer Network

Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...Yahoo Developer Network
 
Athenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Athenz & SPIFFE, Tatsuya Yano, Yahoo JapanAthenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Athenz & SPIFFE, Tatsuya Yano, Yahoo JapanYahoo Developer Network
 
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...Yahoo Developer Network
 
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathBig Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathYahoo Developer Network
 
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenuHow @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenuYahoo Developer Network
 
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, AmpoolThe Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, AmpoolYahoo Developer Network
 
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...Yahoo Developer Network
 
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...Yahoo Developer Network
 
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, OathHDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, OathYahoo Developer Network
 
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...Yahoo Developer Network
 
Moving the Oath Grid to Docker, Eric Badger, Oath
Moving the Oath Grid to Docker, Eric Badger, OathMoving the Oath Grid to Docker, Eric Badger, Oath
Moving the Oath Grid to Docker, Eric Badger, OathYahoo Developer Network
 
Architecting Petabyte Scale AI Applications
Architecting Petabyte Scale AI ApplicationsArchitecting Petabyte Scale AI Applications
Architecting Petabyte Scale AI ApplicationsYahoo Developer Network
 
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...Yahoo Developer Network
 
Jun 2017 HUG: YARN Scheduling – A Step Beyond
Jun 2017 HUG: YARN Scheduling – A Step BeyondJun 2017 HUG: YARN Scheduling – A Step Beyond
Jun 2017 HUG: YARN Scheduling – A Step BeyondYahoo Developer Network
 
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies Yahoo Developer Network
 
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...Yahoo Developer Network
 
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexFebruary 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexYahoo Developer Network
 
February 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
February 2017 HUG: Data Sketches: A required toolkit for Big Data AnalyticsFebruary 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
February 2017 HUG: Data Sketches: A required toolkit for Big Data AnalyticsYahoo Developer Network
 
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...Yahoo Developer Network
 

Mehr von Yahoo Developer Network (20)

Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
Athenz - The Open-Source Solution to Provide Access Control in Dynamic Infras...
 
Athenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Athenz & SPIFFE, Tatsuya Yano, Yahoo JapanAthenz & SPIFFE, Tatsuya Yano, Yahoo Japan
Athenz & SPIFFE, Tatsuya Yano, Yahoo Japan
 
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
Athenz with Istio - Single Access Control Model in Cloud Infrastructures, Tat...
 
CICD at Oath using Screwdriver
CICD at Oath using ScrewdriverCICD at Oath using Screwdriver
CICD at Oath using Screwdriver
 
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, OathBig Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
Big Data Serving with Vespa - Jon Bratseth, Distinguished Architect, Oath
 
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenuHow @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
How @TwitterHadoop Chose Google Cloud, Joep Rottinghuis, Lohit VijayaRenu
 
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, AmpoolThe Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
The Future of Hadoop in an AI World, Milind Bhandarkar, CEO, Ampool
 
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
Apache YARN Federation and Tez at Microsoft, Anupam Upadhyay, Adrian Nicoara,...
 
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
Containerized Services on Apache Hadoop YARN: Past, Present, and Future, Shan...
 
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, OathHDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
HDFS Scalability and Security, Daryn Sharp, Senior Engineer, Oath
 
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
Hadoop {Submarine} Project: Running deep learning workloads on YARN, Wangda T...
 
Moving the Oath Grid to Docker, Eric Badger, Oath
Moving the Oath Grid to Docker, Eric Badger, OathMoving the Oath Grid to Docker, Eric Badger, Oath
Moving the Oath Grid to Docker, Eric Badger, Oath
 
Architecting Petabyte Scale AI Applications
Architecting Petabyte Scale AI ApplicationsArchitecting Petabyte Scale AI Applications
Architecting Petabyte Scale AI Applications
 
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
Introduction to Vespa – The Open Source Big Data Serving Engine, Jon Bratseth...
 
Jun 2017 HUG: YARN Scheduling – A Step Beyond
Jun 2017 HUG: YARN Scheduling – A Step BeyondJun 2017 HUG: YARN Scheduling – A Step Beyond
Jun 2017 HUG: YARN Scheduling – A Step Beyond
 
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
Jun 2017 HUG: Large-Scale Machine Learning: Use Cases and Technologies
 
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
February 2017 HUG: Slow, Stuck, or Runaway Apps? Learn How to Quickly Fix Pro...
 
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache ApexFebruary 2017 HUG: Exactly-once end-to-end processing with Apache Apex
February 2017 HUG: Exactly-once end-to-end processing with Apache Apex
 
February 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
February 2017 HUG: Data Sketches: A required toolkit for Big Data AnalyticsFebruary 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
February 2017 HUG: Data Sketches: A required toolkit for Big Data Analytics
 
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...
October 2016 HUG: Pulsar,  a highly scalable, low latency pub-sub messaging s...
 

Kürzlich hochgeladen

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Yahoo! Query Language - YQL: Select * from Internet - Including Live Demo!

  • 1. select * from internet Yahoo Query Language: Jonathan Trevor
  • 3. + data visualization data manipulation Application =
  • 6.
  • 7. 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
  • 8. 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
  • 9. 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 Bindings YQL YQL stmt select desc show
  • 10. 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.
  • 11. 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
  • 12. 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
  • 14. Get any data: Open Data Tables
  • 15. Open Data Tables Bindings YQL
  • 16. Open Data Tables Map YQL to Endpoint YQL
  • 17. USE Verb and environment files use ‘http://url-to-def.xml’ as tableName; select * from tableNamewhere key=‘value’... Imports the Open Data Table definition Makes it available as tableName Acts just like other YQL Tables Open tables can be collected together into environment files
  • 18. Open Developer Community Leverage the work of others github repository http://github.com/yql/yql-tables/tree/master datatables.orgmirrors the master and builds a single environment with all tables (faster serving) Console with community tables
  • 19. 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 Status, Bit.ly shortener Yahoo profile status, application update stream Amazon SimpleDB
  • 21. yql.storage / yql.storage.admin tables Allow developers to store and work with data in YQL itself share tables, environments and JavaScript with anyone hosted by YQL Layered on Yahoo! Sherpa DHT cloud storage platform globally available, quick everywhere Storage mapped to INSERT/UPDATE/DELETE
  • 22. yql.storage / yql.storage.admin tables insert into yql.storage.admin(url) values ("http://dom.com/table.xml") Token based capabilities and access control Using a stored piece of data <inserted>    <execute>store://4cd56a99-7xxx-4600-ade1-3bf7f5a11193</execute>    <select>store://08fd2c74-dxxx-48c4-9ee1-3bf7e5a1ec92</select>    <update>store://3cc85a99-6xxx-4600-ade1-f7f83ecc4b83</update> </inserted> use “store://4cd56a99-7xxx-4600-ade1-3bf7f5a11193” as mytable;select * from mytable where …
  • 23. Building your own open data tables
  • 24. Open Data 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
  • 25. YQL Open Data Table example
  • 26. Open Data Table example
  • 27. Open Data Table example
  • 28. <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
  • 29. YQL <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
  • 30. hello world <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <sampleQuery>select * from {table} where a='cat' and b='dog';</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>
  • 31. 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, amp;quot;product-displayamp;quot;)]'").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>
  • 32. Inner join (unified web+image search) <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <bindings> <select itemPath="results.result" produces="XML"> <inputs> <key id="query" type="xs:string" paramType="query" required="true"/> </inputs> <execute><![CDATA[ varqs = query; var search = y.query('select * from search.web(50) where query=@query', {query: qs}).results; var images = []; default xml namespace='http://www.inktomi.com/'; for each (var result in search.result) { images.push(y.query('select * from search.images(1) where query=@query and url=@url', {url:result.url, query:qs})); } vari = 0; for each (var result in search.result) { var image = images[i++].results.result; if (image) { result.image = <image>{image}</image>; } } response.object = search; ]]></execute> </select> </bindings> </table>
  • 33. 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>
  • 34. 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>
  • 35. 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>
  • 36. Conclusion More easily build applications fewer lines of code data processing done away from app consistent and familiar syntax for all data access iterative environment for developing the query
  • 37.
  • 38. store tables, environments, js, text files…
  • 39. conversion, filtering, parallel requests...With smaller network footprint fewer (client) calls smaller data amounts closer to the data, fatter pipes
  • 41. YQL: select * from internet Jonathan Trevor Questions? http://developer.yahoo.com/yql