forked from D-Net/dnet-hadoop
[graph cleaning] avoid NPEs
This commit is contained in:
parent
a460ebe215
commit
05ee7d8b09
|
@ -509,12 +509,19 @@ public class GraphCleaningFunctions extends CleaningFunctions {
|
||||||
|
|
||||||
// from the script from Dimitris
|
// from the script from Dimitris
|
||||||
if ("0000".equals(i.getRefereed().getClassid())) {
|
if ("0000".equals(i.getRefereed().getClassid())) {
|
||||||
final boolean isFromCrossref = ModelConstants.CROSSREF_ID
|
final boolean isFromCrossref = Optional
|
||||||
.equals(i.getCollectedfrom().getKey());
|
.ofNullable(i.getCollectedfrom())
|
||||||
final boolean hasDoi = i
|
.map(KeyValue::getKey)
|
||||||
.getPid()
|
.map(id -> id.equals(ModelConstants.CROSSREF_ID))
|
||||||
.stream()
|
.orElse(false);
|
||||||
.anyMatch(pid -> PidType.doi.toString().equals(pid.getQualifier().getClassid()));
|
final boolean hasDoi = Optional
|
||||||
|
.ofNullable(i.getPid())
|
||||||
|
.map(
|
||||||
|
pid -> pid
|
||||||
|
.stream()
|
||||||
|
.anyMatch(
|
||||||
|
p -> PidType.doi.toString().equals(p.getQualifier().getClassid())))
|
||||||
|
.orElse(false);
|
||||||
final boolean isPeerReviewedType = PEER_REVIEWED_TYPES
|
final boolean isPeerReviewedType = PEER_REVIEWED_TYPES
|
||||||
.contains(i.getInstancetype().getClassname());
|
.contains(i.getInstancetype().getClassname());
|
||||||
final boolean noOtherLitType = r
|
final boolean noOtherLitType = r
|
||||||
|
|
Loading…
Reference in New Issue