diff --git a/dump/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java b/dump/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java index 6dd997c..df2c337 100644 --- a/dump/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java +++ b/dump/src/main/java/eu/dnetlib/dhp/oa/graph/dump/ResultMapper.java @@ -56,8 +56,8 @@ public class ResultMapper implements Serializable { mapCountry(out, input); mapCoverage(out, input); out.setDateOfCollection(input.getDateofcollection()); - out.setGreen(input.getIsGreen()); - out.setInDiamondJournal(input.getIsInDiamondJournal()); + out.setIsGreen(input.getIsGreen()); + out.setIsInDiamondJournal(input.getIsInDiamondJournal()); out.setPubliclyFunded(input.getPubliclyFunded()); mapOpenAccessColor(out, input); mapDescription(out, input); @@ -196,6 +196,10 @@ public class ResultMapper implements Serializable { .ifPresent( value -> value .stream() + .filter( + s -> !(s.getQualifier().getClassid().equalsIgnoreCase("fos")) || + (s.getQualifier().getClassid().equalsIgnoreCase("fos") && + s.getValue().split(" ")[0].trim().length() < 5)) // .filter( // s -> !((s.getQualifier().getClassid().equalsIgnoreCase("fos") && // Optional.ofNullable(s.getDataInfo()).isPresent() @@ -226,17 +230,13 @@ public class ResultMapper implements Serializable { private static void mapPublisher(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { Optional> oStr; oStr = Optional.ofNullable(input.getPublisher()); - if (oStr.isPresent()) { - out.setPublisher(oStr.get().getValue()); - } + oStr.ifPresent(stringField -> out.setPublisher(stringField.getValue())); } private static void mapDateOfAcceptance(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { Optional> oStr; oStr = Optional.ofNullable(input.getDateofacceptance()); - if (oStr.isPresent()) { - out.setPublicationDate(oStr.get().getValue()); - } + oStr.ifPresent(stringField -> out.setPublicationDate(stringField.getValue())); } private static void mapPid(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { @@ -279,9 +279,7 @@ public class ResultMapper implements Serializable { private static void mapLastUpdateTimestamp(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { Optional oLong = Optional.ofNullable(input.getLastupdatetimestamp()); - if (oLong.isPresent()) { - out.setLastUpdateTimeStamp(oLong.get()); - } + oLong.ifPresent(out::setLastUpdateTimeStamp); } private static void mapLanguage(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { @@ -337,9 +335,7 @@ public class ResultMapper implements Serializable { private static void mapEmbargo(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { Optional> oStr = Optional.ofNullable(input.getEmbargoenddate()); - if (oStr.isPresent()) { - out.setEmbargoEndDate(oStr.get().getValue()); - } + oStr.ifPresent(stringField -> out.setEmbargoEndDate(stringField.getValue())); } private static void mapDescription(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { diff --git a/pom.xml b/pom.xml index a241104..4f690a2 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ 3.5 11.0.2 [6.1.3] - [8.0.0-SNAPSHOT] + [8.0.0] \ No newline at end of file