[SKG-IF] added CitationCount to the dumped measures

This commit is contained in:
Miriam Baglioni 2024-06-18 09:24:22 +02:00
parent 546684ae68
commit ed754e05d2
4 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,20 @@
package eu.dnetlib.dhp.skgif.model;
import java.io.Serializable;
public class Impact implements Serializable {
private Integer citationCount;
public Integer getCitationCount() {
return citationCount;
}
public void setCitationCount(Integer citationCount) {
this.citationCount = citationCount;
}
public Impact() {
citationCount = 0;
}
}

View File

@ -14,6 +14,8 @@ public class Indicator implements Serializable {
return downloadsAndViews;
}
public Impact impact;
public void setDownloadsAndViews(DownloadsAndViews downloadsAndViews) {
this.downloadsAndViews = downloadsAndViews;
}
@ -30,4 +32,11 @@ public class Indicator implements Serializable {
return i;
}
public Impact getImpact() {
return impact;
}
public void setImpact(Impact impact) {
this.impact = impact;
}
}

View File

@ -5,6 +5,8 @@ import java.io.Serializable;
import java.util.*;
import java.util.stream.Collectors;
import org.apache.commons.net.imap.IMAPClient;
import eu.dnetlib.dhp.oa.graph.dump.skgif.exception.NoAllowedTypeException;
import eu.dnetlib.dhp.oa.graph.dump.skgif.exception.NoTitleFoundException;
import eu.dnetlib.dhp.schema.oaf.*;
@ -51,6 +53,7 @@ public class ResultMapper implements Serializable {
if (Optional.ofNullable(input.getMeasures()).isPresent()) {
Indicator i = new Indicator();
DownloadsAndViews uc = new DownloadsAndViews();
Impact impact = new Impact();
input.getMeasures().forEach(m -> {
if (m.getId().equals("downloads")) {
uc.setDownloads(m.getUnit().get(0).getValue());
@ -58,9 +61,15 @@ public class ResultMapper implements Serializable {
if (m.getId().equals("views")) {
uc.setViews(m.getUnit().get(0).getValue());
}
if (m.getId().equals("influence_alt")) {
impact
.setCitationCount(
Integer.getInteger(m.getUnit().stream().filter(u -> u.getKey().equals("score")).findFirst().get().getValue()));
}
});
i.setDownloadsAndViews(uc);
i.setImpact(impact);
out.setIndicator(i);
}

File diff suppressed because one or more lines are too long