More tinkering with the Election model

I've had a problem with naming Classes in the Election vocab.  Initially I called the overall event an Election and the voting in a Constituency a Poll, but it didn't feel quite right. Chris Taggart had pointed me to  the vocabulary being developed with Jeni Tennison for local elections over in OpenlyLocal. As a result, I've renamed Poll as Election, and the collection of Elections at a particular time as General-Election.

In writing queries, I kept forgetting whether I had defined the relationship (property) constituency from Election to Constituency or its inverse election from Constituency to Election. Both are really needed of course but without a SPARQL engine which understands owl:inverseOf, the inverse triples need to be materialized in the triple store.  Since the data model defines the relationship, it is simple to generate these triples with an XQuery script. The simple RDF browser doesn't yet understand this relationship so redundantly both are shown.

The postponed Thirsk and Malton election gives me the chance to model this unusual situation.  I added the new Election with the latest nominations and will add the result later, so the consituency now shows both elections. (Plus a bit of garbage :-( which crept in - removing triples is something I havent yet tackled) Also, since Member has date-joined and date-left properties, a query can find the MPs at any date with a query like:

select  ?mpName  ?member where {
?assembly rdfs:label "House of Commons".
?member :assembly ?assembly;
        a :Member;
        :date-joined ?joined;
        rdfs:label ?mpName.
OPTIONAL {?member :date-left ?left}.
FILTER (?joined <= "2010-05-25").
FILTER (!bound(?left) || ?left > "2010-05-25").
} orderby ?mpName

which will omit the MP to be elected tomorrow from the list of MPs.

The model is looking robust enough to model some other elections which will be the test of this model (theory). One further change needed is to re-factor the Constituency class into a general Region Class and a specialised Westminster Constituency.  Lots of links yet to do, but its looking promising enough I think to mention it in the list.