Home > politics > Politicans per capita in EU member states

Politicans per capita in EU member states

December 8, 2010

I was looking for an interesting query to use as the basis for a quick SPARQL in Drupal7 page, and given Ireland’s “austerity” (aka hairshirt) budget yesterday and our glorious IMF bailout,  I was minded to create a query ranking number of members of houses of legislature in each country against population.

The query took a long time because its very difficult to ascertain the field names from the dbpedia infobox fields, the dbpedia properties and ontology, and the variations in field usage per country, the apparent disconnect (for a human) between a topic and what might be exected as property. I for instance was expecting to be able see a reference to the house of parliament on each country’s page, but its in fact a little more organised than that 🙂

In the end the easiest way to do this is to open up the SPARQL endpoint [1], for example a wiki page about a country, then find an URI for a dbpedia resource for a country. I ended up using the Czech Republic URI [2].

After much tooing-and-froing the query I came up with the query below. Strangely, some countries have recorded populations that this query doesnt find (eg Germany – simplify the query and take a look).  It’s a bit rough around the edges but the evidence is clear [1] : Ireland is over-represented in legislature.

  • Anyone have any opinions why Ireland is over-represented ?
  • Is the situation similar at local level ?
  • Why doe the query not pick up dbpprop:populationEstimate for Germany ?
SELECT ?s ?t ?estPop ?estPopYear ?cenPop ?cenPopYear ?house ?n (?estPop/?n) as ?estPerCapita (?cenPop/?n) as ?cenPerCapita
WHERE { 
?s ?p <http://dbpedia.org/resource/Category:European_Union_member_states> .
?t skos:subject ?s .
?t rdf:type dbpedia-owl:Country .

optional{
?b skos:broader ?s .
?house skos:subject ?b .
?house dbpedia-owl:numberOfMembers ?n .

?t dbpprop:populationEstimate ?estPop .
?t dbpprop:populationCensus ?cenPop .
?t dbpprop:populationEstimateYear ?estPopYear .
?t dbpprop:populationCensusYear ?cenPopYear .
}

}
order by ?t

[1] http://dbpedia.org/sparql

[2] http://dbpedia.org/resource/Czech_Republic

[3] http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&should-sponge=soft&query=SELECT+%3Fs+%3Ft+%3FestPop+%3FestPopYear+%3FcenPop+%3FcenPopYear+%3Fhouse+%3Fn+%28%3FestPop%2F%3Fn%29+as+%3FestPerCapita+%28%3FcenPop%2F%3Fn%29+as+%3FcenPerCapitaWHERE+{+%0D%0A%3Fs+%3Fp+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FCategory%3AEuropean_Union_member_states%3E+.%0D%0A%3Ft+skos%3Asubject+%3Fs+.%0D%0A%3Ft+rdf%3Atype+dbpedia-owl%3ACountry+.%0D%0A%0D%0Aoptional{%0D%0A%3Fb+skos%3Abroader+%3Fs+.%0D%0A%3Fhouse+skos%3Asubject+%3Fb+.%0D%0A%3Fhouse+dbpedia-owl%3AnumberOfMembers+%3Fn+.%0D%0A%0D%0A%3Ft+dbpprop%3ApopulationEstimate+%3FestPop+.%0D%0A%3Ft+dbpprop%3ApopulationCensus+%3FcenPop+.%0D%0A%3Ft+dbpprop%3ApopulationEstimateYear+%3FestPopYear+.%0D%0A%3Ft+dbpprop%3ApopulationCensusYear+%3FcenPopYear+.%0D%0A}%0D%0A%0D%0A}%0D%0Aorder+by+%3Ft%0D%0A&debug=on&timeout=&format=text%2Fhtml&save=display&fname=fname=

Advertisements
  1. December 14, 2010 at 8:55 pm

    Nothing for Bulgaria too. Are they hiding something from us? 🙂

    • December 14, 2010 at 8:59 pm

      I must check that sparql query again – I know theres a population figure for DE for instance, but in this query it seems to get dropped out. I’ve also got to see if I can get the figures for local gov/administrative divisions

      Does Bulgaria have too many politicians, a busted banking system (bonuses almost got approved tho), a successful export economy and many people out of work ?

  2. December 15, 2010 at 9:29 pm

    In Bulgaria everyone is a politician 🙂

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: