query-41942bb545dcd11236d913b02dc53c40
Countries
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 bd: <http://www.bigdata.com/rdf#>
SELECT
?exhibitions
(CONCAT("#country/", SUBSTR(STR(?country), 32), "/exhibition") AS ?exhibitionsUrl)
?country ?countryLabel
(CONCAT("#country/", SUBSTR(STR(?country), 32)) AS ?countryUrl)
?example_exhibition ?example_exhibitionLabel
(CONCAT("#exhibition/", SUBSTR(STR(?example_exhibition), 32)) AS ?example_exhibitionUrl)
WHERE {
{
SELECT
(COUNT(?exhibition) AS ?exhibitions)
?country
(SAMPLE(?exhibition) AS ?example_exhibition)
WHERE {
?exhibition wdt:P31 / wdt:P279* wd:Q464980 ;
wdt:P17 ?country .
}
GROUP BY ?country
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,cz,da,de,es,fi,fr,nb,nn,sv,zh". }
}
ORDER BY DESC(?exhibitions)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?country"):::projected
v6("?countryUrl")
v4("?example_exhibition"):::projected
v7("?example_exhibitionUrl")
v2("?exhibition")
v4("?exhibitions"):::projected
v5("?exhibitionsUrl")
a1((" "))
c8(["#91;AUTO_LANGUAGE#93;,mul,en,cz,da,de,es,fi,fr,nb,nn,sv,zh"]):::literal
c6(["bd:serviceParam"]):::iri
c3(["wd:Q464980"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P17"--> v3
bind2[/"count(?exhibition)"/]
v2 --o bind2
bind2 --as--o v4
bind3[/"sample(?exhibition)"/]
v2 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind4[/"concat('#country/',substring(str(?country),'32^^xsd:integer'),'/exhibition')"/]
v3 --o bind4
bind4 --as--o v5
bind5[/"concat('#country/',substring(str(?country),'32^^xsd:integer'))"/]
v3 --o bind5
bind5 --as--o v6
bind6[/"concat('#exhibition/',substring(str(?example_exhibition),'32^^xsd:integer'))"/]
v4 --o bind6
bind6 --as--o v7