query-d8a58ae5f0005ffc6c4bbc4f19258d2c
Timeline of winners
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 prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
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
#defaultView:ImageGrid
SELECT DISTINCT ?item ?itemLabel (SAMPLE(?img) AS ?image) ?time ?refurl
WHERE {
?item p:P166 ?s. ?s ps:P166 wd:Q160082. ?s pq:P585 ?time.
?item wdt:P31 wd:Q5.
OPTIONAL{?item wdt:P18 ?img}
OPTIONAL{?s prov:wasDerivedFrom/pr:P854 ?refurl FILTER(CONTAINS(STR(?refurl),"bookerprizes.com"))}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?item ?itemLabel ?time ?refurl
ORDER BY ?time
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?image")
v5("?img"):::projected
v3("?item"):::projected
v2("?refurl"):::projected
v4("?s")
v1("?time"):::projected
a1((" "))
c12(["bd:serviceParam"]):::iri
c4(["wd:Q160082"]):::iri
c7(["wd:Q5"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v3 --"p:P166"--> v4
v4 --"p:statement/P166"--> c4
v4 --"p:qualifier/P585"--> v1
v3 --"p:direct/P31"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P18".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."prov:wasDerivedFrom".-> a1
a1 --"p:reference/P854"--> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
bind1[/"sample(?img)"/]
v5 --o bind1
bind1 --as--o v6