query-b6bcfe23df851e762f35d7790700ffb3
Same but with links to the Khalili Collections web site
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 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 (?link as ?q) (?nameplusdesc AS ?qLabel) ?img WHERE {
{SELECT (SAMPLE(?work) AS ?w) ?depicted {
?work wdt:P195/wdt:P361 wd:Q63160499; wdt:P180 ?depicted.
} GROUP BY ?depicted }
?w wdt:P18 ?img ; wdt:P973 ?link;
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)
} ORDER BY UCASE(?qLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?depicted")
v8("?desc")
v5("?img"):::projected
v6("?link"):::projected
v7("?name")
v9("?nameplusdesc"):::projected
v10("?q")
v11("?qLabel")
v4("?w")
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:P180"--> v3
bind1[/"sample(?work)"/]
v2 --o bind1
bind1 --as--o v4
v4 --"wdt:P18"--> v5
v4 --"wdt:P973"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
v3 --"rdfs:label"--> v7
v3 --"schema:description"--> v8
end
bind2[/"if(bound(?desc),concat(?name,', ',?desc),?name)"/]
v8 --o bind2
v7 --o bind2
bind2 --as--o v9
bind3[/"?link"/]
v6 --o bind3
bind3 --as--o v10
bind4[/"?nameplusdesc"/]
v9 --o bind4
bind4 --as--o v11