query-6bce3d79eb6317f60aaace7391a84b40

rq turtle/ttl

(Trink-)Brunnen im Kanton Bern) Queries#Fontanelle (User:Alexmar983Code

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#>
#defaultView:Map
SELECT ?fountain ?fountainLabel ?inst ?instLabel ?coord ?img ?com ?layer
WHERE {
  ?fountain wdt:P31 wd:Q1630622 . # Q1630622 = Trinkbrunnen
  ?fountain wdt:P131 wd:Q11911 . # Q11911 = Canton of Bern
  #?fountain (wdt:P131)* wd:Q1273 . 
  ?fountain wdt:P625 ?coord . 
  OPTIONAL {?fountain wdt:P18 ?img}
  OPTIONAL {?fountain wdt:P373 ?com}
  BIND(IF(BOUND(?img) && BOUND(?com),"img & com exist",IF(BOUND(?com),"com exists",IF(BOUND(?img),"img exists","none"))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?com"):::projected v2("?coord"):::projected v1("?fountain"):::projected v3("?img"):::projected v5("?layer"):::projected c11(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal c9(["bd:serviceParam"]):::iri c2(["wd:Q1630622"]):::iri c4(["wd:Q11911"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P131"--> c4 v1 --"wdt:P625"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P373".-> v4 end bind0[/"if(bound(?img)bound(?com),'img & com exist',if(bound(?com),'com exists',if(bound(?img),'img exists','none')))"/] v3 --o bind0 v4 --o bind0 bind0 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end