query-55f8c383083af879a10ae5567a83d4b9

rq turtle/ttl

IIIF manifests for self-portrait paintings

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:ImageGrid{"hide": ["?image", "?placeholder"]}
SELECT DISTINCT ?qLabel ?image ?placeholder (GROUP_CONCAT(DISTINCT ?collectionLabel; separator="; ") AS ?where)
(URI(CONCAT('https://tools.wmflabs.org/mirador/?manifest=', STR(?iiif))) AS ?iiiflink)
WHERE { 
  ?q wdt:P31 wd:Q3305213; # painting
     wdt:P136 wd:Q192110; # genre: self-portrait
     wdt:P6108 ?iiif.  # IIIF manifest link on Wikidata
OPTIONAL{ ?q wdt:P18 ?img } # Image on Commons

?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
      MINUS {?s ps:P195 wd:Q1322278 }
 # ?collection wdt:P17 wd:Q145 # collection in the UK
BIND (IF(BOUND(?img), ?img, <http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg>) AS ?image)
BIND (IF(BOUND(?img), 1, 0) AS ?placeholder)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?q rdfs:label ?qLabel. ?collection rdfs:label ?collectionLabel
    }
} GROUP BY ?q ?qLabel ?iiif ?image ?placeholder
ORDER BY DESC(?placeholder) ?where

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?collection") v10("?collectionLabel"):::projected v4("?iiif"):::projected v11("?iiiflink") v8("?image"):::projected v5("?img") v9("?placeholder"):::projected v3("?q") v9("?qLabel"):::projected v6("?s") v11("?where") a1((" ")) c10(["wd:Q1322278"]):::iri c2(["wd:Q3305213"]):::iri c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q192110"]):::iri v3 --"p:direct/P31"--> c2 v3 --"p:direct/P136"--> c4 v3 --"p:direct/P6108"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P18".-> v5 end v3 --"p:P195"--> v6 v6 --"p:statement/P195"--> v7 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v6 --"p:qualifier/P582"--> a1 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v6 --"p:statement/P195"--> c10 end bind2[/"if(bound(?img),?img,http://commons.wikimedia.org/wiki/Special:FilePath/No%20image%20available.svg)"/] v5 --o bind2 bind2 --as--o v8 bind3[/"if(bound(?img),'1^^xsd:integer','0^^xsd:integer')"/] v5 --o bind3 bind3 --as--o v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 v3 --"rdfs:label"--> v9 v7 --"rdfs:label"--> v10 end bind5[/"?collectionLabel"/] v10 --o bind5 bind5 --as--o v11 bind6[/"concat('https://tools.wmflabs.org/mirador/?manifest=',str(?iiif))"/] v4 --o bind6 bind6 --as--o v11