对你的问题的一个天真的答案是:
SELECT ?movie (count(?wikipage) AS ?count) WHERE {
hint:Query hint:optimizer "None" .
?movie wdt:P31 wd:Q11424 .
?wikipage schema:about ?movie .
?wikipage schema:isPartOf/wikibase:wikiGroup "wikipedia"
} GROUP BY ?movie HAVING (?count > 10) ORDER BY DESC(?count)
Try it! https://query.wikidata.org/#SELECT%20%3Fmovie%20%28count%28%3Fwikipage%29%20AS%20%3Fcount%29%20WHERE%20%7B%0A%20%20%20hint%3AQuery%20hint%3Aoptimizer%20%22None%22.%0A%20%20%20%3Fmovie%20wdt%3AP31%20wd%3AQ11424.%0A%20%20%20%3Fwikipage%20schema%3Aabout%20%3Fmovie%20.%0A%20%20%20%3Fwikipage%20schema%3AisPartOf%2Fwikibase%3AwikiGroup%20%22wikipedia%22%20.%0A%7D%20GROUP%20BY%20%3Fmovie%20HAVING%20%28%3Fcount%20%3E%2010%29%20ORDER%20BY%20DESC%28%3Fcount%29
或者,您可以考虑附加链接的总数。附加链接包括到维基百科的链接以及到维基语录、维基导游等的链接。优点是附加链接的总数是预先计算的。
SELECT ?movie ?sitelinks WHERE {
?movie wdt:P31 wd:Q11424 .
?movie wikibase:sitelinks ?sitelinks .
FILTER (?sitelinks > 10)
} ORDER BY DESC(?sitelinks)
Try it! https://query.wikidata.org/#SELECT%20%3Fmovie%20%3Fsitelinks%20WHERE%20%7B%0A%20%20%20%3Fmovie%20wdt%3AP31%20wd%3AQ11424.%0A%20%20%20%3Fmovie%20wikibase%3Asitelinks%20%3Fsitelinks%20.%0A%20%20%20FILTER%20%28%3Fsitelinks%20%3E%2010%29%20%0A%7D%20ORDER%20BY%20DESC%28%3Fsitelinks%29
另请参阅以下问题:
- 在维基数据 SPARQL 查询中获取维基百科 URL(附加链接) https://opendata.stackexchange.com/q/6050/16193
- 维基数据结果按类似于 PageRank 的方式排序 https://stackoverflow.com/q/39438022/7879193
正如@TallTed和@AKSW所指出的,不同语言的标签数量可能与不同语言的维基百科文章数量不同。下面做个对比。
维基百科文章排名前 5 的电影
| title | articles | sitelinks | labels |
|---------------------|----------|-----------|--------|
| Avatar | 92 | 103 | 99 |
| Titanic | 86 | 100 | 101 |
| The Godfather | 79 | 103 | 82 |
| Slumdog Millionaire | 72 | 75 | 80 |
| Forrest Gump | 71 | 101 | 84 |
按附加链接排名前 5 的电影
| title | articles | sitelinks | labels |
|---------------|----------|-----------|--------|
| Avatar | 92 | 103 | 99 |
| The Godfather | 79 | 103 | 82 |
| Forrest Gump | 71 | 101 | 84 |
| Titanic | 86 | 100 | 101 |
| The Matrix | 67 | 94 | 77 |
按标签排名前 5 的电影
| title | articles | sitelinks | labels |
|------------------------------|----------|-----------|--------|
| The 25th Reich | 2 | 2 | 227 |
| Time Is But Brief | 0 | 0 | 224 |
| Michael Moore in TrumpLand | 6 | 6 | 222 |
| Magnus - The Mozart of Chess | 1 | 1 | 221 |
| Lee Chong Wei | 1 | 1 | 196 |