Skip to content

Commit

Permalink
Merge pull request #842 from catenax-ng/feature/488-new-datasets
Browse files Browse the repository at this point in the history
feat(impl):[#488] new datasets
  • Loading branch information
ds-ext-kmassalski authored Apr 2, 2024
2 parents a2f4915 + dd76c23 commit 9df6ea3
Show file tree
Hide file tree
Showing 29 changed files with 175,192 additions and 261,407 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
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
20 changes: 10 additions & 10 deletions irs-api/src/test/java/org/eclipse/tractusx/irs/util/TestMother.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
*/
public class TestMother {

public static final String singleLevelBomAsBuiltAspectName = "urn:bamm:io.catenax.single_level_bom_as_built:2.0.0#SingleLevelBomAsBuilt";
public static final String singleLevelUsageAsBuiltAspectName = "urn:bamm:io.catenax.single_level_usage_as_built:2.0.0#SingleLevelUsageAsBuilt";
public static final String serialPartAspectName = "urn:bamm:io.catenax.serial_part:1.0.1#SerialPart";
public static final String batchAspectName = "urn:samm:io.catenax.batch:2.0.0#Batch";
public static final String materialForRecyclingAspectName = "urn:bamm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling";
public static final String productDescriptionAspectName = "urn:bamm:io.catenax.vehicle.product_description:2.0.0#ProductDescription";
public static final String singleLevelBomAsBuiltAspectName = "urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt";
public static final String singleLevelUsageAsBuiltAspectName = "urn:samm:io.catenax.single_level_usage_as_built:2.0.0#SingleLevelUsageAsBuilt";
public static final String serialPartAspectName = "urn:samm:io.catenax.serial_part:3.0.0#SerialPart";
public static final String batchAspectName = "urn:samm:io.catenax.batch:3.0.0#Batch";
public static final String materialForRecyclingAspectName = "urn:samm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling";
public static final String productDescriptionAspectName = "urn:samm:io.catenax.battery.product_description:1.0.1#ProductDescription";

Faker faker = new Faker();

Expand All @@ -89,7 +89,7 @@ public static RegisterJob registerJobWithoutDepth() {
}

public static RegisterJob registerJobWithDepthAndAspect(final Integer depth, final List<String> aspectTypes) {
return registerJob("urn:uuid:8ddd8fe0-1b4f-44b4-90f3-a8f68e551ac7", depth, aspectTypes, false, false,
return registerJob("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41", depth, aspectTypes, false, false,
Direction.DOWNWARD);
}

Expand All @@ -98,20 +98,20 @@ public static RegisterJob registerJobWithDirection(final String globalAssetId, f
}

public static RegisterJob registerJobWithUrl(final String callbackUrl) {
final RegisterJob registerJob = registerJob("urn:uuid:8ddd8fe0-1b4f-44b4-90f3-a8f68e551ac7", 100, List.of(),
final RegisterJob registerJob = registerJob("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41", 100, List.of(),
false, false, Direction.DOWNWARD);
registerJob.setCallbackUrl(callbackUrl);
return registerJob;
}

public static RegisterJob registerJobWithDepthAndAspectAndCollectAspects(final Integer depth,
final List<String> aspectTypes) {
return registerJob("urn:uuid:8ddd8fe0-1b4f-44b4-90f3-a8f68e551ac7", depth, aspectTypes, true, false,
return registerJob("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41", depth, aspectTypes, true, false,
Direction.DOWNWARD);
}

public static RegisterJob registerJobWithLookupBPNs() {
return registerJob("urn:uuid:8ddd8fe0-1b4f-44b4-90f3-a8f68e551ac7", null,
return registerJob("urn:uuid:1398cd56-682b-4c94-93ac-4807f9bfca41", null,
List.of(singleLevelBomAsBuiltAspectName), false, true, Direction.DOWNWARD);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{
"catenaXId": "urn:uuid:7e4541ea-bb0f-464c-8cb3-021abccbfaf5",
"quantity": {
"quantityNumber": 0.2014,
"measurementUnit": "unit:kilogram"
"value": 0.2014,
"unit": "unit:kilogram"
},
"hasAlternatives": true,
"businessPartner": "BPNL00000000TEST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"catenaXId": "urn:uuid:a314ad6b-77ea-417e-ae2d-193b3e249e99",
"quantity": {
"quantityNumber": 0.2014,
"quantityNumber": 0.4014,
"measurementUnit": "unit:kilogram"
},
"hasAlternatives": true,
Expand Down
Loading

0 comments on commit 9df6ea3

Please sign in to comment.