query-dc08fe17191ac0ce4cf9e6b165fd2bea
v3 (solo biblioteche e non sottoinsiemi es biblioteche specializzate)
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 bd: <http://www.bigdata.com/rdf#>
#Biblioteche dell'Emilia-Romagna aventi le coordinate geografiche su Wikidata
#defaultView:Map
SELECT DISTINCT ?i ?iLabel ?iDescription ?coord ?inst ?instLabel
WHERE {
VALUES ?instance { wd:Q7075 }
?i wdt:P31 ?instance .
?i (wdt:P131)* wd:Q1263 .
?i wdt:P131 ?inst .
?inst wdt:P625 ?instcoord .
OPTIONAL { ?i wdt:P625 ?icoord . }
BIND(IF(BOUND(?icoord),?icoord,?instcoord) AS ?coord)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,enit,fr,es,de". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coord"):::projected
v2("?i"):::projected
v5("?icoord")
v3("?inst"):::projected
v1("?instance")
v4("?instcoord")
c6(["bd:serviceParam"]):::iri
c3(["wd:Q1263"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,it,enit,fr,es,de"]):::literal
bind0[/VALUES ?instance/]
bind0-->v1
bind00(["wd:Q7075"])
bind00 --> bind0
v2 --"wdt:P31"--> v1
v2 --"wdt:P131"--> c3
v2 --"wdt:P131"--> v3
v3 --"wdt:P625"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v5
end
bind1[/"if(bound(?icoord),?icoord,?instcoord)"/]
v5 --o bind1
v4 --o bind1
bind1 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end