?country wdt:P31 wd:Q6256 .
This (wdt = wikidata truthy) only searches for items that have P31=Q6256 with highest set rank.
This is despite Finland being an instance (P31) of country (Q6256):
Finnland has P31=Q6256 with rank normal, but P31=Q3624078 with preferred rank.
You have to either include Q3624078 too, or replace "wdt" by something that finds also lower ranks:
?country p:P31/ps:P31 wd:Q6256 .
See here about the background of Ranks: https://www.wikidata.org/wiki/Help:Ranking
Cheers, M
Have I got something wrong?
Many thanks, AJP
p.s. this query gets a list of countries the exist on cities but not as entities being an instance of country. Though actually most of them do have "instance of" country.
SELECT ?country ?countryLabel { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]" } { SELECT ?country WHERE { { ?city wdt:P31 wd:Q515 . ?city wdt:P17 ?country . } MINUS { ?country wdt:P31 wd:Q6256 . } } GROUP BY ?country } } ORDER BY ?countryLabel
Wikidata-tech mailing list Wikidata-tech@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-tech