Homework 6: Advanced Theseus

This homework will take you beyond the basics and give you a chance to write Theseus plans that require using wrappers, the Xquery operator, and subplans.

IMPORTANT: You will need to download the newest version of Theseus, which has some important bugfixes.

What to do

You are going to write a plan that, given a zip code, a business category, and a business subcategory, does the following:

  1. Uses Yahoo Yellow Pages to find all businesses in that zip code which match the business category and subcategory specified.
  2. Takes the resulting addresses and uses an online Geocoder to determine the polar coordinates (i.e., the lat and lon) of those locations.
  3. Takes the resulting coordinates and uses an online source called a "Building Finder" to find the URLs for satellite images of each of the businesses

You will need to do the following:

The benefit of using subplans is that your development becomes better modularized. Thus, if you wanted to write a different plan that gathered businesses, geocoded them, and plotted them on a Yahoo map, you would quickly be able to reuse the first two plans as subplans in this new plan.

Notes

There are some important notes regarding various parts of this assignment:

Input and output

Your hw6.plan should have the following interface:

PLAN hw6
{
  INPUT: stream criteria
  OUTPUT: stream imageurls

  BODY 
  {
    /* You will write this! */
  }
}
The input datafile should look something like this:
RELATION criteria: zip char, biz_cat char, biz_subcat char
90292|Retail Shopping|Gifts and Cards
When using this input file with your plan, the output should look like this:
----------------------------------------------
RELATION: hw6_imageurls
   attrs: name, streetaddress, city, state, zip, imageurl, lat, lon
----------------------------------------------
Arico's Hallmark|13175 Mindanao Way|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1835&y=18808&z=11&Scale=10&width=2&height=2&toplon=-118.439953394851&toplat=33.9883621706051&botlon=-118.435563250856&botlat=33.9848063332803&displayHouses=1&displayRoads=1|33.9865842519427|-118.437758322853
Girl From Ipanema|103 Washington Blvd|Venice|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1822&y=18806&z=11&Scale=10&width=2&height=2&toplon=-118.46803281021&toplat=33.984423152998&botlon=-118.463641742986&botlat=33.9808683410465&displayHouses=1&displayRoads=1|33.9826457470222|-118.465837276598
Heather's Flowers|101 Washington Blvd|Venice|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1822&y=18806&z=11&Scale=10&width=2&height=2&toplon=-118.46803281021&toplat=33.984423152998&botlon=-118.463641742986&botlat=33.9808683410465&displayHouses=1&displayRoads=1|33.9826457470222|-118.465837276598
Beyond Scents|4710 Admiralty Way|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1834&y=18806&z=11&Scale=10&width=2&height=2&toplon=-118.4420572117&toplat=33.9847303823688&botlon=-118.437667175289&botlat=33.9811746155411&displayHouses=1&displayRoads=1|33.9829524989549|-118.439862193494
Relish Gift Designs Inc|4223 Glencoe Ave|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1833&y=18810&z=11&Scale=10&width=2&height=2&toplon=-118.444343904389&toplat=33.9919178397541&botlon=-118.439953394851&botlat=33.9883621706051&displayHouses=1&displayRoads=1|33.9901400051796|-118.44214864962
Marina Del Rey Florist|4072 1/2 Lincoln Blvd|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1712&y=0&z=11&Scale=10&width=2&height=2&toplon=-118.416166225139&toplat=0.0018089063233339&botlon=-118.412572628698&botlat=-0.00180890914347243&displayHouses=1&displayRoads=1|-1.4100692661027E-09|-118.414369426919
Jeanne's Hallmark|4726 Admiralty Way|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1834&y=18805&z=11&Scale=10&width=2&height=2&toplon=-118.442026753043&toplat=33.9829271666497&botlon=-118.437636813397&botlat=33.9793713952946&displayHouses=1&displayRoads=1|33.9811492809722|-118.43983178322
Star Lane|13737 Fiji Way|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1712&y=0&z=11&Scale=10&width=2&height=2&toplon=-118.416166225139&toplat=0.0018089063233339&botlon=-118.412572628698&botlat=-0.00180890914347243&displayHouses=1&displayRoads=1|-1.4100692661027E-09|-118.414369426919
Marina Sensations|13755 Fiji Way|Marina Del Rey|CA|90292|http://apollo.isi.edu/BF/Find.aspx?x=1712&y=0&z=11&Scale=10&width=2&height=2&toplon=-118.416166225139&toplat=0.0018089063233339&botlon=-118.412572628698&botlat=-0.00180890914347243&displayHouses=1&displayRoads=1|-1.4100692661027E-09|-118.414369426919
----------------------------------------------

What to turn in

You should turn in the following:

Questions and comments

If you have any, contact Greg Barish.