query-c64053b6a46b13ae95040647fcd783ed
Awards and research prices: Number of person entries and wikipedia articlesHi there, I have written a SPARQL that gives me all awards (Q618779) and research prizes (Q11448906) and counts the number of person entries per award/prize and the number of wikipedia articles. However, as far as I can see, my final list has only awards/research prizes with at least one person with an entry of having received these awards (P166). https://w.wiki/72p7 11:52, 13 July 2023 (UTC)) talk (RichirikkenHas someone an idea, of how to correct this? I would like to have also awards/prices with no person entries in the list. Best regards and thanks in advance! 13:54, 16 July 2023 (UTC)) talk (Vincent Tep https://w.wiki/747n - but I can't get it to work and I don't know if I'm going in the right direction: thisI'm not sure why you would be interested in awards that have no recipients (which would be quite strange - would such awards even be notable enough to warrant a Wikidata item?), but I've tried to write a query that does the opposite, starting from all existing awards and then finding their recipients, drawing inspiration from an "awards received" property. If someone has not received any award, they won't have this property at all since it would have no statements. So you're doing your GROUP BY on a list of people with at least 1 award.who haveI think this is because you start from people ,RichirikkenHello @05:05, 17 July 2023 (UTC)) talk (RichirikkenBest regards, -- You are right in pointing out the reason for my "error", but I cannot find the solution. I'll try to work with your script. Hovewer, if someone can help I would be very happy. Thanks, that is already helpful. We want to have a base list of all awards. If an award has no winner in the wikidata, it just means that the wikidata entries are incomplete, I think. Hello Vincent,I managed t write a SPARQL that gives mit all awards and research prices and counting the number of wikipedia articles.
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item (COUNT(DISTINCT ?article) as ?wiki_article_count) WHERE {
{ ?item p:P31 ?statement0.
?statement0 (ps:P31) wd:Q618779.}
UNION
{?item p:P31 ?statement1.
?statement1 (ps:P31) wd:Q11448906.}
OPTIONAL {
?article schema:about ?item .
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item