Revision 52805
Added by Claudio Atzori over 5 years ago
modules/dnet-mapreduce-jobs/branches/beta/src/main/java/eu/dnetlib/data/mapreduce/hbase/dataexport/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 |
} |
modules/dnet-mapreduce-jobs/branches/beta/src/main/java/eu/dnetlib/data/mapreduce/hbase/dataexport/OpenaireEntityId.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
private String id; |
13 | 13 |
|
14 |
private List<String> pids; |
|
15 |
|
|
14 | 16 |
private List<String> mergedIds; |
15 | 17 |
|
16 | 18 |
private boolean deleted; |
... | ... | |
32 | 34 |
this.id = id; |
33 | 35 |
} |
34 | 36 |
|
37 |
public List<String> getPids() { |
|
38 |
return pids; |
|
39 |
} |
|
40 |
|
|
41 |
public void setPids(final List<String> pids) { |
|
42 |
this.pids = pids; |
|
43 |
} |
|
44 |
|
|
35 | 45 |
public List<String> getMergedIds() { |
36 | 46 |
return mergedIds; |
37 | 47 |
} |
... | ... | |
52 | 62 |
public String toString() { |
53 | 63 |
return new Gson().toJson(this); |
54 | 64 |
} |
65 |
|
|
55 | 66 |
} |
Also available in: Unified diff
avoid to emit enrichment events when the similarity score is below the threshold