query-e07fcbbefb922eb791e94b64a9cc4372
All different categories of settlements (in India) SELECT ?settlementtype ?settlementtypeLabel (COUNT(DISTINCT ?object) AS ?count) WHERE { ?object wdt:P17 wd:Q668. #India ?object wdt:P31/wdt:P279* wd:Q486972. #Human settlement ?object wdt:P31 ?settlementtype SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } GROUP BY ?settlementtype ?settlementtypeLabel ORDER BY DESC(?count)
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#>
#All different categories of settlements (in India)
SELECT ?settlementtype ?settlementtypeLabel (COUNT(DISTINCT ?object) AS ?count) WHERE {
?object wdt:P17 wd:Q668. #India
?object wdt:P31/wdt:P279* wd:Q486972. #Human settlement
?object wdt:P31 ?settlementtype
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?settlementtype ?settlementtypeLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count")
v2("?object"):::projected
v3("?settlementtype"):::projected
a1((" "))
c5(["wd:Q486972"]):::iri
c7(["bd:serviceParam"]):::iri
c2(["wd:Q668"]):::iri
c9(["en"]):::literal
v2 --"wdt:P17"--> c2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
v2 --"wdt:P31"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind1[/"count(?object)"/]
v2 --o bind1
bind1 --as--o v4