query-ff87d07861a0ef0cc99cd78a49397656

rq turtle/ttl

added before 2016-10 SELECT ?item ?itemLabel ?count WHERE { { SELECT ?item (COUNT(DISTINCT ?country) AS ?count) WHERE { ?item wdt:P31/wdt:P279* wd:Q41176 . ?item wdt:P17 ?country . FILTER NOT EXISTS { ?country wdt:P576 ?end } } GROUP BY ?item } FILTER ( ?count > 1 ) SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY DESC(?count) ?itemL

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#>
#added before 2016-10
SELECT ?item ?itemLabel ?count
WHERE
{
  {
    SELECT ?item (COUNT(DISTINCT ?country) AS ?count) WHERE {
      ?item wdt:P31/wdt:P279* wd:Q41176 .
      ?item wdt:P17 ?country .
      FILTER NOT EXISTS { ?country wdt:P576 ?end }
    }
    GROUP BY ?item
  }
  FILTER ( ?count > 1 )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC(?count) ?itemL

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count"):::projected v3("?country") v4("?end") v5("?item"):::projected v2("?itemL") a1((" ")) c8(["bd:serviceParam"]):::iri c5(["wd:Q41176"]):::iri c10(["en"]):::literal f0[["?count > '1^^xsd:integer'"]] f0 --> v6 f1[["not "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P576"--> e0v2 e0v1("?country"):::projected e0v2("?end"):::projected end f1--EXISTS--> f1e0 f1 --> v3 f1 --> c2 f1 --> v4 v3 --"wdt:P576"--> v4 v5 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 v5 --"wdt:P17"--> v3 bind3[/"count(?country)"/] v3 --o bind3 bind3 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end