forked from D-Net/dnet-hadoop
[Cleaning] drop alternate identifiers with empty values
This commit is contained in:
parent
1dfda3624e
commit
48f2b6127e
|
@ -152,15 +152,21 @@ public class CleaningFunctions {
|
|||
Optional
|
||||
.ofNullable(i.getPid())
|
||||
.ifPresent(pid -> {
|
||||
final Set<StructuredProperty> pids = Sets
|
||||
.newHashSet(
|
||||
final Set<StructuredProperty> pids =
|
||||
pid
|
||||
.stream()
|
||||
.filter(p -> StringUtils.isBlank(p.getValue()))
|
||||
.collect(Collectors.toList()));
|
||||
final Set<StructuredProperty> altIds = Sets.newHashSet(i.getAlternateIdentifier());
|
||||
.filter(p -> StringUtils.isNotBlank(p.getValue()))
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
Optional.ofNullable(i.getAlternateIdentifier())
|
||||
.ifPresent(altId -> {
|
||||
final Set<StructuredProperty> altIds = altId.stream()
|
||||
.filter(p -> StringUtils.isNotBlank(p.getValue()))
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
|
||||
i.setAlternateIdentifier(Lists.newArrayList(Sets.difference(altIds, pids)));
|
||||
});
|
||||
});
|
||||
|
||||
if (Objects.isNull(i.getAccessright()) || StringUtils.isBlank(i.getAccessright().getClassid())) {
|
||||
i
|
||||
|
|
Loading…
Reference in New Issue