Search in sources :

Example 1 with GlobalPublicationStatistics

use of org.nextprot.api.core.domain.publication.GlobalPublicationStatistics in project nextprot-api by calipho-sib.

the class StatisticsServiceImpl method getGlobalPublicationStatistics.

@Cacheable("global-publication-statistics")
@Override
public GlobalPublicationStatistics getGlobalPublicationStatistics() {
    GlobalPublicationStatistics globalPublicationStatistics = new GlobalPublicationStatistics();
    publicationService.findAllPublicationIds().forEach(pubId -> {
        List<EntryPublication> entryPublications = publicationService.getEntryPublications(pubId);
        GlobalPublicationStatistics.PublicationStatistics stats = new PublicationStatisticsAnalyser(pubId, entryPublications).analyse();
        globalPublicationStatistics.putPublicationStatisticsById(pubId, stats);
        if (stats.isCited()) {
            globalPublicationStatistics.incrementNumberOfCitedPublications();
        }
        if (stats.isComputed()) {
            globalPublicationStatistics.incrementNumberOfComputationallyMappedPublications();
        }
        if (stats.isLargeScale()) {
            globalPublicationStatistics.incrementNumberOfLargeScalePublications();
        }
        if (stats.isCurated()) {
            globalPublicationStatistics.incrementNumberOfCuratedPublications();
        }
        globalPublicationStatistics.incrementTotalNumberOfPublications();
    });
    return globalPublicationStatistics;
}
Also used : EntryPublication(org.nextprot.api.core.domain.publication.EntryPublication) GlobalPublicationStatistics(org.nextprot.api.core.domain.publication.GlobalPublicationStatistics) Cacheable(org.springframework.cache.annotation.Cacheable)

Aggregations

EntryPublication (org.nextprot.api.core.domain.publication.EntryPublication)1 GlobalPublicationStatistics (org.nextprot.api.core.domain.publication.GlobalPublicationStatistics)1 Cacheable (org.springframework.cache.annotation.Cacheable)1