forked from D-Net/dnet-hadoop
[EOSC Context Tagging] refactoring
This commit is contained in:
parent
144c103b67
commit
0172bab251
|
@ -117,19 +117,28 @@ public class SparkEoscBulkTag implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <R extends Result> R enrich(R value, List<String> hostedByList) {
|
private static <R extends Result> R enrich(R value, List<String> hostedByList) {
|
||||||
if (value.getInstance().stream().anyMatch(i -> (hostedByList.contains(i.getHostedby().getKey())) ||
|
if (value
|
||||||
(value.getEoscifguidelines() != null && value.getEoscifguidelines().size() > 0)) &&
|
.getInstance()
|
||||||
!value.getContext().stream().anyMatch(c -> c.getId().equals("eosc"))) {
|
.stream()
|
||||||
|
.anyMatch(
|
||||||
|
i -> (hostedByList.contains(i.getHostedby().getKey())) ||
|
||||||
|
(value.getEoscifguidelines() != null && value.getEoscifguidelines().size() > 0))
|
||||||
|
&&
|
||||||
|
!value.getContext().stream().anyMatch(c -> c.getId().equals("eosc"))) {
|
||||||
Context context = new Context();
|
Context context = new Context();
|
||||||
context.setId("eosc");
|
context.setId("eosc");
|
||||||
context.setDataInfo(Arrays.asList(OafMapperUtils
|
context
|
||||||
.dataInfo(
|
.setDataInfo(
|
||||||
false, BULKTAG_DATA_INFO_TYPE, true, false,
|
Arrays
|
||||||
|
.asList(
|
||||||
OafMapperUtils
|
OafMapperUtils
|
||||||
.qualifier(
|
.dataInfo(
|
||||||
|
false, BULKTAG_DATA_INFO_TYPE, true, false,
|
||||||
|
OafMapperUtils
|
||||||
|
.qualifier(
|
||||||
CLASS_ID_DATASOURCE, CLASS_NAME_BULKTAG_DATASOURCE,
|
CLASS_ID_DATASOURCE, CLASS_NAME_BULKTAG_DATASOURCE,
|
||||||
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS),
|
DNET_PROVENANCE_ACTIONS, DNET_PROVENANCE_ACTIONS),
|
||||||
TAGGING_TRUST)));
|
TAGGING_TRUST)));
|
||||||
value.getContext().add(context);
|
value.getContext().add(context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue