query-0bde0f0d87a36425e2ab64706f97a4fc
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide": ["?coordinates", "?layer"]}
SELECT ?item ?itemLabel (SAMPLE(?coordinates_) AS ?coordinates) (?countryLabel AS ?layer) WHERE {
?item wdt:P31/wdt:P279* wd:Q8072;
wdt:P625 ?coordinates_;
wdt:P17 ?country.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?item rdfs:label ?itemLabel.
?country rdfs:label ?countryLabel.
}
}
GROUP BY ?item ?itemLabel ?countryLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coordinates")
v2("?coordinates_"):::projected
v3("?country")
v5("?countryLabel"):::projected
v1("?item"):::projected
v4("?itemLabel"):::projected
v7("?layer")
a1((" "))
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q8072"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P625"--> v2
v1 --"wdt:P17"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v1 --"rdfs:label"--> v4
v3 --"rdfs:label"--> v5
end
bind1[/"sample(?coordinates_)"/]
v2 --o bind1
bind1 --as--o v6
bind2[/"?countryLabel"/]
v5 --o bind2
bind2 --as--o v7