query-252c444a61d3597d8f7916619340c401

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?stat ?lat ?long WHERE {
   {
SELECT ?item ?stat (COUNT(?lat)+COUNT(?long) AS ?count) WHERE {
VALUES ?countries { wd:Q183 }
?item wdt:P17 ?countries;
      p:P625 ?stat. ?stat psv:P625  [wikibase:geoLatitude ?lat ; wikibase:geoLongitude ?long ]  . 
}
GROUP BY ?item ?stat
HAVING(?count>2)
}  ?stat psv:P625 [ wikibase:geoLatitude ?lat; wikibase:geoLongitude ?long ] .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?item

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?_anon_d00291b7e9a143df8ec0be8c8ebd714c52219") v8("?_anon_d00291b7e9a143df8ec0be8c8ebd714c52220") v9("?count") v3("?countries") v1("?item"):::projected v5("?lat"):::projected v6("?long"):::projected v4("?stat"):::projected a1((" ")) a2((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?count > '2^^xsd:integer'"]] f0 --> v9 bind1[/VALUES ?countries/] bind1-->v3 bind10(["wd:Q183"]) bind10 --> bind1 v1 --"p:direct/P17"--> v3 v1 --"p:P625"--> v4 a1 --"wikibase:geoLatitude"--> v5 a1 --"wikibase:geoLongitude"--> v6 v4 --"p:statement/value/P625"--> a1 bind4[/"count(?lat)"/] v5 --o bind4 bind4 --as--o v7 bind5[/"count(?long)"/] v6 --o bind5 bind5 --as--o v8 bind6[/" + "/] null --o bind6 null --o bind6 bind6 --as--o v9 a2 --"wikibase:geoLatitude"--> v5 a2 --"wikibase:geoLongitude"--> v6 v4 --"p:statement/value/P625"--> a2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end