query: SELECT ?item ?itemLabel ?country ?countryLabel ?class ?classLabel
  WHERE {
    ?item wdt:P361 wd:Q16999180.
    ?item wdt:P31/wdt:P279* wd:Q40231.
    ?country wdt:P463 wd:Q458.
    ?item wdt:P17 ?country.
    ?item wdt:P31 ?class.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }