query-d68cec68a0e9590280f1c2ef94726651
Map of things in Oxford and what they are named after
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide": ["?location"]}
SELECT ?person ?personLabel (SAMPLE(?img) AS ?image) (SAMPLE(?loc) AS ?location) ?placeLabel WHERE {
?place wdt:P131 wd:Q34217;
wdt:P138 ?person FILTER (?person != wd:Q34217).
OPTIONAL { ?place wdt:P625 ?coords }
OPTIONAL { ?place p:P159/pq:P625 ?hqcoords }
BIND (IF (BOUND(?coords), ?coords, ?hqcoords) AS ?loc)
OPTIONAL { ?person wdt:P18 ?img }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
} GROUP BY ?person ?personLabel ?placeLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?coords")
v4("?hqcoords")
v7("?image")
v6("?img"):::projected
v5("?loc"):::projected
v8("?location")
v1("?person"):::projected
v2("?place")
a1((" "))
c9(["bd:serviceParam"]):::iri
c1(["wd:Q34217"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
f0[["?person != 'wd:Q34217'"]]
f0 --> v1
v2 --"p:direct/P131"--> c1
v2 --"p:direct/P138"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P625".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P159".-> a1
a1 --"p:qualifier/P625"--> v4
end
bind1[/"if(bound(?coords),?coords,?hqcoords)"/]
v3 --o bind1
v4 --o bind1
bind1 --as--o v5
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind4[/"sample(?img)"/]
v6 --o bind4
bind4 --as--o v7
bind5[/"sample(?loc)"/]
v5 --o bind5
bind5 --as--o v8