Skip to content

[VIVO-1675] Fix publication counts in histogram

backups requested to merge github/fork/grahamtriggs/fix/VIVO-1675 into main

Created by: grahamtriggs

VIVO-1675:

What does this pull request do?

Corrects problem where a publication that has been assigned multiple types gets counted more than once.

What's new?

Assigns all publication types to a single publication activity, rather than creating an additional activity for each publication type.

Uses the configuration of "groups" (Articles, Books) and their associated types as a priority list so that the activity is counted in the first matching group, or "other" if none.

There is a hardcoded default configuration for "Articles" and "Books", however there are optional runtime.properties entries that allow you to change the configuration:

e.g.

histogram.groups = Articles, Books

histogram.types.for.Articles = http://purl.org/ontology/bibo/AcademicArticle, http://purl.org/ontology/bibo/Article

histogram.types.for.Books = http://purl.org/ontology/bibo/Book, http://purl.org/ontology/bibo/BookSection, http://purl.org/ontology/bibo/Chapter, http://purl.org/ontology/bibo/EditedBook

Note, these are all comma separated lists - the groups key provides the names of each group, and the associated types.for key contains the URIs of publication classes to be counted in that group.

Priority is given to the first group in the list.

How should this be tested?

Using Tenderfoot, create a profile with one publication, published in the last 10 years (so it appears on the chart). Add two publication types to the same publication - e.g. Academic Article and Book Chapter.

In the existing code, you should see the one publication counted as both an article and a book.

Applying this fix will show the publication counted only once in the chart.

Interested parties

@VIVO-project/vivo-committers

Merge request reports