forked from D-Net/dnet-hadoop
This commit is contained in:
parent
a634794242
commit
faea30cda0
|
@ -71,10 +71,9 @@ public class ResultTagger implements Serializable {
|
||||||
|
|
||||||
// tagging for Subject
|
// tagging for Subject
|
||||||
final Set<String> subjects = new HashSet<>();
|
final Set<String> subjects = new HashSet<>();
|
||||||
Optional<List<StructuredProperty>> oresultsubj = Optional.ofNullable(result.getSubject());
|
|
||||||
if (oresultsubj.isPresent()) {
|
if (Objects.nonNull(result.getSubject())){
|
||||||
oresultsubj
|
result.getSubject()
|
||||||
.get()
|
|
||||||
.stream()
|
.stream()
|
||||||
.map(subject -> subject.getValue())
|
.map(subject -> subject.getValue())
|
||||||
.filter(StringUtils::isNotBlank)
|
.filter(StringUtils::isNotBlank)
|
||||||
|
@ -90,15 +89,23 @@ public class ResultTagger implements Serializable {
|
||||||
final Set<String> datasources = new HashSet<>();
|
final Set<String> datasources = new HashSet<>();
|
||||||
final Set<String> tmp = new HashSet<>();
|
final Set<String> tmp = new HashSet<>();
|
||||||
|
|
||||||
Optional<List<Instance>> oresultinstance = Optional.ofNullable(result.getInstance());
|
if (Objects.nonNull(result.getInstance())) {
|
||||||
if (oresultinstance.isPresent()) {
|
for (Instance i : result.getInstance()) {
|
||||||
for (Instance i : oresultinstance.get()) {
|
if(Objects.nonNull(i.getCollectedfrom())){
|
||||||
|
if(Objects.nonNull(i.getCollectedfrom().getKey())){
|
||||||
tmp.add(StringUtils.substringAfter(i.getCollectedfrom().getKey(), "|"));
|
tmp.add(StringUtils.substringAfter(i.getCollectedfrom().getKey(), "|"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(Objects.nonNull(i.getHostedby())){
|
||||||
|
if(Objects.nonNull(i.getHostedby().getKey())){
|
||||||
tmp.add(StringUtils.substringAfter(i.getHostedby().getKey(), "|"));
|
tmp.add(StringUtils.substringAfter(i.getHostedby().getKey(), "|"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
oresultinstance
|
}
|
||||||
.get()
|
|
||||||
|
result
|
||||||
|
.getInstance()
|
||||||
.stream()
|
.stream()
|
||||||
.map(i -> new Pair<>(i.getCollectedfrom().getKey(), i.getHostedby().getKey()))
|
.map(i -> new Pair<>(i.getCollectedfrom().getKey(), i.getHostedby().getKey()))
|
||||||
.flatMap(p -> Stream.of(p.getFst(), p.getSnd()))
|
.flatMap(p -> Stream.of(p.getFst(), p.getSnd()))
|
||||||
|
|
Loading…
Reference in New Issue