W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2004

Re: Use case: tiger map/census data: have it your way

From: Eric Prud'hommeaux <eric@w3.org>
Date: Mon, 22 Mar 2004 22:21:42 -0500
To: Dan Connolly <connolly@w3.org>
Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <20040323032142.GB26681@w3.org>

On Wed, Mar 17, 2004 at 12:06:18PM -0600, Dan Connolly wrote:
> 
> The U.S. Census Bureau provides some really nify data
>   http://www.census.gov/geo/www/tiger/tiger2003/tgr2003.html
> it's public domain.
> 
> I want to do a query like
> 	tell me the lat, lon, name, and type
> 	of everything within 50 miles of Cambridge, MA
> 
> Right now, I have to download all the files, unzip them,
> read a bunch of docs, write some software, blah blah blah.
> 
> I'd like to just look at it as a big RDF graph and issue
> a query.
> 
> Hmm... it's not clear they (the census folks) have motivation
> to offer a query service. But clearly a third party could.

I think this is a hard problem.

I know we are supposed be writing fairy tails and not drilling down
into the nitty gritty, but I can't get my head around the size of this
problem without envisioning the mechanics.

write some software, blah blah blah approach:
  Given lat/long of every city center in Massachusetts (a finite number
  of locations) expressed in, or translatable to, RDF, query for each
  lat/long for each city and use sqrt(a^2+b^2) to calculate the distance
  for each. Take the ones where that is < 50 miles.
QL requirements: simple conjunction --
    ?city gis:latitude ?lat
    ?city gis:longitude ?long
  collect (?city ?lat ?long)
and do the rest with custom software.

value-constrained query approach:
  same as above, only limit the scope to those cities within a 50 mile
  *square* of Cambridge. (Assuming 42.3, -71.1 for Cambridge, MA and
  one mile corresponds to .01 degrees in both latitude and longitude):
QL requirements: conjunction+numeric comparison
    ?city gis:latitude ?lat
    ?city gis:longitude ?long
    ?lat <= 42.8
    ?lat >= 41.8
    ?long <= 70.6
    ?long >= 71.6
  collect (?city ?lat ?long)
You still have to write a program to do the same math, but you get to
greatly reduce the query result set that the program must walk through.

crazy mad arithmatic approach:
Put all the math into the query:
QL requirements: the conjunction+numeric comparison+math library
    ?city gis:latitude ?lat
    ?city gis:longitude ?long
    sqrt((?lat-42.3)^2 + (?long-71.1)^2) < 0.5
  collect (?city ?lat ?long)

I wonder which you would like to put forth as a use case, the fairy
tale where someone still has to write the program et al, or the fairy
tale where the QL has math libraries. I guess both are use cases, and
the use case evaluation is the time to decide which approach the QL
should cater to.

> Dan Connolly, W3C http://www.w3.org/People/Connolly/
> see you at the WWW2004 in NY 17-22 May?

be seeing you
-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741 (does not work in Asia)

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.
Received on Monday, 22 March 2004 22:22:33 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:18 GMT