query-3a8d371c8379740dcb1ff8a318517a65
title:Are UK mountain items in OpenStreetMap, with a URL to assist in adding missing QIds to OSM PREFIX osmt: https://wiki.openstreetmap.org/wiki/Key: SELECT DISTINCT ?item ?itemLabel ?osmid ?OSMLINK WHERE { ?item wdt:P31 wd:Q8502; wdt:P17 wd:Q145. SERVICE wikibase:label { bd:serviceParam wikibase:language "en,cy,de,fr,nl,es,sv". } OPTIONAL { SERVICE https://sophox.org/sparql { ?osmid osmt:wikidata ?item. } } OPTIONAL { ?item p:P625/psv:P625/wikibase:geoLatitude ?lat ; p:P625/psv:P625/wikibase:geoLongitude ?long. BIND(IRI(CONCAT("https://www.openstreetmap.org/?mlat=",str(?lat),"&mlon=",str(?long),"&zoom=11")) as ?OSMLINK) } } ORDER BY ?itemLabel
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Are UK mountain items in OpenStreetMap, with a URL to assist in adding missing QIds to OSM
PREFIX osmt: <https://wiki.openstreetmap.org/wiki/Key:>
SELECT DISTINCT ?item ?itemLabel ?osmid ?OSMLINK WHERE {
?item wdt:P31 wd:Q8502;
wdt:P17 wd:Q145.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,cy,de,fr,nl,es,sv". }
OPTIONAL {
SERVICE <https://sophox.org/sparql> {
?osmid osmt:wikidata ?item.
}
}
OPTIONAL {
?item p:P625/psv:P625/wikibase:geoLatitude ?lat ;
p:P625/psv:P625/wikibase:geoLongitude ?long.
BIND(IRI(CONCAT("https://www.openstreetmap.org/?mlat=",str(?lat),"&mlon=",str(?long),"&zoom=11")) as ?OSMLINK)
}
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?OSMLINK"):::projected
v2("?item"):::projected
v1("?itemLabel"):::projected
v4("?lat")
v5("?long")
v3("?osmid"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c8(["en,cy,de,fr,nl,es,sv"]):::literal
c6(["bd:serviceParam"]):::iri
c4(["wd:Q145"]):::iri
c2(["wd:Q8502"]):::iri
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P17"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph s2["https://sophox.org/sparql"]
style s2 stroke-width:4px;
v3 -.https://wiki.openstreetmap.org/wiki/Key:wikidata.-> v2
end
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:P625".-> a1
a1 --"p:statement/value/P625"--> a2
a2 --"wikibase:geoLatitude"--> v4
v2 --"p:P625"--> a3
a3 --"p:statement/value/P625"--> a4
a4 --"wikibase:geoLongitude"--> v5
bind0[/"concat('https://www.openstreetmap.org/?mlat=',str(?lat),'&mlon=',str(?long),'&zoom=11')"/]
v4 --o bind0
v5 --o bind0
bind0 --as--o v6
end