query-8c52a53a83f5f1ed7cc6abc2a75996eb
TODO
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{"hide":"?rgb"}
SELECT ?_s ?_sLabel ?_sDescription (GROUP_CONCAT(DISTINCT ?woBezeichnung; separator=', ') AS ?woLabels) (SAMPLE(?image) AS ?image) ?coord ?rgb ?layer WHERE {
?_s wdt:P17 wd:Q40 .
?_s wdt:P131*/wdt:P279* wd:Q40 .
?_s wdt:P31 wd:Q8502 .
?_s wdt:P625 ?coord .
?_s wdt:P131 ?wo .
OPTIONAL {
?wo rdfs:label ?woLiteral .
FILTER(LANG(?woLiteral) = 'de') .
}
BIND(IF(BOUND(?woLiteral), ?woLiteral, STRAFTER(STR(?wo), 'entity/')) AS ?woBezeichnung) .
OPTIONAL { ?_s wdt:P18 ?image . }
BIND(IF(BOUND(?image),'0000ff','ff0000') AS ?rgb)
BIND(IF(BOUND(?image),'With image','Without image') AS ?layer)
# MINUS { ?_s wdt:P18 [] }
MINUS { ?_s wdt:P373 [] }
SERVICE wikibase:label { bd:serviceParam wikibase:language '[AUTO_LANGUAGE,de,en]' }
} GROUP BY ?_s ?_sLabel ?_sDescription ?coord ?rgb ?layer ORDER BY ASC(?_sLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?_s"):::projected
v1("?_sLabel"):::projected
v4("?coord"):::projected
v11("?image"):::projected
v9("?layer"):::projected
v8("?rgb"):::projected
v5("?wo")
v6("?woBezeichnung"):::projected
v10("?woLabels")
v2("?woLiteral")
a2((" "))
a1((" "))
c3(["wd:Q40"]):::iri
c13(["bd:serviceParam"]):::iri
c15(["#91;AUTO_LANGUAGE,de,en#93;"]):::literal
c7(["wd:Q8502"]):::iri
v3 --"wdt:P17"--> c3
v3 --"wdt:P131"--> a1
a1 --"wdt:P279"--> c3
v3 --"wdt:P31"--> c7
v3 --"wdt:P625"--> v4
v3 --"wdt:P131"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v2
end
bind0[/"if(bound(?woLiteral),?woLiteral,substring-after(str(?wo),'entity/'))"/]
v2 --o bind0
v5 --o bind0
bind0 --as--o v6
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P18".-> v11
end
bind1[/"if(bound(?image),'0000ff','ff0000')"/]
v11 --o bind1
bind1 --as--o v8
bind2[/"if(bound(?image),'With image','Without image')"/]
v11 --o bind2
bind2 --as--o v9
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P373"--> a2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end
bind6[/"?woBezeichnung"/]
v6 --o bind6
bind6 --as--o v10
bind7[/"sample(?image)"/]
v11 --o bind7
bind7 --as--o v11