query-dcc8492ed443a43e21062e6799353d49

rq turtle/ttl

Image gallery including blank images but I don't know how to register a Commons link in SPARQL. Here's my incomplete query: what goes in the blank? commons:File:No image available.svgIn image grids that I create, I'd like to highlight when an image is missing from the relevant item, by showing a placeholder such as

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:ImageGrid
SELECT DISTINCT ?library ?libraryLabel (SAMPLE(?image) AS ?image) ?sitelinks WHERE {
?library wdt:P31/wdt:P279* wd:Q7075 . # libraries or subtypes
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # but not digital libraries
?library wikibase:sitelinks ?sitelinks.
OPTIONAL {?library wdt:P18 ?img}
BIND (IF(BOUND(?img), ?img, _______) AS ?image)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?library ?libraryLabel ?sitelinks
ORDER BY DESC(?sitelinks)
LIMIT 1000

Query found at