query-7c61b3e774b9216aa919302b58a5541a

rq turtle/ttl

v2

Use at

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 in Emilia-Romagna presenti su Wikidata e aderenti al NILDE
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?comuneLabel ?coord WHERE {
  {?item wdt:P31/wdt:P279* wd:Q7075} UNION {?item wdt:P31 wd:Q856584 .}
   ?item (wdt:P131)* wd:Q1263 .
   ?item wdt:P463 wd:Q21272726 .
   ?item wdt:P131 ?comune .
   ?comune wdt:P625 ?comunecoord .
  OPTIONAL { ?item wdt:P625 ?itemcoord . }
  BIND(IF(BOUND(?itemcoord),?itemcoord,?comunecoord) AS ?coord)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en, it, fr, es, de". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?comune") v3("?comunecoord") v5("?coord"):::projected v1("?item"):::projected v4("?itemcoord") a1((" ")) c8(["wd:Q21272726"]):::iri c4(["wd:Q856584"]):::iri c3(["wd:Q7075"]):::iri c11(["bd:serviceParam"]):::iri c6(["wd:Q1263"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en, it, fr, es, de"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 end union0r <== or ==> union0l end v1 --"wdt:P131"--> c6 v1 --"wdt:P463"--> c8 v1 --"wdt:P131"--> v2 v2 --"wdt:P625"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v4 end bind0[/"if(bound(?itemcoord),?itemcoord,?comunecoord)"/] v4 --o bind0 v3 --o bind0 bind0 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end