query-4d2d465679c998184396312709e1c2c1
Display ordered district name of Vienna, Austria SELECT ?item (xsd:integer(?district) AS ?dis) ?itemLabel ?location WHERE { ?item wdt:P31 wd:Q261023. ?item p:P31 ?s. ?item wdt:P625 ?location. ?s pq:P1545 ?district. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?dis
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Display ordered district name of Vienna, Austria
SELECT ?item (xsd:integer(?district) AS ?dis) ?itemLabel ?location
WHERE {
?item wdt:P31 wd:Q261023.
?item p:P31 ?s.
?item wdt:P625 ?location.
?s pq:P1545 ?district.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?dis
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?dis")
v5("?district"):::projected
v2("?item"):::projected
v4("?location"):::projected
v3("?s")
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q261023"]):::iri
v2 --"p:direct/P31"--> c2
v2 --"p:P31"--> v3
v2 --"p:direct/P625"--> v4
v3 --"p:qualifier/P1545"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind0[/"http://www.w3.org/2001/XMLSchema#integer(?district)"/]
v5 --o bind0
bind0 --as--o v6