query-57b88686c385ff9f9ad0c54b557c0d31
Number of objects inside any class of cities SELECT (COUNT(?item) AS ?count) WHERE { ?item wdt:P131 ?city. ?city wdt:P31/wdt:P279 wd:Q515. }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#Number of objects inside any class of cities
SELECT (COUNT(?item) AS ?count) WHERE {
?item wdt:P131* ?city.
?city wdt:P31/wdt:P279* wd:Q515.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?city")
v3("?count")
v1("?item"):::projected
a1((" "))
c4(["wd:Q515"]):::iri
v1 --"wdt:P131"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
bind1[/"count(?item)"/]
v1 --o bind1
bind1 --as--o v3