Created
July 6, 2017 03:26
-
-
Save jnothman/363318ef8cccaa57ad7c1d544bc668b5 to your computer and use it in GitHub Desktop.
Australian politicians'/parliamentarians' history from WikiData
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
?subj | |
?subjLabel | |
?prop | |
?position | |
?positionLabel | |
?start | |
?end | |
?district | |
?districtLabel | |
WHERE | |
{ | |
VALUES ?memberlabel { "Member of the Australian House of Representatives"@en | |
"member of the Australian Senate"@en | |
"Member of the New South Wales Legislative Assembly"@en | |
"Member of the New South Wales Legislative Council"@en | |
"Member of the Australian Capital Territory Legislative Assembly"@en # Broken | |
"Member of the Queensland Legislative Assembly"@en | |
"Member of the Queensland Legislative Council"@en | |
"Member of the South Australian Legislative Council"@en | |
"Member of the South Australian House of Assembly"@en | |
"Member of the Tasmanian House of Assembly"@en | |
"Member of the Tasmanian Legislative Council"@en | |
"Member of the Victorian Legislative Council"@en | |
"Member of the Victorian Legislative Assembly"@en | |
"Member of the Western Australian Legislative Assembly"@en | |
"Member of the Western Australian Legislative Council"@en | |
} . | |
?member rdfs:label ?memberlabel ; | |
wdt:P31 wd:Q4164871 . # topic is a position | |
?subj p:P39|p:P166|p:P102 ?statement; | |
wdt:P31 wd:Q5; | |
?prop ?statement; | |
wdt:P39 ?member. | |
?statement ps:P39|ps:P166|ps:P102 ?position . # surely I don't need to repeat the list of candidate props to get the value out. How do I say "p:*"? | |
OPTIONAL { ?statement pq:P580 ?start . } | |
OPTIONAL { ?statement pq:P582 ?end . } | |
OPTIONAL { ?statement pq:P768 ?district . } | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language "en" . | |
} | |
} | |
ORDER BY ?subj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment