File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11# title: Authors for specific topics
22SELECT
3- ? score
3+ (( ?distinct_topics + ?topics / ( ?topics + 100 )) AS ? score)
44 ?author ?authorLabel (CONCAT ("/author/", SUBSTR (STR (?author ), 32)) AS ?authorUrl )
55 ?example_work ?example_workLabel (CONCAT ("/work/", SUBSTR (STR (?example_work ), 32)) AS ?example_workUrl )
66WITH {
7- SELECT (COUNT (?topic ) AS ?score ) ?author (SAMPLE (?work_ ) AS ?example_work )
8- WHERE {
7+ SELECT
8+ (COUNT (DISTINCT ?topic ) AS ?distinct_topics )
9+ (COUNT (?topic ) AS ?topics )
10+ ?author
11+ (SAMPLE (?work ) AS ?example_work )
12+ WHERE {
913 VALUES ?topic { {% for q in qs %} wd:{{ q }} {% endfor %} }
1014
1115 # A broad query including "(wdt:P361+ | wdt:P1269+ | (wdt:P31* / wdt:P279*) )" seems to take
1216 # long time and time out.
13- ?work wdt:P921 ?topic .
14- ?work wdt:P2860 ?cited_work .
15- { ?cited_work wdt:P50 ?author . BIND(?cited_work AS ?work_ ) }
16- UNION
17- { ?work wdt:P50 ?author . BIND(?work AS ?work_ ) }
17+ ?work wdt:P921 ?topic ;
18+ wdt:P50 ?author .
1819 }
1920 GROUP BY ?author
20- ORDER BY DESC (?score )
21+ ORDER BY DESC (?distinct_topics ) DESC ( ?topics )
2122 LIMIT 200
2223} AS %results
2324WHERE {
You can’t perform that action at this time.
0 commit comments