code formatting

This commit is contained in:
Claudio Atzori 2023-12-08 17:06:19 +01:00
parent 2877839df0
commit aba95ed1d1
1 changed files with 11 additions and 9 deletions

View File

@ -16,7 +16,6 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import eu.dnetlib.dhp.common.vocabulary.VocabularyTerm;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import com.github.sisyphsu.dateparser.DateParserUtils; import com.github.sisyphsu.dateparser.DateParserUtils;
@ -24,6 +23,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import eu.dnetlib.dhp.common.vocabulary.VocabularyGroup; import eu.dnetlib.dhp.common.vocabulary.VocabularyGroup;
import eu.dnetlib.dhp.common.vocabulary.VocabularyTerm;
import eu.dnetlib.dhp.schema.common.ModelConstants; import eu.dnetlib.dhp.schema.common.ModelConstants;
import eu.dnetlib.dhp.schema.common.ModelSupport; import eu.dnetlib.dhp.schema.common.ModelSupport;
import eu.dnetlib.dhp.schema.oaf.*; import eu.dnetlib.dhp.schema.oaf.*;
@ -416,10 +416,11 @@ public class GraphCleaningFunctions extends CleaningFunctions {
.replaceAll(NAME_CLEANING_REGEX, " ")); .replaceAll(NAME_CLEANING_REGEX, " "));
if (vocs.vocabularyExists(DNET_PUBLISHERS)) { if (vocs.vocabularyExists(DNET_PUBLISHERS)) {
vocs.find(DNET_PUBLISHERS) vocs
.map(voc -> voc.getTermBySynonym(r.getPublisher().getValue())) .find(DNET_PUBLISHERS)
.map(VocabularyTerm::getName) .map(voc -> voc.getTermBySynonym(r.getPublisher().getValue()))
.ifPresent(publisher -> r.getPublisher().setValue(publisher)); .map(VocabularyTerm::getName)
.ifPresent(publisher -> r.getPublisher().setValue(publisher));
} }
} }
} }
@ -582,10 +583,11 @@ public class GraphCleaningFunctions extends CleaningFunctions {
} }
if (Objects.nonNull(i.getLicense()) && Objects.nonNull(i.getLicense().getValue())) { if (Objects.nonNull(i.getLicense()) && Objects.nonNull(i.getLicense().getValue())) {
vocs.find(DNET_LICENSES) vocs
.map(voc -> voc.getTermBySynonym(i.getLicense().getValue())) .find(DNET_LICENSES)
.map(VocabularyTerm::getId) .map(voc -> voc.getTermBySynonym(i.getLicense().getValue()))
.ifPresent(license -> i.getLicense().setValue(license)); .map(VocabularyTerm::getId)
.ifPresent(license -> i.getLicense().setValue(license));
} }
// from the script from Dimitris // from the script from Dimitris