From b42303c782f98a5ecd6bea9d538bd19b065091b2 Mon Sep 17 00:00:00 2001 From: southeo Date: Tue, 8 Oct 2024 13:17:53 +0200 Subject: [PATCH] update fdo requests --- .../backend/domain/FdoProfileAttributes.java | 2 +- .../backend/properties/FdoProperties.java | 4 ---- .../backend/service/FdoRecordService.java | 14 +++----------- .../orchestration/backend/testutils/TestUtils.java | 5 +---- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/main/java/eu/dissco/orchestration/backend/domain/FdoProfileAttributes.java b/src/main/java/eu/dissco/orchestration/backend/domain/FdoProfileAttributes.java index 1bd7624..064e455 100644 --- a/src/main/java/eu/dissco/orchestration/backend/domain/FdoProfileAttributes.java +++ b/src/main/java/eu/dissco/orchestration/backend/domain/FdoProfileAttributes.java @@ -10,7 +10,7 @@ public enum FdoProfileAttributes { SOURCE_DATA_STANDARD("sourceDataStandard"), // Source System SOURCE_SYSTEM_NAME("sourceSystemName"), - MAS_NAME("masName"); + MAS_NAME("machineAnnotationServiceName"); private final String attribute; diff --git a/src/main/java/eu/dissco/orchestration/backend/properties/FdoProperties.java b/src/main/java/eu/dissco/orchestration/backend/properties/FdoProperties.java index 6ec7d30..41bf3f1 100644 --- a/src/main/java/eu/dissco/orchestration/backend/properties/FdoProperties.java +++ b/src/main/java/eu/dissco/orchestration/backend/properties/FdoProperties.java @@ -17,8 +17,4 @@ public class FdoProperties { @NotBlank private String masType = "https://doi.org/21.T11148/22e71a0015cbcfba8ffa"; - @NotBlank - private String issuedForAgent = "https://ror.org/0566bfb96"; - - } diff --git a/src/main/java/eu/dissco/orchestration/backend/service/FdoRecordService.java b/src/main/java/eu/dissco/orchestration/backend/service/FdoRecordService.java index eb89da3..ec41468 100644 --- a/src/main/java/eu/dissco/orchestration/backend/service/FdoRecordService.java +++ b/src/main/java/eu/dissco/orchestration/backend/service/FdoRecordService.java @@ -1,6 +1,5 @@ package eu.dissco.orchestration.backend.service; -import static eu.dissco.orchestration.backend.domain.FdoProfileAttributes.ISSUED_FOR_AGENT; import static eu.dissco.orchestration.backend.domain.FdoProfileAttributes.MAS_NAME; import static eu.dissco.orchestration.backend.domain.FdoProfileAttributes.SOURCE_DATA_STANDARD; import static eu.dissco.orchestration.backend.domain.FdoProfileAttributes.SOURCE_SYSTEM_NAME; @@ -9,7 +8,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ArrayNode; -import com.fasterxml.jackson.databind.node.ObjectNode; import eu.dissco.orchestration.backend.domain.ObjectType; import eu.dissco.orchestration.backend.properties.FdoProperties; import eu.dissco.orchestration.backend.schema.DataMappingRequest; @@ -67,17 +65,17 @@ private JsonNode buildRequestAttributes(Object object, ObjectType type) { } private JsonNode buildMappingAttributes(DataMappingRequest mapping) { - return buildGeneralAttributes() + return mapper.createObjectNode() .put(SOURCE_DATA_STANDARD.getAttribute(), mapping.getOdsMappingDataStandard().toString()); } private JsonNode buildMasAttributes(MachineAnnotationServiceRequest mas) { - return buildGeneralAttributes() + return mapper.createObjectNode() .put(MAS_NAME.getAttribute(), mas.getSchemaName()); } private JsonNode buildSourceSystemAttributes(SourceSystemRequest sourceSystemRequest) { - return buildGeneralAttributes() + return mapper.createObjectNode() .put(SOURCE_SYSTEM_NAME.getAttribute(), sourceSystemRequest.getSchemaName()); } @@ -95,10 +93,4 @@ private String getFdoType(ObjectType type) { default -> throw new IllegalStateException(); } } - - private ObjectNode buildGeneralAttributes() { - return mapper.createObjectNode() - .put(ISSUED_FOR_AGENT.getAttribute(), fdoProperties.getIssuedForAgent()); - } - } diff --git a/src/test/java/eu/dissco/orchestration/backend/testutils/TestUtils.java b/src/test/java/eu/dissco/orchestration/backend/testutils/TestUtils.java index 0aba4b8..a1835f6 100644 --- a/src/test/java/eu/dissco/orchestration/backend/testutils/TestUtils.java +++ b/src/test/java/eu/dissco/orchestration/backend/testutils/TestUtils.java @@ -374,8 +374,7 @@ public static JsonNode givenMasHandleRequest() throws Exception { "data": { "type": "https://doi.org/21.T11148/22e71a0015cbcfba8ffa", "attributes": { - "issuedForAgent": "https://ror.org/0566bfb96", - "masName":"A Machine Annotation Service" + "machineAnnotationServiceName":"A Machine Annotation Service" } } }"""); @@ -387,7 +386,6 @@ public static JsonNode givenSourceSystemHandleRequest() throws Exception { "data": { "type": "https://doi.org/21.T11148/417a4f472f60f7974c12", "attributes": { - "issuedForAgent": "https://ror.org/0566bfb96", "sourceSystemName":"Naturalis Tunicate DWCA endpoint" } } @@ -400,7 +398,6 @@ public static JsonNode givenMappingHandleRequest() throws Exception { "data": { "type": "https://doi.org/21.T11148/ce794a6f4df42eb7e77e", "attributes": { - "issuedForAgent": "https://ror.org/0566bfb96", "sourceDataStandard": "dwc" } }