From f74f793cfc3da45a87571655b865eeb1f98a7b92 Mon Sep 17 00:00:00 2001 From: Carlos Schmidt <18703981+carlos-schmidt@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:58:18 +0100 Subject: [PATCH 1/3] Add submodel-only option --- .../de/fraunhofer/iosb/app/aas/AasAgent.java | 117 +++++++++++------- .../iosb/app/controller/AasController.java | 4 +- .../model/configuration/Configuration.java | 11 ++ .../iosb/app/sync/Synchronizer.java | 19 ++- .../fraunhofer/iosb/app/aas/AasAgentTest.java | 2 +- example/configurations/provider.properties | 1 + ...ataspaceconnector-configuration.properties | 1 + 7 files changed, 99 insertions(+), 56 deletions(-) diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/aas/AasAgent.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/aas/AasAgent.java index e7ef9693..23c7725d 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/aas/AasAgent.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/aas/AasAgent.java @@ -15,10 +15,30 @@ */ package de.fraunhofer.iosb.app.aas; +import static java.lang.String.format; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Objects; + +import org.eclipse.edc.spi.EdcException; + import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; + import de.fraunhofer.iosb.app.Logger; -import de.fraunhofer.iosb.app.model.aas.*; +import de.fraunhofer.iosb.app.model.aas.CustomAssetAdministrationShell; +import de.fraunhofer.iosb.app.model.aas.CustomAssetAdministrationShellEnvironment; +import de.fraunhofer.iosb.app.model.aas.CustomConceptDescription; +import de.fraunhofer.iosb.app.model.aas.CustomSubmodel; +import de.fraunhofer.iosb.app.model.aas.CustomSubmodelElement; +import de.fraunhofer.iosb.app.model.aas.CustomSubmodelElementCollection; +import de.fraunhofer.iosb.app.model.aas.Identifier; import de.fraunhofer.iosb.app.util.AASUtil; import de.fraunhofer.iosb.app.util.Encoder; import de.fraunhofer.iosb.app.util.HttpRestClient; @@ -29,14 +49,6 @@ import io.adminshell.aas.v3.model.impl.DefaultSubmodel; import jakarta.ws.rs.core.Response; import okhttp3.OkHttpClient; -import org.eclipse.edc.spi.EdcException; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.*; - -import static java.lang.String.format; /** * Communicating with AAS service @@ -123,11 +135,11 @@ public Response deleteModel(URL aasServiceUrl, String element) { * @return AAS model enriched with each elements access URL as string in assetId * field. */ - public CustomAssetAdministrationShellEnvironment getAasEnvWithUrls(URL aasServiceUrl) + public CustomAssetAdministrationShellEnvironment getAasEnvWithUrls(URL aasServiceUrl, boolean onlySubmodels) throws IOException, DeserializationException { var aasServiceUrlString = aasServiceUrl.toString(); - var model = readModel(aasServiceUrl); + var model = readModel(aasServiceUrl, onlySubmodels); // Add urls to all shells model.getAssetAdministrationShells().forEach(shell -> shell.setSourceUrl( format("%s/shells/%s", aasServiceUrlString, @@ -139,9 +151,9 @@ public CustomAssetAdministrationShellEnvironment getAasEnvWithUrls(URL aasServic Encoder.encodeBase64(submodel.getIdentification().getId()))); submodel.getSubmodelElements() .forEach(elem -> putUrlRec( - format("%s/submodels/%s/submodel/submodel-elements", aasServiceUrlString, - Encoder.encodeBase64(submodel.getIdentification().getId())), - elem)); + format("%s/submodels/%s/submodel/submodel-elements", aasServiceUrlString, + Encoder.encodeBase64(submodel.getIdentification().getId())), + elem)); }); model.getSubmodels().forEach(submodel -> AASUtil.getAllSubmodelElements(submodel) .forEach(element -> element.setSourceUrl( @@ -158,36 +170,53 @@ public CustomAssetAdministrationShellEnvironment getAasEnvWithUrls(URL aasServic /** * Returns the AAS model. */ - private CustomAssetAdministrationShellEnvironment readModel(URL aasServiceUrl) + private CustomAssetAdministrationShellEnvironment readModel(URL aasServiceUrl, boolean onlySubmodels) throws IOException, DeserializationException { + var aasEnv = new CustomAssetAdministrationShellEnvironment(); - String shellResponse; - String conceptResponse; - String submodelResponse; + URL shellsUrl; + URL conceptDescriptionsUrl; + URL submodelUrl; try { - shellResponse = - Objects.requireNonNull(httpRestClient.get(aasServiceUrl.toURI().resolve("/shells").toURL()).body()).string(); - submodelResponse = - Objects.requireNonNull(httpRestClient.get(aasServiceUrl.toURI().resolve("/submodels").toURL()).body()).string(); - conceptResponse = Objects.requireNonNull(httpRestClient.get(aasServiceUrl.toURI().resolve("/concept" + - "-descriptions").toURL()).body()) - .string(); - } catch (URISyntaxException e) { - throw new EdcException(e.getMessage()); + submodelUrl = aasServiceUrl.toURI().resolve("/submodels").toURL(); + shellsUrl = aasServiceUrl.toURI().resolve("/shells").toURL(); + conceptDescriptionsUrl = aasServiceUrl.toURI().resolve("/concept-descriptions").toURL(); + } catch (URISyntaxException resolveUriException) { + throw new EdcException( + format("Error while building URLs for reading from the AAS Service at %s", aasServiceUrl), + resolveUriException); } - CustomAssetAdministrationShell[] shells = objectMapper.readValue(shellResponse, - CustomAssetAdministrationShell[].class); - CustomConceptDescription[] conceptDescriptions = objectMapper.readValue(conceptResponse, - CustomConceptDescription[].class); + aasEnv.setSubmodels(readSubmodels(submodelUrl, onlySubmodels)); + if (!onlySubmodels) { + aasEnv.setAssetAdministrationShells(readShells(shellsUrl)); + aasEnv.setConceptDescriptions(readConceptDescriptions(conceptDescriptionsUrl)); + } + return aasEnv; + } + + private List readConceptDescriptions(URL conceptDescriptionsUrl) throws IOException { - // Because of SMCs "value" field, submodels have to be parsed manually + var conceptResponse = Objects.requireNonNull(httpRestClient.get(conceptDescriptionsUrl).body()).string(); + + return Arrays.asList(objectMapper.readValue(conceptResponse, CustomConceptDescription[].class)); + } - // First, parse into full admin-shell.io submodels: + private List readShells(URL shellsUrl) throws IOException { + var shellHttpResponse = Objects.requireNonNull(httpRestClient.get(shellsUrl).body()).string(); + + return Arrays.asList(objectMapper.readValue(shellHttpResponse, CustomAssetAdministrationShell[].class)); + } + + private List readSubmodels(URL submodelUrl, boolean onlySubmodels) + throws IOException, DeserializationException { + var submodelHttpResponse = Objects.requireNonNull(httpRestClient.get(submodelUrl).body()).string(); + + // First, parse into "full" admin-shell.io submodels: JsonDeserializer jsonDeserializer = new JsonDeserializer(); - List submodels = jsonDeserializer.readReferables(submodelResponse, DefaultSubmodel.class); + List submodels = jsonDeserializer.readReferables(submodelHttpResponse, DefaultSubmodel.class); - // Now, create custom submodels from the data of the full submodels + // Now, create customSubmodels from the "full" submodels List customSubmodels = new ArrayList<>(); for (Submodel submodel : submodels) { var customSubmodel = new CustomSubmodel(); @@ -197,20 +226,14 @@ private CustomAssetAdministrationShellEnvironment readModel(URL aasServiceUrl) customSubmodel.setIdentification(customIdentification); customSubmodel.setIdShort(submodel.getIdShort()); - - // Recursively add submodelElements - var customElements = AASUtil.getCustomSubmodelElementStructureFromSubmodel(submodel); - customSubmodel.setSubmodelElements((List) customElements); - + if (!onlySubmodels) { + // Recursively add submodelElements + var customElements = AASUtil.getCustomSubmodelElementStructureFromSubmodel(submodel); + customSubmodel.setSubmodelElements((List) customElements); + } customSubmodels.add(customSubmodel); } - var aasEnv = new CustomAssetAdministrationShellEnvironment(); - - aasEnv.setAssetAdministrationShells(Arrays.asList(shells)); - aasEnv.setSubmodels(customSubmodels); - aasEnv.setConceptDescriptions(Arrays.asList(conceptDescriptions)); - - return aasEnv; + return customSubmodels; } /** diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/controller/AasController.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/controller/AasController.java index c8602379..e74921c9 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/controller/AasController.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/controller/AasController.java @@ -70,10 +70,10 @@ public Response handleRequest(RequestType requestType, URL url, String... reques * @throws DeserializationException AAS from service could not be deserialized * @throws IOException Communication with AAS service failed */ - public CustomAssetAdministrationShellEnvironment getAasModelWithUrls(URL aasServiceUrl) + public CustomAssetAdministrationShellEnvironment getAasModelWithUrls(URL aasServiceUrl, boolean onlySubmodels) throws IOException, DeserializationException { Objects.requireNonNull(aasServiceUrl); - return aasAgent.getAasEnvWithUrls(aasServiceUrl); + return aasAgent.getAasEnvWithUrls(aasServiceUrl, onlySubmodels); } /** diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/configuration/Configuration.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/configuration/Configuration.java index 5d1d37ee..f98e5d12 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/configuration/Configuration.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/configuration/Configuration.java @@ -43,6 +43,9 @@ public class Configuration { @JsonProperty(SETTINGS_PREFIX + "syncPeriod") private int syncPeriod = 5; // Seconds + + @JsonProperty(SETTINGS_PREFIX + "onlySubmodels") + private boolean onlySubmodels = false; @JsonProperty(SETTINGS_PREFIX + "exposeSelfDescription") private boolean exposeSelfDescription = true; @@ -80,6 +83,14 @@ public int getSyncPeriod() { return syncPeriod; } + public boolean isOnlySubmodels() { + return onlySubmodels; + } + + public void setOnlySubmodels(boolean onlySubmodels) { + this.onlySubmodels = onlySubmodels; + } + public boolean isExposeSelfDescription() { return exposeSelfDescription; } diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/sync/Synchronizer.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/sync/Synchronizer.java index 3271906b..a4c06c2a 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/sync/Synchronizer.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/sync/Synchronizer.java @@ -18,6 +18,7 @@ import de.fraunhofer.iosb.app.controller.AasController; import de.fraunhofer.iosb.app.controller.ResourceController; import de.fraunhofer.iosb.app.model.aas.*; +import de.fraunhofer.iosb.app.model.configuration.Configuration; import de.fraunhofer.iosb.app.model.ids.SelfDescription; import de.fraunhofer.iosb.app.model.ids.SelfDescriptionChangeListener; import de.fraunhofer.iosb.app.model.ids.SelfDescriptionRepository; @@ -43,12 +44,14 @@ public class Synchronizer implements SelfDescriptionChangeListener { private final SelfDescriptionRepository selfDescriptionRepository; private final AasController aasController; private final ResourceController resourceController; + private final Configuration configuration; public Synchronizer(SelfDescriptionRepository selfDescriptionRepository, AasController aasController, ResourceController resourceController) { this.selfDescriptionRepository = selfDescriptionRepository; this.aasController = aasController; this.resourceController = resourceController; + this.configuration = Configuration.getInstance(); } /** @@ -62,10 +65,12 @@ public void synchronize() { } private void synchronize(URL aasServiceUrl) { + var onlySubmodels = this.configuration.isOnlySubmodels(); + var oldSelfDescription = selfDescriptionRepository.getSelfDescription(aasServiceUrl); - CustomAssetAdministrationShellEnvironment newEnvironment; + var newEnvironment = fetchCurrentAasModel(aasServiceUrl, onlySubmodels); - newEnvironment = fetchCurrentAasModel(aasServiceUrl); + // Only load submodels or shells, conceptDescriptions, submodelElements as well? if (Objects.nonNull(oldSelfDescription)) { var oldEnvironment = oldSelfDescription.getEnvironment(); @@ -77,9 +82,10 @@ private void synchronize(URL aasServiceUrl) { // If the element exists in oldEnvironment, copy the old elements into // newEnvironment, already having an idsContractId/idsAssetId syncShell(newEnvironment, oldEnvironment); - syncSubmodel(newEnvironment, oldEnvironment); syncConceptDescription(newEnvironment, oldEnvironment); + syncSubmodel(newEnvironment, oldEnvironment); + removeOldElements(newEnvironment, oldEnvironment); // Finally, update the self description @@ -88,11 +94,11 @@ private void synchronize(URL aasServiceUrl) { selfDescriptionRepository.updateSelfDescription(aasServiceUrl, newEnvironment); } - private CustomAssetAdministrationShellEnvironment fetchCurrentAasModel(URL aasServiceUrl) { + private CustomAssetAdministrationShellEnvironment fetchCurrentAasModel(URL aasServiceUrl, boolean onlySubmodels) { CustomAssetAdministrationShellEnvironment newEnvironment; try { // Fetch current AAS model from AAS service - newEnvironment = aasController.getAasModelWithUrls(aasServiceUrl); + newEnvironment = aasController.getAasModelWithUrls(aasServiceUrl, onlySubmodels); } catch (IOException aasServiceUnreachableException) { throw new EdcException(format("Could not reach AAS service (%s): %s", aasServiceUrl, aasServiceUnreachableException.getMessage())); @@ -105,7 +111,8 @@ private CustomAssetAdministrationShellEnvironment fetchCurrentAasModel(URL aasSe private void addNewElements(CustomAssetAdministrationShellEnvironment newEnvironment) { var envElements = AASUtil.getAllElements(newEnvironment); - addAssetsContracts(envElements.stream().filter(element -> Objects.isNull(element.getIdsAssetId()) || Objects.isNull(element.getIdsContractId())) + addAssetsContracts(envElements.stream().filter( + element -> Objects.isNull(element.getIdsAssetId()) || Objects.isNull(element.getIdsContractId())) .toList()); } diff --git a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java index d166d9db..15c23826 100644 --- a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java +++ b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java @@ -74,7 +74,7 @@ public void testGetAasEnvWithUrls() throws IOException, DeserializationException var shouldBeResult = FileManager.loadResource("selfDescriptionWithAccessURLS.json"); var result = new ObjectMapper().writeValueAsString( - aasAgent.getAasEnvWithUrls(new URL(HTTP_LOCALHOST_8080))); + aasAgent.getAasEnvWithUrls(new URL(HTTP_LOCALHOST_8080), true)); result = result.replace("\n", "").replace(" ", ""); assertEquals(shouldBeResult, result); diff --git a/example/configurations/provider.properties b/example/configurations/provider.properties index a4e79700..fce08b48 100644 --- a/example/configurations/provider.properties +++ b/example/configurations/provider.properties @@ -2,6 +2,7 @@ # Supply AAS model + (port XOR AAS service config) for an AAS service internally started by the extension edc.aas.localAASModelPath=./example/resources/FestoDemoAAS.json edc.aas.localAASServicePort=8080 +edc.aas.onlySubmodels = True # edc.aas.localAASServiceConfigPath = ./example/resources/exampleConfig.json # Provide a URL of an already running AAS service (such as FA³ST, BaSyx) # edc.aas.remoteAasLocation = http://example.com/aas diff --git a/example/dataspaceconnector-configuration.properties b/example/dataspaceconnector-configuration.properties index 11c2e303..9c93d224 100644 --- a/example/dataspaceconnector-configuration.properties +++ b/example/dataspaceconnector-configuration.properties @@ -8,6 +8,7 @@ # Supply AAS model + (port XOR AAS service config) for an AAS service internally started by the extension edc.aas.localAASModelPath=./resources/FestoDemoAAS.json edc.aas.localAASServicePort=9090 +edc.aas.onlySubmodels = False # edc.aas.localAASServiceConfigPath = ./example/resources/exampleConfig.json # Provide a URL of an already running AAS service (such as FA³ST, BaSyx) # edc.aas.remoteAasLocation = http://example.com/aas From fd44d8c974664691f667c68478791ced87e4c310 Mon Sep 17 00:00:00 2001 From: Carlos Schmidt <18703981+carlos-schmidt@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:58:39 +0100 Subject: [PATCH 2/3] Don't show empty lists in self description --- .../aas/CustomAssetAdministrationShellEnvironment.java | 9 ++++++--- .../de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomAssetAdministrationShellEnvironment.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomAssetAdministrationShellEnvironment.java index 26e410db..dacd3f7a 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomAssetAdministrationShellEnvironment.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomAssetAdministrationShellEnvironment.java @@ -16,17 +16,20 @@ package de.fraunhofer.iosb.app.model.aas; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.ArrayList; import java.util.List; +@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) public class CustomAssetAdministrationShellEnvironment { - protected List assetAdministrationShells; + protected List assetAdministrationShells = new ArrayList<>(); - protected List submodels; + protected List submodels= new ArrayList<>(); - protected List conceptDescriptions; + protected List conceptDescriptions= new ArrayList<>(); public List getAssetAdministrationShells() { return assetAdministrationShells; diff --git a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java index 3e2e10d1..1f017c26 100644 --- a/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java +++ b/edc-extension4aas/src/main/java/de/fraunhofer/iosb/app/model/aas/CustomSubmodel.java @@ -17,10 +17,12 @@ import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import java.util.ArrayList; import java.util.List; +@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) @JsonAutoDetect public class CustomSubmodel extends AASElement { From faf6f992caba87e99adacd4fe0e800aba5fb13f4 Mon Sep 17 00:00:00 2001 From: Carlos Schmidt <18703981+carlos-schmidt@users.noreply.github.com> Date: Mon, 11 Dec 2023 12:52:51 +0100 Subject: [PATCH 3/3] Adapt tests to new printing policy --- .../fraunhofer/iosb/app/aas/AasAgentTest.java | 23 +++++++++++++-- .../app/model/ids/SelfDescriptionTest.java | 2 +- .../iosb/app/sync/SynchronizerTest.java | 4 +-- .../oneSubmodelOneSubmodelElementLess.json | 28 +------------------ .../selfDescriptionWithAccessURLS.json | 2 +- ...escriptionWithAccessURLsSubmodelsOnly.json | 1 + .../resources/selfDescriptionWithIds.json | 2 +- ...fDescriptionWithIdsNoSubmodelElements.json | 2 +- ...hIdsOneSubmodelOneSubmodelElementLess.json | 2 +- .../src/test/resources/submodels.json | 1 - 10 files changed, 30 insertions(+), 37 deletions(-) create mode 100644 edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLsSubmodelsOnly.json diff --git a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java index 15c23826..862409d3 100644 --- a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java +++ b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/aas/AasAgentTest.java @@ -59,8 +59,7 @@ public void initializeAasAgent() { aasAgent = new AasAgent(new OkHttpClient()); } - @Test // Can't really test this anymore with new variable "sourceUrl" that is not - // serialized + @Test public void testGetAasEnvWithUrls() throws IOException, DeserializationException { var shells = FileManager.loadResource("shells.json"); var submodels = FileManager.loadResource("submodels.json"); @@ -73,6 +72,26 @@ public void testGetAasEnvWithUrls() throws IOException, DeserializationException var shouldBeResult = FileManager.loadResource("selfDescriptionWithAccessURLS.json"); + var result = new ObjectMapper().writeValueAsString( + aasAgent.getAasEnvWithUrls(new URL(HTTP_LOCALHOST_8080), false)); + result = result.replace("\n", "").replace(" ", ""); + + assertEquals(shouldBeResult, result); + } + + @Test + public void testGetAasEnvWithUrlsOnlySubmodels() throws IOException, DeserializationException { + var shells = FileManager.loadResource("shells.json"); + var submodels = FileManager.loadResource("submodels.json"); + var conceptDescriptions = FileManager.loadResource("conceptDescriptions.json"); + + mockServer.when(request().withMethod("GET").withPath("/shells")).respond(response().withBody(shells)); + mockServer.when(request().withMethod("GET").withPath("/submodels")).respond(response().withBody(submodels)); + mockServer.when(request().withMethod("GET").withPath("/concept-descriptions")) + .respond(response().withBody(conceptDescriptions)); + + var shouldBeResult = FileManager.loadResource("selfDescriptionWithAccessURLsSubmodelsOnly.json"); + var result = new ObjectMapper().writeValueAsString( aasAgent.getAasEnvWithUrls(new URL(HTTP_LOCALHOST_8080), true)); result = result.replace("\n", "").replace(" ", ""); diff --git a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/model/ids/SelfDescriptionTest.java b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/model/ids/SelfDescriptionTest.java index 49cc44bf..406bbb4b 100644 --- a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/model/ids/SelfDescriptionTest.java +++ b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/model/ids/SelfDescriptionTest.java @@ -25,7 +25,7 @@ public class SelfDescriptionTest { @Test public void emptyEnvironmentTest() { SelfDescription selfDescription = new SelfDescription(new CustomAssetAdministrationShellEnvironment()); - assertEquals("{\"assetAdministrationShells\":null,\"submodels\":null,\"conceptDescriptions\":null}", + assertEquals("{}", selfDescription.toString()); } } diff --git a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/sync/SynchronizerTest.java b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/sync/SynchronizerTest.java index 3c63e0a8..162f62dc 100644 --- a/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/sync/SynchronizerTest.java +++ b/edc-extension4aas/src/test/java/de/fraunhofer/iosb/app/sync/SynchronizerTest.java @@ -102,7 +102,7 @@ public void synchronizationInitializeTest() { } @Test - public void synchronizationRemoveSubmodelElementTest() { + public void synchronizationRemoveAllSubmodelElementsTest() { startMockServer(port); prepareDefaultMockedResponse(); @@ -142,7 +142,7 @@ public void synchronizationRemoveAllTest() { prepareEmptyMockedResponse(); synchronizer.synchronize(); - assertEquals("{\"assetAdministrationShells\":[],\"submodels\":[],\"conceptDescriptions\":[]}", + assertEquals("{}", selfDescriptionRepo.getSelfDescription(url).toString()); } diff --git a/edc-extension4aas/src/test/resources/oneSubmodelOneSubmodelElementLess.json b/edc-extension4aas/src/test/resources/oneSubmodelOneSubmodelElementLess.json index bd842c62..700b9a5d 100644 --- a/edc-extension4aas/src/test/resources/oneSubmodelOneSubmodelElementLess.json +++ b/edc-extension4aas/src/test/resources/oneSubmodelOneSubmodelElementLess.json @@ -18,33 +18,7 @@ "name": "Submodel" }, "kind": "Instance", - "submodelElements": [ - { - "value": "", - "semanticId": { - "keys": [ - { - "idType": "Iri", - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ] - }, - "idShort": "GripperUp", - "category": "Variable", - "modelType": { - "name": "Property" - }, - "valueType": "boolean", - "kind": "Instance", - "descriptions": [ - { - "language": "en", - "text": "Shows it the gripper is currently pulled up" - } - ] - } - ] + "submodelElements": [] }, { "semanticId": { diff --git a/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLS.json b/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLS.json index 9053fbea..8e0991ed 100644 --- a/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLS.json +++ b/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLS.json @@ -1 +1 @@ -{"assetAdministrationShells":[{"idsContractId":null,"idsAssetId":null,"idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":null,"idsAssetId":null,"idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"},"submodelElements":[]},{"idsContractId":null,"idsAssetId":null,"idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idShort":"GripperUp"},{"idShort":"Pressure"},{"idShort":"ProcessCounter"},{"idShort":"ProcessDuration"},{"idShort":"RemainingProcesses"},{"idShort":"GripperOpen"},{"idShort":"DistanceSensor"},{"idShort":"LightGateEntrance"},{"idShort":"LightGateMiddle"},{"idShort":"LightGateExit"},{"idShort":"ConveyorBeltForward"},{"idShort":"ConveyorBeltBackward"},{"idShort":"isRunning"},{"idShort":"LED_green"},{"idShort":"LED_yellow"},{"idShort":"LED_red"},{"idShort":"ConveyorBeltReady"}]},{"idsContractId":null,"idsAssetId":null,"idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idShort":"GripperUpAverage"},{"idShort":"GripperOpenAverage"},{"idShort":"DistanceSensorAverage"},{"idShort":"LightGateEntranceAverage"},{"idShort":"LightGateMiddleAverage"},{"idShort":"LightGateExitAverage"},{"idShort":"ConveyorBeltForwardAverage"},{"idShort":"ConveyorBeltBackwardAverage"},{"idShort":"isRunningAverage"},{"idShort":"LED_greenAverage"},{"idShort":"LED_yellowAverage"},{"idShort":"LED_redAverage"},{"idShort":"ConveyorBeltReadyAverage"}]},{"idsContractId":null,"idsAssetId":null,"idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idShort":"JTS_data"}]},{"idsContractId":null,"idsAssetId":null,"idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idShort":"Pressure"},{"idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":null,"idsAssetId":null,"idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file +{"assetAdministrationShells":[{"idsContractId":null,"idsAssetId":null,"idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"}},{"idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idShort":"GripperUp"},{"idShort":"Pressure"},{"idShort":"ProcessCounter"},{"idShort":"ProcessDuration"},{"idShort":"RemainingProcesses"},{"idShort":"GripperOpen"},{"idShort":"DistanceSensor"},{"idShort":"LightGateEntrance"},{"idShort":"LightGateMiddle"},{"idShort":"LightGateExit"},{"idShort":"ConveyorBeltForward"},{"idShort":"ConveyorBeltBackward"},{"idShort":"isRunning"},{"idShort":"LED_green"},{"idShort":"LED_yellow"},{"idShort":"LED_red"},{"idShort":"ConveyorBeltReady"}]},{"idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idShort":"GripperUpAverage"},{"idShort":"GripperOpenAverage"},{"idShort":"DistanceSensorAverage"},{"idShort":"LightGateEntranceAverage"},{"idShort":"LightGateMiddleAverage"},{"idShort":"LightGateExitAverage"},{"idShort":"ConveyorBeltForwardAverage"},{"idShort":"ConveyorBeltBackwardAverage"},{"idShort":"isRunningAverage"},{"idShort":"LED_greenAverage"},{"idShort":"LED_yellowAverage"},{"idShort":"LED_redAverage"},{"idShort":"ConveyorBeltReadyAverage"}]},{"idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idShort":"JTS_data"}]},{"idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idShort":"Pressure"},{"idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":null,"idsAssetId":null,"idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file diff --git a/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLsSubmodelsOnly.json b/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLsSubmodelsOnly.json new file mode 100644 index 00000000..dcd43227 --- /dev/null +++ b/edc-extension4aas/src/test/resources/selfDescriptionWithAccessURLsSubmodelsOnly.json @@ -0,0 +1 @@ +{"submodels":[{"idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"}},{"idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"}},{"idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"}},{"idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"}},{"idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"}}]} \ No newline at end of file diff --git a/edc-extension4aas/src/test/resources/selfDescriptionWithIds.json b/edc-extension4aas/src/test/resources/selfDescriptionWithIds.json index b7b94c4a..4900861b 100644 --- a/edc-extension4aas/src/test/resources/selfDescriptionWithIds.json +++ b/edc-extension4aas/src/test/resources/selfDescriptionWithIds.json @@ -1 +1 @@ -{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"},"submodelElements":[]},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT8","idsAssetId":"1403345733","idShort":"GripperUp"},{"idsContractId":"DEFAULT_CONTRACT9","idsAssetId":"-36927578","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT10","idsAssetId":"-892753618","idShort":"ProcessCounter"},{"idsContractId":"DEFAULT_CONTRACT11","idsAssetId":"769417378","idShort":"ProcessDuration"},{"idsContractId":"DEFAULT_CONTRACT12","idsAssetId":"-1622475224","idShort":"RemainingProcesses"},{"idsContractId":"DEFAULT_CONTRACT13","idsAssetId":"-4657036","idShort":"GripperOpen"},{"idsContractId":"DEFAULT_CONTRACT14","idsAssetId":"1964729520","idShort":"DistanceSensor"},{"idsContractId":"DEFAULT_CONTRACT15","idsAssetId":"-1206164330","idShort":"LightGateEntrance"},{"idsContractId":"DEFAULT_CONTRACT16","idsAssetId":"-988501131","idShort":"LightGateMiddle"},{"idsContractId":"DEFAULT_CONTRACT17","idsAssetId":"1817740030","idShort":"LightGateExit"},{"idsContractId":"DEFAULT_CONTRACT18","idsAssetId":"-451751058","idShort":"ConveyorBeltForward"},{"idsContractId":"DEFAULT_CONTRACT19","idsAssetId":"519282778","idShort":"ConveyorBeltBackward"},{"idsContractId":"DEFAULT_CONTRACT20","idsAssetId":"-1268910060","idShort":"isRunning"},{"idsContractId":"DEFAULT_CONTRACT21","idsAssetId":"866424462","idShort":"LED_green"},{"idsContractId":"DEFAULT_CONTRACT22","idsAssetId":"1592888905","idShort":"LED_yellow"},{"idsContractId":"DEFAULT_CONTRACT23","idsAssetId":"2056775388","idShort":"LED_red"},{"idsContractId":"DEFAULT_CONTRACT24","idsAssetId":"148844684","idShort":"ConveyorBeltReady"}]},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT25","idsAssetId":"-1736407145","idShort":"GripperUpAverage"},{"idsContractId":"DEFAULT_CONTRACT26","idsAssetId":"778529736","idShort":"GripperOpenAverage"},{"idsContractId":"DEFAULT_CONTRACT27","idsAssetId":"751611438","idShort":"DistanceSensorAverage"},{"idsContractId":"DEFAULT_CONTRACT28","idsAssetId":"488415782","idShort":"LightGateEntranceAverage"},{"idsContractId":"DEFAULT_CONTRACT29","idsAssetId":"1611662887","idShort":"LightGateMiddleAverage"},{"idsContractId":"DEFAULT_CONTRACT30","idsAssetId":"1912641086","idShort":"LightGateExitAverage"},{"idsContractId":"DEFAULT_CONTRACT31","idsAssetId":"737143950","idShort":"ConveyorBeltForwardAverage"},{"idsContractId":"DEFAULT_CONTRACT32","idsAssetId":"1165259396","idShort":"ConveyorBeltBackwardAverage"},{"idsContractId":"DEFAULT_CONTRACT33","idsAssetId":"-1355566104","idShort":"isRunningAverage"},{"idsContractId":"DEFAULT_CONTRACT34","idsAssetId":"271497262","idShort":"LED_greenAverage"},{"idsContractId":"DEFAULT_CONTRACT35","idsAssetId":"-1115107595","idShort":"LED_yellowAverage"},{"idsContractId":"DEFAULT_CONTRACT36","idsAssetId":"445523936","idShort":"LED_redAverage"},{"idsContractId":"DEFAULT_CONTRACT37","idsAssetId":"1542428016","idShort":"ConveyorBeltReadyAverage"}]},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT38","idsAssetId":"-378946552","idShort":"JTS_data"}]},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT39","idsAssetId":"1534629733","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT40","idsAssetId":"156363779","idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file +{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"}},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT8","idsAssetId":"1403345733","idShort":"GripperUp"},{"idsContractId":"DEFAULT_CONTRACT9","idsAssetId":"-36927578","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT10","idsAssetId":"-892753618","idShort":"ProcessCounter"},{"idsContractId":"DEFAULT_CONTRACT11","idsAssetId":"769417378","idShort":"ProcessDuration"},{"idsContractId":"DEFAULT_CONTRACT12","idsAssetId":"-1622475224","idShort":"RemainingProcesses"},{"idsContractId":"DEFAULT_CONTRACT13","idsAssetId":"-4657036","idShort":"GripperOpen"},{"idsContractId":"DEFAULT_CONTRACT14","idsAssetId":"1964729520","idShort":"DistanceSensor"},{"idsContractId":"DEFAULT_CONTRACT15","idsAssetId":"-1206164330","idShort":"LightGateEntrance"},{"idsContractId":"DEFAULT_CONTRACT16","idsAssetId":"-988501131","idShort":"LightGateMiddle"},{"idsContractId":"DEFAULT_CONTRACT17","idsAssetId":"1817740030","idShort":"LightGateExit"},{"idsContractId":"DEFAULT_CONTRACT18","idsAssetId":"-451751058","idShort":"ConveyorBeltForward"},{"idsContractId":"DEFAULT_CONTRACT19","idsAssetId":"519282778","idShort":"ConveyorBeltBackward"},{"idsContractId":"DEFAULT_CONTRACT20","idsAssetId":"-1268910060","idShort":"isRunning"},{"idsContractId":"DEFAULT_CONTRACT21","idsAssetId":"866424462","idShort":"LED_green"},{"idsContractId":"DEFAULT_CONTRACT22","idsAssetId":"1592888905","idShort":"LED_yellow"},{"idsContractId":"DEFAULT_CONTRACT23","idsAssetId":"2056775388","idShort":"LED_red"},{"idsContractId":"DEFAULT_CONTRACT24","idsAssetId":"148844684","idShort":"ConveyorBeltReady"}]},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT25","idsAssetId":"-1736407145","idShort":"GripperUpAverage"},{"idsContractId":"DEFAULT_CONTRACT26","idsAssetId":"778529736","idShort":"GripperOpenAverage"},{"idsContractId":"DEFAULT_CONTRACT27","idsAssetId":"751611438","idShort":"DistanceSensorAverage"},{"idsContractId":"DEFAULT_CONTRACT28","idsAssetId":"488415782","idShort":"LightGateEntranceAverage"},{"idsContractId":"DEFAULT_CONTRACT29","idsAssetId":"1611662887","idShort":"LightGateMiddleAverage"},{"idsContractId":"DEFAULT_CONTRACT30","idsAssetId":"1912641086","idShort":"LightGateExitAverage"},{"idsContractId":"DEFAULT_CONTRACT31","idsAssetId":"737143950","idShort":"ConveyorBeltForwardAverage"},{"idsContractId":"DEFAULT_CONTRACT32","idsAssetId":"1165259396","idShort":"ConveyorBeltBackwardAverage"},{"idsContractId":"DEFAULT_CONTRACT33","idsAssetId":"-1355566104","idShort":"isRunningAverage"},{"idsContractId":"DEFAULT_CONTRACT34","idsAssetId":"271497262","idShort":"LED_greenAverage"},{"idsContractId":"DEFAULT_CONTRACT35","idsAssetId":"-1115107595","idShort":"LED_yellowAverage"},{"idsContractId":"DEFAULT_CONTRACT36","idsAssetId":"445523936","idShort":"LED_redAverage"},{"idsContractId":"DEFAULT_CONTRACT37","idsAssetId":"1542428016","idShort":"ConveyorBeltReadyAverage"}]},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT38","idsAssetId":"-378946552","idShort":"JTS_data"}]},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT39","idsAssetId":"1534629733","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT40","idsAssetId":"156363779","idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file diff --git a/edc-extension4aas/src/test/resources/selfDescriptionWithIdsNoSubmodelElements.json b/edc-extension4aas/src/test/resources/selfDescriptionWithIdsNoSubmodelElements.json index c4ce0d69..c7de22eb 100644 --- a/edc-extension4aas/src/test/resources/selfDescriptionWithIdsNoSubmodelElements.json +++ b/edc-extension4aas/src/test/resources/selfDescriptionWithIdsNoSubmodelElements.json @@ -1 +1 @@ -{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"},"submodelElements":[]},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[]},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[]},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[]},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[]}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file +{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"}},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"}},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"}},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"}},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"}}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file diff --git a/edc-extension4aas/src/test/resources/selfDescriptionWithIdsOneSubmodelOneSubmodelElementLess.json b/edc-extension4aas/src/test/resources/selfDescriptionWithIdsOneSubmodelOneSubmodelElementLess.json index 30dca880..ff96e27d 100644 --- a/edc-extension4aas/src/test/resources/selfDescriptionWithIdsOneSubmodelOneSubmodelElementLess.json +++ b/edc-extension4aas/src/test/resources/selfDescriptionWithIdsOneSubmodelOneSubmodelElementLess.json @@ -1 +1 @@ -{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT41","idsAssetId":"-1211678183","idShort":"GripperUp"}]},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT9","idsAssetId":"-36927578","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT10","idsAssetId":"-892753618","idShort":"ProcessCounter"},{"idsContractId":"DEFAULT_CONTRACT11","idsAssetId":"769417378","idShort":"ProcessDuration"},{"idsContractId":"DEFAULT_CONTRACT12","idsAssetId":"-1622475224","idShort":"RemainingProcesses"},{"idsContractId":"DEFAULT_CONTRACT13","idsAssetId":"-4657036","idShort":"GripperOpen"},{"idsContractId":"DEFAULT_CONTRACT14","idsAssetId":"1964729520","idShort":"DistanceSensor"},{"idsContractId":"DEFAULT_CONTRACT15","idsAssetId":"-1206164330","idShort":"LightGateEntrance"},{"idsContractId":"DEFAULT_CONTRACT16","idsAssetId":"-988501131","idShort":"LightGateMiddle"},{"idsContractId":"DEFAULT_CONTRACT17","idsAssetId":"1817740030","idShort":"LightGateExit"},{"idsContractId":"DEFAULT_CONTRACT18","idsAssetId":"-451751058","idShort":"ConveyorBeltForward"},{"idsContractId":"DEFAULT_CONTRACT19","idsAssetId":"519282778","idShort":"ConveyorBeltBackward"},{"idsContractId":"DEFAULT_CONTRACT20","idsAssetId":"-1268910060","idShort":"isRunning"},{"idsContractId":"DEFAULT_CONTRACT21","idsAssetId":"866424462","idShort":"LED_green"},{"idsContractId":"DEFAULT_CONTRACT22","idsAssetId":"1592888905","idShort":"LED_yellow"},{"idsContractId":"DEFAULT_CONTRACT23","idsAssetId":"2056775388","idShort":"LED_red"},{"idsContractId":"DEFAULT_CONTRACT24","idsAssetId":"148844684","idShort":"ConveyorBeltReady"}]},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT25","idsAssetId":"-1736407145","idShort":"GripperUpAverage"},{"idsContractId":"DEFAULT_CONTRACT26","idsAssetId":"778529736","idShort":"GripperOpenAverage"},{"idsContractId":"DEFAULT_CONTRACT27","idsAssetId":"751611438","idShort":"DistanceSensorAverage"},{"idsContractId":"DEFAULT_CONTRACT28","idsAssetId":"488415782","idShort":"LightGateEntranceAverage"},{"idsContractId":"DEFAULT_CONTRACT29","idsAssetId":"1611662887","idShort":"LightGateMiddleAverage"},{"idsContractId":"DEFAULT_CONTRACT30","idsAssetId":"1912641086","idShort":"LightGateExitAverage"},{"idsContractId":"DEFAULT_CONTRACT31","idsAssetId":"737143950","idShort":"ConveyorBeltForwardAverage"},{"idsContractId":"DEFAULT_CONTRACT32","idsAssetId":"1165259396","idShort":"ConveyorBeltBackwardAverage"},{"idsContractId":"DEFAULT_CONTRACT33","idsAssetId":"-1355566104","idShort":"isRunningAverage"},{"idsContractId":"DEFAULT_CONTRACT34","idsAssetId":"271497262","idShort":"LED_greenAverage"},{"idsContractId":"DEFAULT_CONTRACT35","idsAssetId":"-1115107595","idShort":"LED_yellowAverage"},{"idsContractId":"DEFAULT_CONTRACT36","idsAssetId":"445523936","idShort":"LED_redAverage"},{"idsContractId":"DEFAULT_CONTRACT37","idsAssetId":"1542428016","idShort":"ConveyorBeltReadyAverage"}]},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT38","idsAssetId":"-378946552","idShort":"JTS_data"}]},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT39","idsAssetId":"1534629733","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT40","idsAssetId":"156363779","idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file +{"assetAdministrationShells":[{"idsContractId":"DEFAULT_CONTRACT2","idsAssetId":"-1379397334","idShort":"FestoDemoAAS","identification":{"idType":"Iri","id":"https://example.com/ids/aas/3235_8090_6012_8932"}}],"submodels":[{"idsContractId":"DEFAULT_CONTRACT3","idsAssetId":"358736994","idShort":"Config","identification":{"idType":"IRI","id":"https://example.com/ids/sm/1145_8090_6012_5097"}},{"idsContractId":"DEFAULT_CONTRACT4","idsAssetId":"-2140270666","idShort":"Status","identification":{"idType":"IRI","id":"https://example.com/ids/sm/4445_8090_6012_7409"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT9","idsAssetId":"-36927578","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT10","idsAssetId":"-892753618","idShort":"ProcessCounter"},{"idsContractId":"DEFAULT_CONTRACT11","idsAssetId":"769417378","idShort":"ProcessDuration"},{"idsContractId":"DEFAULT_CONTRACT12","idsAssetId":"-1622475224","idShort":"RemainingProcesses"},{"idsContractId":"DEFAULT_CONTRACT13","idsAssetId":"-4657036","idShort":"GripperOpen"},{"idsContractId":"DEFAULT_CONTRACT14","idsAssetId":"1964729520","idShort":"DistanceSensor"},{"idsContractId":"DEFAULT_CONTRACT15","idsAssetId":"-1206164330","idShort":"LightGateEntrance"},{"idsContractId":"DEFAULT_CONTRACT16","idsAssetId":"-988501131","idShort":"LightGateMiddle"},{"idsContractId":"DEFAULT_CONTRACT17","idsAssetId":"1817740030","idShort":"LightGateExit"},{"idsContractId":"DEFAULT_CONTRACT18","idsAssetId":"-451751058","idShort":"ConveyorBeltForward"},{"idsContractId":"DEFAULT_CONTRACT19","idsAssetId":"519282778","idShort":"ConveyorBeltBackward"},{"idsContractId":"DEFAULT_CONTRACT20","idsAssetId":"-1268910060","idShort":"isRunning"},{"idsContractId":"DEFAULT_CONTRACT21","idsAssetId":"866424462","idShort":"LED_green"},{"idsContractId":"DEFAULT_CONTRACT22","idsAssetId":"1592888905","idShort":"LED_yellow"},{"idsContractId":"DEFAULT_CONTRACT23","idsAssetId":"2056775388","idShort":"LED_red"},{"idsContractId":"DEFAULT_CONTRACT24","idsAssetId":"148844684","idShort":"ConveyorBeltReady"}]},{"idsContractId":"DEFAULT_CONTRACT5","idsAssetId":"-772733259","idShort":"CalculatedAverages","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2110_9090_6012_8448"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT25","idsAssetId":"-1736407145","idShort":"GripperUpAverage"},{"idsContractId":"DEFAULT_CONTRACT26","idsAssetId":"778529736","idShort":"GripperOpenAverage"},{"idsContractId":"DEFAULT_CONTRACT27","idsAssetId":"751611438","idShort":"DistanceSensorAverage"},{"idsContractId":"DEFAULT_CONTRACT28","idsAssetId":"488415782","idShort":"LightGateEntranceAverage"},{"idsContractId":"DEFAULT_CONTRACT29","idsAssetId":"1611662887","idShort":"LightGateMiddleAverage"},{"idsContractId":"DEFAULT_CONTRACT30","idsAssetId":"1912641086","idShort":"LightGateExitAverage"},{"idsContractId":"DEFAULT_CONTRACT31","idsAssetId":"737143950","idShort":"ConveyorBeltForwardAverage"},{"idsContractId":"DEFAULT_CONTRACT32","idsAssetId":"1165259396","idShort":"ConveyorBeltBackwardAverage"},{"idsContractId":"DEFAULT_CONTRACT33","idsAssetId":"-1355566104","idShort":"isRunningAverage"},{"idsContractId":"DEFAULT_CONTRACT34","idsAssetId":"271497262","idShort":"LED_greenAverage"},{"idsContractId":"DEFAULT_CONTRACT35","idsAssetId":"-1115107595","idShort":"LED_yellowAverage"},{"idsContractId":"DEFAULT_CONTRACT36","idsAssetId":"445523936","idShort":"LED_redAverage"},{"idsContractId":"DEFAULT_CONTRACT37","idsAssetId":"1542428016","idShort":"ConveyorBeltReadyAverage"}]},{"idsContractId":"DEFAULT_CONTRACT6","idsAssetId":"1218664477","idShort":"DaySummary","identification":{"idType":"IRI","id":"https://example.com/ids/sm/5410_9090_6012_0950"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT38","idsAssetId":"-378946552","idShort":"JTS_data"}]},{"idsContractId":"DEFAULT_CONTRACT7","idsAssetId":"1754436341","idShort":"ProducerRecommendations","identification":{"idType":"IRI","id":"https://example.com/ids/sm/2402_1191_1022_1090"},"submodelElements":[{"idsContractId":"DEFAULT_CONTRACT39","idsAssetId":"1534629733","idShort":"Pressure"},{"idsContractId":"DEFAULT_CONTRACT40","idsAssetId":"156363779","idShort":"ProcessDuration"}]}],"conceptDescriptions":[{"idsContractId":"DEFAULT_CONTRACT1","idsAssetId":"15573708","idShort":"TestConceptDescription","identification":{"idType":"Iri","id":"https://acplt.org/Test_ConceptDescription"}}]} \ No newline at end of file diff --git a/edc-extension4aas/src/test/resources/submodels.json b/edc-extension4aas/src/test/resources/submodels.json index 9f979fc7..b70bd349 100644 --- a/edc-extension4aas/src/test/resources/submodels.json +++ b/edc-extension4aas/src/test/resources/submodels.json @@ -115,7 +115,6 @@ } ] }, - { "value": "13.6", "semanticId": {