Skip to content

Commit 189d70a

Browse files
committed
Fix #2579 Better location-topic score
Nearby researchers table in location-topic aspect had infinite score in some cases. There was a further problem with the score where a work may have been counted multiple times. This is also fixed
1 parent 24d071d commit 189d70a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scholia/app/templates/location-topic_nearby-researchers.sparql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ WITH {
4040
WHERE {
4141
INCLUDE %organizations
4242

43-
BIND(1 / ?distance AS ?inverse_distance_)
43+
BIND(1 / (?distance + 1) AS ?inverse_distance_)
4444
?author wdt:P108 | wdt:P1416 ?organization .
4545
}
4646
GROUP BY ?author
@@ -53,8 +53,10 @@ WITH {
5353
WHERE {
5454
INCLUDE %authors_with_distance
5555
{
56+
# A score of 3 for each authorship in the topic
5657
?work wdt:P50 ?author .
57-
?work wdt:P921 / wdt:P279* target2: . BIND(3 AS ?topic_score)
58+
FILTER EXISTS { ?work wdt:P921 / wdt:P279* target2: . }
59+
BIND(3 AS ?topic_score)
5860
}
5961
UNION
6062
{ ?author wdt:P101 target2: . BIND(20 AS ?topic_score) }

0 commit comments

Comments
 (0)