query-fe35039a25b6319ad604a52c1924f23e
Archivi in Toscana con più di un indirizzo SELECT ?i ?iLabel ?iDescription ?coord ?inst ?instLabel (count(?ind) AS ?num) ?pea WHERE { ?i wdt:P31 wd:Q166118 . ?i (wdt:P131)* wd:Q1273 . ?i wdt:P131 ?inst . #?inst wdt:P625 ?instcoord . ?i wdt:P7764 ?pea . OPTIONAL { ?i wdt:P6375 ?ind . } OPTIONAL { ?i wdt:P625 ?coord . } BIND(IF(BOUND(?coord),'archiv','comune') AS ?layer) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". } } GROUP BY ?i ?iLabel ?iDescription ?coord ?inst ?instLabel ?pea HAVING(?num > 1) ORDER BY(?pea)
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#>
#Archivi in Toscana con più di un indirizzo
SELECT ?i ?iLabel ?iDescription ?coord ?inst ?instLabel (count(?ind) AS ?num) ?pea
WHERE {
?i wdt:P31 wd:Q166118 .
?i (wdt:P131)* wd:Q1273 .
?i wdt:P131 ?inst .
#?inst wdt:P625 ?instcoord .
?i wdt:P7764 ?pea .
OPTIONAL { ?i wdt:P6375 ?ind . }
OPTIONAL { ?i wdt:P625 ?coord . }
BIND(IF(BOUND(?coord),'archiv','comune') AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
GROUP BY ?i ?iLabel ?iDescription ?coord ?inst ?instLabel ?pea
HAVING(?num > 1)
ORDER BY(?pea)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coord"):::projected
v3("?i"):::projected
v5("?ind"):::projected
v4("?inst"):::projected
v7("?layer")
v8("?num")
v1("?pea"):::projected
c12(["#91;AUTO_LANGUAGE#93;,it,en"]):::literal
c3(["wd:Q166118"]):::iri
c10(["bd:serviceParam"]):::iri
c5(["wd:Q1273"]):::iri
f0[["?num > '1^^xsd:integer'"]]
f0 --> v8
v3 --"wdt:P31"--> c3
v3 --"wdt:P131"--> c5
v3 --"wdt:P131"--> v4
v3 --"wdt:P7764"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P6375".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P625".-> v6
end
bind1[/"if(bound(?coord),'archiv','comune')"/]
v6 --o bind1
bind1 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind3[/"count(?ind)"/]
v5 --o bind3
bind3 --as--o v8