Search

2010 election in RDF

I needed a few tweaks to get the data on the nominations for today's election converted into XML, then into RDF via the model (with a couple of added properties) and then into the Talis datastore. It seem to be all there but I couldn't swear to it.

I'm a bit confused about Constituency names.  Mine are derived from the Press Association

http://election.pressassociation.com/Nominations/general.php

with a few changes - title caseing, & ->  and and a few reversals Chester, City of.  However they seem to differ from the names on TheyWorkForYou

http://www.theyworkforyou.com/api/docs/getConstituencies?date=2010-06-01&...

we will see.

The dataset is browseable e.g. Bristol West  as well as queriable via the SPARQL interface

Some triples which are needed are to relate 2010 constituences to 2005 constituences and to relate Candidates in the two elections - the names in 2005 are surname and initial, in 2010 first name and surname. Might need to create some data by hand here.

..

Adding some links to the data set. The script uses a query to get the constituencies and their names:



select  ?constituency ?name where {
    ?election rdfs:label "UK2010".
    ?election :constituency ?constituency.
    ?constituency rdfs:label ?name
}


which is execuet by the Talis SPARQL engine, the result turned into simple XML tuples and then the RDF generated.



<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:xs = "http://www.w3.org/2001/XMLSchema#"
       xmlns="http://www.cems.uwe.ac.uk/xmlwiki/rdf/election/vocab#"
       > 
       {for $tuple in $tuples
       let $name := string($tuple/*:name)
        return
           element rdf:Description {
              attribute rdf:about  {string($tuple/*:constituency)},  
                element leaflets {
                    attribute rdf:resource {concat("http://www.thestraightchoice.org/constituencies/",replace($name," ","_"))}
                },
                element voterpower {
                     attribute rdf:resource {concat("http://www.voterpower.org.uk/",replace(lower-case($name),' ','-'))}
                }
            }
        }
  </rdf:RDF>


which is then piped into a script to send to Talis.