query-a0ef359e3cba6b81f8a07cc757c6ed27
Alle Objekte in AT mit Koordinaten
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":"?rgb"}
#title: all items in Austria with coordinates
SELECT ?item ?itemLabel ?itemDescription (SAMPLE(?image) AS ?image) ?coord ?rgb ?layer WHERE {
{
SELECT DISTINCT ?item WHERE {
?item wdt:P17 wd:Q40 .
?item wdt:P131* wd:Q40 .
?item wdt:P625 [] .
minus {?item wdt:P31 wd:Q35779580.} # möglicherweise ungültiger Eintrag
}
}.
?item wdt:P625 ?coord.
OPTIONAL { ?item wdt:P18 ?image }
BIND(IF(EXISTS { ?item p:P18 [] }, '0000ff', 'ff0000') AS ?rgb) .
BIND(IF(EXISTS { ?item p:P18 [] }, 'With image', 'Without image') AS ?layer) .
SERVICE wikibase:label { bd:serviceParam wikibase:language '[AUTO_LANGUAGE,de,en]' }
} GROUP BY ?item ?itemLabel ?itemDescription ?coord ?rgb ?layer ORDER BY ASC(?item)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?coord"):::projected
v6("?image"):::projected
v1("?item"):::projected
v5("?layer"):::projected
v4("?rgb"):::projected
a1((" "))
c6(["wd:Q35779580"]):::iri
c9(["bd:serviceParam"]):::iri
c2(["wd:Q40"]):::iri
c11(["#91;AUTO_LANGUAGE,de,en#93;"]):::literal
v1 --"p:direct/P17"--> c2
v1 --"p:direct/P131"--> c2
v1 --"p:direct/P625"--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P31"--> c6
end
v1 --"p:direct/P625"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v6
end
v1 --"p:P18"--> null
bind1[/"if( ,'0000ff','ff0000')"/]
subgraph bind1e0["Exists Clause"]
e0v1 --"p:P18"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
bind1--EXISTS--> bind1e0
v1 --o bind1
null --o bind1
null --o bind1
bind1 --as--o v4
v1 --"p:P18"--> null
bind2[/"if( ,'With image','Without image')"/]
subgraph bind2e1["Exists Clause"]
e1v1 --"p:P18"--> e1a1
e1v1("?item"):::projected
e1a1((" ")):::projected
end
bind2--EXISTS--> bind2e1
v1 --o bind2
null --o bind2
null --o bind2
bind2 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind4[/"sample(?image)"/]
v6 --o bind4
bind4 --as--o v6