[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(
Optional
.ofNullable(t.getQualifier())
.map(Qualifier::getClassid)
.map(Qualifier::getClassname)
.orElse(null)))
.map(StructuredProperty::getValue)
.collect(Collectors.toList()))
@ -405,7 +405,7 @@ public class ProvisionModelSupport {
.equals(
Optional
.ofNullable(t.getQualifier())
.map(Qualifier::getClassid)
.map(Qualifier::getClassname)
.orElse(null)))
.map(StructuredProperty::getValue)
.findFirst())
@ -472,7 +472,7 @@ public class ProvisionModelSupport {
}
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) {
@ -581,7 +581,7 @@ public class ProvisionModelSupport {
.map(
pids -> pids
.stream()
.map(p -> Pid.newInstance(p.getQualifier().getClassid(), p.getValue()))
.map(p -> Pid.newInstance(p.getQualifier().getClassname(), p.getValue()))
.collect(Collectors.toList()))
.orElse(null);
}
@ -606,8 +606,8 @@ public class ProvisionModelSupport {
subjects -> subjects
.stream()
.filter(s -> Objects.nonNull(s.getQualifier()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassid()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassid()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassname()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassname()))
.collect(Collectors.toList()))
.orElse(null);
}
@ -619,8 +619,8 @@ public class ProvisionModelSupport {
subjects -> subjects
.stream()
.filter(s -> Objects.nonNull(s.getQualifier()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassid()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassid()))
.filter(s -> Objects.nonNull(s.getQualifier().getClassname()))
.map(s -> Subject.newInstance(s.getValue(), s.getQualifier().getClassname()))
.collect(Collectors.toList()))
.orElse(null);
}