query-a0fa2d02a91b3e502f815487f9bc5f8a
title:Screen Nation award winners with years and work SELECT ?winner ?winnerLabel ?awardLabel ?workLabel (YEAR(?time) AS ?year) WHERE { ?award wdt:P31/wdt:P279/wdt:P279 wd:Q7439004. # Screen Nation awards ?winner p:P166 ?s. ?s ps:P166 ?award. OPTIONAL {?s pq:P585 ?time} OPTIONAL {?s pq:P1686 ?work} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?year ?awardLabel
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:Screen Nation award winners with years and work
SELECT ?winner ?winnerLabel ?awardLabel ?workLabel (YEAR(?time) AS ?year) WHERE {
?award wdt:P31/wdt:P279/wdt:P279 wd:Q7439004. # Screen Nation awards
?winner p:P166 ?s. ?s ps:P166 ?award.
OPTIONAL {?s pq:P585 ?time}
OPTIONAL {?s pq:P1686 ?work}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?year ?awardLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?award")
v2("?awardLabel"):::projected
v5("?s")
v6("?time"):::projected
v4("?winner"):::projected
v7("?work")
v8("?year")
a1((" "))
a2((" "))
c9(["bd:serviceParam"]):::iri
c3(["wd:Q7439004"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v3 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> a2
a2 --"p:direct/P279"--> c3
v4 --"p:P166"--> v5
v5 --"p:statement/P166"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P585".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P1686".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind0[/"year-from-dateTime(?time)"/]
v6 --o bind0
bind0 --as--o v8