everypolitician / compare_with_wikidata

Library for diffing Wikidata and CSVs
MIT License
2 stars 0 forks source link

Example case: Scotland #13

Open tmtmtmtm opened 7 years ago

tmtmtmtm commented 7 years ago

for each of the terms of the Scottish Parliament, we need to be able to produce a separate prompt comparing the full list of term memberships in Wikidata, with those from parlparse.

e.g. for term 4 we can get the list from Wikidata via:

SELECT DISTINCT ?item ?itemLabel ?startDate ?endDate ?party ?partyLabel ?area ?areaLabel WHERE {
  ?item p:P39 ?mem .
  ?mem ps:P39 wd:Q30580545 .
  OPTIONAL { ?mem pq:P580 ?startDate }
  OPTIONAL { ?mem pq:P582 ?endDate }
  OPTIONAL { ?mem pq:P102|pq:P4100 ?party }
  OPTIONAL { ?mem pq:P768 ?area }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

The parlparse data doesn't currently live in Morph, but is accessible as CSV from parlparse-to-csv app (on heroku), or potentially even just by looking at the most recent version committed to everypolitician-data

lucychambers commented 7 years ago

This example will have full memberships. i.e. people will not disappear from the lists, they will just receive an end date.

TODO during implementation: Decide whether we need to further split this ticket up.

chrismytton commented 7 years ago

There is documentation, along with some code for generating the ID mapping, in the examples/scotland directory.

lucychambers commented 7 years ago

Outstanding on this is making it work without going via the command line.