query-ffdab878dc1230bf3550791a4d5822fe
title:Booker Prize winners and nominees (books) lacking an English Wikipedia article SELECT DISTINCT ?item ?itemLabel ?awardLabel ?rel (YEAR(?time) as ?year) WHERE { hint:Query hint:optimizer "None" . VALUES ?award{wd:Q160082 wd:Q2052291} { ?item p:P166 ?s. ?s ps:P166 ?award. ?s pq:P585 ?time. BIND("won" AS ?rel) }
UNION{ ?item wdt:P1411 wd:Q2052291. BIND("nominated" AS ?rel) }
UNION{?item p:P1411 ?s. ?s ps:P1411 ?award. ?s pq:P1552 wd:Q115010579. ?s pq:P585 ?time. BIND("shortlist" AS ?rel) } UNION{?item p:P1411 ?s. ?s ps:P1411 ?award. ?s pq:P1552 wd:Q115010563. ?s pq:P585 ?time. BIND("longlist" AS ?rel) } MINUS{?item wdt:P31 wd:Q5} OPTIONAL { ?item wdt:P629 ?work . ?work_enwp schema:about ?work ; schema:isPartOf https://en.wikipedia.org/ } OPTIONAL { ?item_enwp schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ } FILTER (!BOUND(?item_enwp) && !BOUND(?work_enwp) ) 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 schema: <http://schema.org/>
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#>
#title:Booker Prize winners and nominees (books) lacking an English Wikipedia article
SELECT DISTINCT ?item ?itemLabel ?awardLabel ?rel (YEAR(?time) as ?year) WHERE {
VALUES ?award{wd:Q160082 wd:Q2052291}
{ ?item p:P166 ?s. ?s ps:P166 ?award. ?s pq:P585 ?time. BIND("won" AS ?rel) }
#UNION{ ?item wdt:P1411 wd:Q2052291. BIND("nominated" AS ?rel) }
UNION{?item p:P1411 ?s. ?s ps:P1411 ?award. ?s pq:P1552 wd:Q115010579. ?s pq:P585 ?time. BIND("shortlist" AS ?rel) }
UNION{?item p:P1411 ?s. ?s ps:P1411 ?award. ?s pq:P1552 wd:Q115010563. ?s pq:P585 ?time. BIND("longlist" AS ?rel) }
MINUS{?item wdt:P31 wd:Q5}
OPTIONAL { ?item wdt:P629 ?work . ?work_enwp schema:about ?work ; schema:isPartOf <https://en.wikipedia.org/> }
OPTIONAL { ?item_enwp schema:about ?item ; schema:isPartOf <https://en.wikipedia.org/> }
FILTER (!BOUND(?item_enwp) && !BOUND(?work_enwp) )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?itemLabel