Stuck in the Senate
by Paul Ford
|
Pages: 1, 2
Breaking All the Roles
OK, so now we have a way of naming people. So how to do we refer to political offices, that is, roles they might enact? Since there are two senators per state, we can establish Tag URIs for the Senators in New York like so:
tag:hackingcongress.info,2004-10-05:/U.S.+Senate/108th/NY/1
tag:hackingcongress.info,2004-10-05:/U.S.+Senate/108th/NY/2
Figure 4. Two Tag URIs for New York senators.
That works for New York's two senators for the 108th Congress; simply slot in the state abbreviations for the other 49 states, and you have a way of pointing to every senator in the country. Leave out the "108th" path component of the identifier, and you've named a Senatorial seat irrespective of any particular session of Congress, which is really a separate resource. Vary the session of Congress and you have a way, for the Senate, at least, to refer to every Senator's seat in every session of Congress. It's also easy to parse by eye -- which, since I'll be editing a lot of data by hand, will be very useful. Here's a Tag URI for the presidency:
tag:hackingcongress.info,2004-10-05:/U.S.+President/
Figure 5. A Tag URI for the President.
And here's one for John Kerry, a person, in his capacity as a Senator in the 108th session of Congress, a role:
tag:hackingcongress.info,2004-10-05:/U.S.+Senate/108th/MA/Kerry,John+F
Figure 6. A Tag URI for Sen. John Kerry.
All right, let's put it together, and see what we have.
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema"
xmlns="http://www.hackingcongress.info/ns/Politics#">
<Human rdf:about =
"tag:hackingcongress.info,2004-10-05:Kerry,John+F">
<FullName>Kerry, John F.</FullName>
<HoldsOffice rdf:resource =
"tag:hackingcongress.info, 2004-10-05:/U.S.+Senate/MA/
Kerry,John+F"/>
<-- Other descriptive RDF goes here-->
</Human>
<OfficeHolder rdf:about =
"tag:hackingcongress.info,2004-10-05:/U.S.+Senate/MA/Kerry,
John+F">
<HasRole rdf:resource =
"tag:hackingcongress.info,2004-10-05:/U.S.+Senate/MA/2"/>
<StartDate>1985</StartDate>
</OfficeHolder>
<Role rdf:about =
"tag:hackingcongress.info,2004-10-05:/U.S.+Senate/MA/2">
<rdfs:Label>Junior Senator from Massachussetts</rdfs:Label>
</Role>
</rdf:RDF>
Figure 7. RDF incorporating Tag URIs.
Now we've broken up John Kerry into many component parts, and started to give ourselves the flexibility we need in order to model reality, if only in part, in the Semantic Web. If we did the same for all Senators, living and dead, it would be possible to issue queries like: "Who were all of the junior senators of Massachusetts?" Or "When was John Kerry elected to his Senate seat?" John Kerry was never in the House of Representatives (he ran, but lost in 1972), but many Senators were previously in the House, and, with Tag URIs, we have a way to keep the distinctions clear between people, the roles they fill, and the offices they hold in order to fill those roles.
We do this for a couple of reasons: first, because people really aren't their roles and roles aren't just the people who fill them. But, second, because we never want to go back and change any RDF (unless it's wrong); we only want to add more over time. So we need to make way for that change, and while it's possible to get overly granular, this sort of breakdown makes sense, and should let us do the sorts of interesting sorting and searching of our data set that we'd like, in the future.
Eventually we'll want to further sharpen our machine-readable description of this chunk of the world by saying things like "people who hold political offices are politicians, which are subclasses of the concept of a FOAF person." More about that when we get to OWL.
Making Friends with the President
One of the nifty things about RDF is that you can throw in data that maps to other schemas, willy-nilly. In this case, since we're talking about human beings, using FOAF data is a natural match. Using Leigh Dodds' FOAF-a-Matic, I came up with some FOAF for John Kerry, and dropped it in:
<Human rdf:about="tag:hackingcongress.info,2004-10-05:
Kerry,John+F">
<FullName>Kerry, John F.</FullName>
<HoldsOffice rdf:resource =
"tag:hackingcongress.info,2004-10-05:/U.S.-Senate/MA/
Kerry,John+F"/>
<foaf:name>John Kerry</foaf:name>
<foaf:title>Mr.</foaf:title>
<foaf:givenname>John</foaf:givenname>
<foaf:family_name>Kerry</foaf:family_name>
<foaf:homepage rdf:resource="http://johnkerry.com"/>
<foaf:workplaceHomepage rdf:resource =
"http://senate.gov"/>
<foaf:workInfoHomepage rdf:resource =
"http://www.slate.com/id/1006400/"/>
<foaf:schoolHomepage rdf:resource="http://yale.edu"/>
<foaf:knows>
<foaf:Person>
<foaf:name>Theresa Heinz Kerry</foaf:name>
</foaf:Person>
</foaf:knows>
</Human>
Figure 8. Kerry, now with FOAF.
Of course, for that RDF to parse, I'd have to add the xmlns:foaf="http://xmlns.com/foaf/0.1/" namespace declaration at the top of my XML file. Of course, FOAF isn't really intended to describe people "in the wild" -- when it's used it as intended, individuals can create their own FOAF files, and agents can collect those files and create a map of relationships between individuals. That said, there are already a number of people working on ways to explore and visualize relationships in FOAF, so perhaps we can use a subset of FOAF's predicates in order to take advantage of the tools that have already been built.
Not Necessarily the Web
So now, we've taken two steps back for last month's step forward, in order to clarify the difference between people, roles, and offices. But they were good steps to take, because there's no purpose in building RDF maps of the House or Executive Branch if the data is confused.
Looking at the shift from HTTP URIs to URNs, you could reasonably ask, "Where's the Web in this Semantic Web application?" By going with TAG URIs, the Hacking Congress data cut its link to the Web as a whole, and it is now defined in terms of itself, at least for now.
There are two points to remember. First, our RDF describing the
Senate will eventually be on the Web itself, where it can be
retrieved, queried, and so on. Second, we will eventually enrich this
data with links to other, related resources, using RDF predicates
like foaf:homepage and rdfs:seeAlso.
But, looking at the bigger picture, there is, I think, an important distinction between the Semantic Web and the Web As We Know It (WAWKI). The Semantic Web is about defining data in a consistent, accurate way, so that it can be shared by machines and by humans. The WAWKI is about moving human-friendly representations of resources from one place to another, and the focus on semantic consistency (in the form of XML, XHTML, and related standards) came after the basic architecture was established. The goal of this column is not to build a "Semantic Web site" because such a thing doesn't really exist. Rather, we're aiming to build a useful knowledge base of information about a specific domain, to publish that knowledge base on the Web, so that agents, both human and machine, can use the data in ways that aids them in accomplishing their goals and plans.
When Hacking Congress returns in November, there will be a new U.S. President, barring a repeat of 2000's electoral debacle, and we'll try to see if we can fit the executive branch into our RDF plans.
- But that's not sufficient, is it?
2004-10-22 03:24:25 ajeru - A full RDF database
2004-10-16 16:43:08 JoshuaTauberer