query-565a8af5bf9fd356d075766d2c728097
title:Identifiers for Booker-nominated and -winning authors SELECT DISTINCT ?item ?itemLabel ?idLabel ?value WITH { SELECT DISTINCT ?item WHERE { VALUES ?award{wd:Q160082 wd:Q2052291} ?item wdt:P166|wdt:P1411 ?award. ?item wdt:P31 wd:Q5. } } AS %subquery WHERE { INCLUDE %subquery . ?id wikibase:propertyType wikibase:ExternalId; wikibase:claim ?p; wikibase:statementProperty ?ps; wdt:P31/wdt:P279* wd:Q19595382. ?item ?p [ ?ps ?value ] . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?itemLabel ?idLabel
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:Identifiers for Booker-nominated and -winning authors
SELECT DISTINCT ?item ?itemLabel ?idLabel ?value WHERE {
{
SELECT DISTINCT ?item WHERE {
VALUES ?award{wd:Q160082 wd:Q2052291}
?item wdt:P166|wdt:P1411 ?award.
?item wdt:P31 wd:Q5.
}
}.
?id wikibase:propertyType wikibase:ExternalId; wikibase:claim ?p; wikibase:statementProperty ?ps; wdt:P31/wdt:P279* wd:Q19595382.
?item ?p [ ?ps ?value ] .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?itemLabel ?idLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?award")
v5("?id")
v2("?idLabel"):::projected
v4("?item"):::projected
v1("?itemLabel"):::projected
v6("?p")
v7("?ps")
v8("?value"):::projected
a1((" "))
a2((" "))
c10(["wd:Q19595382"]):::iri
c6(["wikibase:ExternalId"]):::iri
c12(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?award/]
bind0-->v3
bind00(["wd:Q160082"])
bind00 --> bind0
bind01(["wd:Q2052291"])
bind01 --> bind0
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P1411"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P166"--> v3
end
union0r <== or ==> union0l
end
v4 --"wdt:P31"--> c4
v5 --"wikibase:propertyType"--> c6
v5 --"wikibase:claim"--> v6
v5 --"wikibase:statementProperty"--> v7
v5 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c10
a2 -->v7--> v8
v4 -->v6--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end