1
0
Fork 0

[graph provision] using Qualifier.classNames to populate the correponsing fields in the JSON payload

This commit is contained in:
Claudio Atzori 2024-05-15 15:33:10 +02:00
parent 1efe7f7e39
commit 0611c81a2f
1 changed files with 8 additions and 8 deletions

View File

@ -387,7 +387,7 @@ public class ProvisionModelSupport {
.equals( .equals(
Optional Optional
.ofNullable(t.getQualifier()) .ofNullable(t.getQualifier())
.map(Qualifier::getClassid) .map(Qualifier::getClassname)
.orElse(null))) .orElse(null)))
.map(StructuredProperty::getValue) .map(StructuredProperty::getValue)
.collect(Collectors.toList())) .collect(Collectors.toList()))
@ -405,7 +405,7 @@ public class ProvisionModelSupport {
.equals( .equals(
Optional Optional
.ofNullable(t.getQualifier()) .ofNullable(t.getQualifier())
.map(Qualifier::getClassid) .map(Qualifier::getClassname)
.orElse(null))) .orElse(null)))
.map(StructuredProperty::getValue) .map(StructuredProperty::getValue)
.findFirst()) .findFirst())
@ -472,7 +472,7 @@ public class ProvisionModelSupport {
} }
private static String mapQualifier(eu.dnetlib.dhp.schema.oaf.Qualifier q) { private static String mapQualifier(eu.dnetlib.dhp.schema.oaf.Qualifier q) {
return Optional.ofNullable(q).map(Qualifier::getClassid).orElse(null); return Optional.ofNullable(q).map(Qualifier::getClassname).orElse(null);
} }
private static Journal mapJournal(eu.dnetlib.dhp.schema.oaf.Journal joaf) { private static Journal mapJournal(eu.dnetlib.dhp.schema.oaf.Journal joaf) {
@ -581,7 +581,7 @@ public class ProvisionModelSupport {
.map( .map(
pids -> pids pids -> pids
.stream() .stream()
.map(p -> Pid.newInstance(p.getQualifier().getClassid(), p.getValue())) .map(p -> Pid.newInstance(p.getQualifier().getClassname(), p.getValue()))
.collect(Collectors.toList())) .collect(Collectors.toList()))
.orElse(null); .orElse(null);
} }
@ -606,8 +606,8 @@ public class ProvisionModelSupport {
subjects -> subjects subjects -> subjects
.stream() .stream()
.filter(s -> Objects.nonNull(s.getQualifier())) .filter(s -> Objects.nonNull(s.getQualifier()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassid())) .filter(s -> Objects.nonNull(s.getQualifier().getClassname()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassid())) .map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassname()))
.collect(Collectors.toList())) .collect(Collectors.toList()))
.orElse(null); .orElse(null);
} }
@ -619,8 +619,8 @@ public class ProvisionModelSupport {
subjects -> subjects subjects -> subjects
.stream() .stream()
.filter(s -> Objects.nonNull(s.getQualifier())) .filter(s -> Objects.nonNull(s.getQualifier()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassid())) .filter(s -> Objects.nonNull(s.getQualifier().getClassname()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassid())) .map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassname()))
.collect(Collectors.toList())) .collect(Collectors.toList()))
.orElse(null); .orElse(null);
} }