map results as OPRs in case of missing //CobjCategory/@type and the vocabulary dnet:result_typologies doesn't resolve the super type
This commit is contained in:
parent
32f5e466e3
commit
ebf60020ac
|
@ -93,9 +93,16 @@ public abstract class AbstractMdRecordToOafMapper {
|
||||||
.stream()
|
.stream()
|
||||||
.map(i -> i.getInstancetype().getClassid())
|
.map(i -> i.getInstancetype().getClassid())
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
.map(s -> UNKNOWN.equalsIgnoreCase(s) ? "0000" : s)
|
||||||
.orElse("0000"); // Unknown
|
.orElse("0000"); // Unknown
|
||||||
Qualifier resultType = vocs.getSynonymAsQualifier(ModelConstants.DNET_RESULT_TYPOLOGIES, instanceType);
|
return Optional
|
||||||
return resultType.getClassid();
|
.ofNullable(vocs.getSynonymAsQualifier(ModelConstants.DNET_RESULT_TYPOLOGIES, instanceType))
|
||||||
|
.map(q -> q.getClassid())
|
||||||
|
.orElse("0000");
|
||||||
|
/*
|
||||||
|
* .orElseThrow( () -> new IllegalArgumentException( String.format("'%s' not mapped in %s", instanceType,
|
||||||
|
* DNET_RESULT_TYPOLOGIES)));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
|
Loading…
Reference in New Issue