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
|
Optional
|
||||||
.ofNullable(i.getPid())
|
.ofNullable(i.getPid())
|
||||||
.ifPresent(pid -> {
|
.ifPresent(pid -> {
|
||||||
final Set<StructuredProperty> pids = Sets
|
final Set<StructuredProperty> pids =
|
||||||
.newHashSet(
|
|
||||||
pid
|
pid
|
||||||
.stream()
|
.stream()
|
||||||
.filter(p -> StringUtils.isBlank(p.getValue()))
|
.filter(p -> StringUtils.isNotBlank(p.getValue()))
|
||||||
.collect(Collectors.toList()));
|
.collect(Collectors.toCollection(HashSet::new));
|
||||||
final Set<StructuredProperty> altIds = Sets.newHashSet(i.getAlternateIdentifier());
|
|
||||||
|
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)));
|
i.setAlternateIdentifier(Lists.newArrayList(Sets.difference(altIds, pids)));
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (Objects.isNull(i.getAccessright()) || StringUtils.isBlank(i.getAccessright().getClassid())) {
|
if (Objects.isNull(i.getAccessright()) || StringUtils.isBlank(i.getAccessright().getClassid())) {
|
||||||
i
|
i
|
||||||
|
|
Loading…
Reference in New Issue