query-dd095a4f0fa6db7144c88510f18e06ba
This seems nearly complete, but for 2019 onwards, there are weird duplicate entries. from the song to the contest it won, so I made a query on that basis. (P2522)victory Then I noticed that sometimes there is
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT (YEAR(?date) AS ?year) ?winner ?winnerLabel ?countryLabel ?songLabel (SAMPLE(?img) AS ?image) WHERE {
?contest wdt:P31 wd:Q110288240. # Each contest
?contest wdt:P585 ?date. # Get month and year (we'll just use year)
?song wdt:P2522 ?contest. # Song winner of the contest
?song wdt:P175 ?winner. # performer of the song
OPTIONAL{ ?song p:P1344 ?s. ?s pq:P17 ?country}
OPTIONAL{ ?winner wdt:P18 ?img }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?date ?winner ?winnerLabel ?countryLabel ?songLabel
ORDER BY ?year
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?contest")
v7("?country")
v3("?date"):::projected
v9("?image")
v8("?img"):::projected
v6("?s")
v4("?song")
v5("?winner"):::projected
v9("?year")
c2(["wd:Q110288240"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P585"--> v3
v4 --"p:direct/P2522"--> v2
v4 --"p:direct/P175"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:P1344".-> v6
v6 --"p:qualifier/P17"--> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:direct/P18".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"year-from-dateTime(?date)"/]
v3 --o bind1
bind1 --as--o v9
bind2[/"sample(?img)"/]
v8 --o bind2
bind2 --as--o v9