[Dump] Changed the name for isgreen and isindiamonfjournal per the set methos. Dumping only the FOS level1 and level2

This commit is contained in:
Miriam Baglioni 2024-07-29 10:37:25 +02:00
parent 30d3ae6b69
commit 9a97f1423c
2 changed files with 11 additions and 15 deletions

View File

@ -56,8 +56,8 @@ public class ResultMapper implements Serializable {
mapCountry(out, input); mapCountry(out, input);
mapCoverage(out, input); mapCoverage(out, input);
out.setDateOfCollection(input.getDateofcollection()); out.setDateOfCollection(input.getDateofcollection());
out.setGreen(input.getIsGreen()); out.setIsGreen(input.getIsGreen());
out.setInDiamondJournal(input.getIsInDiamondJournal()); out.setIsInDiamondJournal(input.getIsInDiamondJournal());
out.setPubliclyFunded(input.getPubliclyFunded()); out.setPubliclyFunded(input.getPubliclyFunded());
mapOpenAccessColor(out, input); mapOpenAccessColor(out, input);
mapDescription(out, input); mapDescription(out, input);
@ -196,6 +196,10 @@ public class ResultMapper implements Serializable {
.ifPresent( .ifPresent(
value -> value value -> value
.stream() .stream()
.filter(
s -> !(s.getQualifier().getClassid().equalsIgnoreCase("fos")) ||
(s.getQualifier().getClassid().equalsIgnoreCase("fos") &&
s.getValue().split(" ")[0].trim().length() < 5))
// .filter( // .filter(
// s -> !((s.getQualifier().getClassid().equalsIgnoreCase("fos") && // s -> !((s.getQualifier().getClassid().equalsIgnoreCase("fos") &&
// Optional.ofNullable(s.getDataInfo()).isPresent() // 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) { private static void mapPublisher(Result out, eu.dnetlib.dhp.schema.oaf.Result input) {
Optional<Field<String>> oStr; Optional<Field<String>> oStr;
oStr = Optional.ofNullable(input.getPublisher()); oStr = Optional.ofNullable(input.getPublisher());
if (oStr.isPresent()) { oStr.ifPresent(stringField -> out.setPublisher(stringField.getValue()));
out.setPublisher(oStr.get().getValue());
}
} }
private static void mapDateOfAcceptance(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { private static void mapDateOfAcceptance(Result out, eu.dnetlib.dhp.schema.oaf.Result input) {
Optional<Field<String>> oStr; Optional<Field<String>> oStr;
oStr = Optional.ofNullable(input.getDateofacceptance()); oStr = Optional.ofNullable(input.getDateofacceptance());
if (oStr.isPresent()) { oStr.ifPresent(stringField -> out.setPublicationDate(stringField.getValue()));
out.setPublicationDate(oStr.get().getValue());
}
} }
private static void mapPid(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { 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) { private static void mapLastUpdateTimestamp(Result out, eu.dnetlib.dhp.schema.oaf.Result input) {
Optional<Long> oLong = Optional.ofNullable(input.getLastupdatetimestamp()); Optional<Long> oLong = Optional.ofNullable(input.getLastupdatetimestamp());
if (oLong.isPresent()) { oLong.ifPresent(out::setLastUpdateTimeStamp);
out.setLastUpdateTimeStamp(oLong.get());
}
} }
private static void mapLanguage(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { 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) { private static void mapEmbargo(Result out, eu.dnetlib.dhp.schema.oaf.Result input) {
Optional<Field<String>> oStr = Optional.ofNullable(input.getEmbargoenddate()); Optional<Field<String>> oStr = Optional.ofNullable(input.getEmbargoenddate());
if (oStr.isPresent()) { oStr.ifPresent(stringField -> out.setEmbargoEndDate(stringField.getValue()));
out.setEmbargoEndDate(oStr.get().getValue());
}
} }
private static void mapDescription(Result out, eu.dnetlib.dhp.schema.oaf.Result input) { private static void mapDescription(Result out, eu.dnetlib.dhp.schema.oaf.Result input) {

View File

@ -103,7 +103,7 @@
<dhp.commons.lang.version>3.5</dhp.commons.lang.version> <dhp.commons.lang.version>3.5</dhp.commons.lang.version>
<dhp.guava.version>11.0.2</dhp.guava.version> <dhp.guava.version>11.0.2</dhp.guava.version>
<dhp-schemas.version>[6.1.3]</dhp-schemas.version> <dhp-schemas.version>[6.1.3]</dhp-schemas.version>
<dhp-dump-schemas.version>[8.0.0-SNAPSHOT]</dhp-dump-schemas.version> <dhp-dump-schemas.version>[8.0.0]</dhp-dump-schemas.version>
</properties> </properties>
</project> </project>