Skip to content

Commit

Permalink
Merge pull request #513 from catenax-ng/main
Browse files Browse the repository at this point in the history
feature: #488, #359, support SingleLevelBomAsBuilt v3.0.0, support Asset Administration Shell v3.1
  • Loading branch information
ds-mwesener authored Apr 3, 2024
2 parents f42b9c3 + 89dd8c7 commit 2f8e476
Show file tree
Hide file tree
Showing 30 changed files with 175,196 additions and 261,411 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
_**For better traceability add the corresponding GitHub issue number in each changelog entry, please.**_

## [Unreleased]
### Changed
- IRS now supports Asset Administration Shell v3.1 - adjusted lookup shells endpoint changes (assetIds query param is encoded). #359
-
### Added
- Extended EdcPolicyDefinitionService to check if a policy in the edc exists

### Changed
- IRS now supports Asset Administration Shell v3.1 - adjusted lookup shells endpoint changes (assetIds query param is encoded). #359
- Support of building relationships based on SingleLevelBomAsBuilt v3.0.0 #488

## [4.8.0] - 2024-03-18
### Changed
- Improved maintainability in EdcSubmodelClientImpl by reduced method visibility and better naming (in context of #448).
Expand Down
8 changes: 4 additions & 4 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.19, Apach
maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.aspectj/aspectjweaver/1.9.21, Apache-2.0 AND BSD-3-Clause AND EPL-1.0 AND BSD-3-Clause AND Apache-1.1, approved, #7695
maven/mavencentral/org.assertj/assertj-core/3.24.2, Apache-2.0, approved, #6161
maven/mavencentral/org.awaitility/awaitility/4.2.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.awaitility/awaitility/4.2.0, Apache-2.0, approved, #14178
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.76, MIT, approved, #9825
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.74, MIT AND CC0-1.0, approved, #9091
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.76, MIT AND CC0-1.0, approved, #9827
Expand Down Expand Up @@ -370,11 +370,11 @@ maven/mavencentral/org.javassist/javassist/3.29.2-GA, Apache-2.0 AND LGPL-2.1-or
maven/mavencentral/org.jboss.logging/jboss-logging/3.4.3.Final, Apache-2.0, approved, CQ21255
maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, approved, #9471
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.22, Apache-2.0, approved, #8910
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.0, Apache-2.0, approved, #14186
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.8.22, Apache-2.0, approved, #8807
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.9.0, Apache-2.0, approved, #14193
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.8.22, Apache-2.0, approved, #8875
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.9.0, Apache-2.0, approved, #14191
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.6.20, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.8.22, Apache-2.0, approved, #8865
maven/mavencentral/org.jetbrains/annotations/13.0, Apache-2.0, approved, clearlydefined
Expand Down
22 changes: 11 additions & 11 deletions docs/src/api/irs-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand Down Expand Up @@ -1044,7 +1044,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand Down Expand Up @@ -1170,7 +1170,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand Down Expand Up @@ -1252,7 +1252,7 @@ components:
value: urn:bamm:io.catenax.vehicle:0.1.1#PartDetails
type: ModelReference
submodels:
- aspectType: urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- aspectType: urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
contractAgreementId: f253718e-a270-4367-901b-9d50d9bd8462
identification: urn:uuid:fc784d2a-5506-4e61-8e34-21600f8cdeff
payload:
Expand Down Expand Up @@ -1324,7 +1324,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand Down Expand Up @@ -1362,7 +1362,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand Down Expand Up @@ -1442,7 +1442,7 @@ components:
- type: Submodel
value: urn:bamm:io.catenax.vehicle:0.1.1#PartDetails
submodels:
- aspectType: urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- aspectType: urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
contractAgreementId: f253718e-a270-4367-901b-9d50d9bd8462
identification: urn:uuid:fc784d2a-5506-4e61-8e34-21600f8cdeff
payload:
Expand Down Expand Up @@ -1480,7 +1480,7 @@ components:
lastModifiedOn: 2022-02-03T14:48:54.709Z
parameter:
aspects:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
- urn:bamm:io.catenax.serial_part:1.0.1#SerialPart
auditContractNegotiation: false
bomLifecycle: asBuilt
Expand All @@ -1502,7 +1502,7 @@ components:
value:
lastUpdated: 2023-02-13T08:18:11.990659500Z
models:
- urn: urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn: urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
name: SingleLevelBomAsBuilt
status: RELEASED
type: BAMM
Expand Down Expand Up @@ -2561,7 +2561,7 @@ components:
description: List of aspect names that will be collected if \<collectAspects\>
flag is set to true.
example:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
items:
type: string
pattern: ^(urn:[bs]amm:.*\d\.\d\.\d)?(#)?(\w+)?$
Expand Down Expand Up @@ -2747,7 +2747,7 @@ components:
description: List of aspect names that will be collected if \<collectAspects\>
flag is set to true.
example:
- urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt
- urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt
items:
type: string
pattern: ^(urn:[bs]amm:.*\d\.\d\.\d)?(#)?(\w+)?$
Expand Down
2 changes: 1 addition & 1 deletion docs/src/docs/arc42/scope-context/technical-context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The integrated EDC client in the IRS is responsible for creating restful request

|===
| Name | Description |
| SingleLevelBomAsBuilt | The single-level bill of material represents one sub-level of an assembly and does not include any lower-level subassemblies. The as-built lifecycle references all child items as manufactured by the manufacturer referencing only child items in an as-built lifecycle themselves, unless parts can only be tracked by an part ID. If it's unclear which item has been built-in into the parent item, all potential parts must be listed. This is the case when, e.g. the same item is supplied by two suppliers and the item is only tracked by a customer part ID during assembly, these items can not be differentiated from each other. | 2.0.0
| SingleLevelBomAsBuilt | The single-level bill of material represents one sub-level of an assembly and does not include any lower-level subassemblies. The as-built lifecycle references all child items as manufactured by the manufacturer referencing only child items in an as-built lifecycle themselves, unless parts can only be tracked by an part ID. If it's unclear which item has been built-in into the parent item, all potential parts must be listed. This is the case when, e.g. the same item is supplied by two suppliers and the item is only tracked by a customer part ID during assembly, these items can not be differentiated from each other. | 3.0.0
| SingleLevelUsageAsBuilt | The aspect provides the information in which parent part(s)/product(s) the given item is assembled in. Could be a 1:1 relationship in terms of a e.g. a brake component or 1:n for e.g. coatings. The given item as well as the parent item must refer to an object from as-built lifecycle phase, i.e. a batch or a serialized part. | 2.0.0
|===

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class OpenApiExamples {
private static final String SUPPLY_CHAIN_IMPACTED_ASPECT_TYPE = "supply_chain_impacted";
private static final String SUPPLY_CHAIN_IMPACTED_KEY = "supplyChainImpacted";
private static final String SUPPLY_CHAIN_IMPACTER_RESULT = "YES";
private static final String SINGLE_LEVEL_BOM_AS_BUILT_ASPECT = "urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt";
private static final String SINGLE_LEVEL_BOM_AS_BUILT_ASPECT = "urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt";
private static final String SERIAL_PART_ASPECT = "urn:bamm:io.catenax.serial_part:1.0.1#SerialPart";
private static final int FETCHED_ITEMS_SIZE = 3;
private static final int NO_RUNNING_OR_FAILED_ITEMS = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,11 @@ public String getModelJsonSchema(final String urn) {
@Override
public List<AspectModel> getAllAspectModels() {
return List.of(
new AspectModel("urn:bamm:io.catenax.serial_part:1.0.1#SerialPart", "1.0.1",
new AspectModel("urn:samm:io.catenax.serial_part:3.0.0#SerialPart", "3.0.0",
"SerialPart", MODEL_TYPE, MODEL_STATUS),
new AspectModel("urn:bamm:io.catenax.esr_certificates.esr_certificate:1.0.0#EsrCertificate", "1.0.0",
"EsrCertificate", MODEL_TYPE, MODEL_STATUS),
new AspectModel("urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt",
"2.0.0", "SingleLevelBomAsBuilt", MODEL_TYPE, MODEL_STATUS),
new AspectModel("urn:bamm:io.catenax.part_as_specified:2.0.0#PartAsSpecified",
new AspectModel("urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt",
"3.0.0", "SingleLevelBomAsBuilt", MODEL_TYPE, MODEL_STATUS),
new AspectModel("urn:samm:io.catenax.part_as_specified:2.0.0#PartAsSpecified",
"2.0.0", "PartAsSpecified", MODEL_TYPE, MODEL_STATUS),
new AspectModel("urn:bamm:io.catenax.part_as_planned:1.0.1#PartAsPlanned",
"1.0.1", "PartAsPlanned", MODEL_TYPE, MODEL_STATUS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import static org.eclipse.tractusx.irs.testing.wiremock.SubmodelFacadeWiremockSupport.PATH_NEGOTIATE;
import static org.eclipse.tractusx.irs.testing.wiremock.SubmodelFacadeWiremockSupport.PATH_STATE;
import static org.eclipse.tractusx.irs.testing.wiremock.SubmodelFacadeWiremockSupport.PATH_TRANSFER;
import static org.eclipse.tractusx.irs.util.TestMother.batchAspectName;
import static org.eclipse.tractusx.irs.util.TestMother.singleLevelBomAsBuiltAspectName;

import java.time.Duration;
Expand Down Expand Up @@ -153,7 +154,7 @@ void shouldStartApplicationAndCollectSemanticModels() throws SchemaNotFoundExcep
final AspectModels allAspectModels = semanticHubService.getAllAspectModels();

// Assert
assertThat(allAspectModels.models()).hasSize(79);
assertThat(allAspectModels.models()).hasSize(99);
}

@Test
Expand Down Expand Up @@ -288,7 +289,7 @@ private void successfulRegistryAndDataRequest(final String globalAssetId, final

final String edcAssetId = WiremockSupport.randomUUIDwithPrefix();
final String batch = WiremockSupport.submodelRequest(edcAssetId, "Batch",
"urn:samm:io.catenax.batch:2.0.0#Batch", batchFileName);
batchAspectName, batchFileName);

final String singleLevelBomAsBuilt = WiremockSupport.submodelRequest(edcAssetId, "SingleLevelBomAsBuilt",
singleLevelBomAsBuiltAspectName, sbomFileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
* WireMock configurations and requests used for testing Semantic Hub fLow.
*/
public final class SemanticHubWireMockSupport {
public static final String BATCH_URN = "urn:samm:io.catenax.batch:2.0.0%23Batch";
private static final String SINGLE_LEVEL_BOM_AS_BUILT_URN = "urn:bamm:io.catenax.single_level_bom_as_built:2.0.0%23SingleLevelBomAsBuilt";
public static final String BATCH_URN = "urn:samm:io.catenax.batch:3.0.0%23Batch";
private static final String SINGLE_LEVEL_BOM_AS_BUILT_URN = "urn:samm:io.catenax.single_level_bom_as_built:3.0.0%23SingleLevelBomAsBuilt";
public static final String SCHEMA_PATH_PLACEHOLDER = "/models/%s/json-schema";
public static final String SEMANTIC_HUB_SCHEMA_URL =
"http://semantic.hub" + SCHEMA_PATH_PLACEHOLDER.formatted("{urn}");
Expand All @@ -44,12 +44,12 @@ private SemanticHubWireMockSupport() {
}

public static void semanticHubWillReturnBatchSchema() {
schemaResponse200(SCHEMA_PATH_PLACEHOLDER.formatted(BATCH_URN), "semantichub/batch-2.0.0-schema.json");
schemaResponse200(SCHEMA_PATH_PLACEHOLDER.formatted(BATCH_URN), "semantichub/batch-3.0.0-schema.json");
}

public static void semanticHubWillReturnSingleLevelBomAsBuiltSchema() {
schemaResponse200(SCHEMA_PATH_PLACEHOLDER.formatted(SINGLE_LEVEL_BOM_AS_BUILT_URN),
"semantichub/singleLevelBomAsBuilt-2.0.0-schema.json");
"semantichub/singleLevelBomAsBuilt-3.0.0-schema.json");
}

private static void schemaResponse200(final String urlRegex, final String fileName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ void shouldReturnJsonSchema() throws SchemaNotFoundException {
semanticHubWillReturnBatchSchema();

// Act
final String modelJsonSchema = semanticsHubFacade.getModelJsonSchema("urn:samm:io.catenax.batch:2.0.0#Batch");
final String modelJsonSchema = semanticsHubFacade.getModelJsonSchema("urn:samm:io.catenax.batch:3.0.0#Batch");

// Assert
assertThat(modelJsonSchema).contains("urn_samm_io.catenax.batch_2.0.0_CatenaXIdTrait")
.contains("A batch is a quantity of (semi-) finished products or (raw) material");
SemanticHubWireMockSupport.verifySemanticHubWasCalledForModel("urn:samm:io.catenax.batch:2.0.0%23Batch", 1);
assertThat(modelJsonSchema).contains("urn_samm_io.catenax.shared.uuid_2.0.0_UuidV4Trait")
.contains("A batch is a quantity of(semi-)finished products or(raw)material");
SemanticHubWireMockSupport.verifySemanticHubWasCalledForModel("urn:samm:io.catenax.batch:3.0.0%23Batch", 1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void registerJobWithCollectAspectsShouldIncludeSubmodels() throws InvalidSchemaE
when(jsonValidatorService.validate(any(), any())).thenReturn(ValidationResult.builder().valid(true).build());
when(connectorEndpointsService.fetchConnectorEndpoints(any())).thenReturn(
List.of("https://connector.endpoint.nl"));
final RegisterJob registerJob = registerJob("urn:uuid:8ddd8fe0-1b4f-44b4-90f3-a8f68e551ac7", 100,
final RegisterJob registerJob = registerJob("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41", 100,
List.of(serialPartAspectName, productDescriptionAspectName, singleLevelBomAsBuiltAspectName),
true, false, Direction.DOWNWARD);
when(connectorEndpointsService.fetchConnectorEndpoints(registerJob.getKey().getBpn())).thenReturn(
Expand Down Expand Up @@ -192,7 +192,7 @@ void registerJobWithDepthShouldBuildTreeUntilGivenDepth() {
@Test
void registerJobWithUpwardDirectionShouldBuildRelationships() {
// given
final RegisterJob registerJob = registerJobWithDirection("urn:uuid:819816fe-7346-49a5-b528-cec5b5367a71",
final RegisterJob registerJob = registerJobWithDirection("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41",
Direction.UPWARD);
when(connectorEndpointsService.fetchConnectorEndpoints(any())).thenReturn(
List.of("http://localhost/discovery"));
Expand Down
Loading

0 comments on commit 2f8e476

Please sign in to comment.