query-d03257e440c0cb0c491abc25620ef22f
title:Booker Prize winners and nominees lacking images SELECT DISTINCT ?item ?itemLabel (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:", ?commons)) AS ?link) WHERE { VALUES ?award{wd:Q160082 wd:Q2052291} ?item wdt:P166|wdt:P1411 ?award. ?item wdt:P31 wd:Q5. MINUS {?item wdt:P18 []} OPTIONAL {?item wdt:P373 ?commons} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } } ORDER BY ?itemLabel
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#>
#title:Booker Prize winners and nominees lacking images
SELECT DISTINCT ?item ?itemLabel (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:", ?commons)) AS ?link)
WHERE {
VALUES ?award{wd:Q160082 wd:Q2052291}
?item wdt:P166|wdt:P1411 ?award. ?item wdt:P31 wd:Q5.
MINUS {?item wdt:P18 []}
OPTIONAL {?item wdt:P373 ?commons}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?award")
v4("?commons"):::projected
v3("?item"):::projected
v1("?itemLabel"):::projected
v5("?link")
a1((" "))
c8(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?award/]
bind0-->v2
bind00(["wd:Q160082"])
bind00 --> bind0
bind01(["wd:Q2052291"])
bind01 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P1411"--> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P166"--> v2
end
union0r <== or ==> union0l
end
v3 --"wdt:P31"--> c4
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P18"--> a1
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P373".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind2[/"concat('https://commons.wikimedia.org/wiki/Category:',?commons)"/]
v4 --o bind2
bind2 --as--o v5