SlideShare a Scribd company logo
1 of 88
Download to read offline
YQL
         A Query Language for the Web




                                 Sam Pullara (samp@yahoo-inc.com)
                                 Chief Technologist @ Yahoo
Wednesday, March 11, 2009                                           1
Application ?




Wednesday, March 11, 2009   2
Application ?




Wednesday, March 11, 2009   2
Application ?




Wednesday, March 11, 2009   2
Application ?




Wednesday, March 11, 2009   2
Application ?




Wednesday, March 11, 2009   2
Application =




Wednesday, March 11, 2009   3
data manipulation
         Application =




Wednesday, March 11, 2009                       3
data manipulation
         Application =              +
                            data visualization




Wednesday, March 11, 2009                        3
data
         data




Wednesday, March 11, 2009          4
data




Wednesday, March 11, 2009   4
data




Wednesday, March 11, 2009   5
Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   6
dev




Wednesday, March 11, 2009   7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …




Wednesday, March 11, 2009                                           7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …




Wednesday, March 11, 2009                                           7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




Wednesday, March 11, 2009                                              7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              7
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              7
var map = new
                                YMap(document.getElementById('map'));
                                …
                                var currentGeoPoint = new
              dev
                                YGeoPoint( _c.Lat, _c.Lon );
                                map.addMarker(currentGeoPoint);


                            ?
                                …



                                …
                                if (flickcurl_prepare(fc,


                            ?
                                quot;flickr.photos.geo.correctLocationquot;,
                                parameters, count)) { … }
                                …



                            ?   http://search.yahooapis.com/
                                ImageSearchService/V1/imageSearch?
                                appid=YahooDemo&query=Corvette&results=2


                            ?
                                http://weather.yahooapis.com/
                                forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                                  7
var map = new
                                YMap(document.getElementById('map'));
                                …
                                var currentGeoPoint = new
              dev
                                YGeoPoint( _c.Lat, _c.Lon );
                                map.addMarker(currentGeoPoint);


                            ?
                                …



                                …
                                if (flickcurl_prepare(fc,


                            ?
                                quot;flickr.photos.geo.correctLocationquot;,
                                parameters, count)) { … }
                                …



                            ?   http://search.yahooapis.com/
                                ImageSearchService/V1/imageSearch?
                                appid=YahooDemo&query=Corvette&results=2


                            ?
                                http://weather.yahooapis.com/
                                forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                                  8
Yahoo!    My Yahoo!   Mail                                                                                                             Welcome, guest       Sign In

                                                                                                                                                          Search


                                                      var map = new
 MY PROJECTS            APIs & WEB SERVICES          RESOURCES            SUPPORT

                                                      YMap(document.getElementById('map'));
 YDN       Maps Suite     AJAX Maps


 Yahoo! Maps Web Services - AJAX API Getting                                                                       READY TO GET STARTED?
                                                      …                                                                                                            You aren't signed in      Sign In   Help

 Started Guide                                                                 Get an App ID
                                                      var currentGeoPoint = new
            dev Home     The Tour     Sign Up     Explore                                    Search
 Learn the fundamentals of the Yahoo! Maps AJAX API and start creating your own maps. This page contains:
                                                      YGeoPoint( _c.Lat, _c.Lon );
 Introduction and Prerequisites                                             Yahoo! Maps Cheatsheets
                Flickr Services                                                                                 RECENT BLOG ARTICLES
                                                                                     Yahoo!    My Yahoo!  Mail
 Examples                                                                                                                                                                                                                             Welcome, guest            Sign In

                API Documentation Feeds Your API Keys map.addMarker(currentGeoPoint);
       Display a Yahoo! Map




                                                               ?
                                                       Apply for a new API Key
                                                                                                                                                                                                                                                        Search
       Add controls to your Yahoo! Map                                                                          Leonardo da Vinci: Hacker
                                                      …                                                         January 24, 2009
       Add a logger to a Yahoo! Map
       Place a marker on a Yahoo! Map
                                                                                    MY PROJECTS          APIs & WEB SERVICES             RESOURCES            SUPPORT
       Draw Polylines on a Yahoo! Map                                                                           Whaddyathink? & the Yahoo! Application
                                       flickr.places.getPlaceTypes
       Place Smart Markers on a Yahoo! Map                                                                      Platform
                                                                                   YDN       Weather RSS Feed
       Add multiple custom markers on Yahoo! Map                                                                January 22, 2009
       Traffic information overlay
                                                            Yahoo! Weather RSS Feed
       Yahoo! Pipes RSS output information overlay                                                              Making the new Yahoo! Currency Converter
                                                                                                                                     Yahoo!    My Yahoo!   Mail                                                                                                                                 Welcome, guest             Sign In
                                         Fetches a list of available place types for Flickr.
       Yahoo! Pipes JSON output information overlay                                                             accessible
                                                                            YMap
       Local search results overlay                                                The Weather RSS feed enables you
                                                                                                                Januaryto get up-to-date weather information for your location. You can save this
                                                                                                                         21, 2009
                                                                                         …                                                                                                                                                                                                                           Search
       Overlay GeoRSS XML data
                                                                                   feed in My Yahoo! or your favorite feed aggregator, or incorporate the RSS data into your own web site or client
       Overlay custom objects at YGeoPoint location
                                                                                   application. The Weather RSSRetrievingdynamically-generatedfrom based on zip code or Location ID.
                                                                                                                 feed is a and displaying data feed
                                       Authentication
       Overlay custom objects at YCoordPoint location
                                                                                         if (flickcurl_prepare(fc,
                                                                                                                Wikipedia with YQL PROJECTS
                                                                                                                                    MY                    APIs & WEB SERVICES             RESOURCES        SUPPORT
       Overlay polyline on Yahoo! Map
                                                                                   This page describes the format of the 18, 2009 URL and the RSS response for developers. It contains these
                                                                                                                January request




                                                               ?
       Export Yahoo! Map in GeoRSS format                                                                                           YDN       Image Search Documentation for Yahoo! Search Web Services
                                         This method does not require authentication.
                                                                                         quot;flickr.photos.geo.correctLocationquot;,
                                                                                   sections:
       GeoRSS overlay with polyline

                                                                                                      Image Search Documentation for Yahoo! Search
       Get zoom level given radius from center                                                                                                                                                                                                                       READY TO GET STARTED?
                                                                                        RSS Request
                                       Arguments
       Custom position of controls
                                                                                         parameters, count)) { … }                                                                                                                                                   By applying for an Application ID for this service, you
                                                                                             Summary
       Change Marker Images Dynamically                                                                                                                                                                                                                              hereby agree to the Terms of Use
                                                                                             Request Parameters
       Use YMapTypeControl to position map types
                                                                                                      Submitting Image Queries
                                                                                         …
                                         api_key (Required)
 Other Features of the Yahoo! Maps AJAX API                                             RSS Response
                                                                            YEvent, YGeoRSS, YMarker
                                                                                                                                                                                                                                                                                        Get an App ID
 Rate Limit                                     Your API application key. See here for moreTop-Level Elements
                                                                                               details.                             The Image Search Web Service allows you to search the Internet for images.
 Terms of Service                                                                            Channel Elements
 Support & Community
                                                                                             Image Elements




                                                               ?
                                       Example Response                                      Item Elements
                                                                                                                                      Request URL
 Download all of the cheatsheets and example code in the Yahoo
                                                                                             Condition Codes                                                                                                                                                                                                             view all
                                                                                                                                                                                                                                                                     YAHOO! GROUPS DISCUSSIONS
 Maps API Reference Bundle.
                                                                                                                                    http://search.yahooapis.com/ImageSearchService/V1/imageSearch
                                          <place_types>                                 Examples
                                                                                                                                                                                                                                                                     yahoo local search code in php
 For detailed descriptions of the classes and methods in the API, place_type_id=quot;22quot;>neighbourhood</place_type>
                                               <place_type                              Terms of Use
                                                                                                                                                                                                                                                                     Tue, 27 Jan 2009
 check out v3.8 Reference Manual.              <place_type place_type_id=quot;7quot;>locality</place_type>
                                                                                         http://search.yahooapis.com/       Request parameters
                                           <place_type          place_type_id=quot;9quot;>county</place_type>
                                                                               RSS Request                                                                                                                                                                           My Web Search API shut down
                                           <place_type          place_type_id=quot;8quot;>region</place_type>
                                                                        Remaining, Supporting Classes                                                                                                                                                                announcement
                                                                                                                            See information on constructing REST queries
                                                                                         ImageSearchService/V1/imageSearch?
                                           <place_type          place_type_id=quot;12quot;>country</place_type>
                                                                               The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add                                                                                       Wed, 21 Jan 2009
 Introduction and              Prerequisites
                                           <place_type          place_type_id=quot;29quot;>continent</place_type> (?). Multiple parameters are separated by an ampersand (&).
                                                                               parameters and values after a question mark              Parameter     Value                  Description
                                       </place_types>
                                                                                         appid=YahooDemo&query=Corvette&results=2                                                                                                                                    Re: Site Explorer API returns 999 Rate Limit
                                                                                                                                       appid        string (required)      The application ID. See Application IDs for more information.
 The Yahoo! AJAX Maps API lets developers add maps to their web sites using DHTML and JavaScript®. the Weather RSS feed is
                                                                                        The base URL for Maps                                                                                                                                                        Exceeded
 are fully embeddable and scriptable using the JavaScript programming language. Yahoo! Maps AS-Flash API's                             query        string (required)      The query to search for. Use + to include terms, - to exclude terms, and




                                                               ?
                                                                                                                                                                                                                                                                     Wed, 21 Jan 2009
                                       Error Codes                                                                                                                         put quotes around quot;exact phrasequot;.
 built-in geocoder means that you can specify a physical address or latitude/longitude coordinates for your map's
                                                                                        http://weather.yahooapis.com/forecastrss
 location, as you like.                                                                                                                type         all (default), any, or The kind of search to submit:                                                             Reminder: Old obsolete versions of Local
                                                                                        In this section, Summary shows how to make an RSS request with different parameters; Request Parameters
                                                                                                                                                    phrase                                                                                                           Search (V1, V2) shutting do
 In order to create and test applications 100: Yahoo! Maps AJAX API, you'll need to use a supported summarizing those parameters.
                                          using Invalid API Key                         shows a table web                                                                                                                                                            Mon, 19 Jan 2009
                                                                                                                                                                           all returns results with all query terms.
                                                 The API key passed was not valid or has expired.                                                                          any returns results with one or more of the query terms.
 browser: Firefox 2, Internet Explorer 6 or 7, Opera 9 or Safari 3. Newer versions of these browsers are also
                                                                                                                                                                           phrase returns results containing the query terms as a phrase.
 supported. You can code your JavaScript applications usingcurrently unavailable
                                          105: Service your favorite text editor or IDE.
                                                                                        SUMMARY                                        results      integer: default 10, The number of results to return.
                                                 The requested service is temporarily unavailable.
                                                                                                                                                    max 50
 An application ID is required to use the Yahoo! Maps AJAX API. You can get an application ID here.
                                                                                        The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add
                                       111: Format quot;xxxquot; not found
                                                                                                                                        start         integer: default 1    by an starting result position to return (1-based). The finishing position (start
                                                                                                                                                                             The ampersand (&). For
                                                                                       parameters and values after a question mark (?). Multiple parameters are separated
 For best results, you should launch your web pagesrequested response format was not found. applications
                                                 The from a web server. However, it's possible to run                                                                        + results - 1) cannot exceed 1000.
                                                                                       the Weather RSS feed there are two parameters:
 directly from your hard drive by double-clickingMethod This can be donefound
                                        112: on them. quot;xxxquot; not by lowering the security settings in                                    format        any (default), bmp,    Specifies the kind of image file to search for.
 the Internet Explorer browser or by setting the The requested method was not found. p for location.
                                                 UniversalBrowserRead property in Firefox.                                                            gif, jpeg, png
                                                                                           u for degrees units (Fahrenheit or Celsius). adult_ok
                                                                                         http://weather.yahooapis.com/                                no value or 1          The service filters out adult content by default. Enter a 1 to allow adult
                                        114: Invalid SOAP envelope
                                                                                                                                                                             content.
                                              The SOAP envelope send in the requestlocationnot be parsed. required. Use this parameter to indicate the location for the weather forecast as a
                                                                                  The could parameter p is
 Displaying a Yahoo! Map                                                                                                        coloration     any (default), color, The service returns only the images of the coloration specified (color or
                                                                                  zip code or Location ID.
                                                                                         forecastrss?p=FRXX0076&u=c
                                     115: Invalid XML-RPC Method Call
                                                                                                                                               bw                     black-and-white).
 All the API classes and methods necessary to interact with Yahoo! Mapsdocument couldyour application when
                                              The XML-RPC request are availablehttp://weather.yahooapis.com/forecastrss?p=location
                                                                                   to not be parsed.
                                                                                                                                site           string: default no     A domain to restrict your searches to (e.g. www.yahoo.com). You may
 you include Yahoo! Maps AJAX API library in your web page.This example uses the demonstration application
                                                                                                                                           value                             submit up to 30 values (site=www.yahoo.com&site=www.cnn.com).
 ID quot;YD-eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1Hquot;; you cannot use this Application Forand must requestweather for Yahoo! Headquarters in Sunnyvale, CA, use the zip
                                                                                  ID example, to get one                                                                    code for Sunnyvale
                                       API Explorer                                                                          output        string: xml                       The format for the output. If json is requested, the results will be returned
 here.                                                                            (94089):                                                 (default), json, php              in JSON format. If php is requested, the results will be returned in
                                                                                                                                                                             Serialized PHP format.
                              API Explorer : flickr.places.getPlaceTypes
   <html>                                                           http://weather.yahooapis.com/forecastrss?p=94089
                                                                                                                  callback string                                            The name of the callback function to wrap around the JSON data. The
   <head>
                                                                                                                                                                             following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has
                                                                    Or use the Location ID for Sunnyvale (USCA1116):
   <b><script type=quot;text/javascriptquot;
                                                                                                                                                                             not been requested, this parameter has no effect. More information on the
   src=quot;http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=YD-
                                                                                                                                                                             callback can be found in the Yahoo! Developer Network JSON
   eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1Hquot;>                           http://weather.yahooapis.com/forecastrss?p=USCA1116
                                                                                                                                                                             Documentation
Wednesday, March 11, 2009                                                                                                                                                                                                                                                                                                            8
   </script </b
YQL
         select * from internet




Wednesday, March 11, 2009         9
var map = new
                            YMap(document.getElementById('map'));
                            …
                            var currentGeoPoint = new
              dev
                            YGeoPoint( _c.Lat, _c.Lon );
                            map.addMarker(currentGeoPoint);
                            …



                            …
                            if (flickcurl_prepare(fc,
                            quot;flickr.photos.geo.correctLocationquot;,
                            parameters, count)) { … }
                            …



                            http://search.yahooapis.com/
                            ImageSearchService/V1/imageSearch?
                            appid=YahooDemo&query=Corvette&results=2




                            http://weather.yahooapis.com/
                            forecastrss?p=FRXX0076&u=c




Wednesday, March 11, 2009                                              10
dev




                            YQL




Wednesday, March 11, 2009         10
dev




                            YQL




Wednesday, March 11, 2009         10
dev



                             Bindings




                            YQL




Wednesday, March 11, 2009               10
dev



                             Bindings




                            YQL




Wednesday, March 11, 2009               10
dev



                                        Bindings




                                       YQL
                            YQL stmt




Wednesday, March 11, 2009                          10
dev



                                        Bindings




                                       YQL
                            YQL stmt
                            select




Wednesday, March 11, 2009                          10
dev



                                        Bindings




                                       YQL
                            YQL stmt
                            select
                            desc




Wednesday, March 11, 2009                          10
dev



                                        Bindings




                                       YQL
                            YQL stmt
                            select
                            desc
                            show



Wednesday, March 11, 2009                          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 combining, tweaking, shaping even after it
              gets to the developer.




Wednesday, March 11, 2009                                         11
YQL
                SQL-Like Language
                            Synonymous with Data access
                            Familiar to developers
                            Expressive enough to get the right data.
                Self Describing - show, desc table
                Allows you to query, filter and join data across
                WebServices.




Wednesday, March 11, 2009                                              12
YQL Statement Basics
         Verbs

              show: lists the supported tables
              desc: describes the structure of a table
              select: fetches data
              use: use an Open Data Table *new*


              show tables
              desc social.contacts

Wednesday, March 11, 2009                                13
YQL Select Statement
         Syntax


              SELECT what
              FROM collection
              WHERE filter condition
              IN (sub-select)
              LIMIT n OFFSET n




Wednesday, March 11, 2009              14
Demo:
         developer.yahoo.com/yql/



Wednesday, March 11, 2009           15
YQL Statement Basics
         Syntax -> Select -> Collection


              FROM collection

              Yahoo! Web Services
                            Social Dir, Upcoming, MyblogLog, Y!Local,
                            Search(BOSS)
              External Data Sources
                            XML, Atom, RSS, JSON, CSV, HTML


Wednesday, March 11, 2009                                               16
YQL Statement Basics
         Syntax -> Select -> WHERE clause


              Table data can be filtered in the WHERE
              clause either
                            Remotely by the table data source
                            Locally by the YQL engine (dot notation)




Wednesday, March 11, 2009                                              17
YQL Statement Basics
         Syntax -> WHERE clause -> Remote Filter
           WHERE <remote_key>=‘value’
                      Tables require Keys in where clause
                      Specified in the describe
                            <query>
                              <key name=”guid” required=”true” .../>
                            </query>


                      Correspond to query, path, header or matrix
                      parameters for the Endpoint


Wednesday, March 11, 2009                                              18
YQL Statement Basics
         Syntax -> WHERE clause -> Local Filter
           WHERE <local_filter> OP ‘value’
                      Filter an element or an attribute
                 <movies>                      Dot notation:
                 <movie>Star Wars</movie>      movies.movie LIKE ‘%Star%’
                 <movie>StarTrek</movie>
                 </movies>

                      <, >, =, LIKE, matches, not matches,
                      not like
                      AND, OR binary operator combinations

Wednesday, March 11, 2009                                                   19
YQL Statement Basics
         Syntax -> Select -> Projection
          SELECT <what>
                 Uses the dot notation to project parts of
                 matching item(s)
         <results>
             <movie>
                   <id>101</id>
                                            Projection: (relative to root)
                   <name>Star Wars</name>
                                            select movie.id, movie.name
             </movie>                       from ...
             <movie>...</movie>
         </results>


Wednesday, March 11, 2009                                                    20
YQL Statement Basics
         Syntax -> Select -> Sub-Select
           IN (SELECT ...)
                      Join across data sources
                      field IN (select guid from ...)
                      Like SELECT but can return only N leaves


            Get the profile for all my connections:
            select * from social.profile where guid in
            (select guid from social.connections where owner_guid = me)



Wednesday, March 11, 2009                                                 21
YQL Statement Basics
         Syntax -> Select -> Sub-Select
           IN (SELECT ...)
                      (field, ...fieldN) IN (SELECT
                      f1,...fn from table)

         Get the Location name of the given Photo:
         select place.name from flickr.places where (lat, lon) in
          (select location.latitude, location.longitude from
         flickr.photos.info where photo_id='3030238604')




Wednesday, March 11, 2009                                           22
YQL Statement Basics
         Syntax -> Select -> Table Size
           Changing the Table Size
                      Yahoo! Tables are limited to a small number
                      by default (10)
                        select * from local.search where zip=‘94089’
                        and query=‘pizza’


                      Increase set size as parameters to Collection
                       select * from local.search(100) where zip=‘94089’
                       and query=‘pizza’




Wednesday, March 11, 2009                                                  23
YQL Statement Basics
         Syntax -> Post Query Manipulation

           Post Select processing using ‘pipe’
           symbol.
                        select ... | sort(field=‘item.pubDate’)
                        select ... | unique(field=‘item.title’)
                        select ... | tail(count=10)

           Functions operate on return data.
           Operations unrelated to table or data
           source.

Wednesday, March 11, 2009                                         24
YQL Statement Basics
           YQL Variables (@var)
                      Like Prepared Statements for YQL
                      Substitutes Query parameter
                      http://<>?q=....&city=Bangalore&state=Karnataka

                      select * from table where city=@city and state=@state

                      Can be used in sub-selects
                      select * from table where city in (@city, @city2,
                      @city3)




Wednesday, March 11, 2009                                                     25
YQL Statement Basics
           YQL Variables (@var)
                      Multi Valued variables
                   http://<>?q=....&city=Bangalore&city=Mumbai

                   select * from table where city in (@city)




Wednesday, March 11, 2009                                        26
Sounds Good.
         But what about my Web
         Service?




Wednesday, March 11, 2009        27
Can I add my data tables?




Wednesday, March 11, 2009            28
Open Data Tables



                YQL



Wednesday, March 11, 2009   29
Open Data Tables



                YQL



Wednesday, March 11, 2009   29
Open Data Tables



                YQL



Wednesday, March 11, 2009   29
Open Data Tables



                YQL



Wednesday, March 11, 2009   29
Open Data Tables
                            Bindings




                YQL



Wednesday, March 11, 2009              29
Open Data Tables



                YQL



Wednesday, March 11, 2009   30
Open Data Tables



                YQL



Wednesday, March 11, 2009   30
Open Data Tables

                            Map YQL to Endpoint


                YQL



Wednesday, March 11, 2009                         30
Open Data Tables



                YQL



Wednesday, March 11, 2009   31
Open Data Tables



                YQL



Wednesday, March 11, 2009   31
Open Data Tables




Wednesday, March 11, 2009   32
Open Data Tables




Wednesday, March 11, 2009   33
Open Data Tables

                    Schema defines mapping between YQL and
                    Endpoint
                    Keys can either be query, path, header or matrix
                    parameters
                    Keys can be marked as required
                    YQL Compiler validates existence of required keys
                    and uses them to select an endpoint



Wednesday, March 11, 2009                                               34
USE Verb
          use ‘http://url-to-def.xml’ as tableName;
          select * from tableName where key=‘value’...


              Imports the Table definition
              Makes it available to following statements as
              tableName
              desc tableName - describes the def
              Acts like a First Class Data Source just like
              other YQL Tables.

Wednesday, March 11, 2009                                     35
Environment files
                    Text files that contain multiple table “use” statements
                    Useful for defining your own default working sets of
                    tables
                            No need to “use” per call




Wednesday, March 11, 2009                                                    36
Using environment files
            http://query.yahooapis.com/v1/yql?
            q=...&env=http://...
            http://developer.yahoo.com/v1/yql?
            env=http://...

              Add a query parameter to the web service
                            or console call
              Shows up in console table list / show tables
              http://developer.yahoo.com/yql/console/?env=http://
              github.com/spullara/yql-tables/raw/
              ef685688d649a7514ebd27722366b2918d966573/alltables.env
Wednesday, March 11, 2009                                              37
Accessing YQL
              OAuth Endpoint
              http://query.yahooapis.com/v1/yql?q=...

              Public Endpoint
              http://query.yahooapis.com/v1/public/yql?q=

              YQL Console
              http://developer.yahoo.com/yql/console


Wednesday, March 11, 2009                                   38
Accessing YQL
              YQL Via Pipes




Wednesday, March 11, 2009     39
YQL Console




Wednesday, March 11, 2009   40
YQL Console




Wednesday, March 11, 2009   40
Conclusion


                    build applications more easily
                            fewer lines of code
                            consistent and familiar syntax for all data access
                            iterative environment for developing the query




Wednesday, March 11, 2009                                                        41
Conclusion

                    build applications that run faster
                            service in the cloud does the work
                            with smaller network footprint
                              fewer (client) calls
                              smaller data amounts
                              closer to the data, fatter pipes



Wednesday, March 11, 2009                                        42
data




Wednesday, March 11, 2009   43
One API : YQL



Wednesday, March 11, 2009   44
Q&A
             http://developer.yahoo.com/yql

                            Follow up:
                   http://developer.yahoo.com/
                          events/etech09




Wednesday, March 11, 2009                        45

More Related Content

Recently uploaded

Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 

Recently uploaded (20)

201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

YQL

  • 1. YQL A Query Language for the Web Sam Pullara (samp@yahoo-inc.com) Chief Technologist @ Yahoo Wednesday, March 11, 2009 1
  • 8. data manipulation Application = Wednesday, March 11, 2009 3
  • 9. data manipulation Application = + data visualization Wednesday, March 11, 2009 3
  • 10. data data Wednesday, March 11, 2009 4
  • 25. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … Wednesday, March 11, 2009 7
  • 26. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … Wednesday, March 11, 2009 7
  • 27. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 Wednesday, March 11, 2009 7
  • 28. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 29. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 30. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 31. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 32. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 33. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); ? … … if (flickcurl_prepare(fc, ? quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … ? http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 ? http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 7
  • 34. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); ? … … if (flickcurl_prepare(fc, ? quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … ? http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 ? http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 8
  • 35. Yahoo! My Yahoo! Mail Welcome, guest Sign In Search var map = new MY PROJECTS APIs & WEB SERVICES RESOURCES SUPPORT YMap(document.getElementById('map')); YDN Maps Suite AJAX Maps Yahoo! Maps Web Services - AJAX API Getting READY TO GET STARTED? … You aren't signed in Sign In Help Started Guide Get an App ID var currentGeoPoint = new dev Home The Tour Sign Up Explore Search Learn the fundamentals of the Yahoo! Maps AJAX API and start creating your own maps. This page contains: YGeoPoint( _c.Lat, _c.Lon ); Introduction and Prerequisites Yahoo! Maps Cheatsheets Flickr Services RECENT BLOG ARTICLES Yahoo! My Yahoo! Mail Examples Welcome, guest Sign In API Documentation Feeds Your API Keys map.addMarker(currentGeoPoint); Display a Yahoo! Map ? Apply for a new API Key Search Add controls to your Yahoo! Map Leonardo da Vinci: Hacker … January 24, 2009 Add a logger to a Yahoo! Map Place a marker on a Yahoo! Map MY PROJECTS APIs & WEB SERVICES RESOURCES SUPPORT Draw Polylines on a Yahoo! Map Whaddyathink? & the Yahoo! Application flickr.places.getPlaceTypes Place Smart Markers on a Yahoo! Map Platform YDN Weather RSS Feed Add multiple custom markers on Yahoo! Map January 22, 2009 Traffic information overlay Yahoo! Weather RSS Feed Yahoo! Pipes RSS output information overlay Making the new Yahoo! Currency Converter Yahoo! My Yahoo! Mail Welcome, guest Sign In Fetches a list of available place types for Flickr. Yahoo! Pipes JSON output information overlay accessible YMap Local search results overlay The Weather RSS feed enables you Januaryto get up-to-date weather information for your location. You can save this 21, 2009 … Search Overlay GeoRSS XML data feed in My Yahoo! or your favorite feed aggregator, or incorporate the RSS data into your own web site or client Overlay custom objects at YGeoPoint location application. The Weather RSSRetrievingdynamically-generatedfrom based on zip code or Location ID. feed is a and displaying data feed Authentication Overlay custom objects at YCoordPoint location if (flickcurl_prepare(fc, Wikipedia with YQL PROJECTS MY APIs & WEB SERVICES RESOURCES SUPPORT Overlay polyline on Yahoo! Map This page describes the format of the 18, 2009 URL and the RSS response for developers. It contains these January request ? Export Yahoo! Map in GeoRSS format YDN Image Search Documentation for Yahoo! Search Web Services This method does not require authentication. quot;flickr.photos.geo.correctLocationquot;, sections: GeoRSS overlay with polyline Image Search Documentation for Yahoo! Search Get zoom level given radius from center READY TO GET STARTED? RSS Request Arguments Custom position of controls parameters, count)) { … } By applying for an Application ID for this service, you Summary Change Marker Images Dynamically hereby agree to the Terms of Use Request Parameters Use YMapTypeControl to position map types Submitting Image Queries … api_key (Required) Other Features of the Yahoo! Maps AJAX API RSS Response YEvent, YGeoRSS, YMarker Get an App ID Rate Limit Your API application key. See here for moreTop-Level Elements details. The Image Search Web Service allows you to search the Internet for images. Terms of Service Channel Elements Support & Community Image Elements ? Example Response Item Elements Request URL Download all of the cheatsheets and example code in the Yahoo Condition Codes view all YAHOO! GROUPS DISCUSSIONS Maps API Reference Bundle. http://search.yahooapis.com/ImageSearchService/V1/imageSearch <place_types> Examples yahoo local search code in php For detailed descriptions of the classes and methods in the API, place_type_id=quot;22quot;>neighbourhood</place_type> <place_type Terms of Use Tue, 27 Jan 2009 check out v3.8 Reference Manual. <place_type place_type_id=quot;7quot;>locality</place_type> http://search.yahooapis.com/ Request parameters <place_type place_type_id=quot;9quot;>county</place_type> RSS Request My Web Search API shut down <place_type place_type_id=quot;8quot;>region</place_type> Remaining, Supporting Classes announcement See information on constructing REST queries ImageSearchService/V1/imageSearch? <place_type place_type_id=quot;12quot;>country</place_type> The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add Wed, 21 Jan 2009 Introduction and Prerequisites <place_type place_type_id=quot;29quot;>continent</place_type> (?). Multiple parameters are separated by an ampersand (&). parameters and values after a question mark Parameter Value Description </place_types> appid=YahooDemo&query=Corvette&results=2 Re: Site Explorer API returns 999 Rate Limit appid string (required) The application ID. See Application IDs for more information. The Yahoo! AJAX Maps API lets developers add maps to their web sites using DHTML and JavaScript®. the Weather RSS feed is The base URL for Maps Exceeded are fully embeddable and scriptable using the JavaScript programming language. Yahoo! Maps AS-Flash API's query string (required) The query to search for. Use + to include terms, - to exclude terms, and ? Wed, 21 Jan 2009 Error Codes put quotes around quot;exact phrasequot;. built-in geocoder means that you can specify a physical address or latitude/longitude coordinates for your map's http://weather.yahooapis.com/forecastrss location, as you like. type all (default), any, or The kind of search to submit: Reminder: Old obsolete versions of Local In this section, Summary shows how to make an RSS request with different parameters; Request Parameters phrase Search (V1, V2) shutting do In order to create and test applications 100: Yahoo! Maps AJAX API, you'll need to use a supported summarizing those parameters. using Invalid API Key shows a table web Mon, 19 Jan 2009 all returns results with all query terms. The API key passed was not valid or has expired. any returns results with one or more of the query terms. browser: Firefox 2, Internet Explorer 6 or 7, Opera 9 or Safari 3. Newer versions of these browsers are also phrase returns results containing the query terms as a phrase. supported. You can code your JavaScript applications usingcurrently unavailable 105: Service your favorite text editor or IDE. SUMMARY results integer: default 10, The number of results to return. The requested service is temporarily unavailable. max 50 An application ID is required to use the Yahoo! Maps AJAX API. You can get an application ID here. The Weather RSS feed request follows simple HTTP GET syntax: start with a base URL and then add 111: Format quot;xxxquot; not found start integer: default 1 by an starting result position to return (1-based). The finishing position (start The ampersand (&). For parameters and values after a question mark (?). Multiple parameters are separated For best results, you should launch your web pagesrequested response format was not found. applications The from a web server. However, it's possible to run + results - 1) cannot exceed 1000. the Weather RSS feed there are two parameters: directly from your hard drive by double-clickingMethod This can be donefound 112: on them. quot;xxxquot; not by lowering the security settings in format any (default), bmp, Specifies the kind of image file to search for. the Internet Explorer browser or by setting the The requested method was not found. p for location. UniversalBrowserRead property in Firefox. gif, jpeg, png u for degrees units (Fahrenheit or Celsius). adult_ok http://weather.yahooapis.com/ no value or 1 The service filters out adult content by default. Enter a 1 to allow adult 114: Invalid SOAP envelope content. The SOAP envelope send in the requestlocationnot be parsed. required. Use this parameter to indicate the location for the weather forecast as a The could parameter p is Displaying a Yahoo! Map coloration any (default), color, The service returns only the images of the coloration specified (color or zip code or Location ID. forecastrss?p=FRXX0076&u=c 115: Invalid XML-RPC Method Call bw black-and-white). All the API classes and methods necessary to interact with Yahoo! Mapsdocument couldyour application when The XML-RPC request are availablehttp://weather.yahooapis.com/forecastrss?p=location to not be parsed. site string: default no A domain to restrict your searches to (e.g. www.yahoo.com). You may you include Yahoo! Maps AJAX API library in your web page.This example uses the demonstration application value submit up to 30 values (site=www.yahoo.com&site=www.cnn.com). ID quot;YD-eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1Hquot;; you cannot use this Application Forand must requestweather for Yahoo! Headquarters in Sunnyvale, CA, use the zip ID example, to get one code for Sunnyvale API Explorer output string: xml The format for the output. If json is requested, the results will be returned here. (94089): (default), json, php in JSON format. If php is requested, the results will be returned in Serialized PHP format. API Explorer : flickr.places.getPlaceTypes <html> http://weather.yahooapis.com/forecastrss?p=94089 callback string The name of the callback function to wrap around the JSON data. The <head> following characters are allowed: A-Z a-z 0-9 . [] and _. If output=json has Or use the Location ID for Sunnyvale (USCA1116): <b><script type=quot;text/javascriptquot; not been requested, this parameter has no effect. More information on the src=quot;http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=YD- callback can be found in the Yahoo! Developer Network JSON eQRpTl0_JX2E95l_xAFs5UwZUlNQhhn7lj1Hquot;> http://weather.yahooapis.com/forecastrss?p=USCA1116 Documentation Wednesday, March 11, 2009 8 </script </b
  • 36. YQL select * from internet Wednesday, March 11, 2009 9
  • 37. var map = new YMap(document.getElementById('map')); … var currentGeoPoint = new dev YGeoPoint( _c.Lat, _c.Lon ); map.addMarker(currentGeoPoint); … … if (flickcurl_prepare(fc, quot;flickr.photos.geo.correctLocationquot;, parameters, count)) { … } … http://search.yahooapis.com/ ImageSearchService/V1/imageSearch? appid=YahooDemo&query=Corvette&results=2 http://weather.yahooapis.com/ forecastrss?p=FRXX0076&u=c Wednesday, March 11, 2009 10
  • 38. dev YQL Wednesday, March 11, 2009 10
  • 39. dev YQL Wednesday, March 11, 2009 10
  • 40. dev Bindings YQL Wednesday, March 11, 2009 10
  • 41. dev Bindings YQL Wednesday, March 11, 2009 10
  • 42. dev Bindings YQL YQL stmt Wednesday, March 11, 2009 10
  • 43. dev Bindings YQL YQL stmt select Wednesday, March 11, 2009 10
  • 44. dev Bindings YQL YQL stmt select desc Wednesday, March 11, 2009 10
  • 45. dev Bindings YQL YQL stmt select desc show Wednesday, March 11, 2009 10
  • 46. 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 combining, tweaking, shaping even after it gets to the developer. Wednesday, March 11, 2009 11
  • 47. YQL SQL-Like Language Synonymous with Data access Familiar to developers Expressive enough to get the right data. Self Describing - show, desc table Allows you to query, filter and join data across WebServices. Wednesday, March 11, 2009 12
  • 48. YQL Statement Basics Verbs show: lists the supported tables desc: describes the structure of a table select: fetches data use: use an Open Data Table *new* show tables desc social.contacts Wednesday, March 11, 2009 13
  • 49. YQL Select Statement Syntax SELECT what FROM collection WHERE filter condition IN (sub-select) LIMIT n OFFSET n Wednesday, March 11, 2009 14
  • 50. Demo: developer.yahoo.com/yql/ Wednesday, March 11, 2009 15
  • 51. YQL Statement Basics Syntax -> Select -> Collection FROM collection Yahoo! Web Services Social Dir, Upcoming, MyblogLog, Y!Local, Search(BOSS) External Data Sources XML, Atom, RSS, JSON, CSV, HTML Wednesday, March 11, 2009 16
  • 52. YQL Statement Basics Syntax -> Select -> WHERE clause Table data can be filtered in the WHERE clause either Remotely by the table data source Locally by the YQL engine (dot notation) Wednesday, March 11, 2009 17
  • 53. YQL Statement Basics Syntax -> WHERE clause -> Remote Filter WHERE <remote_key>=‘value’ Tables require Keys in where clause Specified in the describe <query> <key name=”guid” required=”true” .../> </query> Correspond to query, path, header or matrix parameters for the Endpoint Wednesday, March 11, 2009 18
  • 54. YQL Statement Basics Syntax -> WHERE clause -> Local Filter WHERE <local_filter> OP ‘value’ Filter an element or an attribute <movies> Dot notation: <movie>Star Wars</movie> movies.movie LIKE ‘%Star%’ <movie>StarTrek</movie> </movies> <, >, =, LIKE, matches, not matches, not like AND, OR binary operator combinations Wednesday, March 11, 2009 19
  • 55. YQL Statement Basics Syntax -> Select -> Projection SELECT <what> Uses the dot notation to project parts of matching item(s) <results> <movie> <id>101</id> Projection: (relative to root) <name>Star Wars</name> select movie.id, movie.name </movie> from ... <movie>...</movie> </results> Wednesday, March 11, 2009 20
  • 56. YQL Statement Basics Syntax -> Select -> Sub-Select IN (SELECT ...) Join across data sources field IN (select guid from ...) Like SELECT but can return only N leaves Get the profile for all my connections: select * from social.profile where guid in (select guid from social.connections where owner_guid = me) Wednesday, March 11, 2009 21
  • 57. YQL Statement Basics Syntax -> Select -> Sub-Select IN (SELECT ...) (field, ...fieldN) IN (SELECT f1,...fn from table) Get the Location name of the given Photo: select place.name from flickr.places where (lat, lon) in (select location.latitude, location.longitude from flickr.photos.info where photo_id='3030238604') Wednesday, March 11, 2009 22
  • 58. YQL Statement Basics Syntax -> Select -> Table Size Changing the Table Size Yahoo! Tables are limited to a small number by default (10) select * from local.search where zip=‘94089’ and query=‘pizza’ Increase set size as parameters to Collection select * from local.search(100) where zip=‘94089’ and query=‘pizza’ Wednesday, March 11, 2009 23
  • 59. YQL Statement Basics Syntax -> Post Query Manipulation Post Select processing using ‘pipe’ symbol. select ... | sort(field=‘item.pubDate’) select ... | unique(field=‘item.title’) select ... | tail(count=10) Functions operate on return data. Operations unrelated to table or data source. Wednesday, March 11, 2009 24
  • 60. YQL Statement Basics YQL Variables (@var) Like Prepared Statements for YQL Substitutes Query parameter http://<>?q=....&city=Bangalore&state=Karnataka select * from table where city=@city and state=@state Can be used in sub-selects select * from table where city in (@city, @city2, @city3) Wednesday, March 11, 2009 25
  • 61. YQL Statement Basics YQL Variables (@var) Multi Valued variables http://<>?q=....&city=Bangalore&city=Mumbai select * from table where city in (@city) Wednesday, March 11, 2009 26
  • 62. Sounds Good. But what about my Web Service? Wednesday, March 11, 2009 27
  • 63. Can I add my data tables? Wednesday, March 11, 2009 28
  • 64. Open Data Tables YQL Wednesday, March 11, 2009 29
  • 65. Open Data Tables YQL Wednesday, March 11, 2009 29
  • 66. Open Data Tables YQL Wednesday, March 11, 2009 29
  • 67. Open Data Tables YQL Wednesday, March 11, 2009 29
  • 68. Open Data Tables Bindings YQL Wednesday, March 11, 2009 29
  • 69. Open Data Tables YQL Wednesday, March 11, 2009 30
  • 70. Open Data Tables YQL Wednesday, March 11, 2009 30
  • 71. Open Data Tables Map YQL to Endpoint YQL Wednesday, March 11, 2009 30
  • 72. Open Data Tables YQL Wednesday, March 11, 2009 31
  • 73. Open Data Tables YQL Wednesday, March 11, 2009 31
  • 74. Open Data Tables Wednesday, March 11, 2009 32
  • 75. Open Data Tables Wednesday, March 11, 2009 33
  • 76. Open Data Tables Schema defines mapping between YQL and Endpoint Keys can either be query, path, header or matrix parameters Keys can be marked as required YQL Compiler validates existence of required keys and uses them to select an endpoint Wednesday, March 11, 2009 34
  • 77. USE Verb use ‘http://url-to-def.xml’ as tableName; select * from tableName where key=‘value’... Imports the Table definition Makes it available to following statements as tableName desc tableName - describes the def Acts like a First Class Data Source just like other YQL Tables. Wednesday, March 11, 2009 35
  • 78. Environment files Text files that contain multiple table “use” statements Useful for defining your own default working sets of tables No need to “use” per call Wednesday, March 11, 2009 36
  • 79. Using environment files http://query.yahooapis.com/v1/yql? q=...&env=http://... http://developer.yahoo.com/v1/yql? env=http://... Add a query parameter to the web service or console call Shows up in console table list / show tables http://developer.yahoo.com/yql/console/?env=http:// github.com/spullara/yql-tables/raw/ ef685688d649a7514ebd27722366b2918d966573/alltables.env Wednesday, March 11, 2009 37
  • 80. Accessing YQL OAuth Endpoint http://query.yahooapis.com/v1/yql?q=... Public Endpoint http://query.yahooapis.com/v1/public/yql?q= YQL Console http://developer.yahoo.com/yql/console Wednesday, March 11, 2009 38
  • 81. Accessing YQL YQL Via Pipes Wednesday, March 11, 2009 39
  • 84. Conclusion build applications more easily fewer lines of code consistent and familiar syntax for all data access iterative environment for developing the query Wednesday, March 11, 2009 41
  • 85. Conclusion build applications that run faster service in the cloud does the work with smaller network footprint fewer (client) calls smaller data amounts closer to the data, fatter pipes Wednesday, March 11, 2009 42
  • 87. One API : YQL Wednesday, March 11, 2009 44
  • 88. Q&A http://developer.yahoo.com/yql Follow up: http://developer.yahoo.com/ events/etech09 Wednesday, March 11, 2009 45