query-4d2a185bd4e55f05712c79dbf0d06529
We need guidance and example queries for how to model winners. One of the researchers tried this with the Eurovision Song Contest and it didn't work. I see that winners of the ESC are modelled differently, where each year's contest is treated separately, and that's fine. Winners have to be queried a different way, but after a lot of work I am struggling to find out what that is. I was glad to see there is a dedicated WikiProject for this topic, but the existing documentation doesn't seem to answer my question. [1], just by adapting a query like (Q37922)Nobel Prize in Literature , or (Q1153257)NAACP Image Awards , (Q41254)Grammy Awards , (Q160082)Booker Prize , (Q19020)Academy Awards Hi. Yesterday I was teaching researchers how to use Wikidata, and showing how easy it is to make a data table of winners of This query presently works well up to 1960 and for 2014 onwards, but has huge gaps imbetween:
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#>
SELECT (YEAR(?date) AS ?year) ?winner ?winnerLabel ?countryLabel ?songLabel ?image WHERE {
?contest wdt:P31 wd:Q110288240. # Each contest
?contest wdt:P585 ?date. # Get month and year (we'll just use year)
?contest p:P1346 ?s. ?s ps:P1346 ?winner.
OPTIONAL{ ?s pq:P17 ?country}
OPTIONAL{ ?s pq:P1686 ?song}
OPTIONAL{ ?winner wdt:P18 ?image }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?year