query-f7cabdf25c1e1dbb513c85f7f80222de
title:Winners of New Media Writing Prize, organised by work SELECT DISTINCT (YEAR(?date) AS ?year) ?awardLabel ?work ?workLabel (GROUP_CONCAT(?winnerLabel; separator=", ") AS ?winner_list) WHERE { ?winner p:P166 ?statement0. # Get "award received" statement ?statement0 ps:P166 ?award. # restrict the award wd:Q108459688 wdt:P527? ?award. # award either is New Media Writing Prize or a part of it OPTIONAL { ?statement0 pq:P585 ?date } # show point in time (if we have it) ?statement0 pq:P1686 ?work # identify work SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". ?award rdfs:label ?awardLabel . ?winner rdfs:label ?winnerLabel . ?work rdfs:label ?workLabel} } GROUP BY ?date ?awardLabel ?work ?workLabel ORDER BY ?year ?awardLabel #consistent order of year and awards within a year
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 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#>
#title:Winners of New Media Writing Prize, organised by work
SELECT DISTINCT (YEAR(?date) AS ?year) ?awardLabel ?work ?workLabel (GROUP_CONCAT(?winnerLabel; separator=", ") AS ?winner_list) WHERE {
?winner p:P166 ?statement0. # Get "award received" statement
?statement0 ps:P166 ?award. # restrict the award
wd:Q108459688 wdt:P527? ?award. # award either is New Media Writing Prize or a part of it
OPTIONAL { ?statement0 pq:P585 ?date } # show point in time (if we have it)
?statement0 pq:P1686 ?work # identify work
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]".
?award rdfs:label ?awardLabel . ?winner rdfs:label ?winnerLabel . ?work rdfs:label ?workLabel}
} GROUP BY ?date ?awardLabel ?work ?workLabel
ORDER BY ?year ?awardLabel #consistent order of year and awards within a year