query-96a423ee22279a6b1a17b1acea111864

rq turtle/ttl

Forget it, I already found how to filter by indicating the QID directly being so: 06:22, 29 June 2019 (UTC) 190.231.103.187 appears twice, why is this? --(Q811)Nicaragua does not appear and (Q29)Spain code but I don't complain either. The strangest thing is that w:ISO 639The ideal would be to be able to filter using the ).contribs • talk (Bouzinac comment was added byunsignedThe preceding – Porto Rico ain't a country yet… 07:19, 29 June 2019 (UTC) 190.231.103.187, how do I add it to the query along with the rest of the countries? If possible I would also like to know how to sum the population without using a subquery. --(Q783733)unincorporated territory of the United States is missing that seems to be part of (Q1183)Puerto Rico Thank you, p:P31 [ps:P31 wd:Q6256] was what I needed (Nicaragua is already solved and there are even some countries that did not appear before). Only 06:41, 29 June 2019 (UTC)) talk (Tagishsimon. (Or look also for Sovereign States with a UNION.) Ranks associated with county P31s are probably a bit of a mess. Nicaragua had two population statements set as Preferred, and so you got two rows, one for each. I've demoted one to Normal rank, so now you'll just get one. hth --(P576)dissolved, abolished or demolished date . Use ?item p:P31 [ps:P31 wd:Q6256] to get all countries, but then you'll probably want some other constraint to filter out defunct countries, such as membership of the UN or lack of technical explainer set as 'Preferred rank' for P31, so searching for wdt:P31 wd:Q6256 fails to find it. (Q3624078)sovereign state It's the normal issue with wdt: fetching only the truthy value. Spain has

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 (ROUND(?pop/1000) as ?pop_in_1000s) ?cc ?country ?countryLabel
WHERE
{
  ?country wdt:P297 ?cc ; wdt:P37 wd:Q1321 .
  OPTIONAL { ?country wdt:P1082 ?pop }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],es,en". }
}
ORDER BY DESC(?pop_in_1000s)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?cc"):::projected v2("?country"):::projected v4("?pop"):::projected v5("?pop_in_1000s") c6(["bd:serviceParam"]):::iri c3(["wd:Q1321"]):::iri c8(["#91;AUTO_LANGUAGE#93;,es,en"]):::literal v2 --"wdt:P297"--> v3 v2 --"wdt:P37"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P1082".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind0[/"numeric-round(?pop / '1000^^xsd:integer')"/] v4 --o bind0 bind0 --as--o v5