query-a9099ea2c8b9b044bd693e4a4514b661
11:48, 21 April 2018 (UTC)) talk (InfovariusCan it be because of ranks (normal instead of preferred)? --:(Q34266)Russian Empire : thanks! Finally it's working even for Tagishsimon@ 13:22, 21 April 2018 (UTC)) talk (Tagishsimon "Compare this with the normal triples, which will select only the value(s) with the highest rank. In this case only the Preferred Rank value Germany (Q183)." That section gives advice about how to get more values. --WIKIDATA_Qualifiers,_References_and_Ranks#Ranks: It is the rank. See Infovarius@ Города по населению у любой исторической страны
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?cityLabel ?population WHERE {
?city (wdt:P31/wdt:P279*) wd:Q515.
?city p:P17 ?statement.
?statement ps:P17 wd:Q34266.
?statement wikibase:rank ?rank.
?city wdt:P1082 ?population.
SERVICE wikibase:label { bd:serviceParam wikibase:language "ru". }
}
GROUP BY ?population ?cityLabel
ORDER BY DESC(?population)
LIMIT 20
Query found at
- https://www.wikidata.org/wiki/User:Infovarius/Queries
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/04
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?city")
v1("?population"):::projected
v4("?rank")
v3("?statement")
a1((" "))
c6(["wd:Q34266"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["ru"]):::literal
c3(["wd:Q515"]):::iri
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v2 --"p:P17"--> v3
v3 --"p:statement/P17"--> c6
v3 --"wikibase:rank"--> v4
v2 --"p:direct/P1082"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end