From 298cc6820443fa95b52cac7a7424a8a5d252d2df Mon Sep 17 00:00:00 2001 From: southeo Date: Fri, 29 Nov 2024 17:11:21 +0100 Subject: [PATCH 1/2] use human readable type for responses --- .../backend/component/FdoRecordComponent.java | 4 +- .../controller/AnnotationController.java | 14 +++---- .../eu/dissco/backend/domain/FdoType.java | 39 +++++++++++++++++++ .../eu/dissco/backend/domain/OdsType.java | 20 ---------- .../openapi/annotation/AnnotationRequest.java | 3 +- .../annotation/BatchAnnotationRequest.java | 3 +- .../repository/DigitalSpecimenRepository.java | 3 +- .../backend/service/AnnotationService.java | 18 ++++----- .../backend/service/DigitalMediaService.java | 13 +++---- .../service/DigitalSpecimenService.java | 14 +++---- .../MachineAnnotationServiceService.java | 5 ++- .../backend/service/MasJobRecordService.java | 5 ++- .../java/eu/dissco/backend/TestUtils.java | 6 +-- .../controller/AnnotationControllerTest.java | 5 ++- .../service/DigitalMediaServiceTest.java | 12 +++--- .../service/DigitalSpecimenServiceTest.java | 12 +++--- .../service/MasJobRecordServiceTest.java | 3 +- .../utils/DigitalMediaObjectUtils.java | 28 +++++++------ .../backend/utils/MasJobRecordUtils.java | 3 +- .../dissco/backend/utils/SpecimenUtils.java | 7 ++-- 20 files changed, 119 insertions(+), 98 deletions(-) create mode 100644 src/main/java/eu/dissco/backend/domain/FdoType.java delete mode 100644 src/main/java/eu/dissco/backend/domain/OdsType.java diff --git a/src/main/java/eu/dissco/backend/component/FdoRecordComponent.java b/src/main/java/eu/dissco/backend/component/FdoRecordComponent.java index 7fb7321..f828a4d 100644 --- a/src/main/java/eu/dissco/backend/component/FdoRecordComponent.java +++ b/src/main/java/eu/dissco/backend/component/FdoRecordComponent.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import eu.dissco.backend.domain.OdsType; +import eu.dissco.backend.domain.FdoType; import lombok.Getter; import org.springframework.stereotype.Component; @@ -15,7 +15,7 @@ public class FdoRecordComponent { public FdoRecordComponent(ObjectMapper mapper) { this.postRequest = mapper.createObjectNode() .set("data", mapper.createObjectNode() - .put("type", OdsType.MJR.getPid()) + .put("type", FdoType.MJR.getPid()) .set("attributes", mapper.createObjectNode())); } } diff --git a/src/main/java/eu/dissco/backend/controller/AnnotationController.java b/src/main/java/eu/dissco/backend/controller/AnnotationController.java index f8a72bf..9c7671b 100644 --- a/src/main/java/eu/dissco/backend/controller/AnnotationController.java +++ b/src/main/java/eu/dissco/backend/controller/AnnotationController.java @@ -1,5 +1,6 @@ package eu.dissco.backend.controller; +import static eu.dissco.backend.domain.FdoType.ANNOTATION; import static eu.dissco.backend.repository.RepositoryUtils.HANDLE_STRING; import com.fasterxml.jackson.core.JsonProcessingException; @@ -56,7 +57,6 @@ @RequestMapping("/api/v1/annotation") public class AnnotationController extends BaseController { - public static final String ANNOTATION_TYPE = "ods:Annotation"; private final AnnotationService service; private final SchemaValidatorComponent schemaValidator; @@ -330,19 +330,19 @@ public ResponseEntity tombstoneAnnotation(Authentication authentication, } private AnnotationProcessingRequest getAnnotationFromRequest(AnnotationRequest requestBody) { - if (!requestBody.data().type().equals(ANNOTATION_TYPE)) { + if (!requestBody.data().type().equals(ANNOTATION)) { throw new IllegalArgumentException( - "Invalid type. Type must be " + ANNOTATION_TYPE + " but was " + requestBody.data() - .type()); + "Invalid type. Type must be " + ANNOTATION.getPid() + " or " + ANNOTATION.getName() + + " but was " + requestBody.data().type()); } return requestBody.data().attributes(); } private AnnotationEventRequest getAnnotationFromRequestEvent(BatchAnnotationRequest requestBody) { - if (!requestBody.data().type().equals(ANNOTATION_TYPE)) { + if (!requestBody.data().type().equals(ANNOTATION)) { throw new IllegalArgumentException( - "Invalid type. Type must be " + ANNOTATION_TYPE + " but was " + requestBody.data() - .type()); + "Invalid type. Type must be " + ANNOTATION.getPid() + " or " + ANNOTATION.getName() + + " but was " + requestBody.data().type()); } return requestBody.data().attributes(); } diff --git a/src/main/java/eu/dissco/backend/domain/FdoType.java b/src/main/java/eu/dissco/backend/domain/FdoType.java new file mode 100644 index 0000000..2487763 --- /dev/null +++ b/src/main/java/eu/dissco/backend/domain/FdoType.java @@ -0,0 +1,39 @@ +package eu.dissco.backend.domain; + +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; + +@Getter +public enum FdoType { + @JsonProperty("https://doi.org/21.T11148/894b1e6cad57e921764e") + @JsonAlias("ods:DigitalSpecimen") + DIGITAL_SPECIMEN("https://doi.org/21.T11148/894b1e6cad57e921764e", "ods:DigitalSpecimen"), + @JsonProperty("https://doi.org/21.T11148/bbad8c4e101e8af01115") + @JsonAlias("ods:DigitalMedia") + DIGITAL_MEDIA("https://doi.org/21.T11148/bbad8c4e101e8af01115", "ods:DigitalMedia"), + @JsonProperty("https://doi.org/21.T11148/cf458ca9ee1d44a5608f") + @JsonAlias("ods:Annotation") + ANNOTATION("https://doi.org/21.T11148/cf458ca9ee1d44a5608f", "ods:Annotation"), + @JsonProperty("https://doi.org/21.T11148/417a4f472f60f7974c12") + @JsonAlias("ods:SourceSystem") + SOURCE_SYSTEM("https://doi.org/21.T11148/417a4f472f60f7974c12", "ods:SourceSystem"), + @JsonProperty("https://doi.org/21.T11148/ce794a6f4df42eb7e77e") + @JsonAlias("ods:DataMapping") + DATA_MAPPING("https://doi.org/21.T11148/ce794a6f4df42eb7e77e", "ods:DataMapping"), + @JsonProperty("https://doi.org/21.T11148/22e71a0015cbcfba8ffa") + @JsonAlias("ods:MachineAnnotationService") + MAS("https://doi.org/21.T11148/22e71a0015cbcfba8ffa", "ods:MachineAnnotationService"), + @JsonProperty("https://doi.org/21.T11148/532ce6796e2828dd2be6") + @JsonAlias("MachineAnnotationServiceJobRecord") + MJR("https://doi.org/21.T11148/532ce6796e2828dd2be6", "MachineAnnotationServiceJobRecord"); + + private final String pid; + private final String name; + + + FdoType(String pid, String name){ + this.pid = pid; + this.name = name; + } +} diff --git a/src/main/java/eu/dissco/backend/domain/OdsType.java b/src/main/java/eu/dissco/backend/domain/OdsType.java deleted file mode 100644 index 3b9dad7..0000000 --- a/src/main/java/eu/dissco/backend/domain/OdsType.java +++ /dev/null @@ -1,20 +0,0 @@ -package eu.dissco.backend.domain; - -import lombok.Getter; - -@Getter -public enum OdsType { - DIGITAL_SPECIMEN("https://doi.org/21.T11148/894b1e6cad57e921764e"), - DIGITAL_MEDIA("https://doi.org/21.T11148/bbad8c4e101e8af01115"), - ANNOTATION("https://doi.org/21.T11148/cf458ca9ee1d44a5608f"), - SOURCE_SYSTEM("https://doi.org/21.T11148/417a4f472f60f7974c12"), - DATA_MAPPING("https://doi.org/21.T11148/ce794a6f4df42eb7e77e"), - MAS("https://doi.org/21.T11148/22e71a0015cbcfba8ffa"), - MJR("https://doi.org/21.T11148/532ce6796e2828dd2be6"); - - private final String pid; - - OdsType(String pid){ - this.pid = pid; - } -} diff --git a/src/main/java/eu/dissco/backend/domain/openapi/annotation/AnnotationRequest.java b/src/main/java/eu/dissco/backend/domain/openapi/annotation/AnnotationRequest.java index a6cd0d4..1d552f0 100644 --- a/src/main/java/eu/dissco/backend/domain/openapi/annotation/AnnotationRequest.java +++ b/src/main/java/eu/dissco/backend/domain/openapi/annotation/AnnotationRequest.java @@ -1,5 +1,6 @@ package eu.dissco.backend.domain.openapi.annotation; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.schema.AnnotationProcessingRequest; import io.swagger.v3.oas.annotations.media.Schema; @@ -9,7 +10,7 @@ public record AnnotationRequest( @Schema public record AnnotationRequestData( - @Schema(description = "Type of request. For annotations, must be \"ods:Annotation\"") String type, + @Schema(description = "Type of request. For annotations, must be \"ods:Annotation\"") FdoType type, @Schema(description = "Desired annotation") AnnotationProcessingRequest attributes) { } diff --git a/src/main/java/eu/dissco/backend/domain/openapi/annotation/BatchAnnotationRequest.java b/src/main/java/eu/dissco/backend/domain/openapi/annotation/BatchAnnotationRequest.java index b1e7540..b08120c 100644 --- a/src/main/java/eu/dissco/backend/domain/openapi/annotation/BatchAnnotationRequest.java +++ b/src/main/java/eu/dissco/backend/domain/openapi/annotation/BatchAnnotationRequest.java @@ -1,5 +1,6 @@ package eu.dissco.backend.domain.openapi.annotation; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.annotation.batch.AnnotationEventRequest; import io.swagger.v3.oas.annotations.media.Schema; @@ -9,7 +10,7 @@ public record BatchAnnotationRequest( @Schema public record BatchAnnotationRequestData( - @Schema(description = "Type of request, in this case \"ods:Annotation\"") String type, + @Schema(description = "Type of request, in this case \"ods:Annotation\"") FdoType type, AnnotationEventRequest attributes) { } diff --git a/src/main/java/eu/dissco/backend/repository/DigitalSpecimenRepository.java b/src/main/java/eu/dissco/backend/repository/DigitalSpecimenRepository.java index 5a90cb3..e69bff5 100644 --- a/src/main/java/eu/dissco/backend/repository/DigitalSpecimenRepository.java +++ b/src/main/java/eu/dissco/backend/repository/DigitalSpecimenRepository.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.exceptions.DisscoJsonBMappingException; import eu.dissco.backend.schema.DigitalSpecimen; import java.util.Date; @@ -41,7 +42,7 @@ private DigitalSpecimen mapToDigitalSpecimen(Record dbRecord) { try { return mapper.readValue(dbRecord.get(DIGITAL_SPECIMEN.DATA).data(), DigitalSpecimen.class) .withId("https://doi.org/" + dbRecord.get(DIGITAL_SPECIMEN.ID)) - .withType("ods:DigitalSpecimen") + .withType(FdoType.DIGITAL_SPECIMEN.getName()) .withDctermsIdentifier("https://doi.org/" + dbRecord.get(DIGITAL_SPECIMEN.ID)) .withOdsFdoType(dbRecord.get(DIGITAL_SPECIMEN.TYPE)) .withOdsMidsLevel(dbRecord.get(DIGITAL_SPECIMEN.MIDSLEVEL).intValue()) diff --git a/src/main/java/eu/dissco/backend/service/AnnotationService.java b/src/main/java/eu/dissco/backend/service/AnnotationService.java index b44aaef..80c078a 100644 --- a/src/main/java/eu/dissco/backend/service/AnnotationService.java +++ b/src/main/java/eu/dissco/backend/service/AnnotationService.java @@ -1,11 +1,13 @@ package eu.dissco.backend.service; +import static eu.dissco.backend.domain.FdoType.ANNOTATION; import static eu.dissco.backend.service.DigitalServiceUtils.createVersionNode; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import eu.dissco.backend.client.AnnotationClient; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.annotation.AnnotationTombstoneWrapper; import eu.dissco.backend.domain.annotation.batch.AnnotationEvent; import eu.dissco.backend.domain.annotation.batch.AnnotationEventRequest; @@ -41,7 +43,6 @@ @RequiredArgsConstructor public class AnnotationService { - private static final String ANNOTATION = "ods:Annotation"; private static final String ATTRIBUTES = "attributes"; private static final String DATA = "data"; private final AnnotationRepository repository; @@ -53,7 +54,7 @@ public class AnnotationService { public JsonApiWrapper getAnnotation(String id, String path) { var annotation = repository.getAnnotation(id); - var dataNode = new JsonApiData(id, ANNOTATION, mapper.valueToTree(annotation)); + var dataNode = new JsonApiData(id, FdoType.ANNOTATION.getName(), mapper.valueToTree(annotation)); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -67,8 +68,7 @@ public JsonApiWrapper getAnnotationByVersion(String id, int version, String path throws NotFoundException, JsonProcessingException { var eventNode = mongoRepository.getByVersion(id, version, "annotation_provenance"); validateAnnotationNode(eventNode); - var type = eventNode.get("@type").asText(); - var dataNode = new JsonApiData(id, type, eventNode); + var dataNode = new JsonApiData(id, ANNOTATION.getName(), eventNode); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -104,7 +104,7 @@ public JsonApiWrapper formatResponse(JsonNode response, String path) throws JsonProcessingException { if (response != null) { var annotationResponse = parseToAnnotation(response); - var dataNode = new JsonApiData(annotationResponse.getId(), ANNOTATION, + var dataNode = new JsonApiData(annotationResponse.getId(), ANNOTATION.getName(), response); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -224,14 +224,14 @@ private String getFullId(String id) { // Response Constructors private void validateAnnotationNode(JsonNode annotationNode) throws JsonProcessingException { - mapper.treeToValue(annotationNode.get(ANNOTATION), Annotation.class); + mapper.treeToValue(annotationNode.get(ANNOTATION.getName()), Annotation.class); } private JsonApiListResponseWrapper wrapListResponse(List annotationsPlusOne, int pageNumber, int pageSize, String path) { List dataNodePlusOne = new ArrayList<>(); annotationsPlusOne.forEach(annotation -> dataNodePlusOne.add( - new JsonApiData(annotation.getId(), ANNOTATION, + new JsonApiData(annotation.getId(), FdoType.ANNOTATION.getName(), mapper.valueToTree(annotation)))); return new JsonApiListResponseWrapper(dataNodePlusOne, pageNumber, pageSize, path); } @@ -242,7 +242,7 @@ private JsonApiListResponseWrapper wrapListResponseElasticSearchResults( List dataNodePlusOne = new ArrayList<>(); var annotationsPlusOne = elasticSearchResults.getRight(); annotationsPlusOne.forEach(annotation -> dataNodePlusOne.add( - new JsonApiData(annotation.getId(), ANNOTATION, + new JsonApiData(annotation.getId(), FdoType.ANNOTATION.getName(), mapper.valueToTree(annotation)))); return new JsonApiListResponseWrapper(dataNodePlusOne, pageNumber, pageSize, path, new JsonApiMeta(elasticSearchResults.getLeft())); @@ -252,7 +252,7 @@ private JsonApiListResponseWrapper wrapListResponse(List annotations String path) { List dataNode = new ArrayList<>(); annotations.forEach(annotation -> dataNode.add( - new JsonApiData(annotation.getId(), ANNOTATION, + new JsonApiData(annotation.getId(), ANNOTATION.getName(), mapper.valueToTree(annotation)))); return new JsonApiListResponseWrapper(dataNode, new JsonApiLinksFull(path)); } diff --git a/src/main/java/eu/dissco/backend/service/DigitalMediaService.java b/src/main/java/eu/dissco/backend/service/DigitalMediaService.java index 0ab3f0d..2d80f3b 100644 --- a/src/main/java/eu/dissco/backend/service/DigitalMediaService.java +++ b/src/main/java/eu/dissco/backend/service/DigitalMediaService.java @@ -11,7 +11,7 @@ import eu.dissco.backend.database.jooq.enums.MjrTargetType; import eu.dissco.backend.domain.DigitalMediaFull; import eu.dissco.backend.domain.MasJobRequest; -import eu.dissco.backend.domain.OdsType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.domain.jsonapi.JsonApiLinks; import eu.dissco.backend.domain.jsonapi.JsonApiLinksFull; @@ -30,7 +30,6 @@ import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; @Slf4j @@ -51,7 +50,7 @@ public JsonApiListResponseWrapper getDigitalMediaObjects(int pageNumber, int pag String path) { var mediaPlusOne = repository.getDigitalMediaObjects(pageNumber, pageSize); var dataNodePlusOne = mediaPlusOne.stream().map(media -> - new JsonApiData(media.getDctermsIdentifier(), media.getOdsFdoType(), + new JsonApiData(media.getDctermsIdentifier(), FdoType.DIGITAL_MEDIA.getName(), mapper.valueToTree(media))).toList(); return wrapResponse(dataNodePlusOne, pageNumber, pageSize, path); } @@ -59,7 +58,7 @@ public JsonApiListResponseWrapper getDigitalMediaObjects(int pageNumber, int pag public JsonApiWrapper getDigitalMediaById(String id, String path) { var mediaObject = repository.getLatestDigitalMediaObjectById(id); var dataNode = new JsonApiData(mediaObject.getDctermsIdentifier(), - mediaObject.getOdsFdoType(), mediaObject, mapper); + FdoType.DIGITAL_MEDIA.getName(), mediaObject, mapper); var linksNode = new JsonApiLinks(path); return new JsonApiWrapper(dataNode, linksNode); } @@ -79,7 +78,7 @@ public JsonApiWrapper getDigitalMediaObjectByVersion(String id, int version, Str throws JsonProcessingException, NotFoundException { var digitalMediaNode = mongoRepository.getByVersion(id, version, "digital_media_provenance"); var digitalMedia = mapResultToDigitalMedia(digitalMediaNode); - var dataNode = new JsonApiData(digitalMedia.getDctermsIdentifier(), digitalMedia.getOdsFdoType(), digitalMedia, + var dataNode = new JsonApiData(digitalMedia.getDctermsIdentifier(), FdoType.DIGITAL_MEDIA.getName(), digitalMedia, mapper); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -112,7 +111,7 @@ public List getDigitalMediaForSpecimen(String id) { var mediaList = repository.getDigitalMediaForSpecimen(id); List dataNode = new ArrayList<>(); mediaList.forEach(media -> dataNode.add( - new JsonApiData(media.getDctermsIdentifier(), media.getOdsFdoType(), mapper.valueToTree(media)))); + new JsonApiData(media.getDctermsIdentifier(), FdoType.DIGITAL_MEDIA.getName(), mapper.valueToTree(media)))); return dataNode; } @@ -136,7 +135,7 @@ public JsonApiListResponseWrapper getMass(String id, String path) { public JsonApiWrapper getOriginalDataForMedia(String targetId, String path) { var originalData = repository.getMediaOriginalData(targetId); return new JsonApiWrapper( - new JsonApiData(targetId, OdsType.DIGITAL_MEDIA.getPid(), originalData), + new JsonApiData(targetId, FdoType.DIGITAL_MEDIA.getName(), originalData), new JsonApiLinks(path)); } diff --git a/src/main/java/eu/dissco/backend/service/DigitalSpecimenService.java b/src/main/java/eu/dissco/backend/service/DigitalSpecimenService.java index a9a6dd8..5187cfa 100644 --- a/src/main/java/eu/dissco/backend/service/DigitalSpecimenService.java +++ b/src/main/java/eu/dissco/backend/service/DigitalSpecimenService.java @@ -15,7 +15,7 @@ import eu.dissco.backend.domain.DigitalSpecimenFull; import eu.dissco.backend.domain.MappingTerm; import eu.dissco.backend.domain.MasJobRequest; -import eu.dissco.backend.domain.OdsType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.TaxonMappingTerms; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.domain.jsonapi.JsonApiLinks; @@ -93,7 +93,7 @@ public JsonApiListResponseWrapper getLatestSpecimen(int pageNumber, int pageSize public JsonApiWrapper getSpecimenById(String id, String path) { var digitalSpecimen = repository.getLatestSpecimenById(id); var dataNode = new JsonApiData(digitalSpecimen.getDctermsIdentifier(), - digitalSpecimen.getOdsFdoType(), digitalSpecimen, + FdoType.DIGITAL_SPECIMEN.getName(), digitalSpecimen, mapper); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -118,7 +118,7 @@ public JsonApiListResponseWrapper getMasJobRecordsForSpecimen(String targetId, public JsonApiWrapper getOriginalDataForSpecimen(String targetId, String path) { var originalData = repository.getSpecimenOriginalData(targetId); return new JsonApiWrapper( - new JsonApiData(targetId, OdsType.DIGITAL_SPECIMEN.getPid(), originalData), + new JsonApiData(targetId, FdoType.DIGITAL_SPECIMEN.getName(), originalData), new JsonApiLinks(path)); } @@ -128,7 +128,7 @@ private JsonApiWrapper mapFullSpecimen(String id, String path, DigitalSpecimen s var attributeNode = mapper.valueToTree( new DigitalSpecimenFull(specimen, digitalMedia, annotation)); return new JsonApiWrapper( - new JsonApiData(specimen.getDctermsIdentifier(), specimen.getOdsFdoType(), attributeNode), + new JsonApiData(specimen.getDctermsIdentifier(), FdoType.DIGITAL_SPECIMEN.getName(), attributeNode), new JsonApiLinks(path)); } @@ -136,7 +136,7 @@ public JsonApiWrapper getSpecimenByVersion(String id, int version, String path) throws JsonProcessingException, NotFoundException { var specimenNode = mongoRepository.getByVersion(id, version, MONGODB_COLLECTION_NAME); var specimen = mapResultToSpecimen(specimenNode); - var dataNode = new JsonApiData(specimen.getDctermsIdentifier(), specimen.getOdsFdoType(), specimen, mapper); + var dataNode = new JsonApiData(specimen.getDctermsIdentifier(), FdoType.DIGITAL_SPECIMEN.getName(), specimen, mapper); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -167,7 +167,7 @@ private JsonApiListResponseWrapper wrapListResponse( var digitalSpecimenList = elasticSearchResults.getRight(); var dataNodePlusOne = digitalSpecimenList.stream() .map(specimen -> new JsonApiData(specimen.getDctermsIdentifier(), - specimen.getOdsFdoType(), specimen, mapper)) + FdoType.DIGITAL_SPECIMEN.getName(), specimen, mapper)) .toList(); boolean hasNext = dataNodePlusOne.size() > pageSize; var linksNode = new JsonApiLinksFull(pageNumber, pageSize, hasNext, path); @@ -180,7 +180,7 @@ private JsonApiListResponseWrapper wrapListResponseSearchResults( Pair> digitalSpecimenSearchResult, int pageNumber, int pageSize, MultiValueMap params, String path) { var dataNodePlusOne = digitalSpecimenSearchResult.getRight().stream() - .map(specimen -> new JsonApiData(specimen.getDctermsIdentifier(), specimen.getOdsFdoType(), specimen, + .map(specimen -> new JsonApiData(specimen.getDctermsIdentifier(), FdoType.DIGITAL_SPECIMEN.getName(), specimen, mapper)) .toList(); boolean hasNext = dataNodePlusOne.size() > pageSize; diff --git a/src/main/java/eu/dissco/backend/service/MachineAnnotationServiceService.java b/src/main/java/eu/dissco/backend/service/MachineAnnotationServiceService.java index fe70923..69bf7f9 100644 --- a/src/main/java/eu/dissco/backend/service/MachineAnnotationServiceService.java +++ b/src/main/java/eu/dissco/backend/service/MachineAnnotationServiceService.java @@ -6,6 +6,7 @@ import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.PathNotFoundException; import eu.dissco.backend.database.jooq.enums.MjrTargetType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.MasJobRecord; import eu.dissco.backend.domain.MasJobRequest; import eu.dissco.backend.domain.MasTarget; @@ -71,7 +72,7 @@ public JsonApiListResponseWrapper getMassForObject(JsonNode jsonNode, String pat boolean complies = checkIfMasComplies(jsonNode, masRecord); if (complies) { availableMass.add( - new JsonApiData(masRecord.getId(), "ods:MachineAnnotationService", masRecord, mapper)); + new JsonApiData(masRecord.getId(), FdoType.MAS.getName(), masRecord, mapper)); } } var links = new JsonApiLinksFull(path); @@ -99,7 +100,7 @@ public JsonApiListResponseWrapper scheduleMass(JsonNode flattenObjectData, masRequests.get(machineAnnotationService.getId()).batching()); kafkaPublisherService.sendObjectToQueue(machineAnnotationService.getOdsTopicName(), targetObject); scheduledJobs.add( - new JsonApiData(mjr.jobId(), "MachineAnnotationServiceJobRecord", mjr, mapper)); + new JsonApiData(mjr.jobId(), FdoType.MJR.getName(), mjr, mapper)); } catch (JsonProcessingException e) { log.error("Failed to send masRecord: {} to kafka", machineAnnotationService.getId()); failedRecords.add(mjr.jobId()); diff --git a/src/main/java/eu/dissco/backend/service/MasJobRecordService.java b/src/main/java/eu/dissco/backend/service/MasJobRecordService.java index 86d1caa..60a7670 100644 --- a/src/main/java/eu/dissco/backend/service/MasJobRecordService.java +++ b/src/main/java/eu/dissco/backend/service/MasJobRecordService.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import eu.dissco.backend.database.jooq.enums.JobState; import eu.dissco.backend.database.jooq.enums.MjrTargetType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.MasJobRecord; import eu.dissco.backend.domain.MasJobRecordFull; import eu.dissco.backend.domain.MasJobRequest; @@ -44,7 +45,7 @@ public JsonApiWrapper getMasJobRecordById(String masJobRecordHandle, String path "Unable to find MAS Job Record for job " + masJobRecordHandle); } var masJobRecord = masJobRecordOptional.get(); - var dataNode = new JsonApiData(masJobRecordHandle, "masJobRecord", + var dataNode = new JsonApiData(masJobRecordHandle, FdoType.MJR.getName(), mapper.valueToTree(masJobRecord)); return new JsonApiWrapper(dataNode, new JsonApiLinks(path)); } @@ -74,7 +75,7 @@ private JsonApiListResponseWrapper packageList(List masJobReco boolean hasNext = masJobRecordListPlusOne.size() > pageSize; var sublist = hasNext ? masJobRecordListPlusOne.subList(0, pageSize) : masJobRecordListPlusOne; List dataList = sublist.stream().map( - mjr -> new JsonApiData(mjr.jobHandle(), "masJobRecord", mapper.valueToTree(mjr))) + mjr -> new JsonApiData(mjr.jobHandle(), FdoType.MJR.getName(), mapper.valueToTree(mjr))) .toList(); JsonApiLinksFull linksNode; if (masJobRecordListPlusOne.isEmpty()) { diff --git a/src/test/java/eu/dissco/backend/TestUtils.java b/src/test/java/eu/dissco/backend/TestUtils.java index 76a2f02..cbb00f4 100644 --- a/src/test/java/eu/dissco/backend/TestUtils.java +++ b/src/test/java/eu/dissco/backend/TestUtils.java @@ -1,6 +1,7 @@ package eu.dissco.backend; import com.fasterxml.jackson.databind.ObjectMapper; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.jsonapi.JsonApiLinksFull; import eu.dissco.backend.schema.Agent; import eu.dissco.backend.schema.Agent.Type; @@ -44,7 +45,6 @@ public class TestUtils { public static final String ORCID = "https://orcid.org/0000-0002-XXXX-XXXX"; public static final UUID BATCH_ID = UUID.fromString("f43e4ec6-ca1c-4a88-9aac-08f6da4b0b1c"); - public static final String DIGITAL_SPECIMEN_TYPE = "https://doi.org/21.T11148/894b1e6cad57e921764e"; // Users public static Agent givenAgent() { @@ -123,13 +123,13 @@ private static DigitalSpecimen givenDigitalSpecimen(String id, String physicalId String sourceSystemId, String specimenName, String country) { return new eu.dissco.backend.schema.DigitalSpecimen() .withId(id) - .withType("ods:DigitalSpecimen") + .withType(FdoType.DIGITAL_SPECIMEN.getName()) .withDctermsIdentifier(id) .withOdsPhysicalSpecimenID(physicalId) .withOdsVersion(version) .withOdsMidsLevel(0) .withDctermsCreated(Date.from(CREATED)) - .withOdsFdoType(DIGITAL_SPECIMEN_TYPE) + .withOdsFdoType(FdoType.DIGITAL_SPECIMEN.getPid()) .withDctermsModified("03/12/2012") .withDwcDatasetName("Royal Botanic Garden Edinburgh Herbarium") .withDctermsLicense("http://creativecommons.org/licenses/by/4.0/legalcode") diff --git a/src/test/java/eu/dissco/backend/controller/AnnotationControllerTest.java b/src/test/java/eu/dissco/backend/controller/AnnotationControllerTest.java index 81998f3..034c993 100644 --- a/src/test/java/eu/dissco/backend/controller/AnnotationControllerTest.java +++ b/src/test/java/eu/dissco/backend/controller/AnnotationControllerTest.java @@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock; import eu.dissco.backend.component.SchemaValidatorComponent; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.annotation.AnnotationTargetType; import eu.dissco.backend.domain.openapi.annotation.AnnotationRequest; import eu.dissco.backend.domain.openapi.annotation.AnnotationRequest.AnnotationRequestData; @@ -363,12 +364,12 @@ private void givenAuthentication(Map claims) { public static AnnotationRequest givenAnnotationRequestObject() { return new AnnotationRequest( - new AnnotationRequestData("ods:Annotation", givenAnnotationRequest())); + new AnnotationRequestData(FdoType.ANNOTATION, givenAnnotationRequest())); } public static BatchAnnotationRequest givenBatchAnnotationRequestObject() { return new BatchAnnotationRequest(new BatchAnnotationRequestData( - "ods:Annotation", givenAnnotationEventRequest())); + FdoType.ANNOTATION, givenAnnotationEventRequest())); } } diff --git a/src/test/java/eu/dissco/backend/service/DigitalMediaServiceTest.java b/src/test/java/eu/dissco/backend/service/DigitalMediaServiceTest.java index 343bce7..2c64faf 100644 --- a/src/test/java/eu/dissco/backend/service/DigitalMediaServiceTest.java +++ b/src/test/java/eu/dissco/backend/service/DigitalMediaServiceTest.java @@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.JsonNode; import eu.dissco.backend.database.jooq.enums.MjrTargetType; import eu.dissco.backend.domain.DigitalMediaFull; -import eu.dissco.backend.domain.OdsType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.domain.jsonapi.JsonApiLinks; import eu.dissco.backend.domain.jsonapi.JsonApiListResponseWrapper; @@ -131,7 +131,7 @@ void testGetDigitalMediaById() { var mediaObject = givenDigitalMediaObject(ID); given(repository.getLatestDigitalMediaObjectById(ID)).willReturn(mediaObject); var expected = new JsonApiWrapper( - new JsonApiData(mediaObject.getDctermsIdentifier(), mediaObject.getOdsFdoType(), + new JsonApiData(mediaObject.getDctermsIdentifier(), FdoType.DIGITAL_MEDIA.getName(), MAPPER.valueToTree(mediaObject)), new JsonApiLinks(DIGITAL_MEDIA_PATH)); // When @@ -184,10 +184,8 @@ void testGetDigitalMediaByVersion() throws NotFoundException, JsonProcessingExce given(mongoRepository.getByVersion(ID, version, "digital_media_provenance")).willReturn( mongoResponse); - var type = mongoResponse.get("ods:fdoType").asText(); - var expectedResponse = new JsonApiWrapper( - new JsonApiData(DOI + ID, type, MAPPER.valueToTree(givenDigitalMediaObject(DOI + ID))), + new JsonApiData(DOI + ID, FdoType.DIGITAL_MEDIA.getName(), MAPPER.valueToTree(givenDigitalMediaObject(DOI + ID))), new JsonApiLinks(DIGITAL_MEDIA_PATH)); // When @@ -227,7 +225,7 @@ void testGetDigitalMediaForSpecimen() { var mediaObject = givenDigitalMediaObject(ID); var responseExpected = List.of(new JsonApiData( mediaObject.getDctermsIdentifier(), - mediaObject.getOdsFdoType(), + FdoType.DIGITAL_MEDIA.getName(), MAPPER.valueToTree(mediaObject))); given(repository.getDigitalMediaForSpecimen(ID)).willReturn(List.of(mediaObject)); @@ -341,7 +339,7 @@ void testGetOriginalDataForMedia() throws JsonProcessingException { // Given var expectedJson = givenMongoDBMediaResponse(); var expected = new JsonApiWrapper( - new JsonApiData(ID, OdsType.DIGITAL_MEDIA.getPid(), expectedJson), + new JsonApiData(ID, FdoType.DIGITAL_MEDIA.getName(), expectedJson), new JsonApiLinks(SANDBOX_URI)); given(repository.getMediaOriginalData(ID)).willReturn(expectedJson); diff --git a/src/test/java/eu/dissco/backend/service/DigitalSpecimenServiceTest.java b/src/test/java/eu/dissco/backend/service/DigitalSpecimenServiceTest.java index 219ad7e..23db284 100644 --- a/src/test/java/eu/dissco/backend/service/DigitalSpecimenServiceTest.java +++ b/src/test/java/eu/dissco/backend/service/DigitalSpecimenServiceTest.java @@ -1,6 +1,5 @@ package eu.dissco.backend.service; -import static eu.dissco.backend.TestUtils.DIGITAL_SPECIMEN_TYPE; import static eu.dissco.backend.TestUtils.DOI; import static eu.dissco.backend.TestUtils.ID; import static eu.dissco.backend.TestUtils.MAPPER; @@ -40,7 +39,7 @@ import eu.dissco.backend.database.jooq.enums.MjrTargetType; import eu.dissco.backend.domain.DigitalMediaFull; import eu.dissco.backend.domain.DigitalSpecimenFull; -import eu.dissco.backend.domain.OdsType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.TaxonMappingTerms; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.domain.jsonapi.JsonApiLinks; @@ -207,7 +206,7 @@ void testGetSpecimenByIdFull() { digitalMedia, annotations)); var expected = new JsonApiWrapper( - new JsonApiData(ID, digitalSpecimen.getOdsFdoType(), attributeNode), + new JsonApiData(ID, FdoType.DIGITAL_SPECIMEN.getName(), attributeNode), new JsonApiLinks(ANNOTATION_PATH)); // When @@ -234,7 +233,7 @@ void testGetSpecimenByVersionFull() throws Exception { var attributeNode = MAPPER.valueToTree( new DigitalSpecimenFull(digitalSpecimenWrapper, digitalMedia, annotations)); var expected = new JsonApiWrapper( - new JsonApiData(DOI + ID, DIGITAL_SPECIMEN_TYPE, attributeNode), + new JsonApiData(DOI + ID, FdoType.DIGITAL_SPECIMEN.getName(), attributeNode), new JsonApiLinks(ANNOTATION_PATH)); // When @@ -254,7 +253,7 @@ void testSpecimenByVersion() throws Exception { given(mongoRepository.getByVersion(ID, version, "digital_specimen_provenance")).willReturn( specimen); var responseExpected = new JsonApiWrapper( - new JsonApiData(DOI + ID, DIGITAL_SPECIMEN_TYPE, + new JsonApiData(DOI + ID, FdoType.DIGITAL_SPECIMEN.getName(), givenSpecimenWrapper, MAPPER), new JsonApiLinks(SPECIMEN_PATH) @@ -576,7 +575,7 @@ void testGetOriginalDataForSpecimen() throws JsonProcessingException { // Given var expectedJson = givenMongoDBResponse(); var expected = new JsonApiWrapper( - new JsonApiData(ID, OdsType.DIGITAL_SPECIMEN.getPid(), expectedJson), + new JsonApiData(ID, FdoType.DIGITAL_SPECIMEN.getName(), expectedJson), new JsonApiLinks(SANDBOX_URI)); given(repository.getSpecimenOriginalData(ID)).willReturn(expectedJson); @@ -605,7 +604,6 @@ private JsonNode givenMongoDBResponse() throws JsonProcessingException { "ods:sourceSystemID": "https://hdl.handle.net/20.5000.1025/3XA-8PT-SAY", "dcterms:license": "http://creativecommons.org/licenses/by/4.0/legalcode", "dcterms:modified": "03/12/2012", - "dwc:preparations": "", "ods:organisationID": "https://ror.org/0349vqz63", "ods:organisationName": "Royal Botanic Garden Edinburgh Herbarium", "dwc:datasetName": "Royal Botanic Garden Edinburgh Herbarium", diff --git a/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java b/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java index aa2c3fd..d86911b 100644 --- a/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java +++ b/src/test/java/eu/dissco/backend/service/MasJobRecordServiceTest.java @@ -21,6 +21,7 @@ import eu.dissco.backend.database.jooq.enums.JobState; import eu.dissco.backend.database.jooq.enums.MjrTargetType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.MasJobRecord; import eu.dissco.backend.domain.annotation.AnnotationTargetType; import eu.dissco.backend.domain.jsonapi.JsonApiData; @@ -59,7 +60,7 @@ void setup() { void testGetMasJobRecordById() throws Exception { // Given var expected = new JsonApiWrapper( - new JsonApiData(JOB_ID, "masJobRecord", givenMasJobRecordFullScheduled(), + new JsonApiData(JOB_ID, FdoType.MJR.getName(), givenMasJobRecordFullScheduled(), MAPPER), new JsonApiLinks(MJR_URI) ); diff --git a/src/test/java/eu/dissco/backend/utils/DigitalMediaObjectUtils.java b/src/test/java/eu/dissco/backend/utils/DigitalMediaObjectUtils.java index e67cce0..59278bd 100644 --- a/src/test/java/eu/dissco/backend/utils/DigitalMediaObjectUtils.java +++ b/src/test/java/eu/dissco/backend/utils/DigitalMediaObjectUtils.java @@ -1,12 +1,12 @@ package eu.dissco.backend.utils; -import static eu.dissco.backend.TestUtils.CREATED; import static eu.dissco.backend.TestUtils.DOI; import static eu.dissco.backend.TestUtils.ID_ALT; import static eu.dissco.backend.TestUtils.MAPPER; import static eu.dissco.backend.TestUtils.SANDBOX_URI; import static eu.dissco.backend.TestUtils.SOURCE_SYSTEM_ID_1; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.domain.jsonapi.JsonApiLinks; import eu.dissco.backend.domain.jsonapi.JsonApiLinksFull; @@ -16,7 +16,6 @@ import eu.dissco.backend.schema.DigitalMedia.DctermsType; import eu.dissco.backend.schema.DigitalMedia.OdsStatus; import eu.dissco.backend.schema.EntityRelationship; -import java.time.Instant; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -25,12 +24,11 @@ public class DigitalMediaObjectUtils { public static final String DIGITAL_MEDIA_URI = "/api/v1/digitalmedia"; public static final String DIGITAL_MEDIA_PATH = SANDBOX_URI + DIGITAL_MEDIA_URI; - public static final String DIGITAL_MEDIA_FDO_TYPE = "https://doi.org/21.T11148/bbad8c4e101e8af01115"; // Media Object public static DigitalMedia givenDigitalMediaObject(String id) { - return givenDigitalMediaObjectData(id, 1, CREATED, DIGITAL_MEDIA_FDO_TYPE, DOI + ID_ALT, - "https://dissco.com", "image/jpeg"); + return givenDigitalMediaObjectData(id, 1, DOI + ID_ALT + ); } public static DigitalMedia givenDigitalMediaObject(String mediaId, String specimenId) { @@ -39,15 +37,15 @@ public static DigitalMedia givenDigitalMediaObject(String mediaId, String specim public static DigitalMedia givenDigitalMediaObject(String mediaId, String specimenId, int version) { - return givenDigitalMediaObjectData(mediaId, version, CREATED, DIGITAL_MEDIA_FDO_TYPE, - specimenId, - "https://dissco.com", "image/jpeg"); + return givenDigitalMediaObjectData(mediaId, version, + specimenId + ); } // JsonApiData public static JsonApiData givenDigitalMediaJsonApiData(String id) { var mediaObject = givenDigitalMediaObject(id); - return new JsonApiData(mediaObject.getDctermsIdentifier(), mediaObject.getOdsFdoType(), mediaObject, MAPPER); + return new JsonApiData(mediaObject.getDctermsIdentifier(), FdoType.DIGITAL_MEDIA.getName(), mediaObject, MAPPER); } public static JsonApiWrapper givenDigitalMediaJsonResponse(String path, String mediaId) { @@ -72,18 +70,18 @@ public static JsonApiListResponseWrapper givenDigitalMediaJsonResponse(String pa } private static DigitalMedia givenDigitalMediaObjectData(String mediaId, int version, - Instant created, String type, String specimenId, String url, String contentType) { + String specimenId) { return new DigitalMedia() .withId(mediaId) - .withType("ods:DigitalMedia") + .withType(FdoType.DIGITAL_MEDIA.getName()) .withDctermsIdentifier(mediaId) .withOdsVersion(version) .withOdsStatus(OdsStatus.ACTIVE) - .withDctermsCreated(Date.from(created)) - .withOdsFdoType(type) - .withAcAccessURI(url) + .withDctermsCreated(Date.from(eu.dissco.backend.TestUtils.CREATED)) + .withOdsFdoType(FdoType.DIGITAL_MEDIA.getPid()) + .withAcAccessURI("https://dissco.com") .withDctermsType(DctermsType.STILL_IMAGE) - .withDctermsFormat(contentType) + .withDctermsFormat("image/jpeg") .withOdsSourceSystemID(SOURCE_SYSTEM_ID_1) .withOdsHasEntityRelationships(List.of( new EntityRelationship().withType("ods:EntityRelationship") diff --git a/src/test/java/eu/dissco/backend/utils/MasJobRecordUtils.java b/src/test/java/eu/dissco/backend/utils/MasJobRecordUtils.java index f36bc36..cf0e1dd 100644 --- a/src/test/java/eu/dissco/backend/utils/MasJobRecordUtils.java +++ b/src/test/java/eu/dissco/backend/utils/MasJobRecordUtils.java @@ -8,6 +8,7 @@ import eu.dissco.backend.database.jooq.enums.JobState; import eu.dissco.backend.database.jooq.enums.MjrTargetType; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.MasJobRecord; import eu.dissco.backend.domain.MasJobRecordFull; import eu.dissco.backend.domain.jsonapi.JsonApiData; @@ -101,7 +102,7 @@ public static JsonApiListResponseWrapper givenMjrListResponse(int pageSize, int var linksNode = new JsonApiLinksFull(pageNum, pageSize, hasNext, MJR_URI); var mjr = givenMasJobRecordFullScheduled(); var dataList = Collections.nCopies(pageSize, - new JsonApiData(JOB_ID, "masJobRecord", MAPPER.valueToTree(mjr))); + new JsonApiData(JOB_ID, FdoType.MJR.getName(), MAPPER.valueToTree(mjr))); return new JsonApiListResponseWrapper(dataList, linksNode); } } diff --git a/src/test/java/eu/dissco/backend/utils/SpecimenUtils.java b/src/test/java/eu/dissco/backend/utils/SpecimenUtils.java index 1f14212..9f774d3 100644 --- a/src/test/java/eu/dissco/backend/utils/SpecimenUtils.java +++ b/src/test/java/eu/dissco/backend/utils/SpecimenUtils.java @@ -5,6 +5,7 @@ import static eu.dissco.backend.TestUtils.SANDBOX_URI; import static eu.dissco.backend.TestUtils.givenDigitalSpecimenWrapper; +import eu.dissco.backend.domain.FdoType; import eu.dissco.backend.domain.jsonapi.JsonApiData; import eu.dissco.backend.schema.DigitalSpecimen; import java.util.ArrayList; @@ -21,13 +22,13 @@ public static List givenDigitalSpecimenJsonApiData( List dataNode = new ArrayList<>(); digitalSpecimenList.forEach(specimenWrapper -> dataNode.add( new JsonApiData(specimenWrapper.getDctermsIdentifier(), - specimenWrapper.getOdsFdoType(), MAPPER.valueToTree(specimenWrapper)))); + FdoType.DIGITAL_SPECIMEN.getName(), MAPPER.valueToTree(specimenWrapper)))); return dataNode; } public static JsonApiData givenDigitalSpecimenJsonApiData( DigitalSpecimen specimenWrapper) { - return new JsonApiData(specimenWrapper.getDctermsIdentifier(), specimenWrapper.getOdsFdoType(), + return new JsonApiData(specimenWrapper.getDctermsIdentifier(), FdoType.DIGITAL_SPECIMEN.getName(), MAPPER.valueToTree(specimenWrapper)); } @@ -43,7 +44,7 @@ public static List givenDigitalSpecimenJsonApiDataList(int qty) { List digitalSpecimen = givenDigitalSpecimenList(qty); List dataNode = new ArrayList<>(); digitalSpecimen.forEach( - s -> dataNode.add(new JsonApiData(s.getDctermsIdentifier(), s.getOdsFdoType(), MAPPER.valueToTree(s)))); + s -> dataNode.add(new JsonApiData(s.getDctermsIdentifier(), FdoType.DIGITAL_SPECIMEN.getName(), MAPPER.valueToTree(s)))); return dataNode; } From e88491461bd8b2f458fe23f1880005193f1e871c Mon Sep 17 00:00:00 2001 From: southeo Date: Mon, 2 Dec 2024 10:18:35 +0100 Subject: [PATCH 2/2] fix mas fdo type --- src/main/java/eu/dissco/backend/domain/FdoType.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/dissco/backend/domain/FdoType.java b/src/main/java/eu/dissco/backend/domain/FdoType.java index 2487763..1cb710f 100644 --- a/src/main/java/eu/dissco/backend/domain/FdoType.java +++ b/src/main/java/eu/dissco/backend/domain/FdoType.java @@ -9,21 +9,27 @@ public enum FdoType { @JsonProperty("https://doi.org/21.T11148/894b1e6cad57e921764e") @JsonAlias("ods:DigitalSpecimen") DIGITAL_SPECIMEN("https://doi.org/21.T11148/894b1e6cad57e921764e", "ods:DigitalSpecimen"), + @JsonProperty("https://doi.org/21.T11148/bbad8c4e101e8af01115") @JsonAlias("ods:DigitalMedia") DIGITAL_MEDIA("https://doi.org/21.T11148/bbad8c4e101e8af01115", "ods:DigitalMedia"), + @JsonProperty("https://doi.org/21.T11148/cf458ca9ee1d44a5608f") @JsonAlias("ods:Annotation") ANNOTATION("https://doi.org/21.T11148/cf458ca9ee1d44a5608f", "ods:Annotation"), + @JsonProperty("https://doi.org/21.T11148/417a4f472f60f7974c12") @JsonAlias("ods:SourceSystem") SOURCE_SYSTEM("https://doi.org/21.T11148/417a4f472f60f7974c12", "ods:SourceSystem"), + @JsonProperty("https://doi.org/21.T11148/ce794a6f4df42eb7e77e") @JsonAlias("ods:DataMapping") DATA_MAPPING("https://doi.org/21.T11148/ce794a6f4df42eb7e77e", "ods:DataMapping"), - @JsonProperty("https://doi.org/21.T11148/22e71a0015cbcfba8ffa") + + @JsonProperty("https://doi.org/21.T11148/a369e128df5ef31044d4") @JsonAlias("ods:MachineAnnotationService") - MAS("https://doi.org/21.T11148/22e71a0015cbcfba8ffa", "ods:MachineAnnotationService"), + MAS("https://doi.org/21.T11148/a369e128df5ef31044d4", "ods:MachineAnnotationService"), + @JsonProperty("https://doi.org/21.T11148/532ce6796e2828dd2be6") @JsonAlias("MachineAnnotationServiceJobRecord") MJR("https://doi.org/21.T11148/532ce6796e2828dd2be6", "MachineAnnotationServiceJobRecord");