query-15b8a8a31425601761a9cb9f97262231

rq turtle/ttl

Districts and Regions of India (with Geonames)

Use at

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 ?place ?placeLabel ?region ?regionLabel ?geonamesID WHERE {
?place wdt:P31 wd:Q1149652;
       wdt:P17 wd:Q668.
OPTIONAL{ ?place wdt:P131 ?region 
            MINUS {?region wdt:P576 [] } # region not abolished
        }
OPTIONAL {?place wdt:P1566 ?geonamesID }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?regionLabel ?placelabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?geonamesID"):::projected v3("?place"):::projected v2("?placelabel") v4("?region"):::projected v1("?regionLabel"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c4(["wd:Q668"]):::iri c2(["wd:Q1149652"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal v3 --"wdt:P31"--> c2 v3 --"wdt:P17"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P131".-> v4 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v4 --"wdt:P576"--> a1 end end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P1566".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end