query-9f87230dfa4cc9f3ea6cb105c8253dc7
title:Nominees for New Media Writing Prize SELECT DISTINCT (YEAR(?date) AS ?year) ?awardLabel ?winner ?winnerLabel ?workLabel WHERE { ?winner p:P1411 ?statement0. # Get "nominated for" statement ?statement0 ps:P1411 ?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) OPTIONAL { ?statement0 pq:P1686 ?work } # show "for work" (if we have it) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". } } 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 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:Nominees for New Media Writing Prize
SELECT DISTINCT (YEAR(?date) AS ?year) ?awardLabel ?winner ?winnerLabel ?workLabel WHERE {
?winner p:P1411 ?statement0. # Get "nominated for" statement
?statement0 ps:P1411 ?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)
OPTIONAL { ?statement0 pq:P1686 ?work } # show "for work" (if we have it)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
} ORDER BY ?year ?awardLabel #consistent order of year and awards within a year
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?award")
v2("?awardLabel"):::projected
v6("?date"):::projected
v4("?statement0")
v3("?winner"):::projected
v7("?work")
v8("?year")
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;"]):::literal
c3(["wd:Q108459688"]):::iri
v3 --"p:P1411"--> v4
v4 --"p:statement/P1411"--> v5
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
c3 --"p:direct/P527"--> v5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P585".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P1686".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind0[/"year-from-dateTime(?date)"/]
v6 --o bind0
bind0 --as--o v8