query-ffafc2c3d2bffaac2985f7405a4f39dc

rq turtle/ttl

Herzi Pinki

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#>
#defaultView:Map
SELECT ?item ?itemLabel ?coord (COUNT(?item) AS ?countries) (IF(?countries = 1, SAMPLE(?country), ?countries) AS ?layer) {
  VALUES ?country { wd:Q38 wd:Q40 wd:Q39 wd:Q183 wd:Q215}
  ?item wdt:P31 wd:Q8502 .
  ?item wdt:P17 ?country .
  ?item wdt:P625 ?coord . 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?coord

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?_anon_42b5416610844a34809f33a099ae9de19717"):::projected v3("?coord"):::projected v5("?countries"):::projected v1("?country") v2("?item"):::projected v6("?layer") c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q8502"]):::iri bind0[/VALUES ?country/] bind0-->v1 bind00(["wd:Q38"]) bind00 --> bind0 bind01(["wd:Q40"]) bind01 --> bind0 bind02(["wd:Q39"]) bind02 --> bind0 bind03(["wd:Q183"]) bind03 --> bind0 bind04(["wd:Q215"]) bind04 --> bind0 v2 --"wdt:P31"--> c2 v2 --"wdt:P17"--> v1 v2 --"wdt:P625"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind3[/"sample(?country)"/] v1 --o bind3 bind3 --as--o v4 bind4[/"count(?item)"/] v2 --o bind4 bind4 --as--o v5 bind5[/"if(?countries = '1^^xsd:integer',,?countries)"/] v5 --o bind5 null --o bind5 bind5 --as--o v6