579
edits
Line 891: | Line 891: | ||
BIND(geof:latitude(?geo1) AS ?lat) | BIND(geof:latitude(?geo1) AS ?lat) | ||
} # geocoords if available | } # geocoords if available | ||
} # /wikidata service | |||
} #/wikidata optional | |||
BIND(COALESCE(?geo1, ?geo2) AS ?geo). # if geo1 available use that, then try geo2 | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en-gb". } | |||
} | |||
</sparql> | |||
====Counties of residence for women nominated as FSAs, on a map==== | |||
<sparql tryit="1"> | |||
# Counties of residence for women nominated as FSAs | |||
PREFIX bnwd: <https://beyond-notability.wikibase.cloud/entity/> | |||
PREFIX bnwds: <https://beyond-notability.wikibase.cloud/entity/statement/> | |||
PREFIX bnwdv: <https://beyond-notability.wikibase.cloud/value/> | |||
PREFIX bnwdt: <https://beyond-notability.wikibase.cloud/prop/direct/> | |||
PREFIX bnp: <https://beyond-notability.wikibase.cloud/prop/> | |||
PREFIX bnps: <https://beyond-notability.wikibase.cloud/prop/statement/> | |||
PREFIX bnpq: <https://beyond-notability.wikibase.cloud/prop/qualifier/> | |||
#defaultView:Map{"hide":["?geo", "?wikidata"]} | |||
SELECT distinct ?person ?personLabel ?county ?countyLabel ?wikidata ?geo | |||
WHERE { | |||
?person bnwdt:P3 bnwd:Q3 . # select women | |||
?person bnwdt:P16 ?signatory . #select women who were nominated for election to FSA | |||
FILTER NOT EXISTS {?person bnwdt:P4 bnwd:Q12 .} #filter out project team | |||
?person bnwdt:P29 ?residence . # select residences | |||
?residence bnwdt:P33 ?district . #select districts | |||
?district bnwdt:P33 ?county . #select counties | |||
optional { ?county bnwdt:P153 ?geo2 . } # for geocoords added to BN | |||
optional { | |||
?county bnp:P117 ?ws . # wikidata id P117 | |||
?ws bnpq:P14 ?wikidata_url . | |||
BIND(IRI(REPLACE(?wikidata_url, "https://www.wikidata.org/wiki/", "http://www.wikidata.org/entity/")) as ?wikidata ) | |||
SERVICE <https://query.wikidata.org/sparql> { | |||
optional { ?wikidata wdt:P625 ?geo1 . } # geocoords if available | |||
} # /wikidata service | } # /wikidata service | ||
} #/wikidata optional | } #/wikidata optional |
edits