query-a934b68c5b9c3b2013ef7b00ca7b3acb
Alle Objekte in AT mit Koordinaten und ohne instance of (P31)
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 [] .
filter not exists {?item wdt:P31 []}
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
a2((" "))
a1((" "))
c6(["wd:Q35779580"]):::iri
c9(["bd:serviceParam"]):::iri
c3(["wd:Q40"]):::iri
c11(["#91;AUTO_LANGUAGE,de,en#93;"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P31"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
v1 --"p:direct/P31"--> a1
v1 --"p:direct/P17"--> c3
v1 --"p:direct/P131"--> c3
v1 --"p:direct/P625"--> a2
subgraph minus1["MINUS"]
style minus1 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
bind2[/"if( ,'0000ff','ff0000')"/]
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 v4
v1 --"p:P18"--> null
bind3[/"if( ,'With image','Without image')"/]
subgraph bind3e2["Exists Clause"]
e2v1 --"p:P18"--> e2a1
e2v1("?item"):::projected
e2a1((" ")):::projected
end
bind3--EXISTS--> bind3e2
v1 --o bind3
null --o bind3
null --o bind3
bind3 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind5[/"sample(?image)"/]
v6 --o bind5
bind5 --as--o v6