query-f63225e16022f52e4135eb9ddbeb126a
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?id ?geo (concat('[[:de:', '', '#', substr(str(?id),32,13), '|', ?idLabel, ']]', '\\n', '[[File:Wikidata-logo S.svg|16px|link=d:', substr(str(?id),32,13), ']]', (SAMPLE(?idBild))) as ?description)
('building' as ?marker_symbol) ('small' as ?marker_size) ?marker_color ?rgb
WHERE {?id wdt:P2817 ?list.
?id wdt:P625 ?geo.
#VALUES ?list {wd:}.
VALUES ?list {wd:Q1859286}.
SERVICE wikibase:label { bd:serviceParam wikibase:language 'de,en' .
?id rdfs:label ?idLabel . }
OPTIONAL { ?id wdt:P18 ?img . BIND("00FF00" as ?rgb)}
optional {?id p:P18 [a wdno:P18]. BIND("000000" as ?rgb) }
BIND(IF(BOUND(?img), concat('\\n', '[[File:', substr(str(?img), 52, 400), '|250px]]'), '') AS ?idBild) .
OPTIONAL {
?id p:P1435 ?statement.
?statement ps:P1435 wd:Q1188447.
?statement pq:P582 ?end.}
BIND(IF(!BOUND(?rgb),"FF0000",?rgb) as ?rgb)
# bind(if(BOUND(?img), if(BOUND(?end), '#80F080', '#008000'), if(BOUND(?end), '#F08080', '#800000')) as ?marker_color).
?link schema:about ?list .
?link schema:isPartOf <https://de.wikipedia.org/> .}
GROUP BY ?id ?geo ?link ?idLabel ?marker_color ?rgb
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?_anon_42b5416610844a34809f33a099ae9de1115667"):::projected
v12("?description")
v9("?end")
v3("?geo"):::projected
v1("?id"):::projected
v7("?idBild")
v4("?idLabel"):::projected
v5("?img")
v10("?link")
v4("?list")
v14("?marker_size")
v13("?marker_symbol")
v10("?rgb"):::projected
v8("?statement")
a1((" "))
c18([https://de.wikipedia.org/]):::iri
c10(["p:novalue/P18"]):::iri
c4(["bd:serviceParam"]):::iri
c6(["de,en"]):::literal
c14(["wd:Q1188447"]):::iri
v1 --"p:direct/P2817"--> v4
v1 --"p:direct/P625"--> v3
bind0[/VALUES ?list/]
bind0-->v4
bind00(["wd:Q1859286"])
bind00 --> bind0
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
v1 --"rdfs:label"--> v4
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P18".-> v5
bind1[/"'00FF00'"/]
bind1 --as--o v10
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
a1 -."a".-> c10
v1 --"p:P18"--> a1
bind2[/"'000000'"/]
bind2 --as--o v10
end
bind3[/"if(bound(?img),concat('\n','#91;#91;File:',substring(str(?img),'52^^xsd:integer','400^^xsd:integer'),'|250px#93;#93;'),'')"/]
v5 --o bind3
bind3 --as--o v7
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P1435".-> v8
v8 --"p:statement/P1435"--> c14
v8 --"p:qualifier/P582"--> v9
end
bind4[/"if(not bound(?rgb),'FF0000',?rgb)"/]
v10 --o bind4
bind4 --as--o v10
v10 --"schema:about"--> v4
v10 --"schema:isPartOf"--> c18
bind6[/"sample(?idBild)"/]
v7 --o bind6
bind6 --as--o v11
bind7[/"concat('#91;#91;:de:','','#',substring(str(?id),'32^^xsd:integer','13^^xsd:integer'),'|',?idLabel,'#93;#93;','\n','#91;#91;File:Wikidata-logo S.svg|16px|link=d:',substring(str(?id),'32^^xsd:integer','13^^xsd:integer'),'#93;#93;',)"/]
v1 --o bind7
v4 --o bind7
null --o bind7
bind7 --as--o v12
bind8[/"'building'"/]
bind8 --as--o v13
bind9[/"'small'"/]
bind9 --as--o v14