query-0c5ef28c93bb8ead19fe853a61f3cdb0
title:Booker winners and nominees (book) not in English Wikipedia but in other Wikipedias SELECT DISTINCT ?item ?itemLabel ?awardLabel ?rel ?langname ?wp WHERE { hint:Query hint:optimizer "None" . VALUES ?award{wd:Q160082 wd:Q2052291} { ?item wdt:P166 ?award. BIND("won" AS ?rel) } UNION{ ?item wdt:P1411 ?award. BIND("nominated" AS ?rel) } MINUS{?item wdt:P31 wd:Q5} MINUS{?enwp schema:about ?item ; schema:isPartOf https://en.wikipedia.org/} ?wp schema:about ?item; schema:inLanguage ?langcode . OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name BIND(COALESCE(?langlabel, ?langcode) AS ?langname) 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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Booker winners and nominees (book) not in English Wikipedia but in other Wikipedias
SELECT DISTINCT ?item ?itemLabel ?awardLabel ?rel ?langname ?wp WHERE {
VALUES ?award{wd:Q160082 wd:Q2052291}
{ ?item wdt:P166 ?award. BIND("won" AS ?rel) }
UNION{ ?item wdt:P1411 ?award. BIND("nominated" AS ?rel) }
MINUS{?item wdt:P31 wd:Q5}
MINUS{?enwp schema:about ?item ; schema:isPartOf <https://en.wikipedia.org/>}
?wp schema:about ?item; schema:inLanguage ?langcode .
OPTIONAL { ?language wdt:P218 ?langcode; rdfs:label ?langlabel FILTER(lang(?langlabel) = "en") } # Convert short code to full language name
BIND(COALESCE(?langlabel, ?langcode) AS ?langname)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY ?itemLabel