query-5aca2345792ea88148d2070f70e3114a
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?person ?personLabel ?born ?bornLabel ?coord {
?position wdt:P279* wd:Q1711695 . # 1. find all the MSP positions
?person wdt:P39 ?position . # 2. did they hold any MSP position
?person wdt:P19 ?born . # 3. where were they born
?born wdt:P131* wd:Q22 . # 4. this bit filters down to just "in Scotland"
OPTIONAL { ?born wdt:P625 ?coord . } # 5. coordinates if available
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
#defaultView:Map
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?born"):::projected
v4("?coord"):::projected
v2("?person"):::projected
v1("?position")
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
c2(["wd:Q1711695"]):::iri
c6(["wd:Q22"]):::iri
v1 --"wdt:P279"--> c2
v2 --"wdt:P39"--> v1
v2 --"wdt:P19"--> v3
v3 --"wdt:P131"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P625".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end