Re: Senate query

Danny Ayers wrote:
> David Janes asks in a blog post [1]:
> (snip)
> Apropos of nothing, I'm mulling in my how this result could be
> accomplished (easily) by a Semantic Web type application, without
> requiring standardized names and semi-sophisticated CMS to generate
> the pages.

::cough::  This is only exactly what I've been working on...

I don't have a live demo to show, but given the existing RDF data I have 
at www.GovTrack.us, plus the following query:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix bill: <urn://govshare.info/rdf/usbill/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

?bill rdf:type bill:Bill .
?bill bill:congress "109" .   (i.e. bill number S.R. 39, 109th Congress)
?bill bill:type "sr" .
?bill bill:number "39" .

?bill bill:cosponsor ?person .
?person foaf:name ?name .

plus my SemWeb library (with bug fixes since the first release), yields 
the following (abridged) list of cosponsoring senators:

<sparql xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result">
   <head>
     <variable name="bill" />
     <variable name="person" />
     <variable name="name" />
   </head>
   <results>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/1999/specter" />
       <name>Arlen Specter</name>
     </result>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/2001/corzine" />
       <name>Jon Corzine</name>
     </result>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/1995/sarbanes" />
       <name>Paul Sarbanes</name>
     </result>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/1995/lautenberg" />
       <name>Frank Lautenberg</name>
     </result>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/1995/stevens" />
       <name>Ted Stevens</name>
     </result>
     <result>
       <bill uri="urn://govshare.info/data/us/congress/109/bills/sr39" />
       <person 
uri="urn://govshare.info/data/us/congress/people/1999/reid" />
       <name>Harry Reid</name>
     </result>
(snipped)

I don't have a mechanism for testing for the nonexistence of a cosponsor 
relation between a bill and a senator, but it could be added quickly if 
I didn't have to run to class.  (See also: 
http://www.govtrack.us/rdfbrowse.xpd and http://www.govtrack.us/source.xpd)

-- 
- Joshua Tauberer

http://taubz.for.net

** Nothing Unreal Exists **

Received on Wednesday, 15 June 2005 12:37:01 UTC