query-dd1bd67e14f71749c4ec6cea17c7e0ed
Image grid of the most notable museums
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#>
#defaultView:ImageGrid
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?image) AS ?image) ?sitelinks (SAMPLE(?web) AS ?web) WHERE {
?museum wdt:P31/wdt:P279* wd:Q33506 . # museums or subtypes
?museum wikibase:sitelinks ?sitelinks
OPTIONAL {?museum wdt:P18 ?img}
OPTIONAL {?museum wdt:P856 ?web}
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?museum ?museumLabel ?sitelinks
ORDER BY DESC(?sitelinks)
LIMIT 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?image"):::projected
v3("?img")
v2("?museum"):::projected
v1("?sitelinks"):::projected
v6("?web"):::projected
a1((" "))
c3(["wd:Q33506"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wikibase:sitelinks"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P856".-> v6
end
bind0[/"if(bound(?img),?img,http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg)"/]
v3 --o bind0
bind0 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind3[/"sample(?image)"/]
v6 --o bind3
bind3 --as--o v6
bind4[/"sample(?web)"/]
v6 --o bind4
bind4 --as--o v6