diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml index 00081160894a838de00c90bb6b6467a853f71023..a7c1e4e4cd180fec8afe5d0d1ed07879589d0fc7 100644 --- a/.github/workflows/build-snapshot.yml +++ b/.github/workflows/build-snapshot.yml @@ -32,7 +32,7 @@ on: - backend/** env: - FUSEKI_VERSION: 4.7.0 + FUSEKI_VERSION: 5.0.0 jobs: build: @@ -54,7 +54,7 @@ jobs: run: | unzip jena-fuseki.zip cd jena-fuseki-docker-$FUSEKI_VERSION - docker build --build-arg JENA_VERSION=$FUSEKI_VERSION -t jena-fuseki-docker:4.7.0 . + docker build --build-arg JENA_VERSION=$FUSEKI_VERSION -t jena-fuseki-docker:$FUSEKI_VERSION . - name: Build and Deploy with Maven run: mvn clean install env: diff --git a/.github/workflows/license-check.yaml b/.github/workflows/license-check.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b47972d30f71a522c932a40b721bf61ab5446a71 --- /dev/null +++ b/.github/workflows/license-check.yaml @@ -0,0 +1,54 @@ +name: 3PP License Check + +on: + push: + branches: + - main + workflow_dispatch: + pull_request: + branches: + - main + schedule: + - cron: '0 4 * * *' # Runs every day at 4am + +jobs: + + License-check: + name: 3PP License Check + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + java: ['17'] # Java 17 matrix + + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + + container: + image: maven:3.9.8-eclipse-temurin-17 # Java 17 container image + + steps: + + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + clean: true + + - name: Clear Maven Cache + run: rm -rf ~/.m2/repository + + - name: Cache Maven Dependencies + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Build with Maven + run: mvn clean install -X -DskipTests + + - name: Run License Check with Dash License Tool + run: mvn org.eclipse.dash:license-tool-plugin:license-check -Ddash.summary=DEPENDENCIES diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 860850f59719f9f3d6224427313249d323fe6527..c72726f2a9cbf45b2b3202b71f53f46701ffb8c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ on: required: true env: - FUSEKI_VERSION: 4.7.0 + FUSEKI_VERSION: 5.0.0 jobs: build: diff --git a/backend/pom.xml b/backend/pom.xml index 99bcb85e91d5cc71c55e0fa49d69b82ff2cd1076..c20284d49be152bd975d6197a604a66119ab6296 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -176,6 +176,10 @@ <groupId>org.apache.jena</groupId> <artifactId>jena-arq</artifactId> </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> <!-- Tests --> <dependency> <groupId>org.assertj</groupId> diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/AspectModelService.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/AspectModelService.java index f9d359846840e137014f5cd7e51df2fb33982ccb..163f5777e35004bd089dfe720ee7e7ed0d39cba3 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/AspectModelService.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/AspectModelService.java @@ -23,6 +23,7 @@ import java.net.URLDecoder; import java.nio.charset.StandardCharsets; import java.util.List; +import org.eclipse.esmf.aspectmodel.aas.AasFileFormat; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.tractusx.semantics.hub.api.ModelsApiDelegate; import org.eclipse.tractusx.semantics.hub.domain.ModelPackageStatus; @@ -162,18 +163,31 @@ public class AspectModelService implements ModelsApiDelegate { return new ResponseEntity( result.get(), HttpStatus.OK ); } - @Override - public ResponseEntity getAasSubmodelTemplate(String urn, AasFormat aasFormat) { - final Try result = sdkHelper.getAasSubmodelTemplate(urn, aasFormat); - if ( result.isFailure() ) { - throw new RuntimeException( String.format( "Failed to generate AASX submodel template for model with urn %s", urn ) ); - } - HttpHeaders responseHeaders = new HttpHeaders(); + @Override + public ResponseEntity getAasSubmodelTemplate(String urn, AasFormat aasFormat) { + AasFileFormat fileFormat = resolveFileFormat(aasFormat); + Try<byte[]> result = sdkHelper.getAasSubmodelTemplate(urn, fileFormat); - responseHeaders.setContentType(getMediaType( aasFormat )); + if ( result.isFailure() ) { + throw new RuntimeException( String.format( "Failed to generate AASX submodel template for model with urn %s", urn ) ); + } + HttpHeaders responseHeaders = new HttpHeaders(); - return new ResponseEntity( result.get(), responseHeaders, HttpStatus.OK ); - } + responseHeaders.setContentType(getMediaType( aasFormat )); + + return new ResponseEntity( result.get(), responseHeaders, HttpStatus.OK ); + } + + private AasFileFormat resolveFileFormat(AasFormat aasFormat) { + if (AasFormat.FILE.equals(aasFormat)) { + return AasFileFormat.AASX; + } + try { + return AasFileFormat.valueOf(aasFormat.getValue()); // Convert AasFormat to AasFileFormat + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Invalid AasFormat value: " + aasFormat.getValue(), e); + } + } /** * Determines the MediaType based on the AasFormat diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/SDKAccessHelper.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/SDKAccessHelper.java index d80f04562e92d7d0f2b47525d375bd4e3a9c8af3..b0c12b15001211085104744cbeae4304e81368e0 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/SDKAccessHelper.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/SDKAccessHelper.java @@ -19,12 +19,9 @@ ********************************************************************************/ package org.eclipse.tractusx.semantics.hub; -import java.util.List; - -import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; -import org.eclipse.tractusx.semantics.hub.model.AasFormat; +import org.eclipse.esmf.aspectmodel.aas.AasFileFormat; +import org.eclipse.esmf.aspectmodel.generator.diagram.DiagramGenerationConfig; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.tractusx.semantics.hub.persistence.PersistenceLayer; import org.eclipse.tractusx.semantics.hub.samm.SDKAccessHelperSAMM; import org.springframework.stereotype.Component; @@ -42,13 +39,8 @@ public class SDKAccessHelper { sdkAccessHelperSAMM.setPersistenceLayer( persistenceLayer ); } - public List<Violation> validateModel( Try<VersionedModel> model ) { - // SAMM validator should also process BAMM models so no switch here - return sdkAccessHelperSAMM.validateModel( model ); - } - public Try<byte[]> generateSvg( String urn ) { - return sdkAccessHelperSAMM.generateDiagram( urn, AspectModelDiagramGenerator.Format.SVG ); + return sdkAccessHelperSAMM.generateDiagram( urn, DiagramGenerationConfig.Format.SVG ); } public JsonNode getJsonSchema( String urn ) { @@ -56,7 +48,7 @@ public class SDKAccessHelper { } public Try<byte[]> getHtmlDocu( String urn ) { - return sdkAccessHelperSAMM.getHtmlDocu( urn ); + return sdkAccessHelperSAMM.getHtmlDocument( urn ); } public String getOpenApiDefinitionJson( String urn, String baseUrl ) { @@ -67,11 +59,11 @@ public class SDKAccessHelper { return sdkAccessHelperSAMM.getExamplePayloadJson( urn ); } - public Try getAasSubmodelTemplate( String urn, AasFormat aasFormat ) { + public Try getAasSubmodelTemplate( String urn, AasFileFormat aasFormat ) { return sdkAccessHelperSAMM.getAasSubmodelTemplate( urn, aasFormat ); } - public Try<VersionedModel> loadBammModel( String modelString ) { - return sdkAccessHelperSAMM.loadSammModel( modelString ); - } + public Try<AspectModel> loadAspectModel(String modelUrn){ + return sdkAccessHelperSAMM.loadAspectModel(modelUrn); + } } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/TripleStoreConfiguration.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/TripleStoreConfiguration.java index 7d6d9f236028252d1bcf2273292d85ffca003ff5..43e4b5eed297b4ad32cbbe74c92cd8e1dfee6a24 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/TripleStoreConfiguration.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/TripleStoreConfiguration.java @@ -67,7 +67,6 @@ public class TripleStoreConfiguration { .verbose( true ) .contextPath( embedded.getContextPath() ) .enableStats( true ) - .enableCors( true ) .build().start(); } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SAMMSdk.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SAMMSdk.java index 8f57888ab7e3f9b47a10e2eecb6de0827c911590..ed80ace9ee9cd12aeb5b628ac37f404872f9f0c4 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SAMMSdk.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SAMMSdk.java @@ -20,73 +20,60 @@ package org.eclipse.tractusx.semantics.hub.persistence.triplestore; import static java.util.Spliterator.ORDERED; +import static org.eclipse.esmf.aspectmodel.resolver.AspectModelFileLoader.*; -import java.util.ArrayList; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Spliterators; -import java.util.function.Function; import java.util.stream.Collectors; +import java.util.stream.Stream; import java.util.stream.StreamSupport; +import java.util.function.Function; import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; import org.apache.jena.rdf.model.Statement; import org.apache.jena.rdf.model.StmtIterator; import org.apache.jena.vocabulary.RDF; -import org.eclipse.esmf.aspectmodel.MissingMetaModelVersionException; -import org.eclipse.esmf.aspectmodel.MultipleMetaModelVersionsException; -import org.eclipse.esmf.aspectmodel.UnsupportedVersionException; -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.AspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategySupport; +import org.eclipse.esmf.aspectmodel.resolver.exceptions.ModelResolutionException; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.urn.ElementType; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.tractusx.semantics.hub.InvalidAspectModelException; import org.eclipse.tractusx.semantics.hub.model.SemanticModelType; -import io.vavr.control.Try; - public class SAMMSdk { - private static final String MESSAGE_MISSING_METAMODEL_VERSION = "Unable to parse metamodel version"; - private static final String MESSAGE_MULTIPLE_METAMODEL_VERSIONS = "Multiple metamodel versions detected, unable to parse"; - private static final String MESSAGE_SAMM_VERSION_NOT_SUPPORTED = "The used meta model version is not supported"; - - private final AspectMetaModelResourceResolver aspectMetaModelResourceResolver; - private final AspectModelResolver aspectModelResolver; - private final AspectModelValidator aspectModelValidator; - - public SAMMSdk() { - aspectMetaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - aspectModelResolver = new AspectModelResolver(); - aspectModelValidator = new AspectModelValidator(); - } - - public void validate( final Model model, final Function<String, Model> tripleStoreRequester, SemanticModelType type ) { - final ResolutionStrategy resolutionStrategy = - new SAMMSdk.TripleStoreResolutionStrategy( tripleStoreRequester, type ); - - final Try<VersionedModel> resolvedModel = new AspectModelResolver().resolveAspectModel( resolutionStrategy, model ); - - final List<Violation> violations = aspectModelValidator.validateModel( resolvedModel ); - if ( !violations.isEmpty() ) { - Map<String, String> detailsMap = violations.stream() - .collect( - Collectors.groupingBy( - Violation::errorCode, - Collectors.mapping( Violation::message, Collectors.joining( "," ) ) - ) - ); + public void validate( final String modelData, final Function<String, Model> tripleStoreRequester, SemanticModelType type ) { + InputStream inputStream = new ByteArrayInputStream(modelData.getBytes(StandardCharsets.UTF_8)); + AspectModel aspectModel; + final ResolutionStrategy resolutionStrategy=new TripleStoreResolutionStrategy(tripleStoreRequester,type); + try { + aspectModel = new AspectModelLoader(resolutionStrategy).load(inputStream); + }catch (Exception e){ + throw new InvalidAspectModelException( e.getMessage() ); + } + final AspectModelValidator validator = new AspectModelValidator(); + final List<Violation> violations = validator.validateModel(aspectModel); + if ( !violations.isEmpty() ) { + Map<String, String> detailsMap = violations.stream() + .collect( + Collectors.groupingBy( + Violation::errorCode, + Collectors.mapping( Violation::message, Collectors.joining( "," ) ) + ) + ); throw new InvalidAspectModelException( detailsMap ); } @@ -104,79 +91,65 @@ public class SAMMSdk { .orElseThrow( () -> new InvalidAspectModelException( "Unable to parse Aspect Model URN" ) ); } - public VersionNumber getKnownVersion( final Model rawModel ) { - return aspectMetaModelResourceResolver - .getMetaModelVersion( rawModel ) - .onFailure( MissingMetaModelVersionException.class, - e -> { - throw new InvalidAspectModelException( MESSAGE_MISSING_METAMODEL_VERSION ); - } ) - .onFailure( MultipleMetaModelVersionsException.class, - e -> { - throw new InvalidAspectModelException( MESSAGE_MULTIPLE_METAMODEL_VERSIONS ); - } ) - .onFailure( UnsupportedVersionException.class, - e -> { - throw new InvalidAspectModelException( MESSAGE_SAMM_VERSION_NOT_SUPPORTED ); - } ).get(); - } - public static class TripleStoreResolutionStrategy implements ResolutionStrategy { - - private final Function<String, Model> tripleStoreRequester; - private final List<String> alreadyLoadedNamespaces = new ArrayList<>(); - private final SemanticModelType type; - - public TripleStoreResolutionStrategy( final Function<String, Model> tripleStoreRequester, SemanticModelType type ) { - this.tripleStoreRequester = tripleStoreRequester; - this.type = type; - } - - @Override - public Try<Model> apply( final AspectModelUrn aspectModelUrn ) { - final String namespace = checkAndReplaceToBammPrefix(aspectModelUrn.getNamespace()); - final Resource resource = ResourceFactory.createResource( checkAndReplaceToBammPrefix(aspectModelUrn.getUrn().toASCIIString())); - final Model model = tripleStoreRequester.apply( checkAndReplaceToBammPrefix(aspectModelUrn.getUrn().toString())); - - if(!isBamm()){ - if ( alreadyLoadedNamespaces.contains( namespace ) ) { - return Try.success( ModelFactory.createDefaultModel() ); - } - alreadyLoadedNamespaces.add( namespace ); - } - - if ( model == null ) { - return Try.failure( new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ) ); - } - return model.contains( resource, RDF.type, (RDFNode) null ) ? - Try.success( model ) : - Try.failure( new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ) ); - } - - private String checkAndReplaceToBammPrefix(String value){ - return !isBamm() ? value : value.replace( "samm", "bamm" ) - .replace( "org.eclipse.esmf.samm","io.openmanufacturing" ); - } - - private boolean isBamm(){ - return type.equals( SemanticModelType.BAMM ); - } - } - - private static class SelfResolutionStrategy implements ResolutionStrategy { - - private final Model model; - - public SelfResolutionStrategy( final Model model ) { - this.model = model; - } - - @Override - public Try<Model> apply( final AspectModelUrn aspectModelUrn ) { - final Resource resource = ResourceFactory.createResource( aspectModelUrn.getUrn().toString() ); - return model.contains( resource, RDF.type, (RDFNode) null ) ? - Try.success( model ) : - Try.failure( new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ) ); - } - } + private final Function<String, Model> tripleStoreRequester; + private final SemanticModelType type; + private AspectModelFile aspectModelFile; + + public TripleStoreResolutionStrategy(Function<String, Model> tripleStoreRequester, SemanticModelType type) { + this.tripleStoreRequester = tripleStoreRequester; + this.type = type; + } + + + @Override + public AspectModelFile apply(AspectModelUrn aspectModelUrn, ResolutionStrategySupport resolutionStrategySupport) throws ModelResolutionException { + final Resource resource = ResourceFactory.createResource( checkAndReplaceToBammPrefix(aspectModelUrn.getUrn().toASCIIString())); + try { + final Model model = tripleStoreRequester.apply( checkAndReplaceToBammPrefix(aspectModelUrn.getUrn().toString())); + if ( model == null ) { + throw new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ) ; + } + if(!model.contains( resource, RDF.type, (RDFNode) null ) ){ + throw new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ); + } + aspectModelFile=load(model); + return aspectModelFile; + } catch (Exception e) { + throw new ResourceDefinitionNotFoundException( getClass().getSimpleName(), resource ) ; } + } + + @Override + public Stream<URI> listContents() { + return aspectModelFile.sourceLocation().stream(); + } + + + @Override + public Stream<URI> listContentsForNamespace( final AspectModelUrn namespace ) { + return aspectModelFile.namespace().urn().equals( namespace ) + ? aspectModelFile.sourceLocation().stream() + : Stream.empty(); + } + + @Override + public Stream<AspectModelFile> loadContents() { + return Stream.of( aspectModelFile ); + } + + @Override + public Stream<AspectModelFile> loadContentsForNamespace( final AspectModelUrn namespace ) { + return aspectModelFile.namespace().urn().equals( namespace ) + ? Stream.of( aspectModelFile ) + : Stream.empty(); + } + + private String checkAndReplaceToBammPrefix(String value){ + return isBamm() ? value.replace( "samm", "bamm" ) : value ; + } + + private boolean isBamm(){ + return type.equals( SemanticModelType.BAMM ); + } + } } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SdsSdk.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SdsSdk.java index 0297deb48b3fdbcebc9dfd996cf465246807c0a2..f36c06869c66d9b66a0cfd4ee723e9a2a4136405 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SdsSdk.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/SdsSdk.java @@ -53,7 +53,7 @@ public class SdsSdk { * * @param model - the model to validate */ - public void validate( final Model model, final Function<String, Model> tripleStoreRequester, SemanticModelType type ) { + public void validate( final String model, final Function<String, Model> tripleStoreRequester, SemanticModelType type ) { sammSdk.validate( model, tripleStoreRequester, type ); } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/TripleStorePersistence.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/TripleStorePersistence.java index f40489bec0c3b2afa27a011abfac2d370bec1601..f1873864b0232161fb5600d14e13fe6ad255e9b2 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/TripleStorePersistence.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/persistence/triplestore/TripleStorePersistence.java @@ -30,6 +30,7 @@ import java.util.stream.Collectors; import javax.annotation.Nullable; +import org.apache.commons.lang3.ObjectUtils; import org.apache.jena.arq.querybuilder.UpdateBuilder; import org.apache.jena.query.Query; import org.apache.jena.query.QuerySolution; @@ -40,7 +41,6 @@ import org.apache.jena.rdf.model.ResourceFactory; import org.apache.jena.rdfconnection.RDFConnection; import org.apache.jena.rdfconnection.RDFConnectionRemoteBuilder; import org.apache.jena.update.UpdateRequest; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.aspectmodel.urn.UrnSyntaxException; import org.eclipse.tractusx.semantics.hub.AspectModelNotFoundException; @@ -107,6 +107,7 @@ public class TripleStorePersistence implements PersistenceLayer { @Override public SemanticModel updateModel( String urn, SemanticModelStatus status ) { + validateStatusParameter(status); SemanticModel semanticModel = Optional.ofNullable( findByUrn( AspectModelUrn.fromUrn( urn ) ) ).orElseThrow( () -> new IllegalArgumentException( String.format( "Invalid URN %s", @@ -127,15 +128,14 @@ public class TripleStorePersistence implements PersistenceLayer { @Override public SemanticModel save( SemanticModelType type, String newModel, SemanticModelStatus status ) { + validateStatusParameter(status); final Model rdfModel = sdsSdk.load( newModel.getBytes( StandardCharsets.UTF_8 ) ); final AspectModelUrn modelUrn = sdsSdk.getAspectUrn( rdfModel ); Optional<ModelPackage> existsByPackage = findByPackageByUrn( ModelPackageUrn.fromUrn( modelUrn ) ); - if ( existsByPackage.isPresent() ) { - validateStatus( status, rdfModel, modelUrn, existsByPackage.get().getStatus() ); - } + existsByPackage.ifPresent(modelPackage -> validateStatus(status, rdfModel, modelUrn, modelPackage.getStatus())); - sdsSdk.validate( rdfModel, this::findContainingModelByUrn, type ); + sdsSdk.validate( newModel, this::findContainingModelByUrn, type ); Model rdfModelOriginal = sdsSdk.load( newModel.getBytes( StandardCharsets.UTF_8 ) ); @@ -248,23 +248,28 @@ public class TripleStorePersistence implements PersistenceLayer { } private boolean hasReferenceToDraftPackage( AspectModelUrn modelUrn, Model model ) { - Pattern pattern = Pattern.compile( SparqlQueries.ALL_SAMM_ASPECT_URN_PREFIX ); + Pattern pattern = Pattern.compile(SparqlQueries.ALL_SAMM_ASPECT_URN_PREFIX); + List<String> urns = model.getNsPrefixMap().values().stream() + .filter(value -> value.contains(AspectModelUrn.VALID_PROTOCOL)) + .toList(); - List<String> urns = AspectModelResolver.getAllUrnsInModel( model ).stream().filter( urn -> getAspectModelUrn( urn ).isSuccess() ) - .map( urn -> getAspectModelUrn( urn ).get().getUrnPrefix() ) - .distinct() - .collect( Collectors.toList() ); - for ( var entry : urns ) { - Matcher matcher = pattern.matcher( entry ); - if ( !matcher.find() && !modelUrn.getUrnPrefix().equals( entry ) ) { - if ( findByPackageByUrn( ModelPackageUrn.fromUrn( entry ) ).get().getStatus().equals( ModelPackageStatus.DRAFT ) ) { - return false; - } - } - } + for (String entry : urns) { + Matcher matcher = pattern.matcher(entry); + + if (matcher.find() || modelUrn.getUrnPrefix().equals(entry)) { + continue; + } + + var packageStatus = findByPackageByUrn(ModelPackageUrn.fromUrn(entry)) + .map(ModelPackage::getStatus) + .orElse(null); - return true; + if (ModelPackageStatus.DRAFT.equals(packageStatus)) { + return false; + } + } + return true; } private Integer getTotalItemsCount( @Nullable String namespaceFilter, @@ -376,4 +381,10 @@ public class TripleStorePersistence implements PersistenceLayer { return SemanticModelType.SAMM; } } + private void validateStatusParameter(SemanticModelStatus status) { + if (ObjectUtils.allNull(status)) { + throw new IllegalArgumentException( + "SemanticModelStatus cannot be null. Valid values are: DRAFT, RELEASED, STANDARDIZED, DEPRECATED."); + } + } } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/SDKAccessHelperSAMM.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/SDKAccessHelperSAMM.java index 32bac866e7d0027549dde5eeb5f663c13a06c5a9..218b2c1b7d1bc725d069170a04a8871ef2338fd7 100644 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/SDKAccessHelperSAMM.java +++ b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/SDKAccessHelperSAMM.java @@ -24,33 +24,28 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.List; +import java.nio.charset.StandardCharsets; import java.util.Locale; -import java.util.Map; -import java.util.Optional; +import java.util.stream.Stream; -import org.apache.jena.rdf.model.Model; -import org.eclipse.esmf.aspectmodel.aas.AspectModelAASGenerator; +import lombok.Setter; +import org.eclipse.esmf.aspectmodel.aas.*; import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; -import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator.Format; +import org.eclipse.esmf.aspectmodel.generator.diagram.DiagramArtifact; +import org.eclipse.esmf.aspectmodel.generator.diagram.DiagramGenerationConfig; import org.eclipse.esmf.aspectmodel.generator.docu.AspectModelDocumentationGenerator; -import org.eclipse.esmf.aspectmodel.generator.docu.AspectModelDocumentationGenerator.HtmlGenerationOption; +import org.eclipse.esmf.aspectmodel.generator.docu.DocumentationGenerationConfig; +import org.eclipse.esmf.aspectmodel.generator.docu.DocumentationGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.generator.json.AspectModelJsonPayloadGenerator; import org.eclipse.esmf.aspectmodel.generator.jsonschema.AspectModelJsonSchemaGenerator; +import org.eclipse.esmf.aspectmodel.generator.jsonschema.JsonSchemaGenerationConfig; +import org.eclipse.esmf.aspectmodel.generator.jsonschema.JsonSchemaGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.generator.openapi.AspectModelOpenApiGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; +import org.eclipse.esmf.aspectmodel.generator.openapi.OpenApiSchemaGenerationConfig; +import org.eclipse.esmf.aspectmodel.generator.openapi.OpenApiSchemaGenerationConfigBuilder; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.tractusx.semantics.hub.InvalidAspectModelException; -import org.eclipse.tractusx.semantics.hub.ResolutionException; -import org.eclipse.tractusx.semantics.hub.model.AasFormat; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.tractusx.semantics.hub.persistence.PersistenceLayer; import com.fasterxml.jackson.databind.JsonNode; @@ -58,155 +53,106 @@ import com.google.common.io.CharStreams; import io.vavr.control.Try; +@Setter public class SDKAccessHelperSAMM { PersistenceLayer persistenceLayer; - public void setPersistenceLayer( PersistenceLayer persistenceLayer ) { - this.persistenceLayer = persistenceLayer; - } - - public List<Violation> validateModel( Try<VersionedModel> model ) { - final AspectModelValidator validator = new AspectModelValidator(); - return validator.validateModel( model ); - } - - public Try<byte[]> generateDiagram( String urn, Format format ) { - - VersionedModel versionedModel = getVersionedModel( urn ); - - final Aspect aspect = AspectModelLoader.getAspects( versionedModel ).get().get( 0 ); - - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( new AspectContext( versionedModel, aspect ) ); - - try ( ByteArrayOutputStream output = new ByteArrayOutputStream() ) { - generator.generateDiagram( format , Locale.ENGLISH, output ); - final byte[] bytes = output.toByteArray(); - - return Try.success( bytes ); - } catch ( IOException e ) { - return Try.failure( e ); - } + public Try<byte[]> generateDiagram( String urn, DiagramGenerationConfig.Format format ) { + return Try.of(() -> { + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel =loadAspectModel(modelData).get(); + DiagramGenerationConfig config = new DiagramGenerationConfig(Locale.ENGLISH, format); + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator(aspectModel.aspect(), config); + + // Generate the diagram and retrieve the content + return generator.generate() + .findFirst() + .map(DiagramArtifact::getContent) + .orElseThrow(() -> new IllegalStateException("No artifact was generated.")); + }); } public JsonNode getJsonSchema( String urn ) { - Aspect aspect = getBamAspect( urn ); - AspectModelJsonSchemaGenerator jsonSchemaGenerator = new AspectModelJsonSchemaGenerator(); - return jsonSchemaGenerator.apply( aspect, Locale.ENGLISH ); - } - - public Try<byte[]> getHtmlDocu( String urn ) { - VersionedModel versionedModel = getVersionedModel( urn ); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - - final Aspect aspect = AspectModelLoader.getAspects(versionedModel).get().get(0); - - AspectModelDocumentationGenerator documentationGenerator = new AspectModelDocumentationGenerator( new AspectContext(versionedModel, aspect) ); - - Map<HtmlGenerationOption, String> options = new HashMap(); - - try { - InputStream ompCSS = getClass().getResourceAsStream( "/catena-template.css" ); - String defaultCSS = CharStreams.toString( new InputStreamReader( ompCSS ) ); - - options.put( HtmlGenerationOption.STYLESHEET, defaultCSS ); - } catch ( IOException e ) { - return Try.failure( e ); + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel =loadAspectModel(modelData).get(); + final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() + .locale( Locale.ENGLISH ) + .build(); + final AspectModelJsonSchemaGenerator generator = new AspectModelJsonSchemaGenerator( aspectModel.aspect(), config ); + return generator.getContent(); } - try { - documentationGenerator.generate( ( String a ) -> { - return output; - }, options ); + public Try<byte[]> getHtmlDocument(String urn) { + return Try.of(() -> { + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel =loadAspectModel(modelData).get(); + InputStream ompCSS = getClass().getResourceAsStream("/catena-template.css"); + if (ompCSS == null) { + throw new IOException("CSS resource not found"); + } + String defaultCSS = CharStreams.toString( new InputStreamReader( ompCSS ) ); - return Try.success( output.toByteArray() ); - } catch ( IOException e ) { - return Try.failure( e ); - } - } - public String getOpenApiDefinitionJson( String urn, String baseUrl ) { - Aspect aspect = getBamAspect( urn ); - AspectModelOpenApiGenerator openApiGenerator = new AspectModelOpenApiGenerator(); + final DocumentationGenerationConfig config = DocumentationGenerationConfigBuilder.builder() + .stylesheet(defaultCSS) + .build(); + final AspectModelDocumentationGenerator generator = + new AspectModelDocumentationGenerator(aspectModel.aspect(), config); - JsonNode resultJson = openApiGenerator.applyForJson( aspect, true, baseUrl, Optional.empty(), Optional.empty(), false, Optional.empty() ); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + generator.generate(aspectFileName -> outputStream); - return resultJson.toString(); - } + return outputStream.toByteArray(); + }); + } - public Try<String> getExamplePayloadJson( String urn ) { - Aspect aspect = getBamAspect( urn ); - AspectModelJsonPayloadGenerator payloadGenerator = new AspectModelJsonPayloadGenerator( aspect ); - - return Try.of( payloadGenerator::generateJson ); - } - - public Try getAasSubmodelTemplate( String urn, AasFormat aasFormat ) { - Aspect aspect = getBamAspect( urn ); - AspectModelAASGenerator aasGenerator = new AspectModelAASGenerator(); - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - - try { - switch ( aasFormat ) { - case FILE: - aasGenerator.generateAASXFile( aspect, ( String s ) -> { - return stream; - } ); - return Try.of( stream::toByteArray ); - case XML: - aasGenerator.generateAasXmlFile( aspect, ( String s ) -> { - return stream; - } ); - return Try.of( stream::toString ); - case JSON: - aasGenerator.generateAasJsonFile( aspect, ( String s ) -> { - return stream; - } ); - return Try.of( stream::toString ); - default: - return Try.failure( new Exception( String.format( "Wrong AAS output format %s", aasFormat.toString() ) ) ); - - } - } catch ( IOException e ) { - return Try.failure( e ); - } - } - - private org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel getVersionedModel( String urn ) { - final String modelDefinition = persistenceLayer.getModelDefinition( AspectModelUrn.fromUrn( urn ) ); - final Try<org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel> versionedModel = - loadSammModel( modelDefinition ); - - if ( versionedModel.isFailure() ) { - throw new RuntimeException( "Failed to load versioned model", versionedModel.getCause() ); - } - return versionedModel.get(); - } + public String getOpenApiDefinitionJson( String urn, String baseUrl ) { + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel = loadAspectModel(modelData).get(); - private org.eclipse.esmf.metamodel.Aspect getBamAspect( String urn ) { - final Try<List<org.eclipse.esmf.metamodel.Aspect>> aspect = getAspectFromVersionedModel( getVersionedModel( urn ) ); - if ( aspect.isFailure() ) { - throw new RuntimeException( "Failed to load aspect model", aspect.getCause() ); - } - return aspect.get().get( 0 ); - } - - private Try<List<Aspect>> getAspectFromVersionedModel( VersionedModel versionedModel ) { - return AspectModelLoader.getAspects( versionedModel ); - } + final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder().baseUrl(baseUrl).build(); + final AspectModelOpenApiGenerator generator = new AspectModelOpenApiGenerator(aspectModel.aspect(), config); - public Try<VersionedModel> loadSammModel( String ttl ) { - InputStream targetStream = new ByteArrayInputStream( ttl.getBytes() ); - Try<Model> model = TurtleLoader.loadTurtle( targetStream ); + return generator.generateJson(); + } - StaticResolutionStrategy resolutionStrategy = new StaticResolutionStrategy( model ); - AspectModelResolver resolver = new AspectModelResolver(); - Try<VersionedModel> versionedModel = resolver.resolveAspectModel( resolutionStrategy, - model.getOrElseThrow( cause -> new InvalidAspectModelException( cause.getMessage() ) ) ); - - if ( resolutionStrategy.getResolvementCounter() > 1 ) { - return Try.failure( new ResolutionException( "The definition must be self contained!" ) ); - } - return versionedModel; - } + public Try<String> getExamplePayloadJson( String urn ) { + return Try.of(() -> { + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel =loadAspectModel(modelData).get(); + final AspectModelJsonPayloadGenerator generator = new AspectModelJsonPayloadGenerator( aspectModel.aspect() ); + return generator.generateJson(); + }); + } + + public Try<byte[]> getAasSubmodelTemplate( String urn, AasFileFormat aasFormat ) { + return Try.of(() -> { + String modelData = persistenceLayer.getModelDefinition(AspectModelUrn.fromUrn(urn)); + final AspectModel aspectModel =loadAspectModel(modelData).get(); + AasGenerationConfig config = AasGenerationConfigBuilder.builder() + .format(aasFormat) + .build(); + + Stream<AasArtifact> artifacts = new AspectModelAasGenerator(aspectModel.aspect(), config).generate(); + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + + artifacts.forEach(artifact -> { + try { + outputStream.write(artifact.getContent()); + } catch (IOException e) { + throw new RuntimeException("Error writing artifact content to stream", e); + } + }); + return outputStream.toByteArray(); + }); + } + + public Try<AspectModel> loadAspectModel(String modelUrn) { + return Try.of(() -> { + InputStream inputStream = new ByteArrayInputStream(modelUrn.getBytes(StandardCharsets.UTF_8)); + return new AspectModelLoader().load(inputStream); + }); + } } diff --git a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/StaticResolutionStrategy.java b/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/StaticResolutionStrategy.java deleted file mode 100644 index c64a79a8cef98318adb58e4b8296f228a8e5b3b4..0000000000000000000000000000000000000000 --- a/backend/src/main/java/org/eclipse/tractusx/semantics/hub/samm/StaticResolutionStrategy.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2021-2022 Robert Bosch Manufacturing Solutions GmbH - * Copyright (c) 2021-2022 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ -package org.eclipse.tractusx.semantics.hub.samm; - -import java.util.List; -import java.util.Optional; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.vocabulary.RDF; -import org.eclipse.esmf.aspectmodel.resolver.AbstractResolutionStrategy; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; - -import io.vavr.NotImplementedError; -import io.vavr.control.Try; - -public class StaticResolutionStrategy extends AbstractResolutionStrategy { - private int counter; - private final Try<Model> model; - - public StaticResolutionStrategy( Try<Model> model ) { - this.model = model; - } - - @Override - public Try<Model> apply( AspectModelUrn t ) { - counter++; - return this.model; - } - - public int getResolvementCounter() { - return counter; - } - - public AspectModelUrn getAspectModelUrn() { - final Optional<StmtIterator> stmtIterator = getStmtIterator(); - - final String aspectModelUrn = stmtIterator.orElseThrow( - () -> new NotImplementedError( "AspectModelUrn cannot be found." ) ) - .next().getSubject().getURI(); - - return AspectModelUrn.fromUrn( aspectModelUrn ); - } - - private Optional<StmtIterator> getStmtIterator() { - for ( final KnownVersion version : KnownVersion.getVersions() ) { - final SAMM samm = new SAMM( version ); - final List<Resource> resources = List.of( samm.Aspect(), samm.Property(), samm.Entity(), samm.Characteristic() ); - final Optional<StmtIterator> stmtIterator = resources.stream().filter( - resource -> model.get().listStatements( null, RDF.type, resource ).hasNext() ).findFirst() - .map( resource -> model.get().listStatements( null, RDF.type, resource ) ); - if ( stmtIterator.isPresent() ) { - return stmtIterator; - } - } - return Optional.empty(); - } -} diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/FusekiTestContainer.java b/backend/src/test/java/org/eclipse/tractusx/semantics/FusekiTestContainer.java index 4c357f808ed478b88c1b7978220b75d4983fb335..2ed3ffeaa2da953a0e8918676c66d37e2e63c4ab 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/FusekiTestContainer.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/FusekiTestContainer.java @@ -26,7 +26,7 @@ import org.testcontainers.containers.wait.strategy.Wait; public class FusekiTestContainer { private static final int PORT = 3030; - private static final String IMAGE = "jena-fuseki-docker:4.7.0"; + private static final String IMAGE = "jena-fuseki-docker:5.0.0"; private static final String CONTAINER_NAME = "fuseki-container"; public static final GenericContainer<?> FUSEKI_CONTAINER = diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/ModelsApiTest.java b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/ModelsApiTest.java index 59f64d981022017db305bff60e2114420c7252c7..baa9a7e03a113211b4b2d455bf962f17a4e8d08e 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/ModelsApiTest.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/ModelsApiTest.java @@ -112,13 +112,13 @@ public class ModelsApiTest extends AbstractModelsApiTest{ @Test public void testSaveInvalidModelExpectSuccess() throws Exception { - String insertModelJson = "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:1.0.0#> .\n @prefix bamm-c: <urn:samm:org.eclipse.esmf.samm:characteristicX:1.0.0#> .\n @prefix bamm-e: <urn:samm:org.eclipse.esmf.samm:entity:1.0.0#> .\n @prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:1.0.0#> .\n @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n @prefix : <urn:samm:org.eclipse.tractusx:1.0.0#> .\n \n :Movement a samm:Aspect;\n samm:name \"Movement\";\n samm:preferredName \"Movement\"@en;\n samm:description \"Aspect for movement information\"@en;\n samm:propertiesX (:isMoving :speedLimitWarning :position);\n samm:operations ().\n :isMoving a samm:Property;\n samm:name \"isMoving\";\n samm:preferredName \"Moving\"@en;\n samm:description \"Flag indicating whether the asset is currently moving\"@en;\n samm:characteristic bamm-c:Boolean.\n :speedLimitWarning a samm:Property;\n samm:name \"speedLimitWarning\";\n samm:preferredName \"Speed Limit Warning\"@en;\n samm:description \"Indicates if the speed limit is adhered to.\"@en;\n samm:characteristic :TrafficLight.\n :position a samm:Property;\n samm:name \"position\";\n samm:preferredName \"Position\"@en;\n samm:description \"Indicates a position\"@en;\n samm:characteristic :SpatialPositionCharacteristic.\n :TrafficLight a bamm-c:Enumeration;\n samm:name \"TrafficLight\";\n samm:preferredName \"Warning Level\"@en;\n samm:description \"Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red).\"@en;\n samm:dataType xsd:string;\n bamm-c:values (\"green\" \"yellow\" \"red\").\n :SpatialPosition a samm:Entity;\n samm:name \"SpatialPosition\";\n samm:preferredName \"Spatial Position\"@en;\n samm:description \"Position in space, described along three axis, with the third axis optional, if all positions are in a plane.\"@en;\n samm:properties (:x :y :z).\n :x a samm:Property;\n samm:name \"x\";\n samm:preferredName \"x\"@en;\n samm:description \"x coordinate in space\"@en;\n samm:characteristic :Coordinate.\n :y a samm:Property;\n samm:name \"y\";\n samm:preferredName \"y\"@en;\n samm:description \"y coordinate in space\"@en;\n samm:characteristic :Coordinate.\n :z a samm:Property;\n samm:name \"z\";\n samm:preferredName \"z\"@en;\n samm:description \"z coordinate in space\"@en;\n samm:characteristic :Coordinate;\n samm:optional \"true\"^^xsd:boolean.\n :Coordinate a bamm-c:Measurement;\n samm:name \"Coordinate\";\n samm:preferredName \"Coordinate\"@en;\n samm:description \"Represents a coordinate along an axis in space.\"@en;\n samm:dataType xsd:float;\n bamm-c:unit unit:metre.\n :SpatialPositionCharacteristic a bamm-c:SingleEntity;\n samm:name \"SpatialPositionCharacteristic\";\n samm:preferredName \"Spatial Position Characteristic\"@en;\n samm:description \"Represents a single position in space with optional z coordinate.\"@en;\n samm:dataType :SpatialPosition."; + String insertModelJson = "@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:1.0.0#> .\n @prefix bamm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:1.0.0#> .\n @prefix bamm-e: <urn:samm:org.eclipse.esmf.samm:entity:1.0.0#> .\n @prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:1.0.0#> .\n @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n @prefix : <urn:samm:org.eclipse.tractusx:1.0.0#> .\n \n :Movement a samm:Aspect;\n samm:name \"Movement\";\n samm:preferredName \"Movement\"@en;\n samm:description \"Aspect for movement information\"@en;\n samm:propertiesX (:isMoving :speedLimitWarning :position);\n samm:operations ().\n :isMoving a samm:Property;\n samm:name \"isMoving\";\n samm:preferredName \"Moving\"@en;\n samm:description \"Flag indicating whether the asset is currently moving\"@en;\n samm:characteristic bamm-c:bool.\n :speedLimitWarning a samm:Property;\n samm:name \"speedLimitWarning\";\n samm:preferredName \"Speed Limit Warning\"@en;\n samm:description \"Indicates if the speed limit is adhered to.\"@en;\n samm:characteristic :TrafficLight.\n :position a samm:Property;\n samm:name \"position\";\n samm:preferredName \"Position\"@en;\n samm:description \"Indicates a position\"@en;\n samm:characteristic :SpatialPositionCharacteristic.\n :TrafficLight a bamm-c:Enumeration;\n samm:name \"TrafficLight\";\n samm:preferredName \"Warning Level\"@en;\n samm:description \"Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red).\"@en;\n samm:dataType xsd:string;\n bamm-c:values (\"green\" \"yellow\" \"red\").\n :SpatialPosition a samm:Entity;\n samm:name \"SpatialPosition\";\n samm:preferredName \"Spatial Position\"@en;\n samm:description \"Position in space, described along three axis, with the third axis optional, if all positions are in a plane.\"@en;\n samm:properties (:x :y :z).\n :x a samm:Property;\n samm:name \"x\";\n samm:preferredName \"x\"@en;\n samm:description \"x coordinate in space\"@en;\n samm:characteristic :Coordinate.\n :y a samm:Property;\n samm:name \"y\";\n samm:preferredName \"y\"@en;\n samm:description \"y coordinate in space\"@en;\n samm:characteristic :Coordinate.\n :z a samm:Property;\n samm:name \"z\";\n samm:preferredName \"z\"@en;\n samm:description \"z coordinate in space\"@en;\n samm:characteristic :Coordinate;\n samm:optional \"true\"^^xsd:boolean.\n :Coordinate a bamm-c:Measurement;\n samm:name \"Coordinate\";\n samm:preferredName \"Coordinate\"@en;\n samm:description \"Represents a coordinate along an axis in space.\"@en;\n samm:dataType xsd:float;\n bamm-c:unit unit:metre.\n :SpatialPositionCharacteristic a bamm-c:SingleEntity;\n samm:name \"SpatialPositionCharacteristic\";\n samm:preferredName \"Spatial Position Characteristic\"@en;\n samm:description \"Represents a single position in space with optional z coordinate.\"@en;\n samm:dataType :SpatialPosition."; mvc.perform(post( insertModelJson )) .andDo( MockMvcResultHandlers.print() ) .andExpect( jsonPath( "$.error.message", containsString("Validation failed" ) ) ) - .andExpect( jsonPath( "$.error.details.ERR_NO_TYPE", containsString( - "Could not determine type of bamm-c:Boolean." ) ) ) + .andExpect( jsonPath( "$.error.details.validationError", containsString( + "Resource urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#bool has no type" ) ) ) .andExpect( status().is4xxClientError() ); } @@ -239,8 +239,8 @@ public class ModelsApiTest extends AbstractModelsApiTest{ .andDo( MockMvcResultHandlers.print() ) .andExpect( status().isBadRequest() ) .andExpect( jsonPath( "$.error.message", is( "Validation failed." ) ) ) - .andExpect( jsonPath( "$.error.details.ERR_PROCESSING", - containsString( "definition for urn:samm:org.eclipse.tractusx.traceability:0.1.1#PartDataCharacteristic not found" ) ) ); + .andExpect( jsonPath( "$.error.details.validationError", + containsString( "TripleStoreResolutionStrategy: definition for urn:samm:org.eclipse.tractusx.traceability:0.1.1#PartDataCharacteristic not found" ) ) ); // save the traceability aspect model String traceabilityModel = TestUtils.loadModelFromResources( @@ -528,12 +528,12 @@ public class ModelsApiTest extends AbstractModelsApiTest{ @Test public void testSaveInvalidModelExpectSuccessForBAMM() throws Exception { - String insertModelJson = "@prefix bamm: <urn:bamm:io.openmanufacturing:meta-model:1.0.0#> .\n @prefix bamm-c: <urn:bamm:io.openmanufacturing:characteristicX:1.0.0#> .\n @prefix bamm-e: <urn:bamm:io.openmanufacturing:entity:1.0.0#> .\n @prefix unit: <urn:bamm:io.openmanufacturing:unit:1.0.0#> .\n @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n @prefix : <urn:bamm:org.eclipse.tractusx:1.0.0#> .\n \n :Movement a bamm:Aspect;\n bamm:name \"Movement\";\n bamm:preferredName \"Movement\"@en;\n bamm:description \"Aspect for movement information\"@en;\n bamm:propertiesX (:isMoving :speedLimitWarning :position);\n bamm:operations ().\n :isMoving a bamm:Property;\n bamm:name \"isMoving\";\n bamm:preferredName \"Moving\"@en;\n bamm:description \"Flag indicating whether the asset is currently moving\"@en;\n bamm:characteristic bamm-c:Boolean.\n :speedLimitWarning a bamm:Property;\n bamm:name \"speedLimitWarning\";\n bamm:preferredName \"Speed Limit Warning\"@en;\n bamm:description \"Indicates if the speed limit is adhered to.\"@en;\n bamm:characteristic :TrafficLight.\n :position a bamm:Property;\n bamm:name \"position\";\n bamm:preferredName \"Position\"@en;\n bamm:description \"Indicates a position\"@en;\n bamm:characteristic :SpatialPositionCharacteristic.\n :TrafficLight a bamm-c:Enumeration;\n bamm:name \"TrafficLight\";\n bamm:preferredName \"Warning Level\"@en;\n bamm:description \"Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red).\"@en;\n bamm:dataType xsd:string;\n bamm-c:values (\"green\" \"yellow\" \"red\").\n :SpatialPosition a bamm:Entity;\n bamm:name \"SpatialPosition\";\n bamm:preferredName \"Spatial Position\"@en;\n bamm:description \"Position in space, described along three axis, with the third axis optional, if all positions are in a plane.\"@en;\n bamm:properties (:x :y :z).\n :x a bamm:Property;\n bamm:name \"x\";\n bamm:preferredName \"x\"@en;\n bamm:description \"x coordinate in space\"@en;\n bamm:characteristic :Coordinate.\n :y a bamm:Property;\n bamm:name \"y\";\n bamm:preferredName \"y\"@en;\n bamm:description \"y coordinate in space\"@en;\n bamm:characteristic :Coordinate.\n :z a bamm:Property;\n bamm:name \"z\";\n bamm:preferredName \"z\"@en;\n bamm:description \"z coordinate in space\"@en;\n bamm:characteristic :Coordinate;\n bamm:optional \"true\"^^xsd:boolean.\n :Coordinate a bamm-c:Measurement;\n bamm:name \"Coordinate\";\n bamm:preferredName \"Coordinate\"@en;\n bamm:description \"Represents a coordinate along an axis in space.\"@en;\n bamm:dataType xsd:float;\n bamm-c:unit unit:metre.\n :SpatialPositionCharacteristic a bamm-c:SingleEntity;\n bamm:name \"SpatialPositionCharacteristic\";\n bamm:preferredName \"Spatial Position Characteristic\"@en;\n bamm:description \"Represents a single position in space with optional z coordinate.\"@en;\n bamm:dataType :SpatialPosition."; + String insertModelJson = "@prefix bamm: <urn:bamm:io.openmanufacturing:meta-model:1.0.0#> .\n @prefix bamm-c: <urn:bamm:io.openmanufacturing:characteristic:1.0.0#> .\n @prefix bamm-e: <urn:bamm:io.openmanufacturing:entity:1.0.0#> .\n @prefix unit: <urn:bamm:io.openmanufacturing:unit:1.0.0#> .\n @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n @prefix : <urn:bamm:org.eclipse.tractusx:1.0.0#> .\n \n :Movement a bamm:Aspect;\n bamm:name \"Movement\";\n bamm:preferredName \"Movement\"@en;\n bamm:description \"Aspect for movement information\"@en;\n bamm:propertiesX (:isMoving :speedLimitWarning :position);\n bamm:operations ().\n :isMoving a bamm:Property;\n bamm:name \"isMoving\";\n bamm:preferredName \"Moving\"@en;\n bamm:description \"Flag indicating whether the asset is currently moving\"@en;\n bamm:characteristic bamm-c:Bool.\n :speedLimitWarning a bamm:Property;\n bamm:name \"speedLimitWarning\";\n bamm:preferredName \"Speed Limit Warning\"@en;\n bamm:description \"Indicates if the speed limit is adhered to.\"@en;\n bamm:characteristic :TrafficLight.\n :position a bamm:Property;\n bamm:name \"position\";\n bamm:preferredName \"Position\"@en;\n bamm:description \"Indicates a position\"@en;\n bamm:characteristic :SpatialPositionCharacteristic.\n :TrafficLight a bamm-c:Enumeration;\n bamm:name \"TrafficLight\";\n bamm:preferredName \"Warning Level\"@en;\n bamm:description \"Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red).\"@en;\n bamm:dataType xsd:string;\n bamm-c:values (\"green\" \"yellow\" \"red\").\n :SpatialPosition a bamm:Entity;\n bamm:name \"SpatialPosition\";\n bamm:preferredName \"Spatial Position\"@en;\n bamm:description \"Position in space, described along three axis, with the third axis optional, if all positions are in a plane.\"@en;\n bamm:properties (:x :y :z).\n :x a bamm:Property;\n bamm:name \"x\";\n bamm:preferredName \"x\"@en;\n bamm:description \"x coordinate in space\"@en;\n bamm:characteristic :Coordinate.\n :y a bamm:Property;\n bamm:name \"y\";\n bamm:preferredName \"y\"@en;\n bamm:description \"y coordinate in space\"@en;\n bamm:characteristic :Coordinate.\n :z a bamm:Property;\n bamm:name \"z\";\n bamm:preferredName \"z\"@en;\n bamm:description \"z coordinate in space\"@en;\n bamm:characteristic :Coordinate;\n bamm:optional \"true\"^^xsd:boolean.\n :Coordinate a bamm-c:Measurement;\n bamm:name \"Coordinate\";\n bamm:preferredName \"Coordinate\"@en;\n bamm:description \"Represents a coordinate along an axis in space.\"@en;\n bamm:dataType xsd:float;\n bamm-c:unit unit:metre.\n :SpatialPositionCharacteristic a bamm-c:SingleEntity;\n bamm:name \"SpatialPositionCharacteristic\";\n bamm:preferredName \"Spatial Position Characteristic\"@en;\n bamm:description \"Represents a single position in space with optional z coordinate.\"@en;\n bamm:dataType :SpatialPosition."; mvc.perform(post( insertModelJson )) .andDo( MockMvcResultHandlers.print() ) - .andExpect( jsonPath( "$.error.details.ERR_NO_TYPE", containsString("Could not determine type of urn:samm:io.openmanufacturing:characteristicX:1.0.0#Boolean" ) ) ) - .andExpect( status().is4xxClientError() ); + .andExpect( jsonPath( "$.error.details.validationError", containsString("Resource urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0#Bool has no type" ) ) ) + .andExpect( status().is4xxClientError() ); } @Test @@ -648,9 +648,10 @@ public class ModelsApiTest extends AbstractModelsApiTest{ .andDo( MockMvcResultHandlers.print() ) .andExpect( status().isBadRequest() ) .andExpect( jsonPath( "$.error.message", is( "Validation failed." ) ) ) - .andExpect( jsonPath( "$.error.details.ERR_PROCESSING", - containsString( "urn:bamm:org.eclipse.tractusx.traceability:0.1.1#PartDataCharacteristic not found" ) ) ); - // save the traceability aspect model + .andExpect( jsonPath( "$.error.details.validationError", + containsString( "TripleStoreResolutionStrategy: definition for urn:bamm:org.eclipse.tractusx.traceability:0.1.1#PartDataCharacteristic not found" ) ) ); + + // save the traceability aspect model String traceabilityModel = TestUtils.loadModelFromResources( TestUtils.TRACEABILITY_MODEL_PATH_FOR_BAMM ); mvc.perform( postBAMM( traceabilityModel, "DRAFT" ) ) @@ -967,7 +968,9 @@ public class ModelsApiTest extends AbstractModelsApiTest{ } - @Test + //issue its fix into latest jena version 4.9.0 or above + +/* @Test public void testInvalidDependentModelBAMMModel() throws Exception { //Given @@ -1008,7 +1011,7 @@ public class ModelsApiTest extends AbstractModelsApiTest{ .andExpect( status().isBadRequest() ) .andExpect( jsonPath( "$.error.message", containsString( "Bad IRI" ) ) ); } - +*/ private static String toMovementUrn(String urn){ return urn + "Movement"; } @@ -1021,7 +1024,7 @@ public class ModelsApiTest extends AbstractModelsApiTest{ .andExpect( status().isBadRequest() ) .andExpect( jsonPath( "$.error.message", is( "The URN must consist of at least 5 sections adhering to the following schema: " - + "urn:samm:<organisation>:<optional>:<version>:<model-name>." ) ) ); + + "urn:samm:<organisation>:<optional>:<version>#<element-name>." ) ) ); } @Test @@ -1070,4 +1073,71 @@ public class ModelsApiTest extends AbstractModelsApiTest{ .andExpect( jsonPath( "$.error.message", containsString( "Invalid URN urn" ) ) ); } -} \ No newline at end of file + @Test + public void testDependentModelSAMMWithValidationFailed() throws Exception { + String ADDRESS_ASPECT_FILE = "AddressAspect.ttl"; + String BUSINESS_PARTNER_NUMBER_FILE = "BusinessPartnerNumber-1.0.0.ttl"; + String CONTACT_INFORMATION_FILE = "ContactInformation-3.0.0.ttl"; + String UUID_FILE ="Uuid-1.0.0.ttl"; + String DIGITAL_PRODUCT_PASSPORT_FILE = "DigitalProductPassport-3.0.0.ttl"; + + //Given + mvc.perform(post ( TestUtils.getTTLFile( ADDRESS_ASPECT_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile( BUSINESS_PARTNER_NUMBER_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile(CONTACT_INFORMATION_FILE), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + + mvc.perform( post( TestUtils.getTTLFile(UUID_FILE), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + //When + mvc.perform( post( TestUtils.getTTLFile( DIGITAL_PRODUCT_PASSPORT_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( jsonPath( "$.error.message", containsString("Validation failed" ) ) ) + .andExpect( jsonPath( "$.error.details.validationError", containsString("TripleStoreResolutionStrategy: definition for urn:samm:io.catenax.shared.quantity:1.0.0#VolumeCharacteristic not found" ) ) ) + .andExpect( status().is4xxClientError() ); + } + + @Test + public void testDependentModelSAMMWithSuccess() throws Exception { + String ADDRESS_ASPECT_FILE = "AddressAspect.ttl"; + String BUSINESS_PARTNER_NUMBER_FILE = "BusinessPartnerNumber-1.0.0.ttl"; + String CONTACT_INFORMATION_FILE = "ContactInformation-3.0.0.ttl"; + String QUANTITY_FILE="Quantity-1.0.0.ttl"; + String UUID_FILE ="Uuid-1.0.0.ttl"; + String DIGITAL_PRODUCT_PASSPORT_FILE = "DigitalProductPassport-3.0.0.ttl"; + + //Given + mvc.perform(post ( TestUtils.getTTLFile( ADDRESS_ASPECT_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile( BUSINESS_PARTNER_NUMBER_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile(CONTACT_INFORMATION_FILE), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile(QUANTITY_FILE), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + + mvc.perform( post( TestUtils.getTTLFile(UUID_FILE), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + //When + mvc.perform( post( TestUtils.getTTLFile( DIGITAL_PRODUCT_PASSPORT_FILE ), "DRAFT" ) ) + .andDo( MockMvcResultHandlers.print() ) + .andExpect( status().isOk() ); + } +} diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/bamm/BammHelperTest.java b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/bamm/BammHelperTest.java index 21374f67fbc35bc8b740a34f55a25068b292770a..9d376615085fe0517eddee3b33f3c18ea8688de4 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/bamm/BammHelperTest.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/bamm/BammHelperTest.java @@ -21,11 +21,10 @@ package org.eclipse.tractusx.semantics.hub.bamm; import static org.junit.jupiter.api.Assertions.*; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.tractusx.semantics.hub.SDKAccessHelper; import org.junit.jupiter.api.Test; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import io.vavr.NotImplementedError; import io.vavr.control.Try; public class BammHelperTest { @@ -35,7 +34,7 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - assertTrue(bammHelper.loadBammModel(modelString).isSuccess()); + assertTrue(bammHelper.loadAspectModel(modelString).isSuccess()); } @Test @@ -44,7 +43,7 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - assertTrue(bammHelper.loadBammModel(modelString).isFailure()); + assertTrue(bammHelper.loadAspectModel(modelString).isFailure()); } @Test @@ -53,9 +52,9 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - Try<VersionedModel> model = bammHelper.loadBammModel(modelString); + Try<AspectModel> model = bammHelper.loadAspectModel(modelString); - assertTrue(bammHelper.validateModel(model).isEmpty()); + assertTrue(model.isSuccess()); } @Test @@ -64,9 +63,9 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - Try<VersionedModel> model = bammHelper.loadBammModel(modelString); + Try<AspectModel> model = bammHelper.loadAspectModel(modelString); - assertFalse(bammHelper.validateModel(model).isEmpty()); + assertTrue(model.isFailure()); } @Test @@ -75,7 +74,7 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - assertTrue(bammHelper.loadBammModel(modelString).isSuccess()); + assertTrue(bammHelper.loadAspectModel(modelString).isSuccess()); } @Test @@ -84,7 +83,7 @@ public class BammHelperTest { SDKAccessHelper bammHelper = new SDKAccessHelper(); - assertTrue(bammHelper.loadBammModel(modelString).isFailure()); + assertTrue(bammHelper.loadAspectModel(modelString).isFailure()); } } diff --git a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/persistence/SdsSdkTest.java b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/persistence/SdsSdkTest.java index a154fd3481b18253658679a690ba581dd565fc2c..7e93b1423bf407c9ec71156ae8ffa5bd3a3884e3 100644 --- a/backend/src/test/java/org/eclipse/tractusx/semantics/hub/persistence/SdsSdkTest.java +++ b/backend/src/test/java/org/eclipse/tractusx/semantics/hub/persistence/SdsSdkTest.java @@ -21,25 +21,18 @@ package org.eclipse.tractusx.semantics.hub.persistence; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; +import static org.eclipse.tractusx.semantics.hub.TestUtils.loadModelFromResources; import java.io.IOException; -import org.apache.jena.query.Query; import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ResourceFactory; -import org.apache.jena.rdfconnection.RDFConnection; import org.eclipse.tractusx.semantics.hub.model.SemanticModelType; -import org.eclipse.tractusx.semantics.hub.persistence.triplestore.SAMMSdk; -import org.eclipse.tractusx.semantics.hub.persistence.triplestore.SparqlQueries; import org.junit.jupiter.api.Test; import org.eclipse.tractusx.semantics.hub.InvalidAspectModelException; import org.eclipse.tractusx.semantics.hub.TestUtils; -import org.eclipse.tractusx.semantics.hub.persistence.triplestore.ResourceDefinitionNotFoundException; import org.eclipse.tractusx.semantics.hub.persistence.triplestore.SdsSdk; -import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import io.vavr.control.Try; public class SdsSdkTest { @@ -49,7 +42,7 @@ public class SdsSdkTest { final Model model = sdsSdk.load( TestUtils.PRODUCT_USAGE_MODEL_PATH ); final AspectModelUrn aspectUrn = sdsSdk.getAspectUrn( model ); - assertThat( aspectUrn.getNamespace() ).isEqualTo( "org.eclipse.tractusx.semantics.test.productusage" ); + assertThat( aspectUrn.getNamespaceMainPart() ).isEqualTo( "org.eclipse.tractusx.semantics.test.productusage" ); assertThat( aspectUrn.getUrnPrefix() ) .isEqualTo( "urn:samm:org.eclipse.tractusx.semantics.test.productusage:1.2.0#" ); assertThat( aspectUrn.getUrn().toString() ).isEqualTo( @@ -59,7 +52,7 @@ public class SdsSdkTest { @Test public void validateValidAspectModelWithAvailableExternalReferenceExpectSuccess() throws IOException { final SdsSdk sdsSdk = new SdsSdk(); - final Model model = sdsSdk.load( TestUtils.PRODUCT_USAGE_MODEL_PATH ); + final String model = loadModelFromResources( TestUtils.PRODUCT_USAGE_MODEL_PATH ); assertThatCode( () -> sdsSdk.validate( model, this::findContainingModelByUrn, SemanticModelType.SAMM ) ) .doesNotThrowAnyException(); } @@ -72,9 +65,9 @@ public class SdsSdkTest { @Test public void validateAspectModelWithNotAvailableExternalReferenceExpectError() throws IOException { final SdsSdk sdsSdk = new SdsSdk(); - final Model model = sdsSdk.load( TestUtils.VEHICLE_WITH_NOT_AVAILABLE_EXTERNAL_REFERENCE ); + final String model = loadModelFromResources( TestUtils.VEHICLE_WITH_NOT_AVAILABLE_EXTERNAL_REFERENCE ); try { - sdsSdk.validate( model, this::noOpTripleResolution, SemanticModelType.SAMM ); + sdsSdk.validate(model, this::noOpTripleResolution, SemanticModelType.SAMM ); } catch ( final InvalidAspectModelException e ) { System.out.println( e.getDetails() ); } diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/AddressAspect.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/AddressAspect.ttl new file mode 100644 index 0000000000000000000000000000000000000000..bf75d73e59c84f8c8bcf86f98a6e962eb792261e --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/AddressAspect.ttl @@ -0,0 +1,259 @@ +####################################################################### +# Copyright (c) 2023 T-Systems International GmbH +# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### + +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> . +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> . +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> . +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix : <urn:samm:io.catenax.shared.address_characteristic:3.0.0#> . + +:AddressAspect a samm:Aspect ; + samm:preferredName "Address Aspect"@en ; + samm:description "Aspect used for the Characteristic :PostalAddress to reference address data."@en ; + samm:properties ( :address ) ; + samm:operations ( ) ; + samm:events ( ) . + +:address a samm:Property ; + samm:preferredName "Address"@en ; + samm:description "The address of the data provider."@en ; + samm:characteristic :PostalAddress . + +:PostalAddress a samm:Characteristic ; + samm:preferredName "PostalAddress"@en ; + samm:description "A characteristic to express the postal address and which is intended to be referenced by other aspects."@en ; + samm:dataType :AddressEntity . + +:AddressEntity a samm:Entity ; + samm:preferredName "Address Entity"@en ; + samm:description "Entity of an address. Model follows specification of BPDM (Business Partner Data Management)."@en ; + samm:properties ( :thoroughfare :locality [ samm:property :premise; samm:optional true ] [ samm:property :postalDeliveryPoint; samm:optional true ] :country :postCode ) . + +:thoroughfare a samm:Property ; + samm:preferredName "Thoroughfare"@en ; + samm:description "Street or thorough road name."@en ; + samm:characteristic :ThoroughfareCharacteristic . + +:locality a samm:Property ; + samm:preferredName "Locality"@en ; + samm:description "Locality belonging to an address."@en ; + samm:characteristic :LocalityCharacteristic . + +:premise a samm:Property ; + samm:preferredName "Premise"@en ; + samm:description "Premise of an address, e.g. a specific \"BUILDING\" but can also be used for naming a particular site."@en ; + samm:characteristic :PremiseCharacteristic . + +:postalDeliveryPoint a samm:Property ; + samm:preferredName "Postal Delivery Point"@en ; + samm:description "Delivery point, e.g. designation of a gate."@en ; + samm:characteristic :PostalDeliveryPointCharacteristic . + +:country a samm:Property ; + samm:preferredName "Country"@en ; + samm:description "Country of an address."@en ; + samm:characteristic :CountryCharacteristic . + +:postCode a samm:Property ; + samm:preferredName "Post Code"@en ; + samm:description "Postal code of the address."@en ; + samm:characteristic :PostCodeCharacteristic . + +:ThoroughfareCharacteristic a samm-c:SingleEntity ; + samm:preferredName "Thoroughfare Characteristic"@en ; + samm:description "Characteristic for defining a thoroughfare which can consist of a type (e.g. \"STREET\"), value (e.g. \"Bernstra?e\") and number (e.g. \"45\"). Model follows the specification of BPDM."@en ; + samm:dataType :ThoroughfareEntity . + +:LocalityCharacteristic a samm-c:SingleEntity ; + samm:preferredName "Locality Characteristic"@en ; + samm:description "Characteristic for defining a locality which belongs to an address and which consists of a type (e.g. \"CITY\") and value (e.g. \"Mannheim\"). Model follows the specification of BPDM."@en ; + samm:dataType :LocalityEntity . + +:PremiseCharacteristic a samm-c:SingleEntity ; + samm:preferredName "Premise Characteristic"@en ; + samm:description "Characteristic for defining a premise which consists of a technical key (e.g. \"BUILDING\" or \"OTHER\") and a value (e.g. \"Werk 1\")."@en ; + samm:dataType :PremiseEntity . + +:PostalDeliveryPointCharacteristic a samm-c:SingleEntity ; + samm:preferredName "Postal Delivery Point Characteristic"@en ; + samm:description "Characteristic for defining a postal delivery point which consists of a technical key (e.g. \"MAILBOX\" or \"OTHER\") and a value. Model follows the specification of BPDM."@en ; + samm:dataType :PostalDeliveryPointEntity . + +:CountryCharacteristic a samm-c:SingleEntity ; + samm:preferredName "Country Characteristic"@en ; + samm:description "Characteristic of a country belonging to an address"@en ; + samm:dataType :CountryEntity . + +:PostCodeCharacteristic a samm-c:SingleEntity ; + samm:preferredName "PostCode Characteristic"@en ; + samm:description "Characteristic for defining a postcode which can consist of a type (e.g. \"REGULAR\" for zip codes) and a value (e.g. \"98765-4321\"). Model follows the specification of BPDM."@en ; + samm:dataType :PostCodeEntity . + +:ThoroughfareEntity a samm:Entity ; + samm:preferredName "Thoroughfare Entity"@en ; + samm:description "Entity for a thoroughfare which consists of a type, value and number."@en ; + samm:properties ( [ samm:property :thoroughfareTechnicalKey; samm:payloadName "technicalKey" ] [ samm:property :thoroughfareValue; samm:payloadName "value" ] [ samm:property :thoroughfareNumber; samm:payloadName "number" ] ) . + +:LocalityEntity a samm:Entity ; + samm:preferredName "Locality Entity"@en ; + samm:description "Entity for a locality which consists of a key and a value."@en ; + samm:properties ( [ samm:property :localityTechnicalKey; samm:payloadName "technicalKey" ] [ samm:property :localityValue; samm:payloadName "value" ] ) . + +:PremiseEntity a samm:Entity ; + samm:preferredName "Premise Entity"@en ; + samm:description "Entity for a premise which consists of a type (technical key) and a value."@en ; + samm:properties ( [ samm:property :premiseTechnicalKey; samm:payloadName "technicalKey" ] [ samm:property :premiseValue; samm:payloadName "value" ] ) . + +:PostalDeliveryPointEntity a samm:Entity ; + samm:preferredName "Postal Delivery Point Entity"@en ; + samm:description "Entity for a postal delivery point which consists of a technical key and a value."@en ; + samm:properties ( [ samm:property :postalDeliveryPointTechnicalKey; samm:payloadName "technicalKey" ] [ samm:property :postalDeliveryPointValue; samm:payloadName "value" ] ) . + +:CountryEntity a samm:Entity ; + samm:preferredName "Country Entity"@en ; + samm:description "Entity definition for a country."@en ; + samm:properties ( [ samm:property :countryShortName; samm:payloadName "shortName" ] ) . + +:PostCodeEntity a samm:Entity ; + samm:preferredName "PostCode Entity"@en ; + samm:description "Entity for a postcode which consists of a type plus a value."@en ; + samm:properties ( [ samm:property :postCodeValue; samm:payloadName "value" ] [ samm:property :postCodeTechnicalKey; samm:payloadName "technicalKey" ] ) . + +:thoroughfareTechnicalKey a samm:Property ; + samm:preferredName "Thoroughfare Technical Key"@en ; + samm:description "Technical key of a thoroughfare. As specified by BPDM, this can be a \"STREET\" or a different type."@en ; + samm:characteristic :ThoroughfareTechnicalKeyCharacteristic ; + samm:exampleValue "STREET" . + +:thoroughfareValue a samm:Property ; + samm:preferredName "Value Thoroughfare"@en ; + samm:description "Value of a thoroughfare, e.g. name of a street."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Bernstrasse" . + +:thoroughfareNumber a samm:Property ; + samm:preferredName "Thoroughfare Number"@en ; + samm:description "Number of a thoroughfare. As used differently in international context, this number can contain both numerical and alphanumerical values."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "45" . + +:localityTechnicalKey a samm:Property ; + samm:preferredName "Locality Technical Key"@en ; + samm:description "Technical key of a locality."@en ; + samm:characteristic :LocalityTechnicalKeyCharacteristic ; + samm:exampleValue "CITY" . + +:localityValue a samm:Property ; + samm:preferredName "Locality Value"@en ; + samm:description "Value of a locality, e.g. name of a city (\"Mannheim\")."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Mannheim" . + +:premiseTechnicalKey a samm:Property ; + samm:preferredName "Premise Technical Key"@en ; + samm:description "Technical key of a premise."@en ; + samm:characteristic :PremiseTechnicalKeyCharacteristic ; + samm:exampleValue "OTHER" . + +:premiseValue a samm:Property ; + samm:preferredName "Premise Value"@en ; + samm:description "Value of a premise, e.g. name or designation of a particular site."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Werk 1" . + +:postalDeliveryPointTechnicalKey a samm:Property ; + samm:preferredName "Postal Delivery Point Technical Key"@en ; + samm:description "Technical key of a postal delivery point."@en ; + samm:characteristic :PostalDeliveryPointTechnicalKeyCharacteristic ; + samm:exampleValue "OTHER" . + +:postalDeliveryPointValue a samm:Property ; + samm:preferredName "Postal Delivery Point Value"@en ; + samm:description "Value of a postal delivery point, e.g. designation of a gate."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Tor 1" . + +:countryShortName a samm:Property ; + samm:preferredName "Country Short Name"@en ; + samm:description "The short variation of the name of the country."@en ; + samm:characteristic :CountryTrait . + +:postCodeValue a samm:Property ; + samm:preferredName "Post Code Value"@en ; + samm:description "The value of a post code."@en ; + samm:characteristic :PostCodeTrait ; + samm:exampleValue "98765-4321" . + +:postCodeTechnicalKey a samm:Property ; + samm:preferredName "Post Code Technical Key"@en ; + samm:description "The technical key of a post code."@en ; + samm:characteristic :PostCodeTechnicalKeyCharacteristic . + +:ThoroughfareTechnicalKeyCharacteristic a samm-c:Enumeration ; + samm:preferredName "Thoroughfare Technical Key Characteristic"@en ; + samm:description "Characteristic of the technical key of a thoroughfare."@en ; + samm:dataType xsd:string ; + samm-c:values ( "STREET" "INDUSTRIAL_ZONE" "OTHER" "RIVER" "SQUARE" ) . + +:LocalityTechnicalKeyCharacteristic a samm-c:Enumeration ; + samm:preferredName "Locality Technical Key Characteristic"@en ; + samm:description "Characteristic of the technical key of a locality"@en ; + samm:dataType xsd:string ; + samm-c:values ( "BLOCK" "CITY" "DISTRICT" "OTHER" "POST_OFFICE_CITY" "QUARTER" ) . + +:PremiseTechnicalKeyCharacteristic a samm-c:Enumeration ; + samm:preferredName "Premise Technical Key Characteristic"@en ; + samm:description "Characteristic of the technical key of a premise."@en ; + samm:dataType xsd:string ; + samm-c:values ( "BUILDING" "HARBOUR" "LEVEL" "OTHER" "ROOM" "SUITE" "UNIT" "WAREHOUSE" ) . + +:PostalDeliveryPointTechnicalKeyCharacteristic a samm-c:Enumeration ; + samm:preferredName "Postal Delivery Point Technical Key Characteristic"@en ; + samm:description "Characteristic of the technical key of a postal delivery point."@en ; + samm:dataType xsd:string ; + samm-c:values ( "INTERURBAN_DELIVERY_POINT" "MAIL_STATION" "MAILBOX" "OTHER" "POST_OFFICE_BOX" ) . + +:CountryTrait a samm-c:Trait ; + samm-c:baseCharacteristic :CountryShortNameCharacteristic ; + samm-c:constraint :CountryShortNameConstraint . + +:PostCodeTrait a samm-c:Trait ; + samm-c:baseCharacteristic samm-c:Text ; + samm-c:constraint :PostCodeConstraint . + +:PostCodeTechnicalKeyCharacteristic a samm-c:Enumeration ; + samm:preferredName "Post Code Technical Key Characteristic"@en ; + samm:description "Characteristic for the technical key of a post code."@en ; + samm:dataType xsd:string ; + samm-c:values ( "CEDEX" "LARGE_MAIL_USER" "OTHER" "POST_BOX" "REGULAR" ) . + +:CountryShortNameCharacteristic a samm:Characteristic ; + samm:preferredName "Country Short Name Characteristic"@en ; + samm:description "Characteristic for a short name of a country belonging to an address."@en ; + samm:dataType xsd:string . + +:CountryShortNameConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "CountryShortNameConstraint"@en ; + samm:description "Regular expression for designation of a short name of a country as defined in ISO 3166-2."@en ; + samm:value "([A-Z]{2}-[A-Z0-9]{1,3}|)" . + +:PostCodeConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "Post Code Constraint"@en ; + samm:description "Regular expression for post codes."@en ; + samm:value "^[a-z0-9][a-z0-9\\- ]{0,10}$" . diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/BusinessPartnerNumber-1.0.0.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/BusinessPartnerNumber-1.0.0.ttl new file mode 100644 index 0000000000000000000000000000000000000000..19281caaf9fb2503b32cc4175ec7c28c95a60d8a --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/BusinessPartnerNumber-1.0.0.ttl @@ -0,0 +1,86 @@ +####################################################################### +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### + +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#>. +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#>. +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#>. +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#>. +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. +@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. +@prefix : <urn:samm:io.catenax.shared.business_partner_number:1.0.0#>. + +:BusinessPartnerNumber a samm:Aspect; + samm:preferredName "Shared Aspect for any business partner number"@en; + samm:description "This is a shared aspect for BPN with a regex."@en; + samm:properties (:bpnlProperty :bpnsProperty :bpnaProperty); + samm:operations (); + samm:events (). +:bpnlProperty a samm:Property; + samm:preferredName "Business Partner Number Legal Entity Property"@en; + samm:description "Property based on a BPNL."@en; + samm:characteristic :BpnlTrait; + samm:exampleValue "BPNL0123456789ZZ". +:BpnlTrait a samm-c:Trait; + samm:preferredName "BPNl Trait"@en; + samm:description "Trait to ensure data format for BPNL."@en; + samm-c:baseCharacteristic :BpnlCharacteristic; + samm-c:constraint :BpnlRegularExpression. +:BpnlCharacteristic a samm:Characteristic; + samm:preferredName "Business Partner Number Legal Entity"@en; + samm:description "BPNL (Business Partner Number Legal Entity) represents the legal entity of an organization (e.g. enterprise, university, association, …) and contains its legal name (incl. legal form, if registered), registered address and tax number. The registered address is the official, legal correspondence address which has to be supplied to governmental and tax authorities and is the address which is used in any legal or court documents. BPNL is on corporate level and is unique for this legal entity."@en; + samm:dataType xsd:string; + samm:see <https://catena-x.net/fileadmin/user_upload/Standard-Bibliothek/Update_PDF_Maerz/5_BPDM/CX_-_0010_BUSINESS_PARTNER_NUMBER_PlatformCapabilityBPDM_v_1.0.1.pdf>. +:BpnlRegularExpression a samm-c:RegularExpressionConstraint; + samm:preferredName "BPNL Regular Expression"@en; + samm:description "The provided regular expression ensures that the BPNL is composed of prefix 'BPNL', 10 digits and two uppercase letters."@en; + samm:value "^BPNL[0-9]{8}[a-zA-Z0-9]{4}$". +:bpnaProperty a samm:Property; + samm:preferredName "Business Partner Number Address Property"@en; + samm:description "Property based on a BPNA."@en; + samm:characteristic :BpnaTrait; + samm:exampleValue "BPNA0123456789ZZ". +:BpnaTrait a samm-c:Trait; + samm:preferredName "BPNA Trait"@en; + samm:description "Trait to ensure data format for BPNA."@en; + samm-c:baseCharacteristic :BpnaCharacteristic; + samm-c:constraint :BpnaRegularExpression. +:BpnaCharacteristic a samm:Characteristic; + samm:preferredName "Business Partner Number Site"@en; + samm:description "BPNA (Business Partner Number Address) contains the legal name (incl. legal form, if registered) and additional organization information about site, e.g. Plant xxx, Branch office yyy of an organization with its corresponding, most commonly physical, address. A BPNA is always linked to a BPNL via relationship 'belongs to legal entity' and should be linked to a BPNS via relationship 'belongs to site'.The BPNA is on operational level (e.g. shipping or pick-up address)."@en; + samm:dataType xsd:string; + samm:see <https://catena-x.net/fileadmin/user_upload/Standard-Bibliothek/Update_PDF_Maerz/5_BPDM/CX_-_0010_BUSINESS_PARTNER_NUMBER_PlatformCapabilityBPDM_v_1.0.1.pdf>. +:BpnaRegularExpression a samm-c:RegularExpressionConstraint; + samm:preferredName "BPNA Regular Expression"@en; + samm:description "The provided regular expression ensures that the BPNA is composed of prefix 'BPNA', 10 digits and two uppercase letters."@en; + samm:value "^BPNA[0-9]{8}[a-zA-Z0-9]{4}$". +:bpnsProperty a samm:Property; + samm:preferredName "Business Partner Number Site Property"@en; + samm:description "Property based on a BPNS."@en; + samm:characteristic :BpnsTrait; + samm:exampleValue "BPNS0123456789ZZ". +:BpnsTrait a samm-c:Trait; + samm:preferredName "BPNS Trait"@en; + samm:description "Trait to ensure data format for BPNS."@en; + samm-c:baseCharacteristic :BpnsCharacteristic; + samm-c:constraint :BpnsRegularExpression. +:BpnsCharacteristic a samm:Characteristic; + samm:preferredName "Business Partner Number Site"@en; + samm:description "BPNS (Business Partner Number Site) represents a site which can be a production plant. A site can also be e.g. an office or a warehouse. An information related to a site is e.g. needed for reporting issues (How many sites does e.g. Beispiel AG have?), status of operation (out of operations due to environmental disaster), for certificates on site level (e.g. environment certificates) or for internal regulations on site level, (e.g. security topics, Corona rules,...). Several addresses (= BPNA with different streets and different gates) can belong to one site. A BPNS should be always linked to one BPNL via relationship 'belongs to legal entity'."@en; + samm:dataType xsd:string; + samm:see <https://catena-x.net/fileadmin/user_upload/Standard-Bibliothek/Update_PDF_Maerz/5_BPDM/CX_-_0010_BUSINESS_PARTNER_NUMBER_PlatformCapabilityBPDM_v_1.0.1.pdf>. +:BpnsRegularExpression a samm-c:RegularExpressionConstraint; + samm:preferredName "BPNS Regular Expression"@en; + samm:description "The provided regular expression ensures that the BPNS is composed of prefix 'BPNS', 10 digits and two uppercase letters."@en; + samm:value "^BPNS[0-9]{8}[a-zA-Z0-9]{4}$". diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/ContactInformation-3.0.0.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/ContactInformation-3.0.0.ttl new file mode 100644 index 0000000000000000000000000000000000000000..ac767efadf4aa6de774ef8424b25ff46a8b8baa4 --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/ContactInformation-3.0.0.ttl @@ -0,0 +1,96 @@ +####################################################################### +# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH +# Copyright (c) 2023 T-Systems International GmbH +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### + +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> . +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> . +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> . +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix : <urn:samm:io.catenax.shared.contact_information:3.0.0#> . + +:ContactInformation a samm:Aspect ; + samm:preferredName "Contact Information"@en ; + samm:description "Entity encapsulating the contact details."@en ; + samm:see <https://www.plattform-i40.de/IP/Redaktion/DE/Downloads/Publikation/Spezifikation_Submodel-Templates.html> ; + samm:properties ( :contactProperty ) ; + samm:operations ( ) ; + samm:events ( ) . + +:contactProperty a samm:Property ; + samm:preferredName "Contact Property"@en ; + samm:description "Property describing contact information for an organization."@en ; + samm:characteristic :ContactCharacteristic . + +:ContactCharacteristic a samm:Characteristic ; + samm:preferredName "Contact Characteristic"@en ; + samm:description "Characteristic describing information on how to contact an organization."@en ; + samm:dataType :ContactEntity . + +:ContactEntity a samm:Entity ; + samm:preferredName "Contact Entity"@en ; + samm:description "Entity to bundle the properties for the information on how to contact an organization."@en ; + samm:properties ( [ samm:property :website; samm:optional true ] [ samm:property :phoneNumber; samm:optional true ] [ samm:property :email; samm:optional true ] [ samm:property :faxNumber; samm:optional true ] ) . + +:website a samm:Property ; + samm:preferredName "Website"@en ; + samm:description "Website of the contact."@en ; + samm:characteristic :WebsiteCharacteristic ; + samm:exampleValue "https://www.samsung.com"^^xsd:anyURI . + +:phoneNumber a samm:Property ; + samm:preferredName "Phone Number"@en ; + samm:description "Phone number with country and area code."@en ; + samm:characteristic :PhoneNumberTrait ; + samm:exampleValue "+49 89 1234567890" . + +:email a samm:Property ; + samm:preferredName "Email"@en ; + samm:description "An email address."@en ; + samm:characteristic :EMailTrait ; + samm:exampleValue "test.mail@example.com" . + +:faxNumber a samm:Property ; + samm:preferredName "Fax Number"@en ; + samm:description "Fax number with country and area code."@en ; + samm:characteristic :PhoneNumberTrait ; + samm:exampleValue "+49 89 0987654321" . + +:WebsiteCharacteristic a samm:Characteristic ; + samm:preferredName "Website Characteristic"@en ; + samm:description "Address of the website."@en ; + samm:dataType xsd:anyURI . + +:PhoneNumberTrait a samm-c:Trait ; + samm-c:baseCharacteristic samm-c:Text ; + samm-c:constraint :PhoneNumberConstraint . + +:EMailTrait a samm-c:Trait ; + samm-c:baseCharacteristic samm-c:Text ; + samm-c:constraint :EMailConstraint . + +:PhoneNumberConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "PhoneNumber Constraint"@en ; + samm:description "Constraint to allow only numbers, whitespaces and an optional leading + sign."@en ; + samm:value "^[+]?[0-9 ]+$" . + +:EMailConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "Email Constraint"@en ; + samm:description "Regular expression for mail address as defined in W3C."@en ; + samm:see <https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address> ; + samm:value "^[a-zA-Z0-9.!#$%&?*+\\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$" . + diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/DigitalProductPassport-3.0.0.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/DigitalProductPassport-3.0.0.ttl new file mode 100644 index 0000000000000000000000000000000000000000..025c6cb230b1fa12f311d618ce8004e62113e7bc --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/DigitalProductPassport-3.0.0.ttl @@ -0,0 +1,1267 @@ +####################################################################### +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 BMW AG +# Copyright (c) 2023 BASF Coatings GmbH +# Copyright (c) 2023 Henkel AG & Co. KGaA +# Copyright (c) 2023 CGI Deutschland B.V. & Co. KG +# Copyright (c) 2023 SAP Deutschland SE & Co.KG +# Copyright (c) 2023 T-Systems International GmbH +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### + +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#> . +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#> . +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#> . +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix : <urn:samm:io.catenax.generic.digital_product_passport:3.0.0#> . +@prefix ext-address: <urn:samm:io.catenax.shared.address_characteristic:3.0.0#> . +@prefix ext-contact: <urn:samm:io.catenax.shared.contact_information:3.0.0#> . +@prefix ext-number: <urn:samm:io.catenax.shared.business_partner_number:1.0.0#> . +@prefix ext-quantity: <urn:samm:io.catenax.shared.quantity:1.0.0#> . +@prefix ext-uuid: <urn:samm:io.catenax.shared.uuid:1.0.0#> . + +:DigitalProductPassport a samm:Aspect ; + samm:preferredName "Digital Product Passport"@en ; + samm:description "The Digital Product Passport (DPP) allows to share process and product-related information amongst supply chain businesses, authorities and consumers. The DPP allows for efficient information flows following best practices; and the possibility of accompanying the measures under this Regulation with mitigating measures so that impacts are expected to remain proportionate for SMEs.This is expected to increase transparency, both for supply chain businesses and for the general public, and increase efficiencies in terms of information transfer to support the data exchange between economic actors in integrating circularity in product design and manufacturing.\nIn particular, it is likely to help facilitate and streamline the monitoring and enforcement of the regulation carried out by EU and Member State authorities. It is also likely to provide a market-intelligence tool that may be used for revising and refining obligations in the future.\nThe DPP includes data about components, materials and chemical substances, information on repairability, spare parts, environmental impact and professional disposal for a product.\nThe data model will be updated, as newer versions of the regulation will be published.\nThis data model is based on the proposed Ecodesign Regulation (\"Proposal for a REGULATION OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL establishing a framework for setting ecodesign requirements for sustainable products and repealing Directive 2009/125/EC\" ESPR from March 30th, 2022 with some additional data points which can be found in the adopted Amendments from July 12th 2023 (Amendments adopted by the European Parliament on 12 July 2023 on the proposal for a regulation of the European Parliament and of the Council establishing a framework for setting eco-design requirements for sustainable products and repealing Directive 2009/125/EC)."@en ; + samm:see <https://www.europarl.europa.eu/doceo/document/TA-9-2023-0272_EN.html> ; + samm:see <https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:52022PC0142> ; + samm:see <https://commission.europa.eu/energy-climate-change-environment/standards-tools-and-labels/products-labelling-rules-and-requirements/sustainable-products/ecodesign-sustainable-products_en> ; + samm:see <https://data.consilium.europa.eu/doc/document/ST-9014-2023-INIT/en/pdf> ; + samm:properties ( :metadata :typology :sustainability :characteristics :commercial :operation :identification :sources [ samm:property :additionalData; samm:optional true ] :handling ) ; + samm:operations ( ) ; + samm:events ( ) . + +:metadata a samm:Property ; + samm:preferredName "Metadata"@en ; + samm:description "Metadata of the product passport regarding issue and expiration date, version, status and the economic operator. These are mentioned in the ESPR proposal from March 30th, 2022 and some changed by the amendments of the European Parliament from July 12th, 2023 Article 8:\n(2) (h) the period during which the product passport shall remain available which shall correspond to at least the expected lifetime of a specific product.\nAdditionally Annex III mentions:\n(g) information related to the manufacturer, such as its unique operator identifier and the information referred to in Article 21(7);\n(h) unique operator identifiers other than that of the manufacturer;\n(k) the [...] unique operator identifier code of the economic operator established in the Union responsible for carrying out the tasks set out in Article 4 of Regulation (EU) 2019/1020, or Article 15 of Regulation (EU) [?/?] on general product safety, or similar tasks pursuant to other EU legislation applicable to the product."@en ; + samm:characteristic :MetadataCharacteristic . + +:typology a samm:Property ; + samm:preferredName "Typology"@en ; + samm:description "Properties further describing the product type."@en ; + samm:characteristic :TypologyCharacteristic . + +:sustainability a samm:Property ; + samm:preferredName "sustainability"@en ; + samm:description "Properties which are relevant for the sustainability of the product."@en ; + samm:characteristic :SustainabilityCharacteristic . + +:characteristics a samm:Property ; + samm:preferredName "Characteristics"@en ; + samm:description "Defines specific characteristics of a product."@en ; + samm:characteristic :Characteristics . + +:commercial a samm:Property ; + samm:preferredName "Commercial"@en ; + samm:description "Commercial information of the product."@en ; + samm:characteristic :CommercialCharacteristic . + +:operation a samm:Property ; + samm:preferredName "Operation"@en ; + samm:description "Operational information of the product."@en ; + samm:characteristic :OperationCharacteristic . + +:identification a samm:Property ; + samm:preferredName "Identification"@en ; + samm:description "Identification information of the product, especially identifiers and codes."@en ; + samm:characteristic :IdentificationCharacteristic . + +:sources a samm:Property ; + samm:preferredName "Sources"@en ; + samm:description "Documents which are mandatory if applicable for the product. These are mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(e) compliance documentation and information required under this Regulation or other Union law applicable to the product, such as the declaration of conformity, technical documentation or conformity certificates;\n(f) user manuals, instructions, warnings or safety information, as required by other Union legislation applicable to the product.\nAdditionally requirements are mentioned in Article 21:\n(7) Manufacturers shall ensure that that a product covered by a delegated act adopted pursuant to Article 4 is accompanied by instructions that enable consumers and other end-users to safely assemble, install, operate, store, maintain, repair and dispose of the product in a language that can be easily understood by consumers and other end-users, as determined by the Member State concerned. Such instructions shall be clear, understandable and legible and include at least the information specified in the delegated acts adopted pursuant to Article 4 and pursuant to Article 7(2)(b), point (ii).\nArticle 7 states additionally:\n(2) (b) (ii) information for consumers and other end-users on how to install, use, maintain and repair the product in order to minimise its impact on the environment and to ensure optimum durability, as well as on how to return or dispose of the product at end-of-life;\n(2) (b) (iii) information for treatment facilities on disassembly, recycling, or disposal at end-of-life;\n(2) (b) (iv) other information that may influence the way the product is handled by parties other than the manufacturer in order to improve performance in relation to product parameters referred to in Annex I.\n(5) (d) relevant instructions for the safe use of the product."@en ; + samm:characteristic :SourceList . + +:additionalData a samm:Property ; + samm:preferredName "Additional Data"@en ; + samm:description "Data in form of open fields which need to be transferred in addition. The regulation is still under development and may change in the future. To accommodate this, additional data allows the option to include additional data required by future changes to the regulation. In addition, the DPP can be easily updated and adapted to the new requirements."@en ; + samm:characteristic :AdditionalDataList . + +:handling a samm:Property ; + samm:preferredName "handling"@en ; + samm:description "Properties connected with the handling of the product."@en ; + samm:characteristic :HandlingCharacteristic . + +:MetadataCharacteristic a samm:Characteristic ; + samm:preferredName "Metadata Characteristic"@en ; + samm:description "Characteristic for the passport metadata of the digital product passport."@en ; + samm:dataType :MetadataEntity . + +:TypologyCharacteristic a samm:Characteristic ; + samm:preferredName "Typology Characteristic"@en ; + samm:description "Characteristic to further describe product."@en ; + samm:dataType :TypologyEntity . + +:SustainabilityCharacteristic a samm:Characteristic ; + samm:preferredName "Sustainability Characteristic"@en ; + samm:description "Characteristic which describes relevant information for the sustainability of the product."@en ; + samm:dataType :SustainabilityEntity . + +:Characteristics a samm:Characteristic ; + samm:preferredName "Characteristics"@en ; + samm:description "Defines a set of specific characteristics of a product."@en ; + samm:dataType :CharacteristicsEntity . + +:CommercialCharacteristic a samm:Characteristic ; + samm:preferredName "Commercial Characteristic"@en ; + samm:description "Commercial information of the product."@en ; + samm:dataType :CommercialEntity . + +:OperationCharacteristic a samm:Characteristic ; + samm:preferredName "Operation Characteristic"@en ; + samm:description "Operational information of the product."@en ; + samm:dataType :OperationEntity . + +:IdentificationCharacteristic a samm:Characteristic ; + samm:preferredName "Identification Characteristic"@en ; + samm:description "Identification information of the product."@en ; + samm:dataType :IdentificationEntity . + +:SourceList a samm-c:List ; + samm:preferredName "Source List"@en ; + samm:description "A list of documents."@en ; + samm:dataType :DocumentEntity . + +:AdditionalDataList a samm-c:List ; + samm:preferredName "Additional Data List"@en ; + samm:description "List of additional data."@en ; + samm:dataType :AdditionalDataEntity . + +:HandlingCharacteristic a samm:Characteristic ; + samm:preferredName "Handling Characteristic"@en ; + samm:description "Characteristic to describe aspects which are connected with the handling of the product."@en ; + samm:dataType :HandlingEntity . + +:MetadataEntity a samm:Entity ; + samm:preferredName "Metadata Entity"@en ; + samm:description "Passport Entity to describe version, status, end and issue date."@en ; + samm:properties ( :version [ samm:property :status; samm:optional true ] :expirationDate :issueDate :economicOperator :predecessor :passportIdentifier ) . + +:TypologyEntity a samm:Entity ; + samm:preferredName "Typology Entity"@en ; + samm:description "Entity describing attributes such class and different names of the product."@en ; + samm:properties ( :longName [ samm:property :class; samm:optional true ] :shortName ) . + +:SustainabilityEntity a samm:Entity ; + samm:preferredName "Sustainability Entity"@en ; + samm:description "Entity with the properties state, al list of different materials, a list of critical materials and the product carbon footprint."@en ; + samm:properties ( [ samm:property :state; samm:payloadName "status" ] :chemicalMaterial :critical [ samm:property :productEnvironmentalFootprint; samm:payloadName "PEF" ] ) . + +:CharacteristicsEntity a samm:Entity ; + samm:preferredName "Characteristics Entity"@en ; + samm:description "Entity which defines specific characteristics of a product such as different life spans and physical dimensions."@en ; + samm:properties ( :lifespan :physicalDimension :physicalState ) . + +:CommercialEntity a samm:Entity ; + samm:preferredName "Commercial Entity"@en ; + samm:description "Commercial information such as placed on market and the warranty."@en ; + samm:properties ( [ samm:property :placedOnMarket; samm:optional true ] ) . + +:OperationEntity a samm:Entity ; + samm:preferredName "Operation Entity"@en ; + samm:description "Operational information of the product such as the owner, manufacturer and importer."@en ; + samm:properties ( :importer :manufacturer ) . + +:IdentificationEntity a samm:Entity ; + samm:preferredName "Identification Entity"@en ; + samm:description "Entity with identification information of the product with local identifiers, other codes and the data carrier."@en ; + samm:properties ( :additionalCode :localIdentifier [ samm:property :dataCarrier; samm:optional true ] ) . + +:DocumentEntity a samm:Entity ; + samm:preferredName "Document Entity"@en ; + samm:description "Document entity with header, content, category and type."@en ; + samm:properties ( :content :category [ samm:property :contentType; samm:payloadName "type" ] :header ) . + +:AdditionalDataEntity a samm:Entity ; + samm:preferredName "Additional Data Entity"@en ; + samm:description "Entity with additional data. Properties are label, description, type, data and children. Either the fields data or children filled. Children constructs a hierarchy with the same attributes. Data is filled as the end of an path/leaf."@en ; + samm:properties ( :label :description :type [ samm:property :data; samm:optional true ] [ samm:property :children; samm:optional true ] ) . + +:HandlingEntity a samm:Entity ; + samm:preferredName "Handling Entity"@en ; + samm:description "Entity to describe different aspects in relation with the handling of the product. Properties are the maintenance history spare parts, substances of concern and reusable packaging."@en ; + samm:properties ( :spareParts :substanceOfConcern ) . + +:version a samm:Property ; + samm:preferredName "Version"@en ; + samm:description "The current version of the product passport. The possibility of modification/updating the product passport needs to include versioning of the dataset. This attribute is an internal versioning from the passport issuer."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "1.0.0" . + +:status a samm:Property ; + samm:preferredName "Status"@en ; + samm:description "The current status of the product passport declared through either: draft, approved, invalid or expired."@en ; + samm:characteristic :StatusEnumeration ; + samm:exampleValue "draft" . + +:expirationDate a samm:Property ; + samm:preferredName "Expiration Date"@en ; + samm:description "The timestamp in the format (yyyy-mm-dd) for the product passport until when it is available or a comment describing this period. This attribute is mentioned in the ESPR proposal from March 30th, 2022 and changed by the amendments of the European Parliament from July 12th, 2023 Article 8:\n(2) (h) the period during which the product passport shall remain available which shall correspond to at least the expected lifetime of a specific product."@en ; + samm:characteristic :DateTrait ; + samm:exampleValue "2000-01-01" . + +:issueDate a samm:Property ; + samm:preferredName "Issue Date"@en ; + samm:description "The timestamp in the format (yyyy-mm-dd) since when the product passport is available."@en ; + samm:characteristic :DateTrait ; + samm:exampleValue "2000-01-01" . + +:economicOperator a samm:Property ; + samm:preferredName "Economic Operator"@en ; + samm:description "The economic operator of the passport."@en ; + samm:characteristic :EconomicOperatorCharacteristic . + +:predecessor a samm:Property ; + samm:preferredName "Predecessor"@en ; + samm:description "Identification of the preceding product passport. This could either be an identification of the registered twin, a redirection to a platform where it is available, or if there is no preceding passport, input null."@en ; + samm:characteristic :IdentificationEither ; + samm:exampleValue "null" . + +:passportIdentifier a samm:Property ; + samm:preferredName "passportIdentifier"@en ; + samm:description "The identifier of the product passport, which could be a uuidv4."@en ; + samm:characteristic :IdentificationEither ; + samm:exampleValue "urn:uuid:550e8400-e29b-41d4-a716-446655440000" . + +:longName a samm:Property ; + samm:preferredName "Long Name"@en ; + samm:description "The full name of the product as a general short product description. This provides the users of the product passport with relevant information about the product. It can also be a marketing slogan or short description with one to a few sentences."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Product Description long text" . + +:class a samm:Property ; + samm:preferredName "Class"@en ; + samm:description "The associated product category according to ECLASS. The ECLASS is the worldwide reference data standard for classifying and clearly describing products and services."@en ; + samm:see <https://eclass.eu/en/eclass-standard/search-content/show?tx_eclasssearch_ecsearch%5Bdischarge%5D=0&tx_eclasssearch_ecsearch%5Bid%5D=44000000&tx_eclasssearch_ecsearch%5Blanguage%5D=1&tx_eclasssearch_ecsearch%5Bversion%5D=13.0&cHash=10abd2696c4c5c526da4e3367e78c592> ; + samm:characteristic :ClassCharacteristic . + +:shortName a samm:Property ; + samm:preferredName "Short Name"@en ; + samm:description "The short name of the product. Short names can contain abbreviations."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "8HP60" . + +:state a samm:Property ; + samm:preferredName "State"@en ; + samm:description "The status of the product (original, repurposed, re-used, remanufactured or waste) to indicated, whether it is a used product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(j) incorporation of used components."@en ; + samm:characteristic :StateEnumeration ; + samm:exampleValue "original" . + +:chemicalMaterial a samm:Property ; + samm:preferredName "Material"@en ; + samm:description "Information on different materials in the product."@en ; + samm:characteristic :EitherMaterialCharacteristic . + +:critical a samm:Property ; + samm:preferredName "Critical"@en ; + samm:description "A list of critical raw material names and their share which are included at the level of the product. This attribute is complemented to the ESPR proposal by the amendments of the European Parliament from July 12th, 2023 Annex I:\n(hb) use or content of critical raw materials.\nIn Annex II of the connected proposal Act of Critical Raw Materials, a list of critical raw materials can be found."@en ; + samm:see <https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=COM:2023:0160:FIN> ; + samm:characteristic :EitherCritical . + +:productEnvironmentalFootprint a samm:Property ; + samm:preferredName "Product Environmental Footprint"@en ; + samm:description "The carbon and environmental footprint of the product. These attributes are mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(l) the environmental footprint of the product, expressed as a quantification, in accordance with the applicable delegated act, of a product?s life cycle environmental impacts, whether in relation to one or more environmental impact categories or an aggregated set of impact categories;\n(m) the carbon footprint of the product.\nBoth are defined by Article 2:\n(23) ?environmental footprint? means a quantification of a product?s environmental impacts, whether in relation to a single environmental impact category or an aggregated set of impact categories based on the Product Environmental Footprint method;\n(25) ?carbon footprint? means the sum of greenhouse gas (GHG) emissions and GHG removals in a product system, expressed as CO2 equivalents and based on a life cycle assessment using the single impact category of climate change."@en ; + samm:characteristic :ProductEnvironmentalFootprintCharacteristic . + +:lifespan a samm:Property ; + samm:preferredName "Lifespan"@en ; + samm:description "The type of lifespan represented with the values guaranteed lifetime, technical lifetime and mean time between failures. Both can be described through the attributes: type, which defines the type such as guaranteed lifetime or technical lifetime, the unit for the lifetime, and the value represented by an integer. These attributes are mentioned in the ESPR proposal from March 30th, 2022 ANNEX I:\n(a) durability and reliability of the product or its components as expressed through the products guaranteed lifetime, technical lifetime [or] mean time between failures [...]."@en ; + samm:characteristic :LifespanList . + +:physicalDimension a samm:Property ; + samm:preferredName "Physical Dimension"@en ; + samm:description "Physical dimensions are properties associated with physical quantities for purposes of classification or differentiation. Mentioned are a part of these requirements in the ESPR proposal from March 30th, 2022 Article 7:\n(2) (b) (i) information on the performance of the product in relation to the product parameters referred to in Annex I;\nAnnex I (i) weight and volume of the product and its packaging, and the product-to-packaging ratio."@en ; + samm:characteristic :PhysicalDimensionCharacteristic . + +:physicalState a samm:Property ; + samm:preferredName "Physical State"@en ; + samm:description "The physical state of the item. There are four states of matter solid, liquid, gas and plasma which can be chosen from an enumeration."@en ; + samm:characteristic :PhysicalStateEnumeration ; + samm:exampleValue "solid" . + +:placedOnMarket a samm:Property ; + samm:preferredName "Placed on Market"@en ; + samm:description "The timestamp in the format (yyyy-mm-dd) with or without time zone when the product was put in the market."@en ; + samm:characteristic :DateTrait ; + samm:exampleValue "2000-01-01" . + +:importer a samm:Property ; + samm:preferredName "Importer"@en ; + samm:description "Information regarding the importer of the product, if different from the owner of the passport. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(j) information related to the importer, including the information referred to in Article 23(3) and its EORI number;\nArticle 23 states:\n(3) Importers shall indicate on the product their name, registered trade name or registered trade mark and the postal address and, where available, electronic means of communication, where they can be contacted or, where this is not possible, on the packaging, in a document accompanying the product or, where available, in a product passport. The contact details shall be clear, understandable and legible."@en ; + samm:characteristic :EitherImporter . + +:manufacturer a samm:Property ; + samm:preferredName "Manufacturer"@en ; + samm:description "Manufacturing information of the product. In the CATENA-X use case, the BPNL and BPNA can be stated. These attributes are mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(g) information related to the manufacturer, such as its unique operator identifier and the information referred to in Article 21(7);\n(i) unique facility identifiers."@en ; + samm:characteristic :ManufacturerCharacteristic . + +:additionalCode a samm:Property ; + samm:preferredName "Additional Code"@en ; + samm:description "Codes for identification can be for example commodity codes. In Europe, two commonly used codes for goods classification are the Harmonized System (HS) code and the Combined Nomenclature (CN). Other codes can also be given."@en ; + samm:characteristic :CodeList . + +:localIdentifier a samm:Property ; + samm:preferredName "Local Identifier"@en ; + samm:description "The unique identifier of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(b) the unique product identifier at the level indicated in the applicable delegated act adopted pursuant to Article 4.\nAdditionally in Article 9 regarding general requirements for the product passport is stated that:\n(e) the information included in the product passport shall refer to the product model, batch, or item as specified in the delegated act adopted pursuant to Article 4."@en ; + samm:characteristic :LocalIdentifierList . + +:dataCarrier a samm:Property ; + samm:preferredName "Data Carrier"@en ; + samm:description "The type and layout of the data carrier on the product. These are mentioned in the ESPR proposal from March 30th, 2022 Article 8:\n(b) the types of data carrier to be used;\n(c) the layout in which the data carrier shall be presented and its positioning."@en ; + samm:characteristic :DataCarrierCharacteristic . + +:content a samm:Property ; + samm:preferredName "Content"@en ; + samm:description "The content of the document e.g a link."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "www.alink.pdf" . + +:category a samm:Property ; + samm:preferredName "Category"@en ; + samm:description "The category in which the document can be sorted. These are mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(e) compliance documentation and information required under this Regulation or other Union law applicable to the product, such as the declaration of conformity, technical documentation or conformity certificates;\nANNEX IV states additional information regarding the content of the technical documentation\nFurther information on documents are mentioned in the proposal from March 30th, 2022 ANNEX III:\n(f) user manuals, instructions, warnings or safety information, as required by other Union legislation applicable to the product.\nAdditionally requirements are mentioned in Article 21:\n(7) Manufacturers shall ensure that that a product covered by a delegated act adopted pursuant to Article 4 is accompanied by instructions that enable consumers and other end-users to safely assemble, install, operate, store, maintain, repair and dispose of the product in a language that can be easily understood by consumers and other end-users, as determined by the Member State concerned. Such instructions shall be clear, understandable and legible and include at least the information specified in the delegated acts adopted pursuant to Article 4 and pursuant to Article 7(2)(b), point (ii).\nArticle 7 states additionally:\n(2) (b) (ii) information for consumers and other end-users on how to install, use, maintain and repair the product in order to minimise its impact on the environment and to ensure optimum durability, as well as on how to return or dispose of the product at end-of-life;\n(2) (b) (iii) information for treatment facilities on disassembly, recycling, or disposal at end-of-life;\n(2) (b) (iv) other information that may influence the way the product is handled by parties other than the manufacturer in order to improve performance in relation to product parameters referred to in Annex I.\n(5) (d) relevant instructions for the safe use of the product."@en ; + samm:characteristic :SourceCategoryEnumeration ; + samm:exampleValue "Legal Information" . + +:contentType a samm:Property ; + samm:preferredName "Content Type"@en ; + samm:description "The type of content which can be expected in the \"content\" property. Examples are a link, restricted link, pdf, excel, etc."@en ; + samm:characteristic :SourceEnumeration ; + samm:exampleValue "URL" . + +:header a samm:Property ; + samm:preferredName "Header"@en ; + samm:description "The header as a short description of the document with a maximum of 100 characters."@en ; + samm:characteristic :HeaderTrait ; + samm:exampleValue "Sustainability Document Material XY" . + +:label a samm:Property ; + samm:preferredName "Label"@en ; + samm:description "The human readable name of the attribute."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Maximum permitted battery power" . + +:description a samm:Property ; + samm:preferredName "Description"@en ; + samm:description "The description of the attribute context."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Description of an attribute" . + +:type a samm:Property ; + samm:preferredName "Type"@en ; + samm:description "The complex description of the type."@en ; + samm:characteristic :TypeCharacteristic . + +:data a samm:Property ; + samm:preferredName "Data"@en ; + samm:description "The content from the attribute which is a depended of the data type and typeUnit."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "23" . + +:children a samm:Property ; + samm:preferredName "children"@en ; + samm:description "Children of the hierarchy."@en ; + samm:characteristic :AdditionalDataList . + +:spareParts a samm:Property ; + samm:preferredName "Spare Parts"@en ; + samm:description "The list of spare parts available for the product from various suppliers."@en ; + samm:characteristic :EitherSparePart . + +:substanceOfConcern a samm:Property ; + samm:preferredName "Concerning Substance"@en ; + samm:description "Information regarding substances of concern in the product. Attributes are among others substance names, ids, concentration, location and hazard class. This is mentioned in the ESPR proposal from March 30th, 2022 and changed by the amendments of the European Parliament from July 12th, 2023 Article 7:\n(5) (a) the International Union of Pure and Applied Chemistry (IUPAC) name of the substances of concern present in the product, including the chemical identification number, that is the European Inventory of Existing Commercial Chemical Substances (EINECS) or European List of Notified Chemical Substances (ELINCS) number or Chemical Abstract Service (CAS) number.\n(5) (b) the location of the substances of concern within the product.\n(5) (c) the concentration, maximum concentration or concentration range of the substances of concern, at the level of the product [...].\n(5) (c) provide exemptions for substances of concern or information elements from the information requirements referred to in the first subparagraph."@en ; + samm:characteristic :SubstanceCharacteristic . + +:StatusEnumeration a samm-c:Enumeration ; + samm:preferredName "Status Enumeration"@en ; + samm:description "The current status of the product passport declared through either: draft, approved, invalid or expired."@en ; + samm:dataType xsd:string ; + samm-c:values ( "draft" "approved" "invalid" "expired" ) . + +:DateTrait a samm-c:Trait ; + samm:preferredName "Date Trait"@en ; + samm:description "Trait for valid traits.."@en ; + samm-c:baseCharacteristic samm-c:Text ; + samm-c:constraint :DateConstraint . + +:EconomicOperatorCharacteristic a samm:Characteristic ; + samm:preferredName "Economic Operator Characteristic"@en ; + samm:description "Economic operator of the passport."@en ; + samm:dataType :EconomicOperatorEntity . + +:IdentificationEither a samm-c:Either ; + samm:preferredName "Identification Either"@en ; + samm:description "Either (left) a uuidv4 or (right) an other type of identifier."@en ; + samm-c:left ext-uuid:UuidV4Trait ; + samm-c:right :IdentifierCharacteristic . + +:ClassCharacteristic a samm:Characteristic ; + samm:preferredName "Class Characteristic"@en ; + samm:description "Characteristic to describe the ECLASS typology of a product."@en ; + samm:dataType :ClassEntity . + +:StateEnumeration a samm-c:Enumeration ; + samm:preferredName "State Enumeration"@en ; + samm:description "Enumeration defined as original, repurposed, re-used, remanufactured or waste."@en ; + samm:dataType xsd:string ; + samm-c:values ( "original" "repurposed" "re-used" "remanufactured" "waste" ) . + +:EitherMaterialCharacteristic a samm-c:Either ; + samm:preferredName "Either Material Characteristic"@en ; + samm:description "Either a material list (left) or the string value \"not applicable\" (right)."@en ; + samm-c:left :MaterialList ; + samm-c:right :NotApplicableEnumeration . + +:EitherCritical a samm-c:Either ; + samm:preferredName "Either Critical"@en ; + samm:description "Either a list of critical materials (left) or the string value \"not applicable\" (right)."@en ; + samm-c:left :CriticalList ; + samm-c:right :NotApplicableEnumeration . + +:ProductEnvironmentalFootprintCharacteristic a samm:Characteristic ; + samm:preferredName "Product Environmental Footprint Characteristic"@en ; + samm:description "The Product Environmental Footprint Characteristic with sustainability information."@en ; + samm:dataType :ProductEnvironmentalFootprintEntity . + +:LifespanList a samm-c:List ; + samm:preferredName "Lifespan List"@en ; + samm:description "List of different life spans of a product."@en ; + samm:dataType :LifespanEntity . + +:PhysicalDimensionCharacteristic a samm:Characteristic ; + samm:preferredName "Physical Dimension Characteristic"@en ; + samm:description "Characteristic for physical dimensions with linear, mass and capacity attributes."@en ; + samm:dataType :PhysicalDimensionEntity . + +:PhysicalStateEnumeration a samm-c:Enumeration ; + samm:preferredName "Physical State Enumeration"@en ; + samm:description "Enumeration with the values solid, liquid, gas and plasma."@en ; + samm:dataType xsd:string ; + samm-c:values ( "solid" "liquid" "gas" "plasma" ) . + +:EitherImporter a samm-c:Either ; + samm:preferredName "Either Importer"@en ; + samm:description "Either the importer with its ids (left) or the string value \"not applicable\" (right)."@en ; + samm-c:left :ImporterCharacteristic ; + samm-c:right :NotApplicableEnumeration . + +:ManufacturerCharacteristic a samm:Characteristic ; + samm:preferredName "Manufacturer Characteristic"@en ; + samm:description "Manufacturing information."@en ; + samm:dataType :ManufacturerEntity . + +:CodeList a samm-c:List ; + samm:preferredName "Code List"@en ; + samm:description "A list of additional codes."@en ; + samm:dataType :CodeEntity . + +:LocalIdentifierList a samm-c:List ; + samm:preferredName "Local Identifier List"@en ; + samm:description "Local Identifier List for the product."@en ; + samm:dataType :IdentifierEntity . + +:DataCarrierCharacteristic a samm:Characteristic ; + samm:preferredName "Data Carrier Characteristic"@en ; + samm:description "Data Carrier Characteristic for the product."@en ; + samm:dataType :DataCarrierEntity . + +:SourceCategoryEnumeration a samm-c:Enumeration ; + samm:preferredName "Source Category Enumeration"@en ; + samm:description "The types of sources that can be linked in a digital product passport can vary depending on the nature of the product and the information that needs to be included. This is an enumeration of possible sources."@en ; + samm:dataType xsd:string ; + samm-c:values ( "Product Specifications" "Manufacturer Information" "User Manuals and Guides" "Certifications and Compliance" "Product Images and Videos" "Warranty Information" "Reviews and Ratings" "Product Variations" "Supply Chain Information" "Environmental Impact" "Compatibility and Accessories" "FAQs and Support" "Purchase and Retail Information" "Privacy and Data Handling" "Third-Party Integrations" "Legal Information" "Safety Information" "Repair and Installation" "Waste Generation and Prevention" "Specific Voluntary Labels" "Product Packaging" "Return and Disposal" "End of Life" "Material and Substance Information" "Technical Documentation" "Other" ) . + +:SourceEnumeration a samm-c:Enumeration ; + samm:preferredName "Source Enumeration"@en ; + samm:description "Enumeration on different sources."@en ; + samm:dataType xsd:string ; + samm-c:values ( "URL" "PDF" "Other" ) . + +:HeaderTrait a samm-c:Trait ; + samm-c:baseCharacteristic samm-c:Text ; + samm-c:constraint :HeaderConstraint . + +:TypeCharacteristic a samm:Characteristic ; + samm:preferredName "Type Characteristic"@en ; + samm:description "Characteristic for the data type."@en ; + samm:dataType :TypeEntity . + +:EitherSparePart a samm-c:Either ; + samm:preferredName "Either Spare Part"@en ; + samm:description "Either spare parts and optional spare part producers (left) or the string value \"not applicable\" (right)."@en ; + samm-c:left :SparePart ; + samm-c:right :NotApplicableEnumeration . + +:SubstanceCharacteristic a samm-c:Either ; + samm:preferredName "Substance Characteristic"@en ; + samm:description "Either a list of substances (left) or the string value \"not applicable\" (right)."@en ; + samm-c:left :SubstanceList ; + samm-c:right :NotApplicableEnumeration . + +:DateConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "Date Constraint"@en ; + samm:description "Constraint fo a timestamp in the format (yyyy-mm-dd)."@en ; + samm:value "^\\d{4}-\\d{2}-\\d{2}$" . + +:EconomicOperatorEntity a samm:Entity ; + samm:preferredName "Economic Operator Entity"@en ; + samm:description "Economic operator entity with identification."@en ; + samm:properties ( :economicOperatorId ) . + +:IdentifierCharacteristic a samm:Characteristic ; + samm:preferredName "Identifier Characteristic"@en ; + samm:description "Characteristic for Identifiers."@en ; + samm:dataType xsd:string . + +:ClassEntity a samm:Entity ; + samm:preferredName "Class Entity"@en ; + samm:description "Entity to describe the associated product category according to ECLASS. ECLASS is a monohierachical classification system where each class has a preferred name and a coded name that represents the classification structure."@en ; + samm:properties ( :code :definition ) . + +:MaterialList a samm-c:List ; + samm:preferredName "Material List"@en ; + samm:description "A list of different materials in the product."@en ; + samm:dataType :MaterialEntity . + +:NotApplicableEnumeration a samm-c:Enumeration ; + samm:preferredName "Not Applicable Enumeration"@en ; + samm:description "Enumeration with the value \"not applicable\"."@en ; + samm:dataType xsd:string ; + samm-c:values ( "not applicable" ) . + +:CriticalList a samm-c:List ; + samm:preferredName "Critical List"@en ; + samm:description "The list of critical raw materials in the product (CRM) which is specified by EU."@en ; + samm:dataType xsd:string . + +:ProductEnvironmentalFootprintEntity a samm:Entity ; + samm:preferredName "Product Environmental Footprint Entity"@en ; + samm:description "The Product Environmental Footprint Entity with sustainability information such as the different environmental footprint types, the carbon footprint explicitly, applicable rules and lifecycle stages."@en ; + samm:properties ( [ samm:property :environmentalFootprint; samm:payloadName "environmental" ] [ samm:property :carbonFootprint; samm:payloadName "carbon" ] ) . + +:LifespanEntity a samm:Entity ; + samm:preferredName "Lifespan Entity"@en ; + samm:description "Entity for the lifespan of a product with type, unit and value."@en ; + samm:properties ( [ samm:property :lifeUnit; samm:payloadName "unit" ] [ samm:property :lifeValue; samm:payloadName "value" ] [ samm:property :lifeType; samm:payloadName "key" ] ) . + +:PhysicalDimensionEntity a samm:Entity ; + samm:preferredName "Physical Dimension Entity"@en ; + samm:description "Entity for physical dimensions with linear, mass and capacity attributes."@en ; + samm:properties ( [ samm:property :width; samm:optional true ] [ samm:property :length; samm:optional true ] [ samm:property :diameter; samm:optional true ] [ samm:property :height; samm:optional true ] :grossWeight :grossVolume :weightOrVolume ) . + +:ImporterCharacteristic a samm:Characteristic ; + samm:preferredName "Importer Characteristic"@en ; + samm:description "Characteristic with information regarding the importer."@en ; + samm:dataType :ImporterEntity . + +:ManufacturerEntity a samm:Entity ; + samm:preferredName "Manufacturer Entity"@en ; + samm:description "Manufacturing Entity with the identification of the main manufacturer and the facility location as well as the manufacturing date."@en ; + samm:properties ( [ samm:property :facilityIdentification; samm:payloadName "facility" ] [ samm:property :manufacturerIdentification; samm:payloadName "manufacturer" ] :manufacturingDate ) . + +:CodeEntity a samm:Entity ; + samm:preferredName "Code Entity"@en ; + samm:description "Code entity with code key and value."@en ; + samm:properties ( [ samm:property :codeKey; samm:payloadName "key" ] [ samm:property :codeValue; samm:payloadName "value" ] ) . + +:IdentifierEntity a samm:Entity ; + samm:preferredName "Identifier Entity"@en ; + samm:description "Identifier Entity with the attributes key and value."@en ; + samm:properties ( [ samm:property :identifierKey; samm:payloadName "key" ] [ samm:property :identifierValue; samm:payloadName "value" ] ) . + +:DataCarrierEntity a samm:Entity ; + samm:preferredName "Data Carrier Entity"@en ; + samm:description "Data Carrier Entity with type and layout of the data carrier."@en ; + samm:properties ( :carrierType :carrierLayout ) . + +:HeaderConstraint a samm-c:LengthConstraint ; + samm:preferredName "Header Constraint"@en ; + samm:description "Constraint for a maximum of 100 characters."@en ; + samm-c:maxValue "100"^^xsd:nonNegativeInteger . + +:TypeEntity a samm:Entity ; + samm:preferredName "Type Entity"@en ; + samm:description "Entity for type with unit and data type."@en ; + samm:properties ( [ samm:property :typeUnit; samm:optional true ] :dataType ) . + +:SparePart a samm:Characteristic ; + samm:preferredName "Spare Part"@en ; + samm:description "Characteristic describing sources and spare parts."@en ; + samm:dataType :SparePartEntity . + +:SubstanceList a samm-c:List ; + samm:preferredName "Substance List"@en ; + samm:description "Characteristic for a list of substances of concern."@en ; + samm:dataType :SubstanceEntity . + +:economicOperatorId a samm:Property ; + samm:preferredName "Economic Operator Id"@en ; + samm:description "The identification of the owner/economic operator of the passport. Proposed, according to ISO 15459, is the CIN (company identification code). Other identification numbers like the tax identification number, value added tax identification number, commercial register number and the like are also valid entries. In the Catena-X network, the BPNL is used for the identification of companies and the information stored like contact information and addresses. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(k) the [...] unique operator identifier code of the economic operator established in the Union responsible for carrying out the tasks set out in Article 4 of Regulation (EU) 2019/1020, or Article 15 of Regulation (EU) [?/?] on general product safety, or similar tasks pursuant to other EU legislation applicable to the product."@en ; + samm:characteristic :EitherBusiness . + +:code a samm:Property ; + samm:preferredName "Code"@en ; + samm:description "The associated product category coded name/code, according to ECLASS. The 8-digit code consists of two digits for each of the four hierarchical levels."@en ; + samm:see <https://eclass.eu/en/eclass-standard/search-content/show?tx_eclasssearch_ecsearch[discharge]=0&tx_eclasssearch_ecsearch[id]=44000000&tx_eclasssearch_ecsearch[language]=1&tx_eclasssearch_ecsearch[version]=13.0&cHash=10abd2696c4c5c526da4e3367e78c592> ; + samm:characteristic :CodeTrait ; + samm:exampleValue "44-09-02-02" . + +:definition a samm:Property ; + samm:preferredName "Definition"@en ; + samm:description "The associated product category preferred name/definition according to ECLASS. This preferred name is always associated with the code."@en ; + samm:see <https://eclass.eu/en/eclass-standard/search-content/show?tx_eclasssearch_ecsearch[discharge]=0&tx_eclasssearch_ecsearch[id]=44000000&tx_eclasssearch_ecsearch[language]=1&tx_eclasssearch_ecsearch[version]=13.0&cHash=10abd2696c4c5c526da4e3367e78c592> ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Manual transmission (motor vehicle)" . + +:MaterialEntity a samm:Entity ; + samm:preferredName "Material Entity"@en ; + samm:description "Information regarding recycled and/or renewable materials in the product. Attributes are among others material names, ids and percentage. These attributes are mentioned in the ESPR proposal from March 30th, 2022 Article 1:\n(1) (f) recycled content in products.\nAnd complemented by the amendments of the European Parliament from July 12th, 2023 Annex I:\n(ha) use or content of sustainably sourced renewable materials."@en ; + samm:properties ( [ samm:property :materialName; samm:payloadName "name" ] :recycled :renewable [ samm:property :materialValue; samm:payloadName "value" ] [ samm:property :substanceUnit; samm:payloadName "unit" ] [ samm:property :materialIdentification; samm:payloadName "id" ] ) . + +:environmentalFootprint a samm:Property ; + samm:preferredName "Environmental Footprint"@en ; + samm:description "The environmental footprint of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(l) the environmental footprint of the product, expressed as a quantification, in accordance with the applicable delegated act, of a product?s life cycle environmental impacts, whether in relation to one or more environmental impact categories or an aggregated set of impact categories."@en ; + samm:characteristic :FootprintList . + +:carbonFootprint a samm:Property ; + samm:preferredName "Carbon Footprint"@en ; + samm:description "The carbon footprint of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(m) the carbon footprint of the product."@en ; + samm:characteristic :FootprintList . + +:lifeUnit a samm:Property ; + samm:preferredName "Life Unit"@en ; + samm:description "The unit of the respective lifespan expressed through the possible units day, month, cycle, year and runningOrOperatingHour."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:characteristic :LifeEnumeration ; + samm:exampleValue "unit:month" . + +:lifeValue a samm:Property ; + samm:preferredName "Life Value"@en ; + samm:description "The value as an integer for the respective lifespan."@en ; + samm:characteristic :LifeValueCharacteristic ; + samm:exampleValue 36 . + +:lifeType a samm:Property ; + samm:preferredName "Life Type"@en ; + samm:description "The type of lifespan represented with the values guaranteed lifetime, technical lifetime and mean time between failures. This attribute is mentioned in the ESPR proposal from March 30th, 2022 ANNEX I:\n(a) durability and reliability of the product or its components as expressed through the product?s guaranteed lifetime, technical lifetime [or] mean time between failures [...]."@en ; + samm:characteristic :LifeTypeEnumeration ; + samm:exampleValue "guaranteed lifetime" . + +:width a samm:Property ; + samm:preferredName "width"@en ; + samm:description "The width of the item measured in a specific linear unit which can be declared in the corresponding unit attribute."@en ; + samm:characteristic ext-quantity:LinearCharacteristic . + +:length a samm:Property ; + samm:preferredName "length"@en ; + samm:description "The length of the item measured in a specific linear unit which can be declared in the corresponding unit attribute."@en ; + samm:characteristic ext-quantity:LinearCharacteristic . + +:diameter a samm:Property ; + samm:preferredName "diameter"@en ; + samm:description "The diameter of the item, if applicable, measured in a specific linear unit which can be declared in the corresponding unit attribute."@en ; + samm:characteristic ext-quantity:LinearCharacteristic . + +:height a samm:Property ; + samm:preferredName "height"@en ; + samm:description "The height of the item measured in a specific linear unit which can be declared in the corresponding unit attribute."@en ; + samm:characteristic ext-quantity:LinearCharacteristic . + +:grossWeight a samm:Property ; + samm:preferredName "Gross Weight"@en ; + samm:description "The gross weight of the item measured in a specific mass unit which can be declared in the corresponding unit attribute. Gross weight refers to the total weight of a product, including the weight of the packaging. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(2) (b) (i) information on the performance of the product in relation to the product parameters referred to in Annex I;\nAnnex I (i) weight and volume of the product and its packaging, and the product-to-packaging ratio."@en ; + samm:characteristic ext-quantity:MassCharacteristic . + +:grossVolume a samm:Property ; + samm:preferredName "Gross Volume"@en ; + samm:description "The gross volume of the item measured in a specific capacity unit which can be declared in the corresponding unit attribute. Gross volume refers to the total volume of a product, including the volume of the packaging. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(2) (b) (i) information on the performance of the product in relation to the product parameters referred to in Annex I;\nAnnex I (i) weight and volume of the product and its packaging, and the product-to-packaging ratio."@en ; + samm:characteristic ext-quantity:VolumeCharacteristic . + +:weightOrVolume a samm:Property ; + samm:preferredName "Weight or Volume"@en ; + samm:description "Weight or volume of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(2) (b) (i) information on the performance of the product in relation to the product parameters referred to in Annex I;\nAnnex I (i) weight and volume of the product [...]."@en ; + samm:characteristic :EitherCharacteristic . + +:ImporterEntity a samm:Entity ; + samm:preferredName "Importer Entity"@en ; + samm:description "Entity with information regarding the importer such as the identification and the EORI."@en ; + samm:properties ( :eori [ samm:property :importerIdentification; samm:payloadName "id" ] ) . + +:facilityIdentification a samm:Property ; + samm:preferredName "Facility Identification"@en ; + samm:description "The facility identification, where the main manufacturing took place. In the CATENA-X use case, the BPNA can be stated. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(i) unique facility identifiers."@en ; + samm:characteristic :EitherPlantLocation . + +:manufacturerIdentification a samm:Property ; + samm:preferredName "Manufacturer Identification"@en ; + samm:description "The main manufacturer, if different from the passport owner, represented by an identification number. In the Catena-X use case, the BPNL can be stated. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(g) information related to the manufacturer, such as its unique operator identifier and the information referred to in Article 21(7)."@en ; + samm:characteristic :EitherBusiness . + +:manufacturingDate a samm:Property ; + samm:preferredName "Manufacturing Date"@en ; + samm:description "The timestamp in the format (yyyy-mm-dd) of the manufacturing date as the final step in production process (e.g. final quality check, ready-for-shipment event)."@en ; + samm:characteristic :DateTrait ; + samm:exampleValue "2000-01-31" . + +:codeKey a samm:Property ; + samm:preferredName "Code Key"@en ; + samm:description "The code key for the identification of the product. These are GTIN, hash, DID, ISBN, TARIC or other which can be chosen from an enumeration. This attribute is mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(b) the unique product identifier at the level indicated in the applicable delegated act adopted pursuant to Article 4;\n(c) the Global Trade Identification Number as provided for in standard ISO/IEC 15459-6 or equivalent of products or their parts;\n(d) relevant commodity codes, such as a TARIC code as defined in Council Regulation (EEC) No 2658/87."@en ; + samm:characteristic :CodeEnumeration ; + samm:exampleValue "TARIC" . + +:codeValue a samm:Property ; + samm:preferredName "Code Value"@en ; + samm:description "The code value for the identification of the product in regard to the chosen code name."@en ; + samm:characteristic :IdentifierCharacteristic ; + samm:exampleValue "8703 24 10 00" . + +:identifierKey a samm:Property ; + samm:preferredName "Identifier Key"@en ; + samm:description "For traceability of the product, the ESPR requires identification on the most specific level. It can be chosen from \"PartInstanceId\" \"BatchId\" \"ModelId\" from an enumeration. This attribute is mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(b) the unique product identifier at the level indicated in the applicable delegated act adopted pursuant to Article 4.\nAdditionally in Article 9 regarding general requirements for the product passport is stated that:\n(e) the information included in the product passport shall refer to the product model, batch, or item as specified in the delegated act adopted pursuant to Article 4."@en ; + samm:characteristic :IdentifierEnumeration ; + samm:exampleValue "PartInstanceId" . + +:identifierValue a samm:Property ; + samm:preferredName "Identifier Value"@en ; + samm:description "The value of the corresponding identifier for part/item, batch or model. This attribute is mentioned in the ESPR proposal from March 30th, 2022 ANNEX III:\n(b) the unique product identifier at the level indicated in the applicable delegated act adopted pursuant to Article 4.\nAdditionally in Article 9 regarding general requirements for the product passport is stated that:\n(e) the information included in the product passport shall refer to the product model, batch, or item as specified in the delegated act adopted pursuant to Article 4."@en ; + samm:characteristic :IdentifierCharacteristic ; + samm:exampleValue "SN12345678" . + +:carrierType a samm:Property ; + samm:preferredName "Carrier Type"@en ; + samm:description "The type of data carrier such as a QR code on the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 8:\n(2) (b) the types of data carrier to be used."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "QR" . + +:carrierLayout a samm:Property ; + samm:preferredName "Carrier Layout"@en ; + samm:description "The positioning of data carrier on the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 8:\n(2) (c) the layout in which the data carrier shall be presented and its positioning."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "upper-left side" . + +:typeUnit a samm:Property ; + samm:preferredName "Type Unit"@en ; + samm:description "Choose a unit type from the unit catalog, or if the property \"children\" is filled, leave empty."@en ; + samm:characteristic :UnitCatalog ; + samm:exampleValue "unit:volume" . + +:dataType a samm:Property ; + samm:preferredName "Data Type"@en ; + samm:description "Data type that describe the content of the attributes children and data. In case \"object\" is selected in the enumeration, the children field will be used in the AdditionalDataEntity instead of the \"data\" property. If it is an other type, the content will be specified in \"data\" as a string."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:characteristic :DataTypeEnumeration ; + samm:exampleValue "xsd:integer" . + +:SparePartEntity a samm:Entity ; + samm:preferredName "Spare Part Entity"@en ; + samm:description "Information regarding possible spare parts. This is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(b) ease of repair and maintenance as expressed through: characteristics, availability and delivery time of spare parts, modularity, compatibility with commonly available spare parts, availability of repair and maintenance instructions, number of materials and components used, use of standard components, use of component and material coding standards for the identification of components and materials, number and complexity of processes and tools needed, ease of non-destructive disassembly and re-assembly, conditions for access to product data, conditions for access to or use of hardware and software needed;\n(c) the Global Trade Identification Number as provided for in standard ISO/IEC 15459-6 or equivalent of products or their parts."@en ; + samm:properties ( [ samm:property :sparePartSources; samm:payloadName "producer" ] :sparePart ) . + +:SubstanceEntity a samm:Entity ; + samm:preferredName "Substance Entity"@en ; + samm:description "Information regarding substances of concern in the product. Attributes are among others substance names, ids, concentration, location. This is mentioned in the ESPR proposal from March 30th, 2022 and changed by the amendments of the European Parliament from July 12th, 2023 Article 7:\n(5) (a) the International Union of Pure and Applied Chemistry (IUPAC) name of the substances of concern present in the product, including the chemical identification number, that is the European Inventory of Existing Commercial Chemical Substances (EINECS) or European List of Notified Chemical Substances (ELINCS) number or Chemical Abstract Service (CAS) number.\n(5) (b) the location of the substances of concern within the product.\n(5) (c) the concentration, maximum concentration or concentration range of the substances of concern, at the level of the product [...].\n(5) (c) provide exemptions for substances of concern or information elements from the information requirements referred to in the first subparagraph."@en ; + samm:properties ( [ samm:property :substanceName; samm:payloadName "name" ] :location [ samm:property :substanceUnit; samm:payloadName "unit" ] :concentration [ samm:property :substanceIdentification; samm:payloadName "id" ] :exemption [ samm:property :hazardClass; samm:optional true ] ) . + +:EitherBusiness a samm-c:Either ; + samm:preferredName "Either Business"@en ; + samm:description "Either a complete business address and contact information (left) or an identifier (right) to reference this information."@en ; + samm-c:left :BusinessAddress ; + samm-c:right :BusinessId . + +:CodeTrait a samm-c:Trait ; + samm:preferredName "Code Trait"@en ; + samm:description "Trait to limit the input to the specified format (00-00-00-00)."@en ; + samm-c:baseCharacteristic :IdentifierCharacteristic ; + samm-c:constraint :CodeConstraint . + +:materialName a samm:Property ; + samm:preferredName "Material Name"@en ; + samm:description "The material name, in accordance with the specification in the attribute for the list type. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 1:\n(1) (f) recycled content in products."@en ; + samm:characteristic :NameCharacteristic . + +:recycled a samm:Property ; + samm:preferredName "Recycled"@en ; + samm:description "The share of the material, which is recovered recycled content from the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 1:\n(1) (f) recycled content in products."@en ; + samm:characteristic :Share ; + samm:exampleValue "12.5"^^xsd:float . + +:renewable a samm:Property ; + samm:preferredName "Renewable"@en ; + samm:description "The share of the material, which is from a renewable resource that can be replenished. Renewable resources are those that can be reproduced by physical, chemical, or mechanical processes. These are the kind of resources that can be regenerated throughout time. Forest wood, for example, can be grown through reforestation. This attribute is complemented to the ESPR proposal by the amendments of the European Parliament from July 12th, 2023 Annex I:\n(ha) use or content of sustainably sourced renewable materials."@en ; + samm:characteristic :Share ; + samm:exampleValue "23.5"^^xsd:float . + +:materialValue a samm:Property ; + samm:preferredName "Material Value"@en ; + samm:description "Concentration of the material in correlation to the material sum."@en ; + samm:characteristic :ConcentrationValue ; + samm:exampleValue "5.0"^^xsd:float . + +:substanceUnit a samm:Property ; + samm:preferredName "Substance Unit"@en ; + samm:description "The unit of concentration chosen from an enumeration: mass percent, volume percent, parts per thousand, parts per million, parts per billion and parts per trillion."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:characteristic :ConcentrationEnumeration ; + samm:exampleValue "unit:percent" . + +:materialIdentification a samm:Property ; + samm:preferredName "Material Identification"@en ; + samm:description "The material identification, in accordance with the specification in the attribute list type."@en ; + samm:characteristic :MaterialIdList . + +:FootprintList a samm-c:List ; + samm:preferredName "Footprint List"@en ; + samm:description "Footprint List for the environmental footprint."@en ; + samm:dataType :FootprintEntity . + +:LifeEnumeration a samm-c:Enumeration ; + samm:preferredName "Life Enumeration"@en ; + samm:description "Enumeration with the possible units day, month, cycle, year and runningOrOperatingHour."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:dataType xsd:string ; + samm-c:values ( "unit:day" "unit:month" "unit:year" "unit:cycle" "unit:runningOrOperatingHour" ) . + +:LifeValueCharacteristic a samm-c:Quantifiable ; + samm:preferredName "Life Value Characteristic"@en ; + samm:description "Characteristic for the life span value as an integer."@en ; + samm:dataType xsd:integer . + +:LifeTypeEnumeration a samm-c:Enumeration ; + samm:preferredName "Life Type Enumeration"@en ; + samm:description "Enumeration with the values guaranteed lifetime, technical lifetime and mean time between failures."@en ; + samm:dataType xsd:string ; + samm-c:values ( "guaranteed lifetime" "technical lifetime" "mean time between failures" ) . + +:EitherCharacteristic a samm-c:Either ; + samm:preferredName "Either Characteristic"@en ; + samm:description "Either a volume (left) or a weight (right) are mandatory."@en ; + samm-c:left ext-quantity:VolumeCharacteristic ; + samm-c:right ext-quantity:MassCharacteristic . + +:eori a samm:Property ; + samm:preferredName "EORI"@en ; + samm:description "An economic operator established in the customs territory of the Union needs, for customs purposes, an EORI number. EORI stands for economic operators registration and identification number. In this case, the importer's EORI must be provided. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(j) information related to the importer, including the information referred to in Article 23(3) and its EORI number."@en ; + samm:see <https://taxation-customs.ec.europa.eu/customs-4/customs-procedures-import-and-export-0/customs-procedures/economic-operators-registration-and-identification-number-eori_en> ; + samm:characteristic :EoriTrait ; + samm:exampleValue "GB123456789000" . + +:importerIdentification a samm:Property ; + samm:preferredName "Importer Identification"@en ; + samm:description "The importer of the product, if different from the owner of the passport. In the Catena-X network, the BPNL is used for the identification of companies and the information stored for this like contact information and addresses.\nThis attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(j) information related to the importer, including the information referred to in Article 23(3) and its EORI number;\nArticle 23 states:\n(3) Importers shall indicate on the product their name, registered trade name or registered trade mark and the postal address and, where available, electronic means of communication, where they can be contacted or, where this is not possible, on the packaging, in a document accompanying the product or, where available, in a product passport. The contact details shall be clear, understandable and legible."@en ; + samm:characteristic :EitherBusiness . + +:EitherPlantLocation a samm-c:Either ; + samm:preferredName "Either Plant Location"@en ; + samm:description "Either the plant location as an ID (right) or a complete address (left)."@en ; + samm-c:left ext-address:PostalAddress ; + samm-c:right :IdLocation . + +:CodeEnumeration a samm-c:Enumeration ; + samm:preferredName "Code Enumeration"@en ; + samm:description "Enumeration for GTIN, hash, DID, ISBN, TARIC or other."@en ; + samm:dataType xsd:string ; + samm-c:values ( "TARIC" "GTIN" "DID" "ISBN" "hash" "other" ) . + +:IdentifierEnumeration a samm-c:Enumeration ; + samm:preferredName "Identifier Enumeration"@en ; + samm:description "Enumeration with \"PartInstanceId\" \"BatchId\" and \"ModelId\"."@en ; + samm:dataType xsd:string ; + samm-c:values ( "PartInstanceId" "BatchId" "ModelId" ) . + +:UnitCatalog a samm:Characteristic ; + samm:preferredName "Unit Catalog"@en ; + samm:description "Link to the unit catalog with all possible units in the format \"unit:xxx\"."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:dataType xsd:string . + +:DataTypeEnumeration a samm-c:Enumeration ; + samm:preferredName "Data Type Enumeration"@en ; + samm:description "Data type that describe the content of the attributes children and data. In case \"object\" is selected in the enumeration, the children field will be used in the AdditionalDataEntity instead of the \"data\" property. If it is an other type, the content will be specified in \"data\" as a string."@en ; + samm:see <https://www.w3.org/2001/XMLSchema> ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:dataType xsd:string ; + samm-c:values ( "array" "object" "xsd:string" "xsd:integer" "xsd:boolean" "xsd:double" "xsd:float" "xsd:byte" ) . + +:sparePartSources a samm:Property ; + samm:preferredName "Spare Part Sources"@en ; + samm:description "Sources of possible spare parts."@en ; + samm:characteristic :SourcesList . + +:sparePart a samm:Property ; + samm:preferredName "Spare Part"@en ; + samm:description "Possible spare parts of the product."@en ; + samm:characteristic :PartList . + +:substanceName a samm:Property ; + samm:preferredName "Substance Name"@en ; + samm:description "The substance name, in accordance with the specification in the attribute for the list type, which is present in the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 and changed by the amendments of the European Parliament from July 12th, 2023 Article 7:\n(5) (a) the International Union of Pure and Applied Chemistry (IUPAC) name of the substances of concern present in the product, including the chemical identification number, that is the European Inventory of Existing Commercial Chemical Substances (EINECS) or European List of Notified Chemical Substances (ELINCS) number or Chemical Abstract Service (CAS) number."@en ; + samm:characteristic :NameCharacteristic . + +:location a samm:Property ; + samm:preferredName "Location"@en ; + samm:description "The location of the substances of concern within the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (b) the location of the substances of concern within the product."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Housing" . + +:concentration a samm:Property ; + samm:preferredName "Concentration"@en ; + samm:description "Concentration of the substance of concern at the level of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (c) the concentration, maximum concentration or concentration range of the substances of concern, at the level of the product [...]."@en ; + samm:characteristic :EitherConcentration . + +:substanceIdentification a samm:Property ; + samm:preferredName "Substance Identification"@en ; + samm:description "The substance identification, in accordance with the specification in the attribute for the list type. This attribute is mentioned in the ESPR proposal from March 30th, 2022 and changed by the amendments of the European Parliament from July 12th, 2023 Article 7:\n(5) (a) the International Union of Pure and Applied Chemistry (IUPAC) name of the substances of concern present in the product, including the chemical identification number, that is the European Inventory of Existing Commercial Chemical Substances (EINECS) or European List of Notified Chemical Substances (ELINCS) number or Chemical Abstract Service (CAS) number."@en ; + samm:characteristic :MaterialIdList . + +:exemption a samm:Property ; + samm:preferredName "Exemption"@en ; + samm:description "Exemptions to the substance of concern. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (c) provide exemptions for substances of concern or information elements from the information requirements referred to in the first subparagraph."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "shall not apply to product x containing not more than 1,5 ml of liquid" . + +:hazardClass a samm:Property ; + samm:description "The specification of the hazard class."@en ; + samm:see <https://echa.europa.eu/et/support/mixture-classification/hazard-class-table> ; + samm:see <https://echa.europa.eu/regulations/clp/classification> ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Acute toxicity" . + +:BusinessAddress a samm:Characteristic ; + samm:preferredName "Business Address"@en ; + samm:description "Characteristic further defining a business address."@en ; + samm:dataType :BusinessEntity . + +:BusinessId a samm-c:List ; + samm:preferredName "Business Id"@en ; + samm:description "A identifier to refer to a business."@en ; + samm:dataType :BusinessIdEntity . + +:CodeConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "Code Constraint"@en ; + samm:description "Constraint to limit the input to a valid ECLASS number. The constraint ensures that each pair of digits is followed by a hyphen, resulting in a pattern like \"00-00-00-00\" where the zeros can be replaced by any digit."@en ; + samm:value "^\\d{2}-\\d{2}-\\d{2}-\\d{2}$" . + +:NameCharacteristic a samm:Characteristic ; + samm:preferredName "Name Characteristic"@en ; + samm:description "Name Characteristic for the definition of the name."@en ; + samm:dataType :NameEntity . + +:Share a samm-c:Measurement ; + samm:preferredName "share"@en ; + samm:description "The share represented in a float number in the unit percent."@en ; + samm:dataType xsd:float ; + samm-c:unit unit:percent . + +:ConcentrationValue a samm-c:Quantifiable ; + samm:preferredName "Concentration Value"@en ; + samm:description "Float number representing a concentration."@en ; + samm:dataType xsd:float . + +:ConcentrationEnumeration a samm-c:Enumeration ; + samm:preferredName "Concentration Enumeration"@en ; + samm:description "Enumeration of possible units of concentration with percent, volume percent, parts per thousand, parts per million, parts per billion and parts per trillion."@en ; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html> ; + samm:dataType xsd:string ; + samm-c:values ( "unit:partPerMillion" "unit:percent" "unit:percentVolume" "unit:partPerThousand" "unit:partPerTrillionUs" "unit:partPerBillionUs" ) . + +:MaterialIdList a samm-c:List ; + samm:preferredName "Material Id List"@en ; + samm:description "List of ids for the identification."@en ; + samm:dataType :MaterialIdEntity . + +:FootprintEntity a samm:Entity ; + samm:preferredName "Footprint Entity"@en ; + samm:description "Footprint Entity for the carbon and environmental footprint with the total value, unit, impact category type, lifecycle, rulebook, declaration, performance class and the facility."@en ; + samm:properties ( [ samm:property :footprintValue; samm:payloadName "value" ] [ samm:property :footprintRulebook; samm:payloadName "rulebook" ] [ samm:property :footprintLifecycle; samm:payloadName "lifecycle" ] [ samm:property :footprintUnit; samm:payloadName "unit" ] [ samm:property :footprintType; samm:payloadName "type" ] [ samm:property :performanceClass; samm:optional true ] :manufacturingPlant :declaration ) . + +:EoriTrait a samm-c:Trait ; + samm:preferredName "Eori Trait"@en ; + samm:description "Trait to limit the input to the specified format of an eori."@en ; + samm-c:baseCharacteristic :IdentifierCharacteristic ; + samm-c:constraint :EoriConstraint . + +:IdLocation a samm:Characteristic ; + samm:preferredName "Id Location"@en ; + samm:description "A short id for a manufacturing plant."@en ; + samm:dataType :LocationIdEntity . + +:SourcesList a samm-c:List ; + samm:preferredName "Sources List"@en ; + samm:description "List of possible spare part sources."@en ; + samm:dataType :SourcesEntity . + +:PartList a samm-c:List ; + samm:preferredName "Part List"@en ; + samm:description "A list of possible spare parts of the product."@en ; + samm:dataType :PartsEntity . + +:EitherConcentration a samm-c:Either ; + samm:preferredName "Either Concentration"@en ; + samm:description "Characteristic with two possible values. Either the concentration range, which can be either the range or only the maximum concentration (left) or a single concentration (right)."@en ; + samm-c:left :RangeCharacteristic ; + samm-c:right :ConcentrationCharacteristic . + +:BusinessEntity a samm:Entity ; + samm:preferredName "Business Entity"@en ; + samm:description "Entity with a company name, address and contact information."@en ; + samm:properties ( :companyName ext-contact:contactProperty ext-address:address ) . + +:BusinessIdEntity a samm:Entity ; + samm:preferredName "Business Id Entity"@en ; + samm:description "Business Id Entity encapsulating a business identifier and type."@en ; + samm:properties ( :businessIdentifier :businessIdentifierType ) . + +:NameEntity a samm:Entity ; + samm:preferredName "Name Entity"@en ; + samm:description "Entity with the name and used list type."@en ; + samm:properties ( :chemicalName [ samm:property :listTypeName; samm:payloadName "type" ] ) . + +:MaterialIdEntity a samm:Entity ; + samm:preferredName "Material Id Entity"@en ; + samm:description "Id Entity with identifier and list type."@en ; + samm:properties ( :materialid [ samm:property :listTypeId; samm:payloadName "type" ] ) . + +:footprintValue a samm:Property ; + samm:preferredName "Footprint Value"@en ; + samm:description "The value of the environmental footprint or carbon footprint of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(l) the environmental footprint of the product, expressed as a quantification, in accordance with the applicable delegated act, of a product?s life cycle environmental impacts, whether in relation to one or more environmental impact categories or an aggregated set of impact categories;\n(m) the carbon footprint of the product.\n"@en ; + samm:characteristic :FootprintValueCharacteristic ; + samm:exampleValue "12.678"^^xsd:float . + +:footprintRulebook a samm:Property ; + samm:preferredName "Footprint Rulebook"@en ; + samm:description "The applied rulebook for the environmental footprint of the product."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "https://www.alink.pdf/" . + +:footprintLifecycle a samm:Property ; + samm:preferredName "Footprint Lifecycle"@en ; + samm:description "The lifecycle stage, to which the environmental footprint corresponds. These could be for example \"raw material acquisition and pre-processing\", \"main product production\", \"distribution\" or \"end of life and recycling\"."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "main product production" . + +:footprintUnit a samm:Property ; + samm:preferredName "Footprint Unit"@en ; + samm:description "The unit of measurement of the environmental impact category. For each impact category a specific unit is used. For climate change/carbon footprint \"kg CO2 eq\" will be used. If an aggregation is used, utilize the normalization and weighting methods used in the referenced rulebook."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "kg CO2 eq" . + +:footprintType a samm:Property ; + samm:preferredName "Footprint Type"@en ; + samm:description "The type of the environmental footprint of the product. This could be one of the environmental impact categories. For the carbon footprint chose the \"Climate Change\" category from the environmental impact categories. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(l) the environmental footprint of the product, expressed as a quantification, in accordance with the applicable delegated act, of a product?s life cycle environmental impacts, whether in relation to one or more environmental impact categories or an aggregated set of impact categories.\n(m) the carbon footprint of the product."@en ; + samm:characteristic :CategoryEnumeration ; + samm:exampleValue "Climate Change" . + +:performanceClass a samm:Property ; + samm:preferredName "Performance Class"@en ; + samm:description "The performance classification of the footprint."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "A" . + +:manufacturingPlant a samm:Property ; + samm:preferredName "Manufacturing Plant"@en ; + samm:description "The manufacturing plant of the footprint in the specific lifecycle phase."@en ; + samm:characteristic :EitherPlantLocation . + +:declaration a samm:Property ; + samm:preferredName "declaration"@en ; + samm:description "The footprint declaration in the format of a link "@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "www.alink.de" . + +:EoriConstraint a samm-c:RegularExpressionConstraint ; + samm:preferredName "EORI Constraint"@en ; + samm:description "Constraint with a pattern which ensures that the EORI number starts with two alphanumeric characters, followed by two alphabetic characters, and ends with 2 to 15 alphanumeric characters."@en ; + samm:value "^[A-Z]{2}[A-Z0-9]{1,18}$" . + +:LocationIdEntity a samm:Entity ; + samm:preferredName "Location Id Entity"@en ; + samm:description "A short id for a manufacturing plant with the identifier itself and a type to describe it."@en ; + samm:properties ( :locationIdentifier :locationIdentifierType ) . + +:SourcesEntity a samm:Entity ; + samm:preferredName "Sources Entity"@en ; + samm:description "Entity for a possible spare part sources."@en ; + samm:properties ( [ samm:property :sourcesIdentification; samm:payloadName "id" ] ) . + +:PartsEntity a samm:Entity ; + samm:preferredName "Parts Entity"@en ; + samm:description "Possible spare parts of the product with identifiers and names."@en ; + samm:properties ( :partNumber :partName ) . + +:RangeCharacteristic a samm-c:List ; + samm:preferredName "Range Characteristic"@en ; + samm:description "Range characteristic with two values, the highest and the lowest of the concentration range. Only providing the maximum range is also possible."@en ; + samm:dataType :RangeEntity . + +:ConcentrationCharacteristic a samm:Characteristic ; + samm:preferredName "Concentration Characteristic"@en ; + samm:description "Single concentration characteristic for the actual concentration."@en ; + samm:dataType :SingleEntity . + +:companyName a samm:Property ; + samm:preferredName "Company Name"@en ; + samm:description "Company name, registered trade name or registered trade mark."@en ; + samm:characteristic :CompanyList . + +:businessIdentifier a samm:Property ; + samm:preferredName "Business Identifier"@en ; + samm:description "The identifier used for a company address."@en ; + samm:characteristic :EitherIdentifier ; + samm:exampleValue "BPNL1234567890AA" . + +:businessIdentifierType a samm:Property ; + samm:preferredName "Business Identifier Type"@en ; + samm:description "The type of identifier used in combination with the business identifier. In case of catena-x, a value can be BPNL or BPNA."@en ; + samm:characteristic :BusinessType ; + samm:exampleValue "BPNL" . + +:chemicalName a samm:Property ; + samm:preferredName "Chemical Name"@en ; + samm:description "The name, in accordance with the specification in the attribute for the list type, which is present in the product."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "phenolphthalein" . + +:listTypeName a samm:Property ; + samm:preferredName "List Type Name"@en ; + samm:description "The type of list used for the identification of the substances. Selected can be for example IUPAC, EC or CAS."@en ; + samm:characteristic :ListTypeEnumerationName ; + samm:exampleValue "CAS" . + +:materialid a samm:Property ; + samm:preferredName "Material Id"@en ; + samm:description "The substance identification, in accordance with the specification in the attribute for the list type."@en ; + samm:characteristic :IdentifierCharacteristic ; + samm:exampleValue "201-004-7" . + +:listTypeId a samm:Property ; + samm:preferredName "List Type Id"@en ; + samm:description "The type of list used for the identification of the substances. Selected can be for example CAS or EC."@en ; + samm:characteristic :ListTypeEnumerationId ; + samm:exampleValue "CAS" . + +:FootprintValueCharacteristic a samm-c:Quantifiable ; + samm:preferredName "Footprint Value Characteristic"@en ; + samm:description "The value corresponding to the environmental footprint associated with the unit."@en ; + samm:dataType xsd:float . + +:CategoryEnumeration a samm-c:Enumeration ; + samm:preferredName "Category Enumeration"@en ; + samm:description "Enumeration of the 19 impact categories in accordance to EN15804+A2."@en ; + samm:dataType xsd:string ; + samm-c:values ( "Climate Change Total" "Climate Change Fossil" "Climate Change Biogenic Removals and Emissions" "Climate Change Land Use and Land Use Change" "Ozone Depletion" "Acidification" "Eutrophication Aquatic Freshwater" "Eutrophication Fresh Marine" "Eutrophication Terrestrial" "Photochemical Ozone Formation" "Abiotic Depletion- Minerals and Metals" "Fossil Fuels" "Water Use" "Particulate Matter Emissions" "Ionizing Radiation, Human Health" "Eco-Toxicity" "Human Toxicity, Cancer Effects" "Human Toxicity, Non-Cancer Effects" "Land Use Related Impacts/Soil Quality" ) . + +:locationIdentifier a samm:Property ; + samm:preferredName "Location Identifier"@en ; + samm:description "The identifier used for a location."@en ; + samm:characteristic :EitherLocationIdentifier ; + samm:exampleValue "BPNA1234567890AA" . + +:locationIdentifierType a samm:Property ; + samm:preferredName "location Identifier Type"@en ; + samm:description "The type of identifier used for a location. In the case of catena-x it is a BPNA."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "BPNA" . + +:sourcesIdentification a samm:Property ; + samm:preferredName "Sources Identification"@en ; + samm:description "The identifier of a spare part producer of the product. In the Catena-X network, the BPNL is used for the identification of companies and the information stored for this like contact information and addresses."@en ; + samm:characteristic :EitherBusiness . + +:partNumber a samm:Property ; + samm:preferredName "part number"@en ; + samm:description "The part number to identify the spare part. It could be a also for example a GTIN. GTIN stands for Global Trade Item Number. It is a unique and internationally recognized identifier used to identify products in the global marketplace. GTINs are typically encoded in barcodes and are used by retailers, manufacturers, and suppliers to track and manage their products throughout the supply chain. Valid inputs are all GTIN versions (GTIN-8, GTIN-12, GTIN-13, and GTIN-14).This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex III:\n(c) the Global Trade Identification Number as provided for in standard ISO/IEC 15459-6 or equivalent of products or their parts."@en ; + samm:characteristic :IdentifierCharacteristic ; + samm:exampleValue "12345678" . + +:partName a samm:Property ; + samm:preferredName "Part Name"@en ; + samm:description "The name of the spare part. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Annex I:\n(b) ease of repair and maintenance as expressed through: characteristics, availability and delivery time of spare parts, modularity, compatibility with commonly available spare parts, availability of repair and maintenance instructions, number of materials and components used, use of standard components, use of component and material coding standards for the identification of components and materials, number and complexity of processes and tools needed, ease of non-destructive disassembly and re-assembly, conditions for access to product data, conditions for access to or use of hardware and software needed."@en ; + samm:characteristic samm-c:Text ; + samm:exampleValue "Aluminum Housing" . + +:RangeEntity a samm:Entity ; + samm:preferredName "Range Entity"@en ; + samm:description "Entity for the concentration range with two values, the highest and the lowest of the concentration range."@en ; + samm:properties ( [ samm:property :minConcentration; samm:optional true; samm:payloadName "min" ] [ samm:property :maxConcentration; samm:payloadName "max" ] ) . + +:SingleEntity a samm:Entity ; + samm:preferredName "Single Entity"@en ; + samm:description "Entity for a single concentration for the maximum or actual concentration."@en ; + samm:properties ( [ samm:property :concentrationSingle; samm:payloadName "value" ] ) . + +:CompanyList a samm-c:List ; + samm:preferredName "Company List"@en ; + samm:description "List of company names."@en ; + samm:dataType xsd:string . + +:EitherIdentifier a samm-c:Either ; + samm:preferredName "Either Identifier"@en ; + samm:description "Either a BPNL (left) or a non-restricted identifier, which can be further defines through the Business Identifier Type."@en ; + samm-c:left ext-number:BpnlTrait ; + samm-c:right :BusinessIdentifierCharacteristic . + +:BusinessType a samm:Characteristic ; + samm:preferredName "Business Type"@en ; + samm:description "The type of identifier used in combination with the business identifier."@en ; + samm:dataType xsd:string . + +:ListTypeEnumerationName a samm-c:Enumeration ; + samm:preferredName "List Type Enumeration Name"@en ; + samm:description "Enumeration of different systems and organizations related to the identification and classification of chemical substances in the field of chemistry. The enumeration values are IUPAC, EC or CAS."@en ; + samm:see <https://www.cas.org/cas-data/cas-registry> ; + samm:see <https://iupac.org/> ; + samm:dataType xsd:string ; + samm-c:values ( "IUPAC" "CAS" "EC" ) . + +:ListTypeEnumerationId a samm-c:Enumeration ; + samm:preferredName "List Type Enumeration Id"@en ; + samm:description "Enumeration of different systems and organizations related to the identification and classification of chemical substances in the field of chemistry. The enumeration values are EC or CAS."@en ; + samm:see <https://www.cas.org/cas-data/cas-registry> ; + samm:dataType xsd:string ; + samm-c:values ( "CAS" "EC" ) . + +:EitherLocationIdentifier a samm-c:Either ; + samm:preferredName "Either Location Identifier"@en ; + samm:description "Either a BPNA (left) or a non-restricted identifier, which can be further defines through the Location Identifier Type."@en ; + samm-c:left ext-number:BpnaTrait ; + samm-c:right :LocationIdentifierCharacteristic . + +:minConcentration a samm:Property ; + samm:preferredName "Minimum Concentration"@en ; + samm:description "The minimum concentration of the substance of concern at the level of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (c) [...] concentration range of the substances of concern, at the level of the product [...]."@en ; + samm:characteristic :ConcentrationValue ; + samm:exampleValue "2.1"^^xsd:float . + +:maxConcentration a samm:Property ; + samm:preferredName "Maximum Concentration"@en ; + samm:description "The maximum concentration of the substance of concern at the level of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (c) the concentration, maximum concentration or concentration range of the substances of concern, at the level of the product [...]."@en ; + samm:characteristic :ConcentrationValue ; + samm:exampleValue "2.6"^^xsd:float . + +:concentrationSingle a samm:Property ; + samm:preferredName "Concentration Single"@en ; + samm:description "Concentration of the substance of concern at the level of the product. This attribute is mentioned in the ESPR proposal from March 30th, 2022 Article 7:\n(5) (c) the concentration [...] of the substances of concern, at the level of the product [...]."@en ; + samm:characteristic :ConcentrationValue ; + samm:exampleValue "2.41"^^xsd:float . + +:BusinessIdentifierCharacteristic a samm:Characteristic ; + samm:preferredName "Business Identifier Characteristic"@en ; + samm:description "Business Identifier Characteristic which describes an identifier for a company."@en ; + samm:dataType xsd:string . + +:LocationIdentifierCharacteristic a samm:Characteristic ; + samm:preferredName "Location Identifier Characteristic"@en ; + samm:description "String for a location identifier."@en ; + samm:dataType xsd:string . \ No newline at end of file diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Quantity-1.0.0.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Quantity-1.0.0.ttl new file mode 100644 index 0000000000000000000000000000000000000000..1661a14354d233166ea7d5eb302787c91b3d7797 --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Quantity-1.0.0.ttl @@ -0,0 +1,291 @@ +####################################################################### +# Copyright (c) 2023 ISTOS GmbH (a member of the DMG Mori Group) +# Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer ISST) +# Copyright (c) 2023 TRUMPF Werkzeugmaschinen SE + Co. KG +# Copyright (c) 2023 Volkswagen AG +# Copyright (c) 2023 BASF SE +# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. (represented by Fraunhofer IML) +# Copyright (c) 2023 Henkel AG & Co. KGaA +# Copyright (c) 2023 Mercedes Benz AG +# Copyright (c) 2023 SAP SE +# Copyright (c) 2023 SupplyOn AG +# Copyright (c) 2023 ZF Friedrichshafen AG +# Copyright (c) 2023 CGI Deutschland B.V. & Co. KG +# Copyright (c) 2023 T-Systems International GmbH +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#>. +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#>. +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#>. +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#>. +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. +@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. +@prefix : <urn:samm:io.catenax.shared.quantity:1.0.0#>. + +:Quantity a samm:Aspect; + samm:preferredName "Quantity with Unit of Measure"@en; + samm:description "The aspect may be reused whenever any kind of Quantity and / or unit of measure is used. One can use all defined units via the item unit or differentiate via mass, miscellaneous, countable, linear, area and volume units."@en; + samm:properties (:massProperty :linearProperty :areaProperty :volumeProperty :countProperty :timeProperty :miscProperty :itemQuantityProperty); + samm:operations (); + samm:events (). +:massProperty a samm:Property; + samm:preferredName "Mass related property"@en; + samm:description "This property defines unit and value for mass related properties."@en; + samm:characteristic :MassCharacteristic. +:linearProperty a samm:Property; + samm:preferredName "Linear property"@en; + samm:description "This property defines unit and value for linear properties."@en; + samm:characteristic :LinearCharacteristic. +:areaProperty a samm:Property; + samm:preferredName "Area related property"@en; + samm:description "This property defines unit and value for area related properties."@en; + samm:characteristic :AreaCharacteristic. +:volumeProperty a samm:Property; + samm:preferredName "Volume related property"@en; + samm:description "This property defines unit and value for volume related properties."@en; + samm:characteristic :VolumeCharacteristic. +:countProperty a samm:Property; + samm:preferredName "Countable property"@en; + samm:description "This property defines unit and value for countable properties."@en; + samm:characteristic :CountQuantityCharacteristic. +:timeProperty a samm:Property; + samm:preferredName "Time related property"@en; + samm:description "This property defines unit and value for time related properties."@en; + samm:characteristic :TimeCharacteristic. +:miscProperty a samm:Property; + samm:preferredName "Miscellaneous unit property"@en; + samm:description "This property defines unit and value for miscellaneous properties."@en; + samm:characteristic :MiscQuantityCharacteristic. +:itemQuantityProperty a samm:Property; + samm:preferredName "Item Quantity property"@en; + samm:description "This property defines common units and the value for items. Items may be measured as mass, countable, miscellaneous, linear, area or volume."@en; + samm:characteristic :ItemQuantityCharacteristic. +:MassCharacteristic a samm:Characteristic; + samm:preferredName "Mass Characteristic"@en; + samm:description "Characteristic for mass measurements of an item."@en; + samm:dataType :MassEntity. +:LinearCharacteristic a samm:Characteristic; + samm:preferredName "Linear Characteristic"@en; + samm:description "Characteristic for linear measurements of an item."@en; + samm:dataType :LinearEntity. +:AreaCharacteristic a samm:Characteristic; + samm:preferredName "Area Characteristic"@en; + samm:description "Characteristic for area measurements of an item."@en; + samm:dataType :AreaEntity. +:VolumeCharacteristic a samm:Characteristic; + samm:preferredName "Volume Characteristic"@en; + samm:description "Characteristic for volume measurements of an item."@en; + samm:dataType :VolumeEntity. +:CountQuantityCharacteristic a samm:Characteristic; + samm:preferredName "Count Quantity Characteristic"@en; + samm:description "Characteristic for countable measurements of an item."@en; + samm:dataType :CountQuantityEntity. +:TimeCharacteristic a samm:Characteristic; + samm:preferredName "Time Characteristic"@en; + samm:description "Characteristic for time measurements of an item."@en; + samm:dataType :TimeEntity. +:MiscQuantityCharacteristic a samm:Characteristic; + samm:preferredName "Miscellaneous Quantity Characteristic"@en; + samm:description "Characteristic for miscellaneous measurements of an item."@en; + samm:dataType :MiscQuantityEntity. +:ItemQuantityCharacteristic a samm:Characteristic; + samm:preferredName "Item Quantity Characteristic"@en; + samm:description "Characteristic for measurements of an item (mass, count, linear, area, volume, misc)."@en; + samm:dataType :ItemQuantityEntity. +:quantityValue a samm:Property; + samm:preferredName "Quantity Value"@en; + samm:description "The quantity value associated with the unit."@en; + samm:characteristic :QuantityValueCharacteristic; + samm:exampleValue "20.5"^^xsd:float. +:QuantityValueCharacteristic a samm-c:Quantifiable; + samm:preferredName "Quantity Value Characteristic"@en; + samm:description "The quantity value associated with the unit expressed as float."@en; + samm:dataType xsd:float. +:MassEntity a samm:Entity; + samm:preferredName "Mass Entity"@en; + samm:description "Entity for mass measurements of an item with an unit and value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :massUnit; + samm:payloadName "unit" +]). +:massUnit a samm:Property; + samm:preferredName "Mass Unit"@en; + samm:description "The unit of a mass related attribute."@en; + samm:characteristic :MassUnitEnumeration; + samm:exampleValue "unit:kilogram"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:MassUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Mass Unit Enumeration"@en; + samm:description "Enumeration for mass units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:gram"^^samm:curie "unit:kilogram"^^samm:curie "unit:tonneMetricTon"^^samm:curie "unit:tonUsOrShortTonUkorus"^^samm:curie "unit:ounceAvoirdupois"^^samm:curie "unit:pound"^^samm:curie). +:LinearEntity a samm:Entity; + samm:preferredName "Linear Entity"@en; + samm:description "Entity for linear measurements of an item with an unit and value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :linearUnit; + samm:payloadName "unit" +]). +:linearUnit a samm:Property; + samm:preferredName "Linear Unit"@en; + samm:description "The unit of a linear attribute."@en; + samm:characteristic :LinearUnitEnumeration; + samm:exampleValue "unit:millimetre"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:LinearUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Linear Unit Enumeration"@en; + samm:description "The unit of a linear attribute that may be used for height, width, length and diameter."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:millimetre"^^samm:curie "unit:centimetre"^^samm:curie "unit:metre"^^samm:curie "unit:kilometre"^^samm:curie "unit:inch"^^samm:curie "unit:foot"^^samm:curie "unit:yard"^^samm:curie). +:AreaEntity a samm:Entity; + samm:preferredName "Area Entity"@en; + samm:description "Entity for area measurements of an item with an unit and value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :areaUnit; + samm:payloadName "unit" +]). +:areaUnit a samm:Property; + samm:preferredName "Area Unit"@en; + samm:description "The unit of a area related attribute."@en; + samm:characteristic :AreaUnitEnumeration; + samm:exampleValue "unit:squareCentimetre"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:AreaUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Area Unit Enumeration"@en; + samm:description "The unit of an area attribute."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:squareCentimetre"^^samm:curie "unit:squareMetre"^^samm:curie "unit:squareInch"^^samm:curie "unit:squareFoot"^^samm:curie "unit:squareYard"^^samm:curie). +:VolumeEntity a samm:Entity; + samm:preferredName "Volume Entity"@en; + samm:description "Entity for volume measurements of an item with an unit and value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :volumeUnit; + samm:payloadName "unit" +]). +:volumeUnit a samm:Property; + samm:preferredName "Volume Unit"@en; + samm:description "The unit of a volume related attribute."@en; + samm:characteristic :VolumeUnitEnumeration; + samm:exampleValue "unit:litre"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:VolumeUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Volume Unit Enumeration"@en; + samm:description "Enumeration for volume units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:cubicMetre"^^samm:curie "unit:litre"^^samm:curie "unit:millilitre"^^samm:curie "unit:cubicCentimetre"^^samm:curie "unit:cubicInch"^^samm:curie "unit:cubicFoot"^^samm:curie "unit:cubicYard"^^samm:curie "unit:hectolitre"^^samm:curie). +:countUnit a samm:Property; + samm:preferredName "Count Unit"@en; + samm:description "The unit of a countable attribute."@en; + samm:characteristic :CountUnitEnumeration; + samm:exampleValue "unit:piece"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:CountUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Count Unit Enumeration"@en; + samm:description "Enumeration for count units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:piece"^^samm:curie "unit:count"^^samm:curie "unit:pair"^^samm:curie "unit:page"^^samm:curie "unit:cycle"^^samm:curie). +:timeUnit a samm:Property; + samm:preferredName "Time Unit"@en; + samm:description "The unit of a time attribute."@en; + samm:characteristic :TimeUnitEnumeration; + samm:exampleValue "unit:secondUnitOfTime"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:TimeUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Time Unit Enumeration"@en; + samm:description "Enumeration for time units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:secondUnitOfTime"^^samm:curie "unit:minuteUnitOfTime"^^samm:curie "unit:hourUnitOfTime"^^samm:curie "unit:day"^^samm:curie). +:miscUnit a samm:Property; + samm:preferredName "Misc Unit"@en; + samm:description "The unit of a miscellaneous attribute."@en; + samm:characteristic :MiscUnitEnumeration; + samm:exampleValue "unit:kilowattHour"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:MiscUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Count Unit Enumeration"@en; + samm:description "Enumeration for miscellaneous units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:kilowattHour"^^samm:curie). +:ItemQuantityEntity a samm:Entity; + samm:preferredName "Item Quantity Entity"@en; + samm:description "Entity for common measurements of an item (mass, count, linear, area, volume, misc) with an unit and a value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :itemUnit; + samm:payloadName "unit" +]). +:itemUnit a samm:Property; + samm:preferredName "Item Unit"@en; + samm:description "The unit of an item. Common units may be related to mass, count, linear, area, volume or misc."@en; + samm:characteristic :ItemUnitEnumeration; + samm:exampleValue "unit:piece"^^samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>. +:ItemUnitEnumeration a samm-c:Enumeration; + samm:preferredName "Item Unit Enumeration"@en; + samm:description "Enumeration for common item units."@en; + samm:dataType samm:curie; + samm:see <https://eclipse-esmf.github.io/samm-specification/2.1.0/index.html>; + samm-c:values ("unit:piece"^^samm:curie "unit:set"^^samm:curie "unit:pair"^^samm:curie "unit:page"^^samm:curie "unit:cycle"^^samm:curie "unit:kilowattHour"^^samm:curie "unit:gram"^^samm:curie "unit:kilogram"^^samm:curie "unit:tonneMetricTon"^^samm:curie "unit:tonUsOrShortTonUkorus"^^samm:curie "unit:ounceAvoirdupois"^^samm:curie "unit:pound"^^samm:curie "unit:metre"^^samm:curie "unit:centimetre"^^samm:curie "unit:kilometre"^^samm:curie "unit:inch"^^samm:curie "unit:foot"^^samm:curie "unit:yard"^^samm:curie "unit:squareCentimetre"^^samm:curie "unit:squareMetre"^^samm:curie "unit:squareInch"^^samm:curie "unit:squareFoot"^^samm:curie "unit:squareYard"^^samm:curie "unit:cubicCentimetre"^^samm:curie "unit:cubicMetre"^^samm:curie "unit:cubicInch"^^samm:curie "unit:cubicFoot"^^samm:curie "unit:cubicYard"^^samm:curie "unit:litre"^^samm:curie "unit:millilitre"^^samm:curie "unit:hectolitre"^^samm:curie "unit:secondUnitOfTime"^^samm:curie "unit:minuteUnitOfTime"^^samm:curie "unit:hourUnitOfTime"^^samm:curie "unit:day"^^samm:curie). +:CountQuantityEntity a samm:Entity; + samm:preferredName "Count Quantity Entity"@en; + samm:description "Entity for countable measurements of an item with an unit and a value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :countUnit; + samm:payloadName "unit" +]). +:TimeEntity a samm:Entity; + samm:preferredName "Time Entity"@en; + samm:description "Entity for time measurements of an item with an unit and a value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :timeUnit; + samm:payloadName "unit" +]). +:MiscQuantityEntity a samm:Entity; + samm:preferredName "Miscellaneous Quantity Entity"@en; + samm:description "Entity for miscellaneous measurements of an item with an unit and a value."@en; + samm:properties ([ + samm:property :quantityValue; + samm:payloadName "value" +] [ + samm:property :miscUnit; + samm:payloadName "unit" +]). \ No newline at end of file diff --git a/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Uuid-1.0.0.ttl b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Uuid-1.0.0.ttl new file mode 100644 index 0000000000000000000000000000000000000000..4f18651ea270eb1e58e7d92dc4230caa7eae621b --- /dev/null +++ b/backend/src/test/resources/org/eclipse/tractusx/semantics/hub/persistence/models/Uuid-1.0.0.ttl @@ -0,0 +1,49 @@ +####################################################################### +# Copyright (c) 2023 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This work is made available under the terms of the +# Creative Commons Attribution 4.0 International (CC-BY-4.0) license, +# which is available at +# https://creativecommons.org/licenses/by/4.0/legalcode. +# +# SPDX-License-Identifier: CC-BY-4.0 +####################################################################### + +@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.0.0#>. +@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.0.0#>. +@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.0.0#>. +@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.0.0#>. +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. +@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. +@prefix : <urn:samm:io.catenax.shared.uuid:1.0.0#>. + +:Uuid a samm:Aspect; + samm:preferredName "Shared Aspect for UUIDs v4"@en; + samm:description "This is a shared aspect for UUIDs with a regex."@en; + samm:properties (:uuidV4Property); + samm:operations (); + samm:events (). +:uuidV4Property a samm:Property; + samm:preferredName "UUID v4 Property"@en; + samm:description "Property based on a UUID v4."@en; + samm:characteristic :UuidV4Trait; + samm:exampleValue "urn:uuid:48878d48-6f1d-47f5-8ded-a441d0d879df". +:UuidV4Trait a samm-c:Trait; + samm:preferredName "Trait for UUIDs v4"@en; + samm:description "Trait to ensure UUID v4 data format."@en; + samm-c:baseCharacteristic :Uuidv4Characteristic; + samm-c:constraint :Uuidv4RegularExpression. +:Uuidv4Characteristic a samm:Characteristic; + samm:preferredName "UUID v4"@en; + samm:description "A version 4 UUID is a universally unique identifier that is generated using random 32 hexadecimal characters."@en; + samm:dataType xsd:string; + samm:see <https://tools.ietf.org/html/rfc4122>. +:Uuidv4RegularExpression a samm-c:RegularExpressionConstraint; + samm:preferredName "UUID v4 Regular Expression"@en; + samm:description "The provided regular expression ensures that the UUID is composed of five groups of characters separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens), optionally prefixed by \"urn:uuid:\" to make it an IRI."@en; + samm:see <https://datatracker.ietf.org/doc/html/rfc4122>; + samm:value "(^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)|(^urn:uuid:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$)". diff --git a/charts/semantic-hub/values.yaml b/charts/semantic-hub/values.yaml index d2f62d4b3ff6fad50ba4d1eea7953543b3f84ac6..cb07a0e77fb94c87dc8bcd1394bbc6767c734669 100644 --- a/charts/semantic-hub/values.yaml +++ b/charts/semantic-hub/values.yaml @@ -79,7 +79,7 @@ hub: graphdb: ## Include Fuski deployment or deploy separately enabled: false - image: jena-fuseki-docker:4.7.0 + image: jena-fuseki-docker:5.0.0 imagePullPolicy: IfNotPresent replicaCount: 1 containerPort: 3030 diff --git a/pom.xml b/pom.xml index 7f357cea74540096330d2349053e733ffc1f8e96..40cc80512e0e589064ec1792784035f7eb4d51cc 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ <openapi-starter-webmvc-ui.version>2.0.2</openapi-starter-webmvc-ui.version> <guava.version>32.1.1-jre</guava.version> <vavr.version>0.10.3</vavr.version> - <commons-io.version>2.11.0</commons-io.version> + <commons-io.version>2.17.0</commons-io.version> <google.findbugs.version>3.0.2</google.findbugs.version> <snakeyaml.version>2.0</snakeyaml.version> <jakarta.validation.version>3.0.2</jakarta.validation.version> @@ -99,9 +99,10 @@ <jaxb-api.version>2.3.1</jaxb-api.version> <!-- semantics --> - <samm.sdk.version>2.4.2</samm.sdk.version> - <jena.version>4.7.0</jena.version> + <samm.sdk.version>2.9.8</samm.sdk.version> + <jena.version>5.0.0</jena.version> <shacl.version>1.3.1</shacl.version> + <apache.http.client.version>4.5.12</apache.http.client.version> <!-- persistence --> <mapstruct.version>1.5.3.Final</mapstruct.version> @@ -120,7 +121,6 @@ <module>backend</module> <!-- more modules expected to come --> </modules> - <dependencyManagement> <dependencies> <!-- Predefined potential dependencies and versions --> @@ -332,9 +332,9 @@ <artifactId>esmf-aspect-model-starter</artifactId> <version>${samm.sdk.version}</version> </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-text</artifactId> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> <version>1.10.0</version> </dependency> <dependency> @@ -385,13 +385,18 @@ <version>${shacl.version}</version> </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>${apache.http.client.version}</version> + </dependency> <!-- Test --> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>${assertj.version}</version> <scope>test</scope> - </dependency> + </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> @@ -511,10 +516,27 @@ <artifactId>openapi-generator-maven-plugin</artifactId> <version>6.2.1</version> </plugin> + <plugin> + <groupId>org.eclipse.dash</groupId> + <artifactId>license-tool-plugin</artifactId> + <version>1.1.0</version> + <inherited>false</inherited> + <executions> + <execution> + <id>check-licenses</id> + <phase>validate</phase> + <goals> + <goal>license-check</goal> + </goals> + </execution> + </executions> + <configuration> + <proxy>my-proxy</proxy> + </configuration> + </plugin> </plugins> </pluginManagement> </build> - <repositories> <repository> <id>Maven Central</id> @@ -531,5 +553,12 @@ <name>GitHub OpenManufacturingPlatform Apache Maven Packages</name> <url>https://maven.pkg.github.com/OpenManufacturingPlatform/sds-sdk</url> </repository> + <repository> + <id>dash-licenses</id> + <url>https://repo.eclipse.org/content/repositories/dash-licenses/</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> </repositories> </project> diff --git a/settings-security.xml b/settings-security.xml new file mode 100644 index 0000000000000000000000000000000000000000..fdeeb9bc03ee34d9bddb823d26677aa0059f0210 --- /dev/null +++ b/settings-security.xml @@ -0,0 +1,12 @@ +<proxies> + <proxy> + <id>my-proxy</id> + <active>true</active> + <protocol>http</protocol> + <host>localhost</host> + <port>3128</port> + <username>johndoe</username> + <password>{GgKsMHh3F80Hr8=}</password> + <nonProxyHosts>www.example.com|*.example.com</nonProxyHosts> + </proxy> +</proxies>