query-283641258bbcf97c30789e65a8a4c4fd
districts of India SELECT ?item ?itemLabel ?division ?divisionLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } # for generating label ?item wdt:P31 wd:Q1149652 . OPTIONAL { ?item wdt:P131 ?division. } } ORDER BY ?divisionLabel
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#>
#districts of India
SELECT ?item ?itemLabel ?division ?divisionLabel
WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } # for generating label
?item wdt:P31 wd:Q1149652 .
OPTIONAL { ?item wdt:P131 ?division. }
}
ORDER BY ?divisionLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?division"):::projected
v1("?divisionLabel"):::projected
v2("?item"):::projected
c2(["bd:serviceParam"]):::iri
c6(["wd:Q1149652"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v2 --"wdt:P31"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P131".-> v3
end