sets author.rank when null

This commit is contained in:
Claudio Atzori 2020-06-25 14:06:21 +02:00
parent 216975c4ec
commit 6f5771c1c9
1 changed files with 12 additions and 1 deletions

View File

@ -152,7 +152,18 @@ public class CleanGraphSparkJob {
}
}
}
if (Objects.nonNull(r.getAuthor())) {
boolean nullRank = r
.getAuthor()
.stream()
.anyMatch(a -> Objects.isNull(a.getRank()));
if (nullRank) {
int i = 1;
for (Author author : r.getAuthor()) {
author.setRank(i++);
}
}
}
if (value instanceof Publication) {
} else if (value instanceof eu.dnetlib.dhp.schema.oaf.Dataset) {