query-f6897724f24a636572c0801afc9f4cf0
Help with COUNT wanted ]reply[15:16, 4 August 2018 (UTC)) talk (Dipsacus fullonumI am trying to make a list of Italian comunes with a count of how many persons is born in each comune. I tried to make the SQARQL below, but it doesn't work. What is wrong, and what should it be? Thanks for your help, --
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#>
SELECT ?comune ?comuneLabel (COUNT(?person) as ?count) WHERE {
?comune wdt:P31 wd:Q747074.
?person wdt:P19 ?comune.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?comune ?comuneLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?comune"):::projected
v3("?count")
v2("?person"):::projected
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q747074"]):::iri
v1 --"wdt:P31"--> c2
v2 --"wdt:P19"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind1[/"count(?person)"/]
v2 --o bind1
bind1 --as--o v3