A stream of consciousness from the brain of B.K. DeLong

 

« Keyes: No Denials | Main | Be an Election Monitor - Or Help One »

October 06, 2004

FOAF, Politics and RDF

During lunch the past couple of days, I've been working on a way for people to define their political views in a FOAF file or any RDF for that matter. As a result of my first attempt, I've realize that we first need a way to define a series of political districts in which voting for an elected official takes place. I think I've captured that with the below bit of code.

The <Region> tag is the parent for defining all the various <locale>s in which voting takes place for a person. You define the localetype - which is just the name for the voting region - the proper name for the locale via <localename> and the various <localepositions> via individual <localeposition> entries. Finally, you define what hierarchial order the locale appears in the governmental structure via the <regionorder> tag. Most of what you see below is logical however despite that the Massachusetts Representative Districts can sometimes include a single city, most voting districts span cross-county hence why I've listed the "District" localetype above the "County" localetype.

Once I defined my various voting regions, I created an election instance using dc:date, and started laying out each individual <Vote> by pairing the localeposition with details of the candidate. I need to come up with a better way to identify an individual candidate because I'm not sure foaf:mbox would work. For cases where I was undecided, I created a <votestatus> tag that defined as such.

Ideally, my political voting region vocabulary could become generalized for the world and voting informational sites would generate PoliticsRDF data for people to stick in their FOAF files. If people didn't want to idenfity their votes until they've voted, a <Vote> item could be converted to something along the lines of CurrentlySupporting in case ones views change overtime.

Unfortunately, I haven't created any sort of RDF schemas so I could use some assistance in making this a reality. I don't even know if I have the proper triples setup. Once that is done, we can add tags to define a particular political view and attach a "status" with regard to that view such as "for" or "against".

Comments are welcome - please help me enhance and internationalize this. I think it would be a fascinating way to constantly take polls and the like.

<politics>
<RegisteredAs>Independent</RegisteredAs>

<Region>
<locale>
<regionorder>1</regionorder>
<localtype>Country</localtype>
<localename>United States</localename>
<localepositions>
<localeposition>President</localeposition>
<localeposition>Vice President</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>2</regionorder>
<localtype>State</localtype>
<localename>Massachusetts</localename>
<localepositions>
<localeposition>Governor</localeposition>
<localeposition>Lieutenant Governor</localeposition>
<localeposition>Secretary of the Commonwealth</localeposition>
<localeposition>Auditor</localeposition>
<localeposition>Treasurer</localeposition>
<localeposition>Attorney General</localeposition>
<localeposition>US Senator</localeposition>
<localeposition>US Senator</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>3</regionorder>
<localtype>District</localtype>
<localnames>
<localename>6th Massachusetts Congressional District</localename>
<localename>2nd Essex Massachusetts Senatorial District</localename>
<localename>7th Essex Massachusetts Representative District</localename>
<localename>5th Massachusetts Governor's Councillor District</localename>
<localename>Eastern Massachusetts District Attorney District</localename>
</localnames>
<localepositions>
<localeposition>U.S. Representative</localeposition>
<localeposition>State Senator</localeposition>
<localeposition>State Represetative</localeposition>
<localeposition>Governor's Council</localeposition>
<localeposition>District Attorney</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>4</regionorder>
<localtype>County</localtype>
<localename>Essex</localename>
<localepositions>
<localeposition>Sheriff</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>5</regionorder>
<localtype>City</localtype>
<localename>Salem</localename>
<localepositions>
<localeposition>Mayor</localeposition>
<localeposition>Councillor-At-Large</localeposition>
<localeposition>Councillor-At-Large</localeposition>
<localeposition>Councillor-At-Large</localeposition>
<localeposition>Councillor-At-Large</localeposition>
<localeposition>School Committee Member</localeposition>
<localeposition>School Committee Member</localeposition>
<localeposition>School Committee Member</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>6</regionorder>
<localtype>Ward</localtype>
<localename>3</localename>
<localepositions>
<localeposition>City Councillor</localeposition>
</localepositions>
</locale>

<locale>
<regionorder>7</regionorder>
<localtype>Precinct</localtype>
<localename>1</localename>
</locale> </Region> <Election>
<dc:date>2004-11-02</dc:date>
<MyVotes>

<Vote>
<localeposition>President</localeposition>
<candidate>
<foaf:name>John Kerry</foaf:name>
<foaf:mbox>john@johnkerry.com</foaf:mbox>
<foaf:homepage>http://www.johnkerry.com</foaf:homepage>
</candidate>
</Vote>

<Vote>
<localeposition>Vice President</localeposition>
<candidate>
<foaf:name>John Edwards</foaf:name>
<foaf:mbox>john@johnedwards2004.com</foaf:mbox>
<foaf:homepage>http://www.johnedwards2004.com</foaf:homepage>
</candidate>
</Vote>

<Vote>
<localeposition>U.S. Representative</localeposition>
<candidate>
<foaf:name>John Tierney</foaf:name>
<foaf:mbox>jtierney@mail.house.gov</foaf:mbox>
<foaf:homepage>http://www.johntierney.com</foaf:homepage>
</candidate>
</Vote>

<Vote>
<localeposition>State Representative</localeposition>
<candidate>
<foaf:name>John Keenan</foaf:name>
<foaf:mbox>john@electkeenan.com</foaf:mbox>
<foaf:homepage>http://www.electkeenan.com</foaf:homepage>
</candidate>
</Vote>

<Vote>
<localeposition>Sheriff</localeposition>
<votestatus>Undecided</votestatus>
</Vote>

</MyVotes>
</Election>

</politics>


posted by B.K. DeLong at 10/ 6/04, 12:38 PM -05:00 GMT | TrackBack (0) - (Top of the page)

Comments