我想获取维基数据中的参与者列表以及每个人获得的奖励数量。我必须写哪个查询?
我试过这个,但它似乎没有用,因为我只有一些结果:
SELECT ?actor ?actorLabel ?awardsNumber WHERE {
{
SELECT ?actor (COUNT(DISTINCT ?awardsNumber) AS ?awardsNumber)
WHERE {
?actor wdt:P106 wd:Q33999 .
?awardsNumber wdt:P166 ?actor .
}
GROUP BY ?actor
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC (?awardsNumber)
提前感谢您的帮助!
答案 0 :(得分:1)
不确定为何使用属性P166
(“已收到奖励”)作为传入属性。当然查询必须是
SELECT ?actor ?actorLabel ?awardsNumber WHERE {
{
SELECT ?actor (COUNT(DISTINCT ?award) AS ?awardsNumber)
WHERE {
?actor wdt:P106 wd:Q33999 .
?actor wdt:P166 ?award.
}
GROUP BY ?actor
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY DESC (?awardsNumber)