Revision 52805
Added by Claudio Atzori over 5 years ago
ExportResultIdentifiersMapper.java | ||
---|---|---|
4 | 4 |
import java.util.ArrayList; |
5 | 5 |
import java.util.Collections; |
6 | 6 |
import java.util.List; |
7 |
import java.util.stream.Collectors; |
|
7 | 8 |
|
8 |
import com.google.common.base.Function; |
|
9 | 9 |
import com.google.common.collect.Iterables; |
10 | 10 |
import com.google.common.collect.Lists; |
11 | 11 |
import eu.dnetlib.data.mapreduce.util.DedupUtils; |
... | ... | |
60 | 60 |
|
61 | 61 |
id.setDeleted(d.getOaf().getDataInfo().getDeletedbyinference()); |
62 | 62 |
id.setId(d.getEntityId()); |
63 |
id.setPids(d.getOaf().getEntity().getPidList().stream().map(p -> p.getValue()).collect(Collectors.toList())); |
|
63 | 64 |
|
64 | 65 |
final List<OafEntity> childrenList = d.getEntity().getChildrenList(); |
65 | 66 |
if (childrenList != null && !childrenList.isEmpty()) { |
66 |
final ArrayList<String> mergedIds = Lists.newArrayList(Iterables.transform(childrenList, new Function<OafEntity, String>() { |
|
67 |
@Override |
|
68 |
public String apply(final OafEntity oafEntity) { |
|
69 |
return oafEntity.getId(); |
|
70 |
} |
|
71 |
})); |
|
67 |
final ArrayList<String> mergedIds = Lists.newArrayList(Iterables.transform(childrenList, oafEntity -> oafEntity.getId())); |
|
72 | 68 |
Collections.sort(mergedIds); |
73 | 69 |
id.setMergedIds(mergedIds); |
74 | 70 |
} |
Also available in: Unified diff
avoid to emit enrichment events when the similarity score is below the threshold