query-608cb0fc7d38b9e48e4258334b19de64

rq turtle/ttl

. (P3749)Google Maps Customer ID un mai perché non hanno (Q747074)commune of Italy e (Q1134686)frazione , quelli che hanno solo una delle due e quelli che non le hanno entrambe (con possibilità di visualizzare solo gli uni o gli altri); ho escluso (P373)Commons category sia (P3749)Google Maps Customer ID ; mostra in colori diversi gli elementi che hanno sia (P131)located in the administrative territorial entity in base alla (Q16245)Province of Pistoia Mappa di tutto ciò che è in

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 ?item ?itemLabel ?itemDescription ?coord ?gmp ?gkg ?ind ?com ?wlm ?layer
WHERE {
  ?item (wdt:P131)* wd:Q16245 . 
  MINUS { { ?item wdt:P31 wd:Q1134686 . } UNION { ?item wdt:P31 wd:Q747074 . } }
  ?item wdt:P625 ?coord . 
  OPTIONAL {?item wdt:P3749 ?gmp}
  OPTIONAL {?item wdt:P2671 ?gkg}
  OPTIONAL {?item wdt:P969 ?ind}
  OPTIONAL {?item wdt:P373 ?com}
  OPTIONAL {?item wdt:P2186 ?wlm}
  BIND(IF(BOUND(?gmp) && BOUND(?com),"gmp & com exist",IF(BOUND(?com),"com exists",IF(BOUND(?gmp),"gmp 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; v6("?com"):::projected v2("?coord"):::projected v4("?gkg"):::projected v3("?gmp"):::projected v5("?ind"):::projected v1("?item"):::projected v8("?layer"):::projected v7("?wlm"):::projected c15(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal c4(["wd:Q1134686"]):::iri c13(["bd:serviceParam"]):::iri c2(["wd:Q16245"]):::iri c5(["wd:Q747074"]):::iri v1 --"wdt:P131"--> c2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c4 end union0r <== or ==> union0l end end v1 --"wdt:P625"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P3749".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P2671".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P969".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P373".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P2186".-> v7 end bind1[/"if(bound(?gmp)bound(?com),'gmp & com exist',if(bound(?com),'com exists',if(bound(?gmp),'gmp exists','none')))"/] v3 --o bind1 v6 --o bind1 bind1 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end