added helper method to get the OpenAIRE ids of the delegated authorities

This commit is contained in:
Claudio Atzori 2022-01-21 14:21:30 +01:00
parent aa0c79e0d1
commit 55800920a9
1 changed files with 7 additions and 0 deletions

View File

@ -67,6 +67,13 @@ public class IdentifierFactory implements Serializable {
DELEGATED_PID_AUTHORITY.get(PidType.doi).put(ZENODO_R3_ID, "zenodo");
}
public static Set<String> delegatedAuthorityDatasourceIds() {
return DELEGATED_PID_AUTHORITY.values()
.stream()
.flatMap(m -> m.keySet().stream())
.collect(Collectors.toCollection(HashSet::new));
}
public static List<StructuredProperty> getPids(List<StructuredProperty> pid, KeyValue collectedFrom) {
return pidFromInstance(pid, collectedFrom, true).distinct().collect(Collectors.toList());
}