query-e0588f9a1c0b8c79ef44db6cdf42071c

rq turtle/ttl

Things depicted in art works of the Khalili Collections (sample images for each item)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:ImageGrid{"hide" :["?img"]}
#title: Things depicted in art works of the Khalili Collections
SELECT (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", STRAFTER(STR(?depicted),"/entity/") )) as ?q) (?nameplusdesc AS ?qLabel) (SAMPLE(?image) AS ?img) WHERE {
  ?work wdt:P195/wdt:P361 wd:Q63160499; wdt:P18 ?image ; wdt:P973 ?link; wdt:P180 ?depicted.  
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                            ?depicted rdfs:label ?name . ?depicted schema:description ?desc }
  BIND(IF(BOUND(?desc), CONCAT(?name, ", ", ?desc), ?name) AS ?nameplusdesc)
} GROUP BY ?depicted ?nameplusdesc
ORDER BY UCASE(?qLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?depicted"):::projected v7("?desc") v3("?image"):::projected v10("?img") v4("?link") v6("?name") v8("?nameplusdesc"):::projected v9("?q") v10("?qLabel") v2("?work") a1((" ")) c8(["bd:serviceParam"]):::iri c3(["wd:Q63160499"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"wdt:P195"--> a1 a1 --"wdt:P361"--> c3 v2 --"wdt:P18"--> v3 v2 --"wdt:P973"--> v4 v2 --"wdt:P180"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 v5 --"rdfs:label"--> v6 v5 --"schema:description"--> v7 end bind0[/"if(bound(?desc),concat(?name,', ',?desc),?name)"/] v7 --o bind0 v6 --o bind0 bind0 --as--o v8 bind2[/"concat('https://tools.wmflabs.org/reasonator/?q=',substring-after(str(?depicted),'/entity/'))"/] v5 --o bind2 bind2 --as--o v9 bind3[/"?nameplusdesc"/] v8 --o bind3 bind3 --as--o v10 bind4[/"sample(?image)"/] v3 --o bind4 bind4 --as--o v10