query-1d8b076bba45e7cb1313483d4d9bd6ee
Geo
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT DISTINCT ?place ?placeLabel ?location (?categoryLabel as ?layer) WHERE {
{
wd:Q8939 wdt:P625 ?Loschwitz .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Loschwitz.
bd:serviceParam wikibase:radius "1".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
} UNION {
wd:Q2160346 wdt:P625 ?Rochwitz .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Rochwitz.
bd:serviceParam wikibase:radius "1.5".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
} UNION {
wd:Q1697072 wdt:P625 ?Rockau .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Rockau.
bd:serviceParam wikibase:radius "1.5".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
} UNION {
wd:Q2538540 wdt:P625 ?Wachwitz .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Wachwitz.
bd:serviceParam wikibase:radius "0.5".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
} UNION {
wd:Q8946 wdt:P625 ?Pillnitz .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Pillnitz.
bd:serviceParam wikibase:radius "1".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
} UNION {
wd:Q894173 wdt:P625 ?Borsberg .
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?Borsberg.
bd:serviceParam wikibase:radius "1".
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 ?category.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "de".
?place rdfs:label ?placeLabel.
?category rdfs:label ?categoryLabel.
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?Borsberg")
v1("?Loschwitz")
v9("?Pillnitz")
v6("?Rochwitz")
v7("?Rockau")
v8("?Wachwitz")
v5("?category")
v12("?categoryLabel"):::projected
v4("?dist")
v13("?layer")
v3("?location"):::projected
v2("?place"):::projected
v11("?placeLabel"):::projected
c19(["de"]):::literal
c1(["wd:Q8939"]):::iri
c10(["wd:Q2160346"]):::iri
c7(["1"]):::literal
c4(["bd:serviceParam"]):::iri
c12(["wd:Q1697072"]):::iri
c14(["0.5"]):::literal
c11(["1.5"]):::literal
c13(["wd:Q2538540"]):::iri
c16(["wd:Q894173"]):::iri
c15(["wd:Q8946"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
c16 --"wdt:P625"--> v10
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v10
c4 --"wikibase:radius"--> c7
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
c15 --"wdt:P625"--> v9
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v9
c4 --"wikibase:radius"--> c7
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
c13 --"wdt:P625"--> v8
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v8
c4 --"wikibase:radius"--> c14
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
c12 --"wdt:P625"--> v7
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v7
c4 --"wikibase:radius"--> c11
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
c10 --"wdt:P625"--> v6
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v6
c4 --"wikibase:radius"--> c11
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
c1 --"wdt:P625"--> v1
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v3
c4 --"wikibase:center"--> v1
c4 --"wikibase:radius"--> c7
c4 --"wikibase:distance"--> v4
end
v2 --"wdt:P31"--> v5
end
union0r <== or ==> union0l
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c19
v2 --"rdfs:label"--> v11
v5 --"rdfs:label"--> v12
end
bind0[/"?categoryLabel"/]
v12 --o bind0
bind0 --as--o v13