diff --git a/core/esmf-aspect-meta-model-interface/pom.xml b/core/esmf-aspect-meta-model-interface/pom.xml index c9c86f855..9bf86321c 100644 --- a/core/esmf-aspect-meta-model-interface/pom.xml +++ b/core/esmf-aspect-meta-model-interface/pom.xml @@ -44,6 +44,14 @@ org.eclipse.esmf esmf-semantic-aspect-meta-model + + jakarta.xml.bind + jakarta.xml.bind-api + + + org.projectlombok + lombok + org.junit.jupiter diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectLoadingException.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectLoadingException.java similarity index 88% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectLoadingException.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectLoadingException.java index f95b75273..c4b8c7956 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectLoadingException.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectLoadingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel; public class AspectLoadingException extends RuntimeException { private static final long serialVersionUID = 7687644022103150329L; diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelFile.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelFile.java new file mode 100644 index 000000000..ddf41147b --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelFile.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel; + +import java.net.URI; +import java.util.List; +import java.util.Optional; + +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.ModelElementGroup; + +import org.apache.jena.rdf.model.Model; + +public interface AspectModelFile extends ModelElementGroup { + Model sourceModel(); + + default List headerComment() { + return List.of(); + } + + Optional sourceLocation(); + + @Override + default List elements() { + throw new UnsupportedOperationException( "Uninitialized Aspect Model" ); + } + + // boolean isAutoMigrated(); +} \ No newline at end of file diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectMetaModelResourceResolver.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectMetaModelResourceResolver.java deleted file mode 100644 index ceea0cc3c..000000000 --- a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectMetaModelResourceResolver.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver; - -import java.util.Set; -import java.util.stream.Stream; - -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.services.VersionedModel; -import org.eclipse.esmf.samm.KnownVersion; - -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Statement; - -/** - * Provides functionality to resolve Aspect Meta Model resources which reside in the classpath. - */ -public interface AspectMetaModelResourceResolver { - - /** - * Returns the {@link VersionedModel} for a loaded raw Aspect model that includes the given rawModeland - * the model which is the rawModel merged with the corresponding meta model - * - * @param rawModel The given raw Aspect model - * @param version The meta model version the model corresponds to - * @return the VersionedModel containing the model, meta model version and raw model - */ - Try mergeMetaModelIntoRawModel( final Model rawModel, final VersionNumber version ); - - default Try mergeMetaModelIntoRawModel( final Model rawModel, final KnownVersion version ) { - return mergeMetaModelIntoRawModel( rawModel, VersionNumber.parse( version.toVersionString() ) ); - } - - /** - * Retrieves the meta model version an Aspect model uses - * - * @param model The RDF model containing an Aspect Model - * @return A {@link Try.Success} with the used meta model version, or a {@link Try.Failure} with one of - * {@link MissingMetaModelVersionException}, {@link MultipleMetaModelVersionsException} or {@link UnsupportedVersionException} (if the - * version can not be parsed). - */ - default Try getMetaModelVersion( final Model model ) { - final Set metaModelVersionsUsedInModel = getUsedMetaModelVersions( model ); - - if ( metaModelVersionsUsedInModel.isEmpty() ) { - return Try.failure( new MissingMetaModelVersionException() ); - } - - if ( metaModelVersionsUsedInModel.size() > 1 ) { - return Try.failure( new MultipleMetaModelVersionsException() ); - } - return Try.success( metaModelVersionsUsedInModel.iterator().next() ); - } - - /** - * Provides the Aspect statements based on the specific meta model version - * - * @param sourceModel the source model - * @param target the target model - * @return stream of statements - */ - Stream listAspectStatements( Model sourceModel, Model target ); - - /** - * Retrieves the set of meta model versions used in a model - * - * @param model the model - * @return the set of meta model versions - */ - Set getUsedMetaModelVersions( final Model model ); -} diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/VersionedModel.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/VersionedModel.java deleted file mode 100644 index e899674bf..000000000 --- a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/VersionedModel.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.samm.KnownVersion; - -import org.apache.jena.rdf.model.Model; - -/** - * Encapsulates an Aspect Model (as RDF model) and the Meta Model version it uses - */ -public class VersionedModel { - /** - * The model including its corresponding meta model - */ - private final Model model; - - /** - * The model without its corresponding meta model - */ - private final Model rawModel; - - /** - * The meta model version the model refers to - */ - private final VersionNumber version; - - public VersionedModel( final Model model, final VersionNumber version, final Model rawModel ) { - this.model = model; - this.version = version; - this.rawModel = rawModel; - } - - public VersionedModel( final Model model, final KnownVersion version, final Model rawModel ) { - this( model, VersionNumber.parse( version.toVersionString() ), rawModel ); - } - - public Model getModel() { - return model; - } - - public VersionNumber getMetaModelVersion() { - return version; - } - - public Model getRawModel() { - return rawModel; - } -} diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/Migrator.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/Migrator.java similarity index 84% rename from core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/Migrator.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/Migrator.java index bdbc745e3..320da4623 100644 --- a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/Migrator.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/Migrator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorFactory.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorFactory.java deleted file mode 100644 index 6d21e0959..000000000 --- a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.util.List; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.AspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.Migrator; - -public interface MigratorFactory { - - VersionNumber getLatestVersion(); - - List createMigrators(); - - AspectMetaModelResourceResolver createAspectMetaModelResourceResolver(); -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectVisitor.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectVisitor.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectVisitor.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectVisitor.java index 1fa3048fb..58c26ad6e 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectVisitor.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,30 +10,8 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.visitor; - -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.List; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.TimeSeries; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.LocaleConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; +package org.eclipse.esmf.aspectmodel.visitor; + import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; @@ -54,6 +32,28 @@ import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; import org.eclipse.esmf.metamodel.Value; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.List; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.LocaleConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; /** * Visitor interface for the traversal of Aspect Meta Model instances diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AbstractEntity.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/AbstractEntity.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AbstractEntity.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/AbstractEntity.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Aspect.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Aspect.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Aspect.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Aspect.java diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/AspectModel.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/AspectModel.java new file mode 100644 index 000000000..21f3769c1 --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/AspectModel.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel; + +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; + +import org.apache.jena.rdf.model.Model; + +/** + * The core interface that represents an Aspect Model. It contains the underlying RDF model, the list of model elements + * (as instances of {@link ModelElement} and provides information about the {@link Namespace}s and the source files + * ({@link AspectModelFile}) that make up the model. + */ +public interface AspectModel extends ModelElementGroup { + /** + * The merged RDF graph of the all AspectModelFiles of this AspectModel. + * + * @return the merged RDF graph + */ + Model mergedModel(); + + /** + * The namespaces that make up this AspectModel. + * + * @return the list of namespaces + */ + List namespaces(); + + /** + * The list of files this AspectModel consists of. + * + * @return the list of files + */ + default List files() { + return elements().stream() + .flatMap( element -> Optional.ofNullable( element.getSourceFile() ).stream() ) + .collect( Collectors.toSet() ) + .stream().toList(); + } + + /** + * Retrieves a given Model Element by URN. + * + * @param urn the model element URN + * @return the model element + * @throws NoSuchElementException if no element exists with this URN + */ + default ModelElement getElementByUrn( final AspectModelUrn urn ) { + return elements().stream() + .filter( element -> urn.equals( element.urn() ) ) + .findFirst() + .orElseThrow( NoSuchElementException::new ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/BoundDefinition.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/BoundDefinition.java similarity index 95% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/BoundDefinition.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/BoundDefinition.java index 5ea122333..05c3429d7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/BoundDefinition.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/BoundDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,12 +11,12 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.impl; +package org.eclipse.esmf.metamodel; import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; +import org.eclipse.esmf.metamodel.vocabulary.SAMMC; /** * Defines the possible values for the {@link SAMMC#lowerBoundDefinition()} and {@link SAMMC#upperBoundDefinition()} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java similarity index 83% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java index f759b3fdf..f044626e1 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Characteristic.java @@ -20,10 +20,10 @@ * * @since SAMM 1.0.0 */ -public interface Characteristic extends NamedElement { +public interface Characteristic extends ModelElement { /** - * The data type of the {@link Property} described by this {@link Characteristic}. + * The data type of the {@link Property} described by this Characteristic. * * @return the {@link Type} */ diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/CollectionValue.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/CollectionValue.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/CollectionValue.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/CollectionValue.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java similarity index 97% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java index 0ffb0dafd..1ad3694f5 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ComplexType.java @@ -49,7 +49,7 @@ default List getAllProperties() { @Override default String getUrn() { - return getAspectModelUrn().get().toString(); + return urn().toString(); } /** diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Constraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Constraint.java similarity index 91% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Constraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Constraint.java index 4cedd6d3a..8b964cc5b 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Constraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Constraint.java @@ -18,5 +18,5 @@ * * @since SAMM 1.0.0 */ -public interface Constraint extends NamedElement { +public interface Constraint extends ModelElement { } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Entity.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Entity.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Entity.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Entity.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java similarity index 90% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java index e2738ac0d..28d1fab19 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/EntityInstance.java @@ -15,7 +15,7 @@ import java.util.Map; -public interface EntityInstance extends NamedElement, Value { +public interface EntityInstance extends ModelElement, Value { Map getAssertions(); default Entity getEntityType() { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Event.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Event.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Event.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Event.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/NamedElement.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/HasDescription.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/NamedElement.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/HasDescription.java index 4da5ea2b6..1d5f95467 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/NamedElement.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/HasDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -16,35 +16,13 @@ import java.util.Collections; import java.util.List; import java.util.Locale; -import java.util.Optional; import java.util.Set; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; -/** - * Represents model elements that have human-readable names and descriptions - */ -public interface NamedElement extends ModelElement { - /** - * @return the URN which identifies an Aspect Model element. - */ - Optional getAspectModelUrn(); - - /** - * @return the name of the Aspect Model element. - */ +public interface HasDescription { String getName(); - /** - * Determines whether this model element has a generated name - * - * @return true if the name is synthetic (generated at load time), false if it is given in the model - */ - default boolean hasSyntheticName() { - return false; - } - /** * @return a {@link java.util.List} of links to an external taxonomy/ontology. */ diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/HasProperties.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/HasProperties.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/HasProperties.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/HasProperties.java diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java new file mode 100644 index 000000000..6674340ad --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel; + +import static java.lang.System.identityHashCode; +import static org.eclipse.esmf.metamodel.Namespace.ANONYMOUS; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.samm.KnownVersion; + +/** + * The ModelElement interface provides all facilities that all Aspect Model elements have. + */ +public interface ModelElement extends HasDescription { + /** + * Returns the URN identifiying this element. If {@link #isAnonymous()} is true, the returned URN is synthetic. In this case, the URN can + * be used to identify the object, but it may not be used for display purposes. + * + * @return the element's URN or an anonymous URN + */ + default AspectModelUrn urn() { + return AspectModelUrn.fromUrn( ANONYMOUS + "x%08X".formatted( identityHashCode( this ) ) ); + } + + @Override + default String getName() { + return urn().getName(); + } + + AspectModelFile getSourceFile(); + + /** + * Determines whether the model element is identified by a proper Aspect Model URN. + * + * @return true of the element is considered anonymous, otherwise it has a global identifying URN + */ + default boolean isAnonymous() { + return true; + } + + T accept( AspectVisitor visitor, C context ); + + default boolean is( final Class clazz ) { + return clazz.isAssignableFrom( getClass() ); + } + + default T as( final Class clazz ) { + return clazz.cast( this ); + } +} diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElementGroup.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElementGroup.java new file mode 100644 index 000000000..51cceea5e --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ModelElementGroup.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel; + +import java.util.List; +import java.util.NoSuchElementException; + +/** + * Represents a collection of {@link ModelElement}s. + */ +public interface ModelElementGroup { + List elements(); + + /** + * Convenience method to get the Aspects in this model element group. + * + * @return the list of aspects + */ + default List aspects() { + return elements().stream() + .filter( element -> element.is( Aspect.class ) ) + .map( element -> element.as( Aspect.class ) ) + .toList(); + } + + /** + * Convenience method to get the single (first) {@link Aspect} of this model element group. + * + * @return the first (single) aspect. + * @throws NoSuchElementException if there are no aspects + */ + default Aspect aspect() { + final List aspects = aspects(); + if ( aspects.isEmpty() ) { + throw new NoSuchElementException(); + } + return aspects().get( 0 ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelNamespace.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Namespace.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelNamespace.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Namespace.java index e7d0d18df..9339783da 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelNamespace.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Namespace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -13,14 +13,20 @@ package org.eclipse.esmf.metamodel; -import java.util.List; +import java.util.Optional; +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.VersionNumber; /** * Represents the namespace the model elements are contained in */ -public interface ModelNamespace { +public interface Namespace extends ModelElementGroup, HasDescription { + /** + * The pseudo namespace URN part that contains anonymously defined model elements + */ + String ANONYMOUS = "urn:samm:anonymous.elements:0.0.0#"; + /** * The package part of the model namespace is an identifier given in * reverse domain name notation, e.g., com.example.myapp. @@ -37,23 +43,11 @@ public interface ModelNamespace { VersionNumber version(); /** - * The model elements contained in this namespace - * - * @return the model elements - */ - List elements(); - - /** - * Convenience method to get the Aspects in this namespace + * The AspectModelFile that contains a namespace element definition for this namespace. * - * @return the list of aspects + * @return the source file */ - default List aspects() { - return elements().stream() - .filter( element -> element.is( Aspect.class ) ) - .map( element -> element.as( Aspect.class ) ) - .toList(); - } + Optional source(); /** * The identifier of the namespace, e.g. urn:samm:com.example.myapp:1.2.3 diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Operation.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Operation.java similarity index 95% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Operation.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Operation.java index ef98b21a7..49296c935 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Operation.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Operation.java @@ -22,7 +22,7 @@ * * @since SAMM 1.0.0 */ -public interface Operation extends NamedElement { +public interface Operation extends ModelElement { /** * @return a {@link List} of {@link Property}(ies) which define the input parameters for the Operation. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Property.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Property.java similarity index 94% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Property.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Property.java index 06bbbf7d5..f810cc432 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Property.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Property.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -15,7 +15,7 @@ import java.util.Optional; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.metamodel.characteristic.Trait; /** * A Property has a name that is unique to its use in an Aspect or an Entity, and a Characteristic (i.e., the @@ -23,7 +23,7 @@ * * @since SAMM 1.0.0 */ -public interface Property extends NamedElement { +public interface Property extends ModelElement { /** * @return the {@link Characteristic} describing this Property. This can be empty when the Property is abstract. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java similarity index 92% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java index 1a0c84db5..161f7de22 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/QuantityKind.java @@ -18,7 +18,7 @@ * * @since SAMM 1.0.0 */ -public interface QuantityKind extends NamedElement { +public interface QuantityKind extends ModelElement { /** * Returns the quantity kind's human-readable name */ diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Scalar.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Scalar.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Scalar.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Scalar.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ScalarValue.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ScalarValue.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ScalarValue.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/ScalarValue.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java similarity index 92% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java index 749082639..44bdc0672 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/StructureElement.java @@ -16,7 +16,7 @@ /** * Represents structural model elements, i.e. that are named and have {@link Property}s */ -public interface StructureElement extends NamedElement, HasProperties { +public interface StructureElement extends ModelElement, HasProperties { default boolean isComplexType() { return false; } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Type.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Type.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Type.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Type.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Unit.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Unit.java similarity index 96% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Unit.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Unit.java index 93bf3dbe4..026e7e681 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Unit.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Unit.java @@ -21,7 +21,7 @@ * * @since SAMM 1.0.0 */ -public interface Unit extends NamedElement { +public interface Unit extends ModelElement { /** * Returns the unit's symbol */ diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Value.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Value.java similarity index 100% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Value.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/Value.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Code.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Code.java similarity index 82% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Code.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Code.java index d0eb30048..92ea22ea2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Code.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Code.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import org.eclipse.esmf.metamodel.Characteristic; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Collection.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Collection.java similarity index 91% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Collection.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Collection.java index 341dfc2f6..d5bc7d37f 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Collection.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Collection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Duration.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Duration.java similarity index 80% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Duration.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Duration.java index 343d85f18..70f21ce7d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Duration.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Duration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A time duration according to ISO 8601. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Either.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Either.java similarity index 88% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Either.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Either.java index 2e38ca5cc..28a0646bf 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Either.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Either.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import org.eclipse.esmf.metamodel.Characteristic; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Enumeration.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Enumeration.java similarity index 88% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Enumeration.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Enumeration.java index 6a29aaee8..225b365ba 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Enumeration.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Enumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import java.util.List; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/List.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/List.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/List.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/List.java index 039fd2204..fb239f630 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/List.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/List.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A collection which may contain duplicates and is ordered. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Measurement.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Measurement.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Measurement.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Measurement.java index f75297c31..5b9e9c638 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Measurement.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Measurement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A value which can be measured and has a unit. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Quantifiable.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Quantifiable.java similarity index 86% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Quantifiable.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Quantifiable.java index 9e35929b0..b65317fd7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Quantifiable.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Quantifiable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Set.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Set.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Set.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Set.java index 2ca6942b2..9d75031e3 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Set.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Set.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A collection which may not contain duplicates and is unordered. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SingleEntity.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SingleEntity.java similarity index 82% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SingleEntity.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SingleEntity.java index e0ee0406e..fd4fee7a5 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SingleEntity.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SingleEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import org.eclipse.esmf.metamodel.Characteristic; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SortedSet.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SortedSet.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SortedSet.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SortedSet.java index 805b79403..a83878d00 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/SortedSet.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/SortedSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A collection which may not contain duplicates and is ordered. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/State.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/State.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/State.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/State.java index 14413ade1..66b6146db 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/State.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/State.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/StructuredValue.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/StructuredValue.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/StructuredValue.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/StructuredValue.java index 8762c7150..0a64857a2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/StructuredValue.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/StructuredValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import java.util.List; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/TimeSeries.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/TimeSeries.java similarity index 82% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/TimeSeries.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/TimeSeries.java index 399671f9e..47ea37c1d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/TimeSeries.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/TimeSeries.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; /** * A collection containing values with the exact point in time when the values where recorded. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Trait.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Trait.java similarity index 89% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Trait.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Trait.java index 1d41b8fe9..de31c8eec 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/Trait.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/characteristic/Trait.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic; +package org.eclipse.esmf.metamodel.characteristic; import java.util.List; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/EncodingConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/EncodingConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/EncodingConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/EncodingConstraint.java index 8d88e10fd..fb15d34c3 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/EncodingConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/EncodingConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import java.nio.charset.Charset; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/FixedPointConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/FixedPointConstraint.java similarity index 85% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/FixedPointConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/FixedPointConstraint.java index 5163b7848..54d36863d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/FixedPointConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/FixedPointConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import org.eclipse.esmf.metamodel.Constraint; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LanguageConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LanguageConstraint.java similarity index 86% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LanguageConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LanguageConstraint.java index a8afce224..69c9e8085 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LanguageConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LanguageConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import java.util.Locale; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LengthConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LengthConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LengthConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LengthConstraint.java index 255dbe29b..f708e659f 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LengthConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LengthConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import java.math.BigInteger; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LocaleConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LocaleConstraint.java similarity index 86% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LocaleConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LocaleConstraint.java index 697f108da..8d9ca00a1 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/LocaleConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/LocaleConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import java.util.Locale; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RangeConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RangeConstraint.java similarity index 90% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RangeConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RangeConstraint.java index bd25e558b..f0310e299 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RangeConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RangeConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import java.util.Optional; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; /** * Restricts the value of a Property to a specific set of possible values. diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RegularExpressionConstraint.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RegularExpressionConstraint.java similarity index 86% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RegularExpressionConstraint.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RegularExpressionConstraint.java index 5f944420e..40b2e9da2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/RegularExpressionConstraint.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/constraint/RegularExpressionConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint; +package org.eclipse.esmf.metamodel.constraint; import org.eclipse.esmf.metamodel.Constraint; diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/Curie.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/Curie.java new file mode 100644 index 000000000..560caa9d9 --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/Curie.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ +package org.eclipse.esmf.metamodel.datatype; + +/** + * Represents a value of the samm:curie data type. For the class that represents the type itself, see {@link CurieType}. + */ +public record Curie( String value ) implements Comparable { + @Override + public String toString() { + return value; + } + + @Override + public int compareTo( final Curie other ) { + return value.compareTo( other.value ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/CurieRdfType.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/CurieType.java similarity index 51% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/CurieRdfType.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/CurieType.java index 233a3220e..215d09d66 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/CurieRdfType.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/CurieType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,74 +11,90 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.metamodel.datatype; +import java.util.Objects; import java.util.Optional; +import java.util.function.Function; +import java.util.function.Predicate; -import org.eclipse.esmf.aspectmodel.resolver.services.TypedRdfDatatype; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.metamodel.datatypes.Curie; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.datatypes.DatatypeFormatException; import org.apache.jena.datatypes.RDFDatatype; import org.apache.jena.graph.impl.LiteralLabel; -public class CurieRdfType implements TypedRdfDatatype { +/** + * Represents the samm:curie datatype itself. For the class that represents a Curie value, see {@link Curie}. + */ +public class CurieType implements SammType { + public static final String CURIE_REGEX = "[a-zA-Z]*:[a-zA-Z]+"; + private final Function parser = Curie::new; + private final Function unparser = Curie::value; + private final Predicate lexicalValidator = value -> value.matches( CURIE_REGEX ); + @Override public Optional parseTyped( final String lexicalForm ) { - if ( isValid( lexicalForm ) ) { - return Optional.of( new Curie( lexicalForm ) ); + try { + return Optional.of( parser.apply( lexicalForm ) ); + } catch ( final RuntimeException exception ) { + if ( SammXsdType.isCheckingEnabled() ) { + throw exception; + } } return Optional.empty(); } @Override public String unparseTyped( final Curie value ) { - return value.getValue(); + return unparser.apply( value ); } @Override public String getURI() { - return new SAMM( KnownVersion.getLatest() ).curie().getURI(); + return SammNs.SAMM.curie().getURI(); } @Override public String unparse( final Object value ) { - if ( value instanceof Curie curie ) { - return unparseTyped( curie ); - } - throw new AspectLoadingException( "Value is no valid curie: " + value ); + return unparseTyped( (Curie) value ); } @Override public Object parse( final String lexicalForm ) throws DatatypeFormatException { - return parseTyped( lexicalForm ).orElseThrow( () -> new DatatypeFormatException() ); + try { + return parser.apply( lexicalForm ); + } catch ( final Exception exception ) { + if ( SammXsdType.isCheckingEnabled() ) { + throw exception; + } + } + return lexicalForm; } @Override public boolean isValid( final String lexicalForm ) { - return lexicalForm.matches( "[^:]*:.*" ); + return lexicalValidator.test( lexicalForm ); } @Override public boolean isValidValue( final Object valueForm ) { - return isValid( valueForm.toString() ); + return isValid( unparse( valueForm ) ); } @Override public boolean isValidLiteral( final LiteralLabel lit ) { - return isValid( lit.getLexicalForm() ); + return lexicalValidator.test( lit.getValue().toString() ); } @Override public boolean isEqual( final LiteralLabel value1, final LiteralLabel value2 ) { - return value1.getLexicalForm().equals( value2.getLexicalForm() ); + return Objects.equals( value1, value2 ); } @Override public int getHashCode( final LiteralLabel lit ) { - return lit.getDefaultHashcode(); + return System.identityHashCode( lit ); } @Override @@ -93,11 +109,11 @@ public Object cannonicalise( final Object value ) { @Override public Object extendedTypeDefinition() { - return null; + return Curie.class; } @Override - public RDFDatatype normalizeSubType( final Object value, final RDFDatatype datatype ) { - return datatype; + public RDFDatatype normalizeSubType( final Object value, final RDFDatatype dt ) { + return dt; } } diff --git a/core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/LangString.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/LangString.java similarity index 90% rename from core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/LangString.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/LangString.java index 97d8c7f3c..21b242c49 100644 --- a/core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/LangString.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/LangString.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,13 +11,13 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.datatypes; +package org.eclipse.esmf.metamodel.datatype; import java.util.Locale; import java.util.Objects; /** - * Java representation of an rdf:langString. + * Java representation of an rdf:langString value. */ public class LangString implements Comparable { private final String value; diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TypedRdfDatatype.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammType.java similarity index 53% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TypedRdfDatatype.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammType.java index 472f362bf..85ec3851e 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TypedRdfDatatype.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,13 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.resolver.services; +package org.eclipse.esmf.metamodel.datatype; import java.util.Optional; import org.apache.jena.datatypes.RDFDatatype; -public interface TypedRdfDatatype extends RDFDatatype { +public interface SammType extends RDFDatatype { + /** + * Parses a lexical representation of a value of the type + * + * @param lexicalForm the lexical representation + * @return if the lexical representation is valid for the type, Optional.of(x) where x is an object of the corresponding Java type (@see + * {@link #getJavaClass()}), otherwise Optional.empty. + */ Optional parseTyped( String lexicalForm ); String unparseTyped( T value ); diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ExtendedXsdDataType.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammXsdType.java similarity index 71% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ExtendedXsdDataType.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammXsdType.java index f223030b4..eda0aa096 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ExtendedXsdDataType.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/datatype/SammXsdType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.resolver.services; +package org.eclipse.esmf.metamodel.datatype; import java.math.BigDecimal; import java.math.BigInteger; @@ -20,21 +20,26 @@ import java.util.Optional; import java.util.function.Function; import java.util.function.Predicate; +import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; import jakarta.xml.bind.DatatypeConverter; import org.apache.jena.datatypes.RDFDatatype; +import org.apache.jena.datatypes.TypeMapper; import org.apache.jena.datatypes.xsd.XSDDatatype; import org.apache.jena.datatypes.xsd.impl.RDFLangString; import org.apache.jena.ext.xerces.impl.dv.XSSimpleType; import org.apache.jena.ext.xerces.impl.dv.xs.ExtendedSchemaDVFactoryImpl; import org.apache.jena.rdf.model.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; // the order of the variables is required because of the way they reference each other -public class ExtendedXsdDataType extends XSDDatatype implements TypedRdfDatatype { - static DatatypeFactory datatypeFactory; +public class SammXsdType extends XSDDatatype implements SammType { + private static final Logger LOG = LoggerFactory.getLogger( SammXsdType.class ); + public static DatatypeFactory datatypeFactory; private final Class correspondingJavaClass; private final Function parser; @@ -43,7 +48,7 @@ public class ExtendedXsdDataType extends XSDDatatype implements TypedRdfDatat private static boolean checking = true; private static final ExtendedSchemaDVFactoryImpl EXTENDED_SCHEMA_DV_FACTORY = new ExtendedSchemaDVFactoryImpl(); - public ExtendedXsdDataType( final Resource dataTypeResource, final Class correspondingJavaClass, + public SammXsdType( final Resource dataTypeResource, final Class correspondingJavaClass, final Function parser, final Function unparser, final Predicate lexicalValidator ) { @@ -54,7 +59,7 @@ public ExtendedXsdDataType( final Resource dataTypeResource, final Class corr this.lexicalValidator = lexicalValidator; } - private ExtendedXsdDataType( final Resource dataTypeResource, final XSSimpleType xstype, + private SammXsdType( final Resource dataTypeResource, final XSSimpleType xstype, final Class correspondingJavaClass, final Function parser, final Function unparser, @@ -67,19 +72,19 @@ private ExtendedXsdDataType( final Resource dataTypeResource, final XSSimpleType this.lexicalValidator = lexicalValidator; } - public static final ExtendedXsdDataType BOOLEAN = new ExtendedXsdDataType<>( + public static final SammXsdType BOOLEAN = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xboolean, Boolean.class, Boolean::valueOf, Object::toString, XSDDatatype.XSDboolean::isValid ); - public static final ExtendedXsdDataType DECIMAL = new ExtendedXsdDataType<>( + public static final SammXsdType DECIMAL = new SammXsdType<>( org.apache.jena.vocabulary.XSD.decimal, BigDecimal.class, BigDecimal::new, BigDecimal::toString, XSDDatatype.XSDdecimal::isValid ); - public static final ExtendedXsdDataType INTEGER = new ExtendedXsdDataType<>( + public static final SammXsdType INTEGER = new SammXsdType<>( org.apache.jena.vocabulary.XSD.integer, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDinteger::isValid ); - public static final ExtendedXsdDataType DOUBLE = new ExtendedXsdDataType<>( + public static final SammXsdType DOUBLE = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xdouble, Double.class, value -> { if ( "INF".equalsIgnoreCase( value ) ) { return Double.POSITIVE_INFINITY; @@ -99,7 +104,7 @@ private ExtendedXsdDataType( final Resource dataTypeResource, final XSSimpleType return value.toString(); }, XSDDatatype.XSDdouble::isValid ); - public static final ExtendedXsdDataType FLOAT = new ExtendedXsdDataType<>( + public static final SammXsdType FLOAT = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xfloat, Float.class, value -> { if ( "INF".equalsIgnoreCase( value ) ) { return Float.POSITIVE_INFINITY; @@ -119,136 +124,136 @@ private ExtendedXsdDataType( final Resource dataTypeResource, final XSSimpleType return value.toString(); }, XSDDatatype.XSDfloat::isValid ); - public static final ExtendedXsdDataType DATE = new ExtendedXsdDataType<>( + public static final SammXsdType DATE = new SammXsdType<>( org.apache.jena.vocabulary.XSD.date, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDdate::isValid ); - public static final ExtendedXsdDataType TIME = new ExtendedXsdDataType<>( + public static final SammXsdType TIME = new SammXsdType<>( org.apache.jena.vocabulary.XSD.time, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDtime::isValid ); - public static final ExtendedXsdDataType DATE_TIME = new ExtendedXsdDataType<>( + public static final SammXsdType DATE_TIME = new SammXsdType<>( org.apache.jena.vocabulary.XSD.dateTime, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDdateTime::isValid ); - public static final ExtendedXsdDataType DATE_TIME_STAMP = new ExtendedXsdDataType<>( + public static final SammXsdType DATE_TIME_STAMP = new SammXsdType<>( org.apache.jena.vocabulary.XSD.dateTimeStamp, EXTENDED_SCHEMA_DV_FACTORY.getBuiltInType( org.apache.jena.vocabulary.XSD.dateTimeStamp.getLocalName() ), XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDdateTimeStamp::isValid ); - public static final ExtendedXsdDataType G_YEAR = new ExtendedXsdDataType<>( + public static final SammXsdType G_YEAR = new SammXsdType<>( org.apache.jena.vocabulary.XSD.gYear, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDgYear::isValid ); - public static final ExtendedXsdDataType G_MONTH = new ExtendedXsdDataType<>( + public static final SammXsdType G_MONTH = new SammXsdType<>( org.apache.jena.vocabulary.XSD.gMonth, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDgMonth::isValid ); - public static final ExtendedXsdDataType G_DAY = new ExtendedXsdDataType<>( + public static final SammXsdType G_DAY = new SammXsdType<>( org.apache.jena.vocabulary.XSD.gDay, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDgDay::isValid ); - public static final ExtendedXsdDataType G_YEAR_MONTH = new ExtendedXsdDataType<>( + public static final SammXsdType G_YEAR_MONTH = new SammXsdType<>( org.apache.jena.vocabulary.XSD.gYearMonth, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDgYearMonth::isValid ); - public static final ExtendedXsdDataType G_MONTH_DAY = new ExtendedXsdDataType<>( + public static final SammXsdType G_MONTH_DAY = new SammXsdType<>( org.apache.jena.vocabulary.XSD.gMonthDay, XMLGregorianCalendar.class, value -> datatypeFactory.newXMLGregorianCalendar( value ), XMLGregorianCalendar::toXMLFormat, XSDDatatype.XSDgMonthDay::isValid ); - public static final ExtendedXsdDataType DURATION = new ExtendedXsdDataType<>( + public static final SammXsdType DURATION = new SammXsdType<>( org.apache.jena.vocabulary.XSD.duration, Duration.class, value -> datatypeFactory.newDuration( value ), Duration::toString, XSDDatatype.XSDduration::isValid ); - public static final ExtendedXsdDataType YEAR_MONTH_DURATION = new ExtendedXsdDataType<>( + public static final SammXsdType YEAR_MONTH_DURATION = new SammXsdType<>( org.apache.jena.vocabulary.XSD.yearMonthDuration, EXTENDED_SCHEMA_DV_FACTORY.getBuiltInType( org.apache.jena.vocabulary.XSD.yearMonthDuration.getLocalName() ), Duration.class, value -> datatypeFactory.newDurationYearMonth( value ), Duration::toString, XSDDatatype.XSDyearMonthDuration::isValid ); - public static final ExtendedXsdDataType DAY_TIME_DURATION = new ExtendedXsdDataType<>( + public static final SammXsdType DAY_TIME_DURATION = new SammXsdType<>( org.apache.jena.vocabulary.XSD.dayTimeDuration, EXTENDED_SCHEMA_DV_FACTORY.getBuiltInType( org.apache.jena.vocabulary.XSD.dayTimeDuration.getLocalName() ), Duration.class, value -> datatypeFactory.newDurationDayTime( value ), Duration::toString, XSDDatatype.XSDdayTimeDuration::isValid ); - public static final ExtendedXsdDataType BYTE = new ExtendedXsdDataType<>( org.apache.jena.vocabulary.XSD.xbyte, + public static final SammXsdType BYTE = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xbyte, Byte.class, Byte::parseByte, Object::toString, XSDDatatype.XSDbyte::isValid ); - public static final ExtendedXsdDataType SHORT = new ExtendedXsdDataType<>( + public static final SammXsdType SHORT = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xshort, Short.class, Short::parseShort, Object::toString, XSDDatatype.XSDshort::isValid ); - public static final ExtendedXsdDataType INT = new ExtendedXsdDataType<>( + public static final SammXsdType INT = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xint, Integer.class, Integer::parseInt, Object::toString, XSDDatatype.XSDint::isValid ); - public static final ExtendedXsdDataType LONG = new ExtendedXsdDataType<>( org.apache.jena.vocabulary.XSD.xlong, + public static final SammXsdType LONG = new SammXsdType<>( org.apache.jena.vocabulary.XSD.xlong, Long.class, Long::parseLong, Object::toString, XSDDatatype.XSDlong::isValid ); - public static final ExtendedXsdDataType UNSIGNED_BYTE = new ExtendedXsdDataType<>( + public static final SammXsdType UNSIGNED_BYTE = new SammXsdType<>( org.apache.jena.vocabulary.XSD.unsignedByte, Short.class, Short::parseShort, Object::toString, XSDDatatype.XSDunsignedByte::isValid ); - public static final ExtendedXsdDataType UNSIGNED_SHORT = new ExtendedXsdDataType<>( + public static final SammXsdType UNSIGNED_SHORT = new SammXsdType<>( org.apache.jena.vocabulary.XSD.unsignedShort, Integer.class, Integer::parseInt, Object::toString, XSDDatatype.XSDunsignedShort::isValid ); - public static final ExtendedXsdDataType UNSIGNED_INT = new ExtendedXsdDataType<>( + public static final SammXsdType UNSIGNED_INT = new SammXsdType<>( org.apache.jena.vocabulary.XSD.unsignedInt, Long.class, Long::parseLong, Object::toString, XSDDatatype.XSDunsignedInt::isValid ); - public static final ExtendedXsdDataType UNSIGNED_LONG = new ExtendedXsdDataType<>( + public static final SammXsdType UNSIGNED_LONG = new SammXsdType<>( org.apache.jena.vocabulary.XSD.unsignedLong, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDunsignedLong::isValid ); - public static final ExtendedXsdDataType POSITIVE_INTEGER = new ExtendedXsdDataType<>( + public static final SammXsdType POSITIVE_INTEGER = new SammXsdType<>( org.apache.jena.vocabulary.XSD.positiveInteger, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDpositiveInteger::isValid ); - public static final ExtendedXsdDataType NON_NEGATIVE_INTEGER = new ExtendedXsdDataType<>( + public static final SammXsdType NON_NEGATIVE_INTEGER = new SammXsdType<>( org.apache.jena.vocabulary.XSD.nonNegativeInteger, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDnonNegativeInteger::isValid ); - public static final ExtendedXsdDataType NEGATIVE_INTEGER = new ExtendedXsdDataType<>( + public static final SammXsdType NEGATIVE_INTEGER = new SammXsdType<>( org.apache.jena.vocabulary.XSD.negativeInteger, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDnegativeInteger::isValid ); - public static final ExtendedXsdDataType NON_POSITIVE_INTEGER = new ExtendedXsdDataType<>( + public static final SammXsdType NON_POSITIVE_INTEGER = new SammXsdType<>( org.apache.jena.vocabulary.XSD.nonPositiveInteger, BigInteger.class, BigInteger::new, BigInteger::toString, XSDDatatype.XSDnonPositiveInteger::isValid ); - public static final ExtendedXsdDataType HEX_BINARY = new ExtendedXsdDataType<>( + public static final SammXsdType HEX_BINARY = new SammXsdType<>( org.apache.jena.vocabulary.XSD.hexBinary, byte[].class, DatatypeConverter::parseHexBinary, DatatypeConverter::printHexBinary, XSDDatatype.XSDhexBinary::isValid ); - public static final ExtendedXsdDataType BASE64_BINARY = new ExtendedXsdDataType<>( + public static final SammXsdType BASE64_BINARY = new SammXsdType<>( org.apache.jena.vocabulary.XSD.base64Binary, byte[].class, DatatypeConverter::parseBase64Binary, DatatypeConverter::printBase64Binary, XSDDatatype.XSDbase64Binary::isValid ); - public static final ExtendedXsdDataType ANY_URI = new ExtendedXsdDataType<>( + public static final SammXsdType ANY_URI = new SammXsdType<>( org.apache.jena.vocabulary.XSD.anyURI, URI.class, value -> URI.create( (String) XSDDatatype.XSDanyURI.parse( value ) ), URI::toString, XSDDatatype.XSDanyURI::isValid ); - public static final List SUPPORTED_XSD_TYPES = List + public static final List ALL_TYPES = List .of( XSDDatatype.XSDstring, BOOLEAN, DECIMAL, INTEGER, DOUBLE, FLOAT, DATE, TIME, DATE_TIME, DATE_TIME_STAMP, G_YEAR, G_MONTH, G_YEAR_MONTH, G_DAY, G_MONTH_DAY, DURATION, YEAR_MONTH_DURATION, DAY_TIME_DURATION, BYTE, SHORT, INT, LONG, UNSIGNED_BYTE, UNSIGNED_SHORT, UNSIGNED_INT, UNSIGNED_LONG, POSITIVE_INTEGER, NON_NEGATIVE_INTEGER, NEGATIVE_INTEGER, NON_POSITIVE_INTEGER, HEX_BINARY, - BASE64_BINARY, ANY_URI, RDFLangString.rdfLangString ); + BASE64_BINARY, ANY_URI, RDFLangString.rdfLangString, new CurieType() ); public static void setChecking( final boolean checking ) { - ExtendedXsdDataType.checking = checking; + SammXsdType.checking = checking; } public static boolean isCheckingEnabled() { @@ -274,13 +279,6 @@ public Object parse( final String lexicalForm ) { return lexicalForm; } - /** - * Parses a lexical representaion of a value of the type - * - * @param lexicalForm the lexical representation - * @return if the lexical representation is valid for the type, Optional.of(x) where x is an object of the corresponding Java type (@see - * {@link #getJavaClass()}), otherwise Optional.empty. - */ @Override public Optional parseTyped( final String lexicalForm ) { try { @@ -313,4 +311,38 @@ public boolean isValid( final String lexicalForm ) { public Class getJavaClass() { return correspondingJavaClass; } + + private static boolean setupPerformed = false; + + /** + * Idempotent method to register the SAMM type mapping in the Jena RDF parser. + */ + public static synchronized void setupTypeMapping() { + if ( !setupPerformed ) { + try { + datatypeFactory = DatatypeFactory.newInstance(); + } catch ( final DatatypeConfigurationException exception ) { + LOG.error( "Could not instantiate DatatypeFactory", exception ); + } + + final TypeMapper typeMapper = TypeMapper.getInstance(); + ALL_TYPES.forEach( typeMapper::registerDatatype ); + setupPerformed = true; + } + } + + /** + * Returns the Java class corresponding to a XSD type in a given meta model version. + * + * @param type the resource of the data type + * @return the java class + */ + public static Class getJavaTypeForMetaModelType( final Resource type ) { + return ALL_TYPES + .stream() + .filter( xsdType -> xsdType.getURI().equals( type.getURI() ) ) + .map( RDFDatatype::getJavaClass ) + .findAny() + .orElseThrow( () -> new IllegalStateException( "Invalid data type " + type + " found in model." ) ); + } } diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/Namespace.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/RdfNamespace.java similarity index 54% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/Namespace.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/RdfNamespace.java index 1e953a5da..2eea404c2 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/Namespace.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/RdfNamespace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.vocabulary; +package org.eclipse.esmf.metamodel.vocabulary; import java.util.LinkedHashMap; import java.util.Map; @@ -28,7 +28,9 @@ /** * Abstracts an RDF namespace */ -public interface Namespace { +public interface RdfNamespace { + String getShortForm(); + String getUri(); default String getNamespace() { @@ -36,29 +38,40 @@ default String getNamespace() { return uri.endsWith( "#" ) ? uri : uri + "#"; } + default String urn( final String element ) { + return getNamespace() + element; + } + default Property property( final String name ) { - return ResourceFactory.createProperty( getNamespace() + name ); + return ResourceFactory.createProperty( urn( name ) ); } default Resource resource( final String name ) { - return ResourceFactory.createResource( getNamespace() + name ); + return ResourceFactory.createResource( urn( name ) ); } static Map createPrefixMap( final KnownVersion metaModelVersion ) { + final Map result = new LinkedHashMap<>(); final SAMM samm = new SAMM( metaModelVersion ); - final SAMMC sammc = new SAMMC( metaModelVersion ); - final SAMME samme = new SAMME( metaModelVersion, samm ); - final UNIT unit = new UNIT( metaModelVersion, samm ); + result.put( "samm", samm.getNamespace() ); + result.put( "samm-c", new SAMMC( metaModelVersion ).getNamespace() ); + result.put( "samm-e", new SAMME( metaModelVersion, samm ).getNamespace() ); + result.put( "unit", new UNIT( metaModelVersion, samm ).getNamespace() ); + result.put( "rdf", RDF.getURI() ); + result.put( "rdfs", RDFS.getURI() ); + result.put( "xsd", XSD.getURI() ); + return result; + } + static Map createPrefixMap() { final Map result = new LinkedHashMap<>(); - result.put( "samm", samm.getUri() + "#" ); - result.put( "samm-c", sammc.getUri() + "#" ); - result.put( "samm-e", samme.getUri() + "#" ); - result.put( "unit", unit.getUri() + "#" ); + result.put( "samm", SammNs.SAMM.getNamespace() ); + result.put( "samm-c", SammNs.SAMMC.getNamespace() ); + result.put( "samm-e", SammNs.SAMME.getNamespace() ); + result.put( "unit", SammNs.UNIT.getNamespace() ); result.put( "rdf", RDF.getURI() ); result.put( "rdfs", RDFS.getURI() ); result.put( "xsd", XSD.getURI() ); - return result; } } diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMM.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMM.java similarity index 95% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMM.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMM.java index f5b6e3052..4f1116a1e 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMM.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMM.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.vocabulary; +package org.eclipse.esmf.metamodel.vocabulary; import org.eclipse.esmf.samm.KnownVersion; @@ -23,7 +23,7 @@ // Since the class is an RDF vocabulary, naming rules for the class and for several methods (which should be named identically // to the corresponding model elements) are suppressed. @SuppressWarnings( { "checkstyle:AbbreviationAsWordInName", "NewMethodNamingConvention" } ) -public class SAMM implements Namespace { +public class SAMM implements RdfNamespace { final KnownVersion metaModelVersion; private static final String BASE_URI = "urn:samm:org.eclipse.esmf.samm:"; @@ -31,6 +31,11 @@ public SAMM( final KnownVersion metaModelVersion ) { this.metaModelVersion = metaModelVersion; } + @Override + public String getShortForm() { + return "samm"; + } + public String getBaseUri() { return BASE_URI; } @@ -91,10 +96,6 @@ public Property characteristic() { return property( "characteristic" ); } - public Property baseCharacteristic() { - return property( "baseCharacteristic" ); - } - @SuppressWarnings( "checkstyle:MethodName" ) public Resource Constraint() { return resource( "Constraint" ); diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMMC.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMMC.java similarity index 95% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMMC.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMMC.java index 8294d4055..f4cfd188a 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMMC.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMMC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.vocabulary; +package org.eclipse.esmf.metamodel.vocabulary; import java.util.function.Function; import java.util.stream.Stream; @@ -26,18 +26,21 @@ // Since the class is an RDF vocabulary, naming rules for the class and for several methods (which should be named identically // to the corresponding model elements) are suppressed. @SuppressWarnings( { "checkstyle:AbbreviationAsWordInName", "NewMethodNamingConvention" } ) -public class SAMMC implements Namespace { +public class SAMMC implements RdfNamespace { private final KnownVersion metaModelVersion; - private final SAMM samm; public SAMMC( final KnownVersion metaModelVersion ) { this.metaModelVersion = metaModelVersion; - samm = new SAMM( metaModelVersion ); + } + + @Override + public String getShortForm() { + return "samm-c"; } @Override public String getUri() { - return samm.getBaseUri() + "characteristic:" + metaModelVersion.toVersionString(); + return SammNs.SAMM.getBaseUri() + "characteristic:" + metaModelVersion.toVersionString(); } /* diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMME.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMME.java similarity index 89% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMME.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMME.java index b4c71b50e..97a2ffbef 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/SAMME.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SAMME.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.vocabulary; +package org.eclipse.esmf.metamodel.vocabulary; import java.util.stream.Stream; @@ -23,7 +23,7 @@ // Since the class is an RDF vocabulary, naming rules for the class and for several methods (which should be named identically // to the corresponding model elements) are suppressed. @SuppressWarnings( { "checkstyle:AbbreviationAsWordInName", "NewMethodNamingConvention" } ) -public class SAMME implements Namespace { +public class SAMME implements RdfNamespace { private final KnownVersion metaModelVersion; private final SAMM samm; @@ -32,6 +32,11 @@ public SAMME( final KnownVersion metaModelVersion, final SAMM samm ) { this.samm = samm; } + @Override + public String getShortForm() { + return "samm-e"; + } + @Override public String getUri() { return samm.getBaseUri() + "entity:" + metaModelVersion.toVersionString(); diff --git a/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SammNs.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SammNs.java new file mode 100644 index 000000000..cb7a491c5 --- /dev/null +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/SammNs.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel.vocabulary; + +import org.eclipse.esmf.samm.KnownVersion; + +/** + * RDF vocabularies of the SAMM meta model namespaces + */ +public class SammNs { + public static final SAMM SAMM = new SAMM( KnownVersion.getLatest() ); + public static final SAMMC SAMMC = new SAMMC( KnownVersion.getLatest() ); + public static final SAMME SAMME = new SAMME( KnownVersion.getLatest(), SAMM ); + public static final UNIT UNIT = new UNIT( KnownVersion.getLatest(), SAMM ); +} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/UNIT.java b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/UNIT.java similarity index 81% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/UNIT.java rename to core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/UNIT.java index d2ec3a413..e84c6300b 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/vocabulary/UNIT.java +++ b/core/esmf-aspect-meta-model-interface/src/main/java/org/eclipse/esmf/metamodel/vocabulary/UNIT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.vocabulary; +package org.eclipse.esmf.metamodel.vocabulary; import org.eclipse.esmf.samm.KnownVersion; // Since the class is an RDF vocabulary, naming rules for the class and for several methods (which should be named identically // to the corresponding model elements) are suppressed. @SuppressWarnings( { "checkstyle:AbbreviationAsWordInName", "CheckStyle" } ) -public class UNIT implements Namespace { +public class UNIT implements RdfNamespace { private final KnownVersion metaModelVersion; private final SAMM samm; @@ -27,6 +27,11 @@ public UNIT( final KnownVersion metaModelVersion, final SAMM samm ) { this.samm = samm; } + @Override + public String getShortForm() { + return "unit"; + } + @Override public String getUri() { return samm.getBaseUri() + "unit:" + metaModelVersion.toVersionString(); diff --git a/core/esmf-aspect-meta-model-java/pom.xml b/core/esmf-aspect-meta-model-java/pom.xml index 321d5e440..687c30a88 100644 --- a/core/esmf-aspect-meta-model-java/pom.xml +++ b/core/esmf-aspect-meta-model-java/pom.xml @@ -36,23 +36,27 @@ org.eclipse.esmf - esmf-aspect-model-resolver + esmf-semantic-aspect-meta-model org.eclipse.esmf - esmf-aspect-meta-model-resolver + esmf-aspect-meta-model-interface - org.eclipse.esmf - esmf-semantic-aspect-meta-model + org.apache.commons + commons-text - org.eclipse.esmf - esmf-aspect-meta-model-types + org.apache.jena + jena-arq - org.apache.commons - commons-text + io.vavr + vavr + + + com.google.guava + guava @@ -68,7 +72,7 @@ org.eclipse.esmf - esmf-test-resources + esmf-test-aspect-models test diff --git a/core/esmf-aspect-meta-model-java/src-buildtime/main/java/org/eclipse/esmf/buildtime/GenerateUnitsTtl.java b/core/esmf-aspect-meta-model-java/src-buildtime/main/java/org/eclipse/esmf/buildtime/GenerateUnitsTtl.java index a9881e339..3b1bd9d97 100644 --- a/core/esmf-aspect-meta-model-java/src-buildtime/main/java/org/eclipse/esmf/buildtime/GenerateUnitsTtl.java +++ b/core/esmf-aspect-meta-model-java/src-buildtime/main/java/org/eclipse/esmf/buildtime/GenerateUnitsTtl.java @@ -28,7 +28,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.samm.KnownVersion; import com.google.common.collect.Lists; @@ -75,13 +76,13 @@ public class GenerateUnitsTtl { import java.util.Collections; import java.util.stream.Collectors; + import org.eclipse.esmf.aspectmodel.AspectModelFile; + import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; + import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; - import org.eclipse.esmf.metamodel.QuantityKind; - import org.eclipse.esmf.metamodel.Unit; + import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.metamodel.impl.DefaultUnit; - import org.eclipse.esmf.samm.KnownVersion; - import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; - import org.eclipse.esmf.metamodel.datatypes.LangString; + import org.eclipse.esmf.metamodel.vocabulary.SammNs; /** * Enumeration of Units as defined in Recommendation 20 by @@ -94,6 +95,13 @@ private Units() { } // ${initMethods} + + /** + * Returns the file that defines this unit + */ + public AspectModelFile getSourceFile() { + return MetaModelFile.UNITS; + } /** * Returns the unit with a given name @@ -168,10 +176,11 @@ public static Set unitsWithQuantityKind( final QuantityKind quantityKind ) import java.util.Arrays; import java.util.Optional; + import org.eclipse.esmf.aspectmodel.AspectModelFile; + import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; - import org.eclipse.esmf.metamodel.QuantityKind; - import org.eclipse.esmf.metamodel.visitor.AspectVisitor; - import org.eclipse.esmf.samm.KnownVersion; + import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; + import org.eclipse.esmf.metamodel.vocabulary.SammNs; /** * Enumeration of Quantity Kinds as defined in Recommendation 20 @@ -187,6 +196,16 @@ public enum QuantityKinds implements QuantityKind { this.name = name; this.label = label; } + + @Override + public AspectModelUrn urn() { + return AspectModelUrn.fromUrn( SammNs.UNIT.urn( name ) ); + } + + @Override + public AspectModelFile getSourceFile() { + return MetaModelFile.UNITS; + } /** * Returns the quantity kind's unique name @@ -212,17 +231,6 @@ public String toString() { return getLabel(); } - @Override - public Optional getAspectModelUrn() { - return Optional.of( AspectModelUrn.fromUrn( - String.format( "urn:samm:org.eclipse.esmf.samm:unit:%s#%s", KnownVersion.getLatest().toVersionString(), name ) ) ); - } - - @Override - public KnownVersion getMetaModelVersion() { - return KnownVersion.getLatest(); - } - @Override public T accept( final AspectVisitor visitor, final C context ) { return visitor.visitQuantityKind( this, context ); @@ -316,7 +324,7 @@ private List attributeValues( final Resource resource, final Property } private List unitDeclarations() { - final SAMM samm = new SAMM( KnownVersion.getLatest() ); + final SAMM samm = SammNs.SAMM; final Function, String> buildDeclaration = optionalValue -> optionalValue.map( StringEscapeUtils::escapeJava ).map( "Optional.of(\"%s\")"::formatted ).orElse( "Optional.empty()" ); @@ -336,20 +344,25 @@ private List unitDeclarations() { optionalAttributeValue( unit, samm.referenceUnit() ).map( Statement::getResource ).map( Resource::getLocalName ) ); final String conversionFactorDeclaration = buildDeclaration.apply( optionalAttributeValue( unit, samm.conversionFactor() ).map( Statement::getString ) ); - final String preferredNames = attributeValues( unit, samm.preferredName() ).stream().flatMap( buildLangString ) - .collect( Collectors.joining( ", ", "Set.of(", ")" ) ); - final String descriptions = attributeValues( unit, samm.description() ).stream().flatMap( buildLangString ) - .collect( Collectors.joining( ", ", "Set.of(", ")" ) ); - final String see = attributeValues( unit, samm.see() ).stream().map( seeValue -> "\"" + seeValue + "\"" ) - .collect( Collectors.joining( ", ", "List.of(", ")" ) ); + final String preferredNames = attributeValues( unit, samm.preferredName() ).stream() + .map( statement -> ".withPreferredName( Locale.forLanguageTag( \"%s\" ), \"%s\" )".formatted( statement.getLanguage(), + statement.getString() ) ).collect( Collectors.joining() ); final String quantityKindDefs = attributeValues( unit, samm.quantityKind() ).stream() .map( quantityKind -> "QuantityKinds." + toUpperSnakeCase( quantityKind.getResource().getLocalName() ) ) .collect( Collectors.joining( ", ", "new HashSet<>(Arrays.asList(", "))" ) ); final String quantityKinds = quantityKindDefs.contains( "()" ) ? "Collections.emptySet()" : quantityKindDefs; - final String metaModelBaseAttributes = - "new MetaModelBaseAttributes( AspectModelUrn.fromUrn( \"%s\" ), \"%s\", %s, %s, %s )".formatted( - unit.getURI(), name, preferredNames, descriptions, see ); + "MetaModelBaseAttributes.builder().withUrn( SammNs.UNIT.urn( \"%s\" ) )%s%s%s.build()".formatted( + unit.getLocalName(), + attributeValues( unit, samm.preferredName() ).stream() + .map( statement -> ".withPreferredName( Locale.forLanguageTag( \"%s\" ), \"%s\" )".formatted( + statement.getLanguage(), statement.getString() ) ).collect( Collectors.joining() ), + attributeValues( unit, samm.description() ).stream() + .map( statement -> ".withDescription( Locale.forLanguageTag( \"%s\" ), \"%s\" )".formatted( + statement.getLanguage(), statement.getString() ) ).collect( Collectors.joining() ), + attributeValues( unit, samm.see() ).stream().map( seeValue -> "withSee( \"" + seeValue + "\" )" ) + .collect( Collectors.joining() ) ); + final String unitDefinition = "new DefaultUnit( %s, %s, %s, %s, %s, %s )".formatted( metaModelBaseAttributes, symbolDeclaration, commonCodeDeclaration, referenceUnitDeclaration, conversionFactorDeclaration, quantityKinds ); return "UNITS_BY_NAME.put( \"%s\", %s );".formatted( name, unitDefinition ); @@ -357,7 +370,7 @@ private List unitDeclarations() { } private List quantityKindDeclarations() { - final SAMM samm = new SAMM( KnownVersion.getLatest() ); + final SAMM samm = SammNs.SAMM; return Streams.stream( unitsModel.listStatements( null, RDF.type, samm.QuantityKind() ) ).map( Statement::getSubject ) .map( quantityKind -> { diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/AnyNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/AnyNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/AnyNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/AnyNode.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/BlankNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/BlankNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/BlankNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/BlankNode.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/LiteralNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/LiteralNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/LiteralNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/LiteralNode.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/TokenNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/TokenNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/TokenNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/TokenNode.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/UriNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/UriNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/UriNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/UriNode.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/VariableNode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/VariableNode.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/apache/jena/graph/VariableNode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/apache/jena/graph/VariableNode.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoader.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoader.java new file mode 100644 index 000000000..2d47de721 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoader.java @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader; + +import static java.util.stream.Collectors.toSet; + +import java.io.File; +import java.io.InputStream; +import java.nio.file.Path; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Deque; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Stream; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.resolver.AspectModelFileLoader; +import org.eclipse.esmf.aspectmodel.resolver.EitherStrategy; +import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; +import org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategySupport; +import org.eclipse.esmf.aspectmodel.resolver.fs.FlatModelsRoot; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.DefaultAspectModelFile; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.urn.ElementType; +import org.eclipse.esmf.aspectmodel.urn.UrnSyntaxException; +import org.eclipse.esmf.aspectmodel.versionupdate.MetaModelVersionMigrator; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.impl.DefaultAspectModel; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; + +import com.google.common.collect.Streams; +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.Statement; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.XSD; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The core class to load an {@link AspectModel}. + */ +public class AspectModelLoader implements ResolutionStrategySupport { + private static final Logger LOG = LoggerFactory.getLogger( AspectModelLoader.class ); + + public static final Supplier DEFAULT_STRATEGY = () -> { + final Path currentDirectory = Path.of( System.getProperty( "user.dir" ) ); + return new FileSystemStrategy( new FlatModelsRoot( currentDirectory ) ); + }; + + private final ResolutionStrategy resolutionStrategy; + + /** + * Default constructor. When encountering model elements not defined in the current file, this will use the default strategy of looking + * for definitions of model elements in .ttl files in the current working directory. + */ + public AspectModelLoader() { + this( List.of() ); + } + + /** + * Constructor that takes a single {@link ResolutionStrategy} to control where the loading process should look for definitions + * of model elements not defined in the current file. + * + * @param resolutionStrategy the strategy + */ + public AspectModelLoader( final ResolutionStrategy resolutionStrategy ) { + this( List.of( resolutionStrategy ) ); + } + + /** + * Constructor that takes multiple {@link ResolutionStrategy}s to control where the loading process should look for definitions + * of model elements not defined in the current file. The strategies are tried one after another until an element definition is found. + * + * @param resolutionStrategies the strategies + */ + public AspectModelLoader( final List resolutionStrategies ) { + if ( resolutionStrategies.size() == 1 ) { + resolutionStrategy = resolutionStrategies.get( 0 ); + } else if ( resolutionStrategies.isEmpty() ) { + resolutionStrategy = DEFAULT_STRATEGY.get(); + } else { + resolutionStrategy = new EitherStrategy( resolutionStrategies ); + } + } + + /** + * Load an Aspect Model from a given file + * + * @param file the file + * @return the Aspect Model + */ + public AspectModel load( final File file ) { + return load( List.of( file ) ); + } + + /** + * Load a set of files into a single Aspect Model + * + * @param files the files + * @return the Aspect Model + */ + public AspectModel load( final Collection files ) { + final List migratedFiles = files.stream() + .map( AspectModelFileLoader::load ) + .map( this::migrate ) + .toList(); + final LoaderContext loaderContext = new LoaderContext(); + resolve( migratedFiles, loaderContext ); + return buildAspectModel( loaderContext.loadedFiles() ); + } + + /** + * Load an Aspect Model by transitively resolving a given input URN + * + * @param urn the Aspect Model URN + * @return the Aspect Model + */ + public AspectModel load( final AspectModelUrn urn ) { + return loadUrns( List.of( urn ) ); + } + + /** + * Load an Aspect Model by transitively resolving a set of given input URNs + * + * @param urns the Aspect Model URNs + * @return the Aspect Model + */ + public AspectModel loadUrns( final Collection urns ) { + final LoaderContext loaderContext = new LoaderContext(); + for ( final AspectModelUrn inputUrn : urns ) { + loaderContext.unresolvedUrns().add( inputUrn.toString() ); + } + resolve( List.of(), loaderContext ); + return buildAspectModel( loaderContext.loadedFiles() ); + } + + /** + * Load an Aspect Model from an input stream + * + * @param inputStream the input stream + * @return the Aspect Model + */ + public AspectModel load( final InputStream inputStream ) { + final AspectModelFile rawFile = AspectModelFileLoader.load( inputStream ); + final AspectModelFile migratedModel = migrate( rawFile ); + final LoaderContext loaderContext = new LoaderContext(); + resolve( List.of( migratedModel ), loaderContext ); + return buildAspectModel( loaderContext.loadedFiles() ); + } + + private AspectModelFile migrate( final AspectModelFile file ) { + return MetaModelVersionMigrator.INSTANCE.apply( file ); + } + + private record LoaderContext( + Set resolvedUrns, + Set loadedFiles, + Deque unresolvedUrns, + Deque unresolvedFiles + ) { + private LoaderContext() { + this( new HashSet<>(), new HashSet<>(), new ArrayDeque<>(), new ArrayDeque<>() ); + } + } + + private Set getAllUrnsInModel( final Model model ) { + return Streams.stream( model.listStatements().mapWith( statement -> { + final Stream subjectUri = statement.getSubject().isURIResource() + ? Stream.of( statement.getSubject().getURI() ) + : Stream.empty(); + final Stream propertyUri = Stream.of( statement.getPredicate().getURI() ); + final Stream objectUri = statement.getObject().isURIResource() + ? Stream.of( statement.getObject().asResource().getURI() ) + : Stream.empty(); + + return Stream.of( subjectUri, propertyUri, objectUri ) + .flatMap( Function.identity() ) + .flatMap( urn -> AspectModelUrn.from( urn ).toJavaOptional().stream() ) + .map( AspectModelUrn::toString ); + } ) ).flatMap( Function.identity() ).collect( toSet() ); + } + + /** + * Adapter that enables the resolver to handle URNs with the legacy "urn:bamm:" prefix. + * + * @param urn the URN to clean up + * @return the original URN (if using valid urn:samm: scheme) or the the cleaned up URN + */ + private String replaceLegacyBammUrn( final String urn ) { + if ( urn.startsWith( "urn:bamm:" ) ) { + return urn.replace( "urn:bamm:", "urn:samm:" ); + } + return urn; + } + + private boolean containsType( final Model model, final String urn ) { + if ( model.contains( model.createResource( urn ), RDF.type, (RDFNode) null ) ) { + return true; + } else if ( urn.startsWith( "urn:samm:" ) ) { + // when deriving a URN from file (via "fileToUrn" method - mainly in samm-cli scenarios), + // we assume new "samm" format, but could actually have been the old "bamm" + return model.contains( model.createResource( toLegacyBammUrn( urn ) ), RDF.type, (RDFNode) null ); + } + return false; + } + + private String toLegacyBammUrn( final String urn ) { + if ( urn.startsWith( "urn:samm:" ) ) { + return urn.replace( "urn:samm:", "urn:bamm:" ); + } + return urn; + } + + private Optional applyResolutionStrategy( final String urn ) { + if ( urn.startsWith( RDF.getURI() ) || urn.startsWith( XSD.getURI() ) ) { + return Optional.empty(); + } + + try { + final AspectModelUrn aspectModelUrn = AspectModelUrn.fromUrn( replaceLegacyBammUrn( urn ) ); + if ( aspectModelUrn.getElementType() != ElementType.NONE ) { + return Optional.empty(); + } + final AspectModelFile resolutionResult = resolutionStrategy.apply( aspectModelUrn, this ); + if ( !containsType( resolutionResult.sourceModel(), urn ) ) { + throw new ModelResolutionException( + "Resolution strategy returned a model which does not contain element definition for " + urn ); + } + return Optional.of( resolutionResult ); + } catch ( final UrnSyntaxException e ) { + // If it's no valid Aspect Model URN but some other URI (e.g., a samm:see value), there is nothing + // to resolve, so we return just an empty model + return Optional.empty(); + } + } + + private void urnsFromModelNeedResolution( final AspectModelFile modelFile, final LoaderContext context ) { + Streams.stream( modelFile.sourceModel().listStatements( null, RDF.type, (RDFNode) null ) ) + .map( Statement::getSubject ) + .filter( Resource::isURIResource ) + .map( Resource::getURI ) + .filter( uri -> uri.startsWith( "urn:samm:" ) ) + .forEach( urn -> context.resolvedUrns().add( urn ) ); + + getAllUrnsInModel( modelFile.sourceModel() ).stream() + .filter( urn -> !context.resolvedUrns().contains( urn ) ) + .filter( urn -> !urn.startsWith( XSD.NS ) ) + .filter( urn -> !urn.startsWith( RDF.uri ) ) + .filter( urn -> !urn.startsWith( SammNs.SAMM.getNamespace() ) ) + .filter( urn -> !urn.startsWith( SammNs.SAMMC.getNamespace() ) ) + .filter( urn -> !urn.startsWith( SammNs.SAMME.getNamespace() ) ) + .filter( urn -> !urn.startsWith( SammNs.UNIT.getNamespace() ) ) + .forEach( urn -> context.unresolvedUrns().add( urn ) ); + } + + private void markModelFileAsLoaded( final AspectModelFile modelFile, final LoaderContext context ) { + if ( !context.loadedFiles().contains( modelFile ) ) { + context.loadedFiles().add( modelFile ); + urnsFromModelNeedResolution( modelFile, context ); + } + } + + private void resolve( final List inputFiles, final LoaderContext context ) { + for ( final AspectModelFile aspectModelFile : inputFiles ) { + context.unresolvedFiles().push( aspectModelFile ); + } + + while ( !context.unresolvedFiles().isEmpty() || !context.unresolvedUrns().isEmpty() ) { + if ( !context.unresolvedFiles().isEmpty() ) { + final AspectModelFile modelFile = context.unresolvedFiles().pop(); + if ( context.loadedFiles().contains( modelFile ) ) { + continue; + } + markModelFileAsLoaded( modelFile, context ); + } + + while ( !context.unresolvedUrns().isEmpty() ) { + applyResolutionStrategy( context.unresolvedUrns().pop() ) + .map( this::migrate ) + .ifPresent( resolvedFile -> markModelFileAsLoaded( resolvedFile, context ) ); + } + } + } + + private AspectModel buildAspectModel( final Collection inputFiles ) { + final Model mergedModel = ModelFactory.createDefaultModel(); + mergedModel.add( MetaModelFile.metaModelDefinitions() ); + for ( final AspectModelFile file : inputFiles ) { + mergedModel.add( file.sourceModel() ); + } + + final List elements = new ArrayList<>(); + for ( final AspectModelFile file : inputFiles ) { + final DefaultAspectModelFile aspectModelFile = new DefaultAspectModelFile( file.sourceModel(), file.headerComment(), + file.sourceLocation() ); + final Model model = file.sourceModel(); + final ModelElementFactory modelElementFactory = new ModelElementFactory( mergedModel, Map.of(), element -> aspectModelFile ); + final List fileElements = model.listStatements( null, RDF.type, (RDFNode) null ).toList().stream() + .map( Statement::getSubject ) + .filter( RDFNode::isURIResource ) + .map( resource -> mergedModel.createResource( resource.getURI() ) ) + .map( resource -> modelElementFactory.create( ModelElement.class, resource ) ) + .toList(); + aspectModelFile.setElements( fileElements ); + elements.addAll( fileElements ); + } + return new DefaultAspectModel( mergedModel, elements ); + } + + /** + * Checks if a given model contains the definition of a model element. + * + * @param aspectModelFile the model file + * @param urn the URN of the model element + * @return true if the model contains the definition of the model element + */ + @Override + public boolean containsDefinition( final AspectModelFile aspectModelFile, final AspectModelUrn urn ) { + final Model model = aspectModelFile.sourceModel(); + if ( model.getNsPrefixMap().values().stream().anyMatch( prefixUri -> prefixUri.startsWith( "urn:bamm:" ) ) ) { + final boolean result = model.contains( model.createResource( urn.toString().replace( "urn:samm:", "urn:bamm:" ) ), RDF.type, + (RDFNode) null ); + LOG.debug( "Checking if model contains {}: {}", urn, result ); + return result; + } + final boolean result = model.contains( model.createResource( urn.toString() ), RDF.type, (RDFNode) null ); + LOG.debug( "Checking if model contains {}: {}", urn, result ); + return result; + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AttributeValueRetriever.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AttributeValueRetriever.java similarity index 94% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AttributeValueRetriever.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AttributeValueRetriever.java index 62d3b42db..2c6bc764d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AttributeValueRetriever.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/AttributeValueRetriever.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import java.util.ArrayList; import java.util.HashSet; @@ -19,7 +19,8 @@ import java.util.Optional; import java.util.Set; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; +import org.eclipse.esmf.aspectmodel.AspectLoadingException; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.RDFList; @@ -40,12 +41,6 @@ * */ public class AttributeValueRetriever { - protected final SAMM samm; - - public AttributeValueRetriever( final SAMM samm ) { - this.samm = samm; - } - /** * Returns the value of an attribute on a model element (or its super elements) * @@ -101,7 +96,7 @@ private boolean isRdfList( final Resource resource ) { * @param attribute the given attribute * @return the list of statements asserting values for the attribute */ - protected List attributeValues( final Resource modelElement, final Property attribute ) { + public List attributeValues( final Resource modelElement, final Property attribute ) { // Attribute values defined directly on the resource go into the result final List result = new ArrayList<>(); for ( final StmtIterator iterator = modelElement.listProperties( attribute ); iterator.hasNext(); ) { @@ -118,7 +113,7 @@ protected List attributeValues( final Resource modelElement, final Pr // If the model element is a bnode with samm:property given, it's a Property reference. Follow it to retrieve the sought-for // attribute assertions. - final StmtIterator referenceIterator = modelElement.listProperties( samm.property() ); + final StmtIterator referenceIterator = modelElement.listProperties( SammNs.SAMM.property() ); if ( referenceIterator.hasNext() ) { final RDFNode referencedElement = referenceIterator.next().getObject(); if ( !referencedElement.isResource() ) { @@ -129,7 +124,7 @@ protected List attributeValues( final Resource modelElement, final Pr } // If the model element is samm:extends another element, retrieve attribute assertions from this supertype as well. - final StmtIterator extendsIterator = modelElement.listProperties( samm._extends() ); + final StmtIterator extendsIterator = modelElement.listProperties( SammNs.SAMM._extends() ); if ( extendsIterator.hasNext() ) { final RDFNode superElementNode = extendsIterator.next().getObject(); if ( !superElementNode.isResource() ) { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/DefaultPropertyWrapper.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/DefaultPropertyWrapper.java similarity index 94% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/DefaultPropertyWrapper.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/DefaultPropertyWrapper.java index 33dbd4807..25f0adae0 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/DefaultPropertyWrapper.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/DefaultPropertyWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/Instantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/Instantiator.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/Instantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/Instantiator.java index c7ffb6bfb..0a4ac2152 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/Instantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/Instantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,11 +11,10 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -24,10 +23,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.esmf.aspectmodel.AspectLoadingException; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.aspectmodel.vocabulary.UNIT; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; @@ -40,9 +37,9 @@ import org.eclipse.esmf.metamodel.impl.DefaultCollectionValue; import org.eclipse.esmf.metamodel.impl.DefaultEntityInstance; import org.eclipse.esmf.metamodel.impl.DefaultScalar; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; -import org.apache.jena.datatypes.RDFDatatype; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.RDFList; @@ -55,44 +52,18 @@ public abstract class Instantiator extends AttributeValueRetriever implements Function { protected final ModelElementFactory modelElementFactory; protected Class targetClass; - protected SAMMC sammc; - protected UNIT unit; protected Model model; - protected KnownVersion metaModelVersion; - protected final RDFDatatype curieDataType = new CurieRdfType(); protected final ValueInstantiator valueInstantiator; public Instantiator( final ModelElementFactory modelElementFactory, final Class targetClass ) { - super( modelElementFactory.getSamm() ); this.modelElementFactory = modelElementFactory; this.targetClass = targetClass; - sammc = modelElementFactory.getSammc(); - unit = modelElementFactory.getUnit(); model = modelElementFactory.getModel(); - metaModelVersion = modelElementFactory.getMetaModelVersion(); - valueInstantiator = new ValueInstantiator( metaModelVersion ); + valueInstantiator = new ValueInstantiator(); } protected MetaModelBaseAttributes buildBaseAttributes( final Resource resource ) { - return MetaModelBaseAttributes.fromModelElement( metaModelVersion, resource, model, samm ); - } - - protected Statement propertyValueFromTypeTree( final Resource subject, final org.apache.jena.rdf.model.Property property ) { - final Optional valueStatement = optionalAttributeValue( subject, property ); - if ( valueStatement.isPresent() ) { - return valueStatement.get(); - } - - // Check if the subject is a Property reference, then we should continue to search the referenced Property - final Optional propertyStatement = optionalAttributeValue( subject, samm.property() ); - if ( propertyStatement.isPresent() ) { - return propertyValueFromTypeTree( propertyStatement.get().getObject().asResource(), property ); - } - - final Statement extendsStatement = optionalAttributeValue( subject, samm._extends() ) - .orElseThrow( () -> new AspectLoadingException( "Property " + property + " not found on " + subject + " or its supertypes" ) ); - final Resource superType = extendsStatement.getObject().asResource(); - return propertyValueFromTypeTree( superType, property ); + return modelElementFactory.createBaseAttributes( resource ); } /** @@ -125,15 +96,15 @@ protected Type getType( final Resource characteristicResource ) { final Optional entityStatement = optionalAttributeValue( dataTypeResource, RDF.type ); - if ( entityStatement.isPresent() && samm.Entity().equals( entityStatement.get().getObject().asResource() ) ) { + if ( entityStatement.isPresent() && SammNs.SAMM.Entity().equals( entityStatement.get().getObject().asResource() ) ) { return modelElementFactory.create( Entity.class, entityStatement.get().getSubject() ); } - if ( entityStatement.isPresent() && samm.AbstractEntity().equals( entityStatement.get().getObject().asResource() ) ) { + if ( entityStatement.isPresent() && SammNs.SAMM.AbstractEntity().equals( entityStatement.get().getObject().asResource() ) ) { return modelElementFactory.create( AbstractEntity.class, entityStatement.get().getSubject() ); } - return new DefaultScalar( dataTypeResource.getURI(), metaModelVersion ); + return new DefaultScalar( dataTypeResource.getURI() ); } /** @@ -143,13 +114,13 @@ protected Type getType( final Resource characteristicResource ) { * @return The statement describing the datatype */ private Statement getDataType( final Resource resource ) { - return Optional.ofNullable( resource.getPropertyResourceValue( samm.baseCharacteristic() ) ) + return Optional.ofNullable( resource.getPropertyResourceValue( SammNs.SAMMC.baseCharacteristic() ) ) .map( this::getDataType ) - .orElseGet( () -> resource.getProperty( samm.dataType() ) ); + .orElseGet( () -> resource.getProperty( SammNs.SAMM.dataType() ) ); } protected Optional getElementCharacteristic( final Resource collection ) { - return optionalAttributeValue( collection, sammc.elementCharacteristic() ) + return optionalAttributeValue( collection, SammNs.SAMMC.elementCharacteristic() ) .map( Statement::getResource ) .map( elementCharacteristicResource -> modelElementFactory.create( Characteristic.class, elementCharacteristicResource ) ); @@ -187,16 +158,17 @@ protected Value buildValue( final RDFNode node, final Optional charact // Collections if ( characteristicResource.isPresent() ) { final Resource characteristic = characteristicResource.get(); - final Optional elementCharacteristic = optionalAttributeValue( characteristic, sammc.elementCharacteristic() ).map( + final Optional elementCharacteristic = optionalAttributeValue( characteristic, + SammNs.SAMMC.elementCharacteristic() ).map( Statement::getResource ); CollectionValue.CollectionType collectionType = null; - if ( isTypeOfOrSubtypeOf( characteristic, sammc.Set() ) ) { + if ( isTypeOfOrSubtypeOf( characteristic, SammNs.SAMMC.Set() ) ) { collectionType = CollectionValue.CollectionType.SET; - } else if ( isTypeOfOrSubtypeOf( characteristic, sammc.SortedSet() ) ) { + } else if ( isTypeOfOrSubtypeOf( characteristic, SammNs.SAMMC.SortedSet() ) ) { collectionType = CollectionValue.CollectionType.SORTEDSET; - } else if ( isTypeOfOrSubtypeOf( characteristic, sammc.List() ) ) { + } else if ( isTypeOfOrSubtypeOf( characteristic, SammNs.SAMMC.List() ) ) { collectionType = CollectionValue.CollectionType.LIST; - } else if ( isTypeOfOrSubtypeOf( characteristic, sammc.Collection() ) ) { + } else if ( isTypeOfOrSubtypeOf( characteristic, SammNs.SAMMC.Collection() ) ) { collectionType = CollectionValue.CollectionType.COLLECTION; } if ( collectionType != null ) { @@ -224,8 +196,7 @@ private CollectionValue buildCollectionValue( final RDFList list, final Collecti protected EntityInstance buildEntityInstance( final Resource entityInstance, final Entity type ) { final Map assertions = new HashMap<>(); type.getAllProperties().forEach( property -> { - final AspectModelUrn propertyUrn = property.getAspectModelUrn() - .orElseThrow( () -> new AspectLoadingException( "Invalid Property without a URN found" ) ); + final AspectModelUrn propertyUrn = property.urn(); final org.apache.jena.rdf.model.Property rdfProperty = model.createProperty( propertyUrn.getUrn().toASCIIString() ); final Statement statement = entityInstance.getProperty( rdfProperty ); if ( statement == null ) { @@ -237,7 +208,7 @@ protected EntityInstance buildEntityInstance( final Resource entityInstance, fin final RDFNode rdfValue = entityInstance.getProperty( rdfProperty ).getObject(); final Type propertyType = property.getDataType() .orElseThrow( () -> new AspectLoadingException( "Invalid Property without a dataType found" ) ); - final Resource characteristic = attributeValue( rdfProperty, samm.characteristic() ).getResource(); + final Resource characteristic = attributeValue( rdfProperty, SammNs.SAMM.characteristic() ).getResource(); final Value value = buildValue( rdfValue, Optional.of( characteristic ), propertyType ); assertions.put( property, value ); } ); @@ -246,12 +217,9 @@ protected EntityInstance buildEntityInstance( final Resource entityInstance, fin } private java.util.Collection createEmptyCollectionForType( final CollectionValue.CollectionType collectionType ) { - if ( collectionType == CollectionValue.CollectionType.SORTEDSET ) { + if ( collectionType == CollectionValue.CollectionType.SORTEDSET || collectionType == CollectionValue.CollectionType.SET ) { return new LinkedHashSet<>(); } - if ( collectionType == CollectionValue.CollectionType.SET ) { - return new HashSet<>(); - } return new ArrayList<>(); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/MetaModelBaseAttributes.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/MetaModelBaseAttributes.java new file mode 100644 index 000000000..17c332ff4 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/MetaModelBaseAttributes.java @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.HasDescription; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.datatype.LangString; + +/** + * Wrapper class for the attributes all Aspect Meta Model elements have. + */ +public class MetaModelBaseAttributes implements HasDescription { + private final AspectModelUrn urn; + private final Set preferredNames; + private final Set descriptions; + private final List see; + private final boolean isAnonymous; + private final AspectModelFile sourceFile; + + private MetaModelBaseAttributes( + final AspectModelUrn urn, + final Set preferredNames, + final Set descriptions, + final List see, + final boolean isAnonymous, + final AspectModelFile sourceFile + ) { + this.urn = urn; + this.preferredNames = preferredNames; + this.descriptions = descriptions; + this.see = see; + this.isAnonymous = isAnonymous; + this.sourceFile = sourceFile; + } + + public AspectModelUrn urn() { + return urn; + } + + @Override + public String getName() { + return urn.getName(); + } + + @Override + public Set getPreferredNames() { + return preferredNames; + } + + @Override + public Set getDescriptions() { + return descriptions; + } + + @Override + public List getSee() { + return see; + } + + public boolean isAnonymous() { + return isAnonymous; + } + + public AspectModelFile getSourceFile() { + return sourceFile; + } + + public static Builder builder() { + return new Builder(); + } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final MetaModelBaseAttributes that = (MetaModelBaseAttributes) o; + return isAnonymous == that.isAnonymous && Objects.equals( urn, that.urn ) && Objects.equals( preferredNames, + that.preferredNames ) && Objects.equals( descriptions, that.descriptions ) && Objects.equals( see, that.see ); + } + + @Override + public int hashCode() { + return Objects.hash( urn, preferredNames, descriptions, see, isAnonymous ); + } + + /** + * Creates an instance of MetaModelBaseAttributes by copying them from a given element. + * + * @param modelElement the named model element to copy the base attributes from + * @return the newly created instance + */ + public static MetaModelBaseAttributes fromModelElement( final ModelElement modelElement ) { + return new MetaModelBaseAttributes( modelElement.urn(), modelElement.getPreferredNames(), + modelElement.getDescriptions(), modelElement.getSee(), modelElement.isAnonymous(), modelElement.getSourceFile() ); + } + + public static class Builder { + private AspectModelUrn urn; + private final Set preferredNames = new HashSet<>(); + private final Set descriptions = new HashSet<>(); + private final List see = new ArrayList<>(); + private boolean isAnonymous = true; + private AspectModelFile sourceFile; + + public Builder withUrn( final String urn ) { + return withUrn( AspectModelUrn.fromUrn( urn ) ); + } + + public Builder withOptionalUrn( final Optional aspectModelUrn ) { + if ( aspectModelUrn.isPresent() ) { + return withUrn( aspectModelUrn.get() ); + } else { + return isAnonymous(); + } + } + + public Builder withUrn( final AspectModelUrn urn ) { + isAnonymous = false; + this.urn = Objects.requireNonNull( urn ); + return this; + } + + public Builder isAnonymous() { + isAnonymous = true; + return this; + } + + public Builder withPreferredName( final Locale locale, final String preferredName ) { + preferredNames.add( new LangString( preferredName, locale ) ); + return this; + } + + public Builder withPreferredNames( final Set preferredNames ) { + this.preferredNames.addAll( preferredNames ); + return this; + } + + public Builder withDescription( final Locale locale, final String description ) { + descriptions.add( new LangString( description, locale ) ); + return this; + } + + public Builder withDescriptions( final Set descriptions ) { + this.descriptions.addAll( descriptions ); + return this; + } + + public Builder withSee( final String see ) { + this.see.add( see ); + return this; + } + + public Builder withSee( final List see ) { + this.see.addAll( see ); + return this; + } + + public Builder withSourceFile( final AspectModelFile sourceFile ) { + this.sourceFile = sourceFile; + return this; + } + + public Builder isAnonymous( final boolean isAnonymous ) { + this.isAnonymous = isAnonymous; + return this; + } + + public MetaModelBaseAttributes build() { + return new MetaModelBaseAttributes( urn, preferredNames, descriptions, see, isAnonymous, sourceFile ); + } + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ModelElementFactory.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ModelElementFactory.java new file mode 100644 index 000000000..3606fe278 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ModelElementFactory.java @@ -0,0 +1,357 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader; + +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.esmf.aspectmodel.AspectLoadingException; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.loader.instantiator.AbstractEntityInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.AspectInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.CharacteristicInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.CodeInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.CollectionInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.ConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.DurationInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EitherInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EncodingConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EntityInstanceInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EntityInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EnumerationInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.EventInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.FixedPointConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.LanguageConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.LengthConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.ListInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.LocaleConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.MeasurementInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.OperationInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.PropertyInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.QuantifiableInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.RangeConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.RegularExpressionConstraintInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.SetInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.SingleEntityInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.SortedSetInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.StateInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.StructuredValueInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.TimeSeriesInstantiator; +import org.eclipse.esmf.aspectmodel.loader.instantiator.TraitInstantiator; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.ComplexType; +import org.eclipse.esmf.metamodel.Entity; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.Namespace; +import org.eclipse.esmf.metamodel.QuantityKind; +import org.eclipse.esmf.metamodel.QuantityKinds; +import org.eclipse.esmf.metamodel.Unit; +import org.eclipse.esmf.metamodel.Units; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.impl.DefaultQuantityKind; +import org.eclipse.esmf.metamodel.impl.DefaultUnit; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; + +import com.google.common.collect.Streams; +import org.apache.commons.lang3.StringUtils; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; + +public class ModelElementFactory extends AttributeValueRetriever { + private final Model model; + private final Map> instantiators = new HashMap<>(); + private final Map loadedElements = new HashMap<>(); + private Set namespaces; + private final Function sourceLocator; + + public ModelElementFactory( final Model model, final Map> additionalInstantiators, + final Function sourceLocator ) { + this.model = model; + this.sourceLocator = sourceLocator; + + registerInstantiator( SammNs.SAMM.AbstractEntity(), new AbstractEntityInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.AbstractProperty(), new PropertyInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Aspect(), new AspectInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Characteristic(), new CharacteristicInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Constraint(), new ConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Entity(), new EntityInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Event(), new EventInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Operation(), new OperationInstantiator( this ) ); + registerInstantiator( SammNs.SAMM.Property(), new PropertyInstantiator( this ) ); + + registerInstantiator( SammNs.SAMMC.Code(), new CodeInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Collection(), new CollectionInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Duration(), new DurationInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Either(), new EitherInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.EncodingConstraint(), new EncodingConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Enumeration(), new EnumerationInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.FixedPointConstraint(), new FixedPointConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.LanguageConstraint(), new LanguageConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.LengthConstraint(), new LengthConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.List(), new ListInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.LocaleConstraint(), new LocaleConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Measurement(), new MeasurementInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Quantifiable(), new QuantifiableInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.RangeConstraint(), new RangeConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.RegularExpressionConstraint(), new RegularExpressionConstraintInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Set(), new SetInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.SingleEntity(), new SingleEntityInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.SortedSet(), new SortedSetInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.State(), new StateInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.StructuredValue(), new StructuredValueInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.TimeSeries(), new TimeSeriesInstantiator( this ) ); + registerInstantiator( SammNs.SAMMC.Trait(), new TraitInstantiator( this ) ); + + instantiators.putAll( additionalInstantiators ); + } + + private void registerInstantiator( final Resource resource, final Instantiator instantiator ) { + instantiators.put( resource, instantiator ); + } + + @SuppressWarnings( "unchecked" ) + public T create( final Class clazz, final Resource modelElement ) { + ModelElement element = loadedElements.get( modelElement ); + if ( element != null ) { + return (T) element; + } + final Resource targetType = resourceType( modelElement ); + if ( SammNs.SAMM.Unit().equals( targetType ) ) { + return (T) findOrCreateUnit( modelElement ); + } + if ( SammNs.SAMM.QuantityKind().equals( targetType ) ) { + return (T) findOrCreateQuantityKind( modelElement ); + } + final Instantiator instantiator = (Instantiator) instantiators.get( targetType ); + if ( instantiator != null ) { + element = instantiator.apply( modelElement ); + loadedElements.put( modelElement, element ); + return (T) element; + } + + // No generic instantiator could be found. This means the element is an entity instance + if ( !model.contains( targetType, RDF.type, (RDFNode) null ) ) { + throw new AspectLoadingException( "Could not load " + modelElement + ": Unknown type " + targetType ); + } + final Entity entity = create( Entity.class, targetType ); + if ( entity == null ) { + throw new AspectLoadingException( "Could not load " + modelElement + ": Expected " + targetType + " to be an Entity" ); + } + return (T) new EntityInstanceInstantiator( this, entity ).apply( modelElement ); + } + + public QuantityKind findOrCreateQuantityKind( final Resource quantityKindResource ) { + final Optional predefinedQuantityKind = QuantityKinds.fromName( quantityKindResource.getLocalName() ); + return predefinedQuantityKind.orElseGet( () -> new DefaultQuantityKind( + createBaseAttributes( quantityKindResource ), + attributeValue( quantityKindResource, SammNs.SAMM.preferredName() ).getLiteral().getLexicalForm() ) ); + } + + public Unit findOrCreateUnit( final Resource unitResource ) { + if ( SammNs.UNIT.getNamespace().equals( unitResource.getNameSpace() ) ) { + final AspectModelUrn unitUrn = AspectModelUrn.fromUrn( unitResource.getURI() ); + return Units.fromName( unitUrn.getName() ).orElseThrow( () -> + new AspectLoadingException( "Unit definition for " + unitUrn + " is invalid" ) ); + } + + final Set quantityKinds = Streams.stream( + model.listStatements( unitResource, SammNs.SAMM.quantityKind(), (RDFNode) null ) ) + .map( quantityKindStatement -> findOrCreateQuantityKind( quantityKindStatement.getObject().asResource() ) ) + .collect( Collectors.toSet() ); + return new DefaultUnit( + createBaseAttributes( unitResource ), + optionalAttributeValue( unitResource, SammNs.SAMM.symbol() ).map( Statement::getString ), + optionalAttributeValue( unitResource, SammNs.SAMM.commonCode() ).map( Statement::getString ), + optionalAttributeValue( unitResource, SammNs.SAMM.referenceUnit() ).map( Statement::getResource ).map( Resource::getLocalName ), + optionalAttributeValue( unitResource, SammNs.SAMM.conversionFactor() ).map( Statement::getString ), + quantityKinds ); + } + + private Resource resourceType( final Resource resource ) { + final Supplier> directType = () -> + optionalAttributeValue( resource, RDF.type ).map( Statement::getResource ); + final Supplier> propertyUsageType = () -> + optionalAttributeValue( resource, SammNs.SAMM.property() ).map( statement -> resourceType( statement.getResource() ) ); + final Supplier> subClassType = () -> + optionalAttributeValue( resource, RDFS.subClassOf ).map( Statement::getResource ).map( this::resourceType ); + final Supplier> extendsType = () -> + optionalAttributeValue( resource, SammNs.SAMM._extends() ).map( Statement::getResource ).map( this::resourceType ); + + return Stream.of( directType, propertyUsageType, subClassType, extendsType ) + .map( Supplier::get ) + .filter( Optional::isPresent ) + .map( Optional::get ) + .findFirst() + .orElseThrow( () -> new AspectLoadingException( "Resource " + resource + " has no type" ) ); + } + + protected Model getModel() { + return model; + } + + public List getExtendingElements( final List extendingElements ) { + return extendingElements.stream().map( urn -> getModel().createResource( urn.toString() ) ) + .map( loadedElements::get ) + .filter( Objects::nonNull ) + .map( ComplexType.class::cast ) + .collect( Collectors.toList() ); + } + + /** + * Creates an instance for a specific Meta Model element. + * + * @param modelElement the Aspect model element to be processed. + * @return the newly created instance + */ + public MetaModelBaseAttributes createBaseAttributes( final Resource modelElement ) { + final AttributeValueRetriever valueRetriever = new AttributeValueRetriever(); + final Optional urn = getUrn( modelElement ); + final Set preferredNames = getLanguages( modelElement, SammNs.SAMM.preferredName(), valueRetriever ); + final Set descriptions = getLanguages( modelElement, SammNs.SAMM.description(), valueRetriever ); + final List seeValues = getSeeValues( modelElement, valueRetriever ); + return MetaModelBaseAttributes.builder() + .withOptionalUrn( urn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( seeValues ) + .withSourceFile( getSourceLocation( modelElement ) ) + .build(); + } + + private static Optional getUrn( final Resource modelElement ) { + if ( modelElement.isAnon() ) { + final Statement propertyStatement = modelElement.getProperty( SammNs.SAMM.property() ); + if ( propertyStatement != null ) { + return getUrn( propertyStatement.getObject().asResource() ); + } + return Optional.empty(); + } + return Optional.of( AspectModelUrn.fromUrn( modelElement.getURI() ) ); + } + + /** + * @param modelElement the RDF {@link Resource} representing the Aspect Model element to be processed + * @param attribute the RDF {@link org.apache.jena.rdf.model.Property} for which the values will be retrieved + * @param valueRetriever the {@link AttributeValueRetriever} used to retrieve the attribute values + * @return a {@link List} containing all values for the given Property in the given Aspect Model element + */ + private static Set getLanguages( final Resource modelElement, + final org.apache.jena.rdf.model.Property attribute, final AttributeValueRetriever valueRetriever ) { + return valueRetriever.attributeValues( modelElement, attribute ).stream() + .filter( languageStatement -> !"und".equals( Locale.forLanguageTag( languageStatement.getLanguage() ).toLanguageTag() ) ) + .map( statement -> new LangString( statement.getString(), Locale.forLanguageTag( statement.getLanguage() ) ) ) + .collect( Collectors.toSet() ); + } + + /** + * @param resource the RDF {@link Resource} representing the Aspect Model element to be processed + * @param valueRetriever the {@link AttributeValueRetriever} used to retrieve the attribute values + * @return a {@link List} containing all {@link SAMM#see()} values for a Aspect Model element + */ + private static List getSeeValues( final Resource resource, final AttributeValueRetriever valueRetriever ) { + return valueRetriever.attributeValues( resource, SammNs.SAMM.see() ).stream() + .map( statement -> statement.getObject().toString() ) + .sorted() + .collect( Collectors.toList() ); + } + + private static String getSyntheticName( final Resource modelElement ) { + final Resource namedParent = getNamedParent( modelElement, modelElement.getModel() ); + if ( namedParent == null ) { + throw new AspectLoadingException( "At least one anonymous node in the model does not have a parent with a regular name." ); + } + final String parentModelElementUri = namedParent.getURI(); + final String parentModelElementName = AspectModelUrn.from( parentModelElementUri ) + .toJavaOptional() + .map( AspectModelUrn::getName ) + .map( StringUtils::capitalize ) + .orElse( "" ); + + final Resource modelElementType = getModelElementType( modelElement ); + final String modelElementTypeUri = modelElementType.getURI(); + final String modelElementTypeName = AspectModelUrn.from( modelElementTypeUri ) + .toJavaOptional() + .map( AspectModelUrn::getName ) + .orElse( "" ); + + return parentModelElementName + modelElementTypeName; + } + + // We have to be careful when searching for the parent nodes with a regular name - the "listStatements" API returns the matching nodes + // in no particular order; with some very specific models this could lead to non-deterministic behavior. + // In the following very simplified example we are looking for ":NumberList" as the parent of "_:blankNode", but could get the + // anonymous node [] instead. + // [ + // aux:contains _:blankNode ; + // ] . + // :NumberList a samm-c:List ; + // samm-c:elementCharacteristic _:blankNode . + // _:blankNode a samm-c:Trait ; + private static Resource getNamedParent( final Resource modelElement, final Model model ) { + final StmtIterator elements = model.listStatements( null, null, modelElement ); + while ( elements.hasNext() ) { + final Resource parentModelElement = elements.next().getSubject(); + if ( parentModelElement.isAnon() ) { + final Resource grandParent = getNamedParent( parentModelElement, model ); + if ( null != grandParent ) { + return grandParent; + } + } else { + return parentModelElement; + } + } + return null; // element has no named parent + } + + private static Resource getModelElementType( final Resource modelElement ) { + final Statement typeStatement = modelElement.getProperty( RDF.type ); + if ( typeStatement != null ) { + return typeStatement.getObject().asResource(); + } + + // If the model element is a Property reference, the actual type will be found when we follow samm:property + final Statement propertyStatement = modelElement.getProperty( SammNs.SAMM.property() ); + if ( propertyStatement != null ) { + return getModelElementType( propertyStatement.getObject().asResource() ); + } + + // This model element has no type, but maybe it extends another element + final Statement extendsStatement = modelElement.getProperty( SammNs.SAMM._extends() ); + if ( extendsStatement == null ) { + throw new AspectLoadingException( "Model element has no type and does not extend another type: " + modelElement ); + } + + final Resource superElement = extendsStatement.getObject().asResource(); + return getModelElementType( superElement ); + } + + public AspectModelFile getSourceLocation( Resource modelElement ) { + return sourceLocator.apply( modelElement ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ValueInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ValueInstantiator.java similarity index 77% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ValueInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ValueInstantiator.java index 523b634d5..77b0d83f7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ValueInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/ValueInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,34 +11,24 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import java.util.Locale; import java.util.Optional; -import java.util.stream.Stream; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; -import org.eclipse.esmf.samm.KnownVersion; -import org.apache.jena.datatypes.RDFDatatype; import org.apache.jena.vocabulary.RDF; /** * Creates new instances of {@link ScalarValue} from the value representation in RDF */ public class ValueInstantiator { - private final RDFDatatype curieDataType = new CurieRdfType(); - private final KnownVersion metaModelVersion; - - public ValueInstantiator( final KnownVersion metaModelVersion ) { - this.metaModelVersion = metaModelVersion; - } - /** * Creates a new scalar value from a lexical value representation. * @@ -58,16 +48,16 @@ public Optional buildScalarValue( final String lexicalRepresentatio return Optional.of( buildLanguageString( lexicalRepresentation, languageTag ) ); } - return Stream.concat( ExtendedXsdDataType.SUPPORTED_XSD_TYPES.stream(), Stream.of( curieDataType ) ) + return SammXsdType.ALL_TYPES.stream() .filter( type -> type.getURI().equals( datatypeUri ) ) .map( type -> type.parse( lexicalRepresentation ) ) - . map( value -> new DefaultScalarValue( value, new DefaultScalar( datatypeUri, metaModelVersion ) ) ) + . map( value -> new DefaultScalarValue( value, new DefaultScalar( datatypeUri ) ) ) .findAny(); } public ScalarValue buildLanguageString( final String lexicalRepresentation, final String languageTag ) { final LangString langString = new LangString( lexicalRepresentation, Locale.forLanguageTag( languageTag ) ); - final Scalar type = new DefaultScalar( RDF.langString.getURI(), metaModelVersion ); + final Scalar type = new DefaultScalar( RDF.langString.getURI() ); return new DefaultScalarValue( langString, type ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AbstractEntityInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AbstractEntityInstantiator.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AbstractEntityInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AbstractEntityInstantiator.java index d16d72de5..72603b4e7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AbstractEntityInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AbstractEntityInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,21 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.impl.DefaultAbstractEntity; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; public class AbstractEntityInstantiator extends ComplexTypeInstantiator { - public AbstractEntityInstantiator( final ModelElementFactory modelElementFactory ) { super( modelElementFactory, AbstractEntity.class ); } @@ -36,11 +35,6 @@ protected AbstractEntity createDefaultEntity( final List properties, final Optional extendedEntity, final List extendingComplexTypes ) { - return new DefaultAbstractEntity( - metaModelBaseAttributes, - properties, - extendedEntity, - extendingComplexTypes, - modelElementFactory ); + return new DefaultAbstractEntity( metaModelBaseAttributes, properties, extendedEntity, extendingComplexTypes, modelElementFactory ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AspectInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AspectInstantiator.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AspectInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AspectInstantiator.java index a4840125a..78a26ff65 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/AspectInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/AspectInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,21 +11,22 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.Collection; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; +import org.eclipse.esmf.metamodel.characteristic.Collection; import org.eclipse.esmf.metamodel.impl.DefaultAspect; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -37,11 +38,11 @@ public AspectInstantiator( final ModelElementFactory modelElementFactory ) { @Override public Aspect apply( final Resource aspect ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( aspect ); - final List properties = getPropertiesModels( aspect, samm.properties() ); - final List operations = getResourcesFromList( aspect, samm.operations() ) + final List properties = getPropertiesModels( aspect, SammNs.SAMM.properties() ); + final List operations = getResourcesFromList( aspect, SammNs.SAMM.operations() ) .map( operation -> modelElementFactory.create( Operation.class, operation ) ) .collect( Collectors.toList() ); - final List events = getResourcesFromList( aspect, samm.events() ) + final List events = getResourcesFromList( aspect, SammNs.SAMM.events() ) .map( event -> modelElementFactory.create( Event.class, event ) ) .collect( Collectors.toList() ); final boolean isCollectionAspect = properties.stream() diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CharacteristicInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CharacteristicInstantiator.java similarity index 78% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CharacteristicInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CharacteristicInstantiator.java index 256062eae..4e7e99d59 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CharacteristicInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CharacteristicInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CodeInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CodeInstantiator.java similarity index 67% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CodeInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CodeInstantiator.java index 84d698ae2..765726e90 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CodeInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CodeInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.impl.DefaultCode; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCode; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CollectionInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CollectionInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CollectionInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CollectionInstantiator.java index e84a885f8..2f2090171 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/CollectionInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/CollectionInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.impl.DefaultCollection; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCollection; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ComplexTypeInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ComplexTypeInstantiator.java similarity index 83% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ComplexTypeInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ComplexTypeInstantiator.java index f15db8414..58de9f6bb 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ComplexTypeInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ComplexTypeInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.ArrayList; import java.util.HashMap; @@ -21,24 +21,24 @@ import java.util.Optional; import java.util.Set; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.characteristic.Collection; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Property; +import org.eclipse.esmf.metamodel.characteristic.Collection; import org.eclipse.esmf.metamodel.impl.DefaultAbstractEntity; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; import org.apache.jena.vocabulary.RDF; public abstract class ComplexTypeInstantiator extends Instantiator { - private final Set processedExtendingElements = new HashSet<>(); private final Map creatingElements = new HashMap<>(); @@ -66,41 +66,35 @@ public T apply( final Resource resource ) { } final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( resource ); - final List properties = getPropertiesModels( resource, samm.properties() ); - + final List properties = getPropertiesModels( resource, SammNs.SAMM.properties() ); final Optional extendedEntity = getExtendedEntity( resource ); - final List extending = new ArrayList<>(); - final T entity = createDefaultEntity( metaModelBaseAttributes, properties, extendedEntity, extending ); - creatingElements.put( resource, entity ); - extending.addAll( getExtending( resource ) ); - return entity; } private List getExtending( final Resource resource ) { - return model.listSubjectsWithProperty( samm._extends(), resource ) + return model.listSubjectsWithProperty( SammNs.SAMM._extends(), resource ) .mapWith( extendingComplexType -> attributeValue( extendingComplexType, RDF.type ) ).mapWith( statement -> { if ( processedExtendingElements.contains( statement.getSubject() ) ) { return AspectModelUrn.fromUrn( statement.getSubject().getURI() ); } processedExtendingElements.add( statement.getSubject() ); - if ( samm.AbstractEntity().equals( statement.getObject().asResource() ) ) { - return modelElementFactory.create( AbstractEntity.class, statement.getSubject() ).getAspectModelUrn().get(); + if ( SammNs.SAMM.AbstractEntity().equals( statement.getObject().asResource() ) ) { + return modelElementFactory.create( AbstractEntity.class, statement.getSubject() ).urn(); } - return modelElementFactory.create( Entity.class, statement.getSubject() ).getAspectModelUrn().get(); + return modelElementFactory.create( Entity.class, statement.getSubject() ).urn(); } ).toList(); } protected Optional getExtendedEntity( final Resource resource ) { - return optionalAttributeValue( resource, samm._extends() ) + return optionalAttributeValue( resource, SammNs.SAMM._extends() ) .map( Statement::getResource ) .map( extendedEntityResource -> attributeValue( extendedEntityResource, RDF.type ) ) .map( entityStatement -> { - if ( samm.AbstractEntity().equals( entityStatement.getObject().asResource() ) ) { + if ( SammNs.SAMM.AbstractEntity().equals( entityStatement.getObject().asResource() ) ) { return modelElementFactory.create( AbstractEntity.class, entityStatement.getSubject() ); } return modelElementFactory.create( Entity.class, entityStatement.getSubject() ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ConstraintInstantiator.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ConstraintInstantiator.java index 2babf75da..8a66197f9 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,13 +11,13 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/DurationInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/DurationInstantiator.java similarity index 70% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/DurationInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/DurationInstantiator.java index 42a141dac..6ee39ed77 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/DurationInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/DurationInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.impl.DefaultDuration; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultDuration; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; @@ -35,7 +36,7 @@ public DurationInstantiator( final ModelElementFactory modelElementFactory ) { public Duration apply( final Resource duration ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( duration ); final Type type = getType( duration ); - final Optional unit = optionalAttributeValue( duration, sammc.unit() ) + final Optional unit = optionalAttributeValue( duration, SammNs.SAMMC.unit() ) .map( Statement::getResource ) .map( modelElementFactory::findOrCreateUnit ); return new DefaultDuration( metaModelBaseAttributes, type, unit ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EitherInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EitherInstantiator.java similarity index 67% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EitherInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EitherInstantiator.java index c3df3bf8c..d7a4b4747 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EitherInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EitherInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.impl.DefaultEither; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultEither; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -33,9 +34,9 @@ public EitherInstantiator( final ModelElementFactory modelElementFactory ) { public Either apply( final Resource either ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( either ); final Characteristic left = modelElementFactory - .create( Characteristic.class, attributeValue( either, sammc.left() ).getResource() ); + .create( Characteristic.class, attributeValue( either, SammNs.SAMMC.left() ).getResource() ); final Characteristic right = modelElementFactory - .create( Characteristic.class, attributeValue( either, sammc.right() ).getResource() ); + .create( Characteristic.class, attributeValue( either, SammNs.SAMMC.right() ).getResource() ); return new DefaultEither( metaModelBaseAttributes, Optional.empty(), left, right ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EncodingConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EncodingConstraintInstantiator.java similarity index 63% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EncodingConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EncodingConstraintInstantiator.java index 9c1c5161a..9483867a6 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EncodingConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EncodingConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,15 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.nio.charset.Charset; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.impl.DefaultEncodingConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultEncodingConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -31,7 +32,7 @@ public EncodingConstraintInstantiator( final ModelElementFactory modelElementFac @Override public EncodingConstraint apply( final Resource encodingConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( encodingConstraint ); - final String value = encodingConstraint.getProperty( samm.value() ).getObject().toString(); + final String value = encodingConstraint.getProperty( SammNs.SAMM.value() ).getObject().toString(); final String encoding = value.substring( value.indexOf( '#' ) + 1 ); return new DefaultEncodingConstraint( metaModelBaseAttributes, Charset.forName( encoding ) ); } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstanceInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstanceInstantiator.java similarity index 80% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstanceInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstanceInstantiator.java index c0db4a2d5..aadde7f9e 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstanceInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstanceInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,12 +11,12 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.EntityInstance; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstantiator.java similarity index 84% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstantiator.java index 842d4f5c1..a6eefba9d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EntityInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EntityInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,18 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.impl.DefaultEntity; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; public class EntityInstantiator extends ComplexTypeInstantiator { public EntityInstantiator( final ModelElementFactory modelElementFactory ) { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EnumerationInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EnumerationInstantiator.java similarity index 71% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EnumerationInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EnumerationInstantiator.java index 582354c3c..6398a7e43 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EnumerationInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EnumerationInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,19 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.impl.DefaultEnumeration; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultEnumeration; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -36,7 +37,7 @@ public EnumerationInstantiator( final ModelElementFactory modelElementFactory ) public Enumeration apply( final Resource enumeration ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( enumeration ); final Type type = getType( enumeration ); - final List enumValues = getNodesFromList( enumeration, sammc.values() ) + final List enumValues = getNodesFromList( enumeration, SammNs.SAMMC.values() ) .map( node -> buildValue( node, Optional.of( enumeration ), type ) ) .collect( Collectors.toList() ); return new DefaultEnumeration( metaModelBaseAttributes, type, enumValues ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EventInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EventInstantiator.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EventInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EventInstantiator.java index feda692c7..76aae1810 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/EventInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/EventInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.impl.DefaultEvent; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -32,7 +33,7 @@ public EventInstantiator( final ModelElementFactory modelElementFactory ) { @Override public Event apply( final Resource event ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( event ); - final List events = getPropertiesModels( event, samm.parameters() ); + final List events = getPropertiesModels( event, SammNs.SAMM.parameters() ); return new DefaultEvent( metaModelBaseAttributes, events ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/FixedPointConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/FixedPointConstraintInstantiator.java similarity index 64% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/FixedPointConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/FixedPointConstraintInstantiator.java index ea3782671..3936963f8 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/FixedPointConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/FixedPointConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,13 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.impl.DefaultFixedPointConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultFixedPointConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -29,8 +30,8 @@ public FixedPointConstraintInstantiator( final ModelElementFactory modelElementF @Override public FixedPointConstraint apply( final Resource fixedPointConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( fixedPointConstraint ); - final Integer scale = attributeValue( fixedPointConstraint, sammc.scale() ).getLiteral().getInt(); - final Integer integer = attributeValue( fixedPointConstraint, sammc.integer() ).getLiteral().getInt(); + final Integer scale = attributeValue( fixedPointConstraint, SammNs.SAMMC.scale() ).getLiteral().getInt(); + final Integer integer = attributeValue( fixedPointConstraint, SammNs.SAMMC.integer() ).getLiteral().getInt(); return new DefaultFixedPointConstraint( metaModelBaseAttributes, scale, integer ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LanguageConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LanguageConstraintInstantiator.java similarity index 65% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LanguageConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LanguageConstraintInstantiator.java index 866253dd0..087128959 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LanguageConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LanguageConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,15 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Locale; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLanguageConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLanguageConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -31,7 +32,7 @@ public LanguageConstraintInstantiator( final ModelElementFactory modelElementFac @Override public LanguageConstraint apply( final Resource languageConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( languageConstraint ); - final String languageCode = attributeValue( languageConstraint, sammc.languageCode() ).getString(); + final String languageCode = attributeValue( languageConstraint, SammNs.SAMMC.languageCode() ).getString(); return new DefaultLanguageConstraint( metaModelBaseAttributes, Locale.forLanguageTag( languageCode ) ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LengthConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LengthConstraintInstantiator.java similarity index 69% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LengthConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LengthConstraintInstantiator.java index 8f3f93f9a..d385de688 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LengthConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LengthConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.math.BigInteger; import java.util.Optional; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLengthConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLengthConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Resource; @@ -34,9 +35,9 @@ public LengthConstraintInstantiator( final ModelElementFactory modelElementFacto @Override public LengthConstraint apply( final Resource lengthConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( lengthConstraint ); - final Optional minValue = optionalAttributeValue( lengthConstraint, sammc.minValue() ) + final Optional minValue = optionalAttributeValue( lengthConstraint, SammNs.SAMMC.minValue() ) .map( Statement::getLiteral ).map( Literal::getLong ).map( BigInteger::valueOf ); - final Optional maxValue = optionalAttributeValue( lengthConstraint, sammc.maxValue() ) + final Optional maxValue = optionalAttributeValue( lengthConstraint, SammNs.SAMMC.maxValue() ) .map( Statement::getLiteral ).map( Literal::getLong ).map( BigInteger::valueOf ); return new DefaultLengthConstraint( metaModelBaseAttributes, minValue, maxValue ); } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ListInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ListInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ListInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ListInstantiator.java index 3fa1eb51d..d37765bd0 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/ListInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/ListInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.List; -import org.eclipse.esmf.characteristic.impl.DefaultList; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.List; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultList; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LocaleConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LocaleConstraintInstantiator.java similarity index 65% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LocaleConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LocaleConstraintInstantiator.java index ab2e3f806..4891412ac 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/LocaleConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/LocaleConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,15 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Locale; -import org.eclipse.esmf.constraint.LocaleConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLocaleConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.LocaleConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLocaleConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -31,7 +32,7 @@ public LocaleConstraintInstantiator( final ModelElementFactory modelElementFacto @Override public LocaleConstraint apply( final Resource localeConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( localeConstraint ); - final String localeCode = attributeValue( localeConstraint, sammc.localeCode() ).getString(); + final String localeCode = attributeValue( localeConstraint, SammNs.SAMMC.localeCode() ).getString(); return new DefaultLocaleConstraint( metaModelBaseAttributes, Locale.forLanguageTag( localeCode ) ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/MeasurementInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MeasurementInstantiator.java similarity index 70% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/MeasurementInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MeasurementInstantiator.java index 20ec23acc..540d712a0 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/MeasurementInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MeasurementInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.impl.DefaultMeasurement; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultMeasurement; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; @@ -35,7 +36,7 @@ public MeasurementInstantiator( final ModelElementFactory modelElementFactory ) public Measurement apply( final Resource measurement ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( measurement ); final Type type = getType( measurement ); - final Optional unit = optionalAttributeValue( measurement, sammc.unit() ) + final Optional unit = optionalAttributeValue( measurement, SammNs.SAMMC.unit() ) .map( Statement::getResource ) .map( modelElementFactory::findOrCreateUnit ); return new DefaultMeasurement( metaModelBaseAttributes, type, unit ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MetaModelBaseAttributesFactory.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MetaModelBaseAttributesFactory.java new file mode 100644 index 000000000..c425f8a3b --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/MetaModelBaseAttributesFactory.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader.instantiator; + +public class MetaModelBaseAttributesFactory { + +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/OperationInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/OperationInstantiator.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/OperationInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/OperationInstantiator.java index f889b537b..68874adc8 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/OperationInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/OperationInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.impl.DefaultOperation; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; @@ -34,9 +35,9 @@ public OperationInstantiator( final ModelElementFactory modelElementFactory ) { @Override public Operation apply( final Resource operation ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( operation ); - final List input = getPropertiesModels( operation, samm.input() ); + final List input = getPropertiesModels( operation, SammNs.SAMM.input() ); final Optional output = - optionalAttributeValue( operation, samm.output() ) + optionalAttributeValue( operation, SammNs.SAMM.output() ) .map( Statement::getResource ) .map( outputPropertyResource -> modelElementFactory .create( Property.class, outputPropertyResource ) ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/PropertyInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/PropertyInstantiator.java similarity index 73% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/PropertyInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/PropertyInstantiator.java index e7a328c2a..119470991 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/PropertyInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/PropertyInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,12 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.HashMap; import java.util.Map; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.DefaultPropertyWrapper; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidModelException; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; @@ -25,11 +29,7 @@ import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultProperty; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; -import org.eclipse.esmf.metamodel.loader.DefaultPropertyWrapper; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.datatypes.BaseDatatype; import org.apache.jena.rdf.model.Literal; @@ -43,23 +43,27 @@ public class PropertyInstantiator extends Instantiator { public PropertyInstantiator( final ModelElementFactory modelElementFactory ) { super( modelElementFactory, Property.class ); - final MetaModelBaseAttributes characteristicBaseAttributes = MetaModelBaseAttributes.builderFor( "UnnamedCharacteristic" ) - .withMetaModelVersion( KnownVersion.getLatest() ) + final MetaModelBaseAttributes characteristicBaseAttributes = MetaModelBaseAttributes.builder() + .isAnonymous() .build(); fallbackCharacteristic = new DefaultCharacteristic( characteristicBaseAttributes, Optional.empty() ); } @Override public Property apply( final Resource property ) { - final boolean isOptional = optionalAttributeValue( property, samm.optional() ).map( Statement::getBoolean ).orElse( false ); - final boolean isNotInPayload = optionalAttributeValue( property, samm.notInPayload() ).map( Statement::getBoolean ).orElse( false ); - final Optional payloadName = optionalAttributeValue( property, samm.payloadName() ).map( Statement::getString ); - final Optional extends_ = optionalAttributeValue( property, samm._extends() ) - .map( Statement::getResource ) - .map( superElementResource -> modelElementFactory.create( Property.class, superElementResource ) ); - final boolean isAbstract = property.getModel().contains( property, RDF.type, samm.AbstractProperty() ); + final boolean isOptional = optionalAttributeValue( property, SammNs.SAMM.optional() ).map( Statement::getBoolean ).orElse( false ); + final boolean isNotInPayload = optionalAttributeValue( property, SammNs.SAMM.notInPayload() ).map( Statement::getBoolean ) + .orElse( false ); + final Optional payloadName = optionalAttributeValue( property, SammNs.SAMM.payloadName() ).map( Statement::getString ); + final Optional extendsResource = optionalAttributeValue( property, SammNs.SAMM._extends() ) + .map( Statement::getResource ); + final Optional extends_ = extendsResource.map( superElementResource -> + modelElementFactory.create( Property.class, superElementResource ) ); + final boolean isAbstract = !property.isAnon() && property.getModel().contains( property, RDF.type, SammNs.SAMM.AbstractProperty() ); - final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( property ); + final MetaModelBaseAttributes metaModelBaseAttributes = property.isAnon() + ? buildBaseAttributes( extendsResource.orElse( property ) ) + : buildBaseAttributes( property ); final DefaultPropertyWrapper defaultPropertyWrapper = new DefaultPropertyWrapper( metaModelBaseAttributes ); if ( resourcePropertyMap.containsKey( property ) ) { @@ -71,9 +75,9 @@ public Property apply( final Resource property ) { defProperty = new DefaultProperty( metaModelBaseAttributes, Optional.of( fallbackCharacteristic ), Optional.empty(), isOptional, isNotInPayload, payloadName, isAbstract, extends_ ); } else { - final Resource characteristicResource = attributeValue( property, samm.characteristic() ).getResource(); + final Resource characteristicResource = attributeValue( property, SammNs.SAMM.characteristic() ).getResource(); final Characteristic characteristic = modelElementFactory.create( Characteristic.class, characteristicResource ); - final Optional exampleValue = optionalAttributeValue( property, samm.exampleValue() ) + final Optional exampleValue = optionalAttributeValue( property, SammNs.SAMM.exampleValue() ) .flatMap( statement -> characteristic.getDataType() .map( type -> { if ( !type.is( Scalar.class ) ) { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/QuantifiableInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/QuantifiableInstantiator.java similarity index 70% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/QuantifiableInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/QuantifiableInstantiator.java index 8d86c8d5d..7589406d3 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/QuantifiableInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/QuantifiableInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.impl.DefaultQuantifiable; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultQuantifiable; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; @@ -35,7 +36,7 @@ public QuantifiableInstantiator( final ModelElementFactory modelElementFactory ) public Quantifiable apply( final Resource quantifiable ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( quantifiable ); final Type type = getType( quantifiable ); - final Optional unit = optionalAttributeValue( quantifiable, sammc.unit() ) + final Optional unit = optionalAttributeValue( quantifiable, SammNs.SAMMC.unit() ) .map( Statement::getResource ) .map( modelElementFactory::findOrCreateUnit ); return new DefaultQuantifiable( metaModelBaseAttributes, type, unit ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RangeConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RangeConstraintInstantiator.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RangeConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RangeConstraintInstantiator.java index 6f55cc7b7..8c8aa7622 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RangeConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RangeConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,19 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRangeConstraint; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRangeConstraint; import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.RDFNode; @@ -39,18 +40,16 @@ public RangeConstraintInstantiator( final ModelElementFactory modelElementFactor public RangeConstraint apply( final Resource rangeConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( rangeConstraint ); - final Optional minValue = optionalAttributeValue( rangeConstraint, sammc.minValue() ) + final Optional minValue = optionalAttributeValue( rangeConstraint, SammNs.SAMMC.minValue() ) .map( Statement::getLiteral ) - .map( literal -> new DefaultScalarValue( literal.getValue(), - new DefaultScalar( literal.getDatatypeURI(), metaModelBaseAttributes.getMetaModelVersion() ) ) ); - final Optional maxValue = optionalAttributeValue( rangeConstraint, sammc.maxValue() ) + .map( literal -> new DefaultScalarValue( literal.getValue(), new DefaultScalar( literal.getDatatypeURI() ) ) ); + final Optional maxValue = optionalAttributeValue( rangeConstraint, SammNs.SAMMC.maxValue() ) .map( Statement::getLiteral ) - .map( literal -> new DefaultScalarValue( literal.getValue(), - new DefaultScalar( literal.getDatatypeURI(), metaModelBaseAttributes.getMetaModelVersion() ) ) ); + .map( literal -> new DefaultScalarValue( literal.getValue(), new DefaultScalar( literal.getDatatypeURI() ) ) ); final BoundDefinition lowerBoundDefinition = getBoundDefinitionForRangeValue( minValue, - sammc.lowerBoundDefinition(), rangeConstraint, BoundDefinition.AT_LEAST ); + SammNs.SAMMC.lowerBoundDefinition(), rangeConstraint, BoundDefinition.AT_LEAST ); final BoundDefinition upperBoundDefinition = getBoundDefinitionForRangeValue( maxValue, - sammc.upperBoundDefinition(), rangeConstraint, BoundDefinition.AT_MOST ); + SammNs.SAMMC.upperBoundDefinition(), rangeConstraint, BoundDefinition.AT_MOST ); return new DefaultRangeConstraint( metaModelBaseAttributes, minValue, maxValue, lowerBoundDefinition, upperBoundDefinition ); } @@ -63,11 +62,11 @@ public RangeConstraint apply( final Resource rangeConstraint ) { * @param rangeConstraint the characteristic being processed * @param defaultBoundDefinitionValue the default value for the bound definition property * @return in case no value was given for the provided upper or lower bound, the default {@link BoundDefinition#OPEN} - * is returned. - * In case a value is given for the provided upper or lower bound and the model does not contain a value for - * the bound definition property, the provided default {@link BoundDefinition} is returned. - * In case a value is given for the provided upper or lower bound and the model does provide a value for the - * bound definition property, provided bound definition value is returned. + * is returned. + * In case a value is given for the provided upper or lower bound and the model does not contain a value for + * the bound definition property, the provided default {@link BoundDefinition} is returned. + * In case a value is given for the provided upper or lower bound and the model does provide a value for the + * bound definition property, provided bound definition value is returned. */ private BoundDefinition getBoundDefinitionForRangeValue( final Optional rangeValue, final Property boundDefinitionProperty, final Resource rangeConstraint, diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RegularExpressionConstraintInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RegularExpressionConstraintInstantiator.java similarity index 65% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RegularExpressionConstraintInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RegularExpressionConstraintInstantiator.java index 20745a2f3..89d898482 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/RegularExpressionConstraintInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/RegularExpressionConstraintInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,13 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRegularExpressionConstraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRegularExpressionConstraint; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -29,7 +30,7 @@ public RegularExpressionConstraintInstantiator( final ModelElementFactory modelE @Override public RegularExpressionConstraint apply( final Resource regularExpressionConstraint ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( regularExpressionConstraint ); - final String value = attributeValue( regularExpressionConstraint, samm.value() ).getString(); + final String value = attributeValue( regularExpressionConstraint, SammNs.SAMM.value() ).getString(); return new DefaultRegularExpressionConstraint( metaModelBaseAttributes, value ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SetInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SetInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SetInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SetInstantiator.java index 8f3e8524e..7044eead4 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SetInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SetInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.impl.DefaultSet; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSet; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SingleEntityInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SingleEntityInstantiator.java similarity index 68% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SingleEntityInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SingleEntityInstantiator.java index 502a975f7..fa780dec2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SingleEntityInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SingleEntityInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.impl.DefaultSingleEntity; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSingleEntity; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SortedSetInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SortedSetInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SortedSetInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SortedSetInstantiator.java index 00d715427..4256e23cb 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/SortedSetInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/SortedSetInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.impl.DefaultSortedSet; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSortedSet; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StateInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StateInstantiator.java similarity index 65% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StateInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StateInstantiator.java index 4ca60b167..e6b647d88 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StateInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StateInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,19 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.impl.DefaultState; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultState; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; @@ -36,10 +37,10 @@ public StateInstantiator( final ModelElementFactory modelElementFactory ) { public State apply( final Resource state ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( state ); final Type type = getType( state ); - final List enumValues = getNodesFromList( state, sammc.values() ) + final List enumValues = getNodesFromList( state, SammNs.SAMMC.values() ) .map( node -> buildValue( node, Optional.of( state ), type ) ) .collect( Collectors.toList() ); - final Value defaultValue = buildValue( attributeValue( state, sammc.defaultValue() ).getObject(), Optional.of( state ), type ); + final Value defaultValue = buildValue( attributeValue( state, SammNs.SAMMC.defaultValue() ).getObject(), Optional.of( state ), type ); return new DefaultState( metaModelBaseAttributes, type, enumValues, defaultValue ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StructuredValueInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StructuredValueInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StructuredValueInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StructuredValueInstantiator.java index 92da3c93d..014649dd2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/StructuredValueInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/StructuredValueInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,18 +11,19 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.impl.DefaultStructuredValue; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultStructuredValue; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.RDFNode; @@ -36,8 +37,8 @@ public StructuredValueInstantiator( final ModelElementFactory modelElementFactor @Override public StructuredValue apply( final Resource structuredValue ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( structuredValue ); - final String deconstructionRule = attributeValue( structuredValue, sammc.deconstructionRule() ).getString(); - final List elements = getNodesFromList( structuredValue, sammc.elements() ) + final String deconstructionRule = attributeValue( structuredValue, SammNs.SAMMC.deconstructionRule() ).getString(); + final List elements = getNodesFromList( structuredValue, SammNs.SAMMC.elements() ) .map( this::toElement ) .collect( Collectors.toList() ); final Type type = getType( structuredValue ); @@ -53,7 +54,7 @@ public StructuredValue apply( final Resource structuredValue ) { */ private Object toElement( final RDFNode node ) { if ( node.isLiteral() ) { - return ((Literal) node).getString(); + return ( (Literal) node ).getString(); } return modelElementFactory.create( Property.class, node.asResource() ); } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TimeSeriesInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TimeSeriesInstantiator.java similarity index 74% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TimeSeriesInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TimeSeriesInstantiator.java index f9bce9e4a..c2edb9965 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TimeSeriesInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TimeSeriesInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.Optional; -import org.eclipse.esmf.characteristic.TimeSeries; -import org.eclipse.esmf.characteristic.impl.DefaultTimeSeries; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTimeSeries; import org.apache.jena.rdf.model.Resource; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TraitInstantiator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TraitInstantiator.java similarity index 60% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TraitInstantiator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TraitInstantiator.java index ce071bfba..6679d7f1c 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/instantiator/TraitInstantiator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/loader/instantiator/TraitInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader.instantiator; +package org.eclipse.esmf.aspectmodel.loader.instantiator; import java.util.List; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.aspectmodel.loader.Instantiator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Constraint; -import org.eclipse.esmf.metamodel.loader.Instantiator; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; @@ -36,12 +37,12 @@ public TraitInstantiator( final ModelElementFactory modelElementFactory ) { public Trait apply( final Resource trait ) { final MetaModelBaseAttributes metaModelBaseAttributes = buildBaseAttributes( trait ); final Characteristic baseCharacteristic = modelElementFactory - .create( Characteristic.class, attributeValue( trait, sammc.baseCharacteristic() ).getResource() ); + .create( Characteristic.class, attributeValue( trait, SammNs.SAMMC.baseCharacteristic() ).getResource() ); final List constraints = - model.listStatements( trait, sammc.constraint(), (RDFNode) null ).mapWith( Statement::getResource ) - .mapWith( constraintResource -> modelElementFactory.create( Constraint.class, constraintResource ) ) - .toList(); + model.listStatements( trait, SammNs.SAMMC.constraint(), (RDFNode) null ).mapWith( Statement::getResource ) + .mapWith( constraintResource -> modelElementFactory.create( Constraint.class, constraintResource ) ) + .toList(); return new DefaultTrait( metaModelBaseAttributes, baseCharacteristic, constraints ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelFileLoader.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelFileLoader.java new file mode 100644 index 000000000..39b5ac75c --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelFileLoader.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver; + +import static org.apache.commons.lang3.StringUtils.isBlank; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.resolver.exceptions.ParserException; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.RawAspectModelFile; +import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; + +import io.vavr.control.Try; +import org.apache.jena.rdf.model.Model; + +/** + * Loads an input source into a {@link RawAspectModelFile}, i.e., an Aspect Model file that does not yet provide information + * about its model elements. This class should normally not be directly used as it is part of the regular Aspect Model loader. + * Use {@link AspectModelLoader} instead. + */ +public class AspectModelFileLoader { + public static RawAspectModelFile load( final File file ) { + try { + final RawAspectModelFile fromString = load( content( new FileInputStream( file ) ) ); + return new RawAspectModelFile( fromString.sourceModel(), fromString.headerComment(), Optional.of( file.toURI() ) ); + } catch ( final FileNotFoundException exception ) { + throw new ModelResolutionException( "File not found: " + file, exception ); + } + } + + public static RawAspectModelFile load( final String rdfTurtle ) { + final List headerComment = headerComment( rdfTurtle ); + final Try tryModel = TurtleLoader.loadTurtle( rdfTurtle ); + if ( tryModel.isFailure() && tryModel.getCause() instanceof final ParserException parserException ) { + throw parserException; + } + final Model model = tryModel.getOrElseThrow( + () -> new ModelResolutionException( "Can not load model", tryModel.getCause() ) ); + return new RawAspectModelFile( model, headerComment, Optional.empty() ); + } + + private static String content( final InputStream inputStream ) { + return new BufferedReader( new InputStreamReader( inputStream, StandardCharsets.UTF_8 ) ).lines() + .collect( Collectors.joining( "\n" ) ); + } + + private static List headerComment( final String content ) { + return content.lines().takeWhile( line -> line.startsWith( "#" ) || isBlank( line ) ).toList(); + } + + public static RawAspectModelFile load( final InputStream inputStream ) { + final AspectModelFile fromString = load( content( inputStream ) ); + return new RawAspectModelFile( fromString.sourceModel(), fromString.headerComment(), Optional.empty() ); + } + + public static RawAspectModelFile load( final Model model ) { + return new RawAspectModelFile( model, List.of(), Optional.empty() ); + } + + public static RawAspectModelFile load( final URL url ) { + if ( url.getProtocol().equals( "file" ) ) { + try { + return load( Paths.get( url.toURI() ).toFile() ); + } catch ( final URISyntaxException exception ) { + throw new ModelResolutionException( "Can not load model from file URL", exception ); + } + } + try { + return load( url.openStream() ); + } catch ( final IOException exception ) { + throw new ModelResolutionException( "Can not load model from URL", exception ); + } + } + + public static RawAspectModelFile load( final URI uri ) { + try { + return load( uri.toURL() ); + } catch ( final MalformedURLException exception ) { + throw new ModelResolutionException( "Can not load model from URIs that are not URLs", exception ); + } + } +} diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java similarity index 86% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java index 966c9f71b..2da0781b1 100644 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ClasspathStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -14,7 +14,6 @@ package org.eclipse.esmf.aspectmodel.resolver; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -29,19 +28,18 @@ import java.util.jar.JarFile; import java.util.stream.Stream; +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import io.vavr.control.Try; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.jena.rdf.model.Model; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Resolution strategy to resolve Aspect models by URN from a well-defined directory structure from the class path. */ -public class ClasspathStrategy extends AbstractResolutionStrategy { +public class ClasspathStrategy implements ResolutionStrategy { private static final Logger LOG = LoggerFactory.getLogger( ClasspathStrategy.class ); private final String modelsRoot; @@ -109,7 +107,7 @@ protected Stream filesInDirectory( final String directory ) { } } - private Optional getDirectoryFile( String directory ) { + private Optional getDirectoryFile( final String directory ) { // The incoming URL will look like this: jar:file:/pathToJar/o.jar/packageName/className // In case we run the code from a jar. Because of that we need to deconstruct the path to get the path to the jar only and remove // the unwanted part of the URL. @@ -123,7 +121,7 @@ private Optional getDirectoryFile( String directory ) { return Optional.of( new File( path ) ); } - private Stream getFilesFromResources( String directory ) throws IOException { + private Stream getFilesFromResources( final String directory ) throws IOException { final InputStream directoryUrl = getClass().getClassLoader().getResourceAsStream( directory ); if ( directoryUrl == null ) { LOG.warn( "No such classpath directory {}", directory ); @@ -132,7 +130,7 @@ private Stream getFilesFromResources( String directory ) throws IOExcept return Arrays.stream( IOUtils.toString( directoryUrl, StandardCharsets.UTF_8 ).split( "\\n" ) ); } - private Stream getFilesFromJar( String directory, File jarFile ) throws IOException { + private Stream getFilesFromJar( final String directory, final File jarFile ) throws IOException { final List fileList = new ArrayList<>(); final JarFile jar = new JarFile( jarFile ); final Enumeration entries = jar.entries(); @@ -151,14 +149,14 @@ private Stream getFilesFromJar( String directory, File jarFile ) throws } @Override - public Try apply( final AspectModelUrn aspectModelUrn ) { + public AspectModelFile apply( final AspectModelUrn aspectModelUrn, final ResolutionStrategySupport resolutionStrategySupport ) { final String modelsRootTrailingSlash = modelsRoot.isEmpty() ? "" : "/"; final String directory = String.format( "%s%s%s/%s", modelsRoot, modelsRootTrailingSlash, aspectModelUrn.getNamespace(), aspectModelUrn.getVersion() ); final URL namedResourceFile = resourceUrl( directory, aspectModelUrn.getName() + ".ttl" ); if ( namedResourceFile != null ) { - return loadFromUrl( namedResourceFile ); + return AspectModelFileLoader.load( namedResourceFile ); } LOG.warn( "Looking for {}, but no {}.ttl was found. Inspecting files in {}", aspectModelUrn.getName(), @@ -168,12 +166,10 @@ public Try apply( final AspectModelUrn aspectModelUrn ) { .filter( name -> name.endsWith( ".ttl" ) ) .map( name -> resourceUrl( directory, name ) ) .sorted( Comparator.comparing( URL::getPath ) ) - .map( this::loadFromUrl ) - .filter( tryModel -> tryModel - .map( model -> AspectModelResolver.containsDefinition( model, aspectModelUrn ) ) - .getOrElse( false ) ) + .map( AspectModelFileLoader::load ) + .filter( aspectModelFile -> resolutionStrategySupport.containsDefinition( aspectModelFile, aspectModelUrn ) ) .findFirst() - .orElse( Try.failure( new FileNotFoundException( - "No model file containing " + aspectModelUrn + " could be found in directory: " + directory ) ) ); + .orElseThrow( () -> new ModelResolutionException( + "No model file containing " + aspectModelUrn + " could be found in directory: " + directory ) ); } } diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/CommandExecutor.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/CommandExecutor.java similarity index 100% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/CommandExecutor.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/CommandExecutor.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java new file mode 100644 index 000000000..a6e16fc41 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver; + +import java.util.List; +import java.util.StringJoiner; +import java.util.stream.Collectors; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; + +import io.vavr.control.Try; + +/** + * A Resolution strategy that supports multiple types of inputs and wraps sub-resolution strategies + */ +public class EitherStrategy implements ResolutionStrategy { + final List strategies; + + public EitherStrategy( final List strategies ) { + this.strategies = strategies; + } + + public EitherStrategy( final ResolutionStrategy... strategies ) { + this( List.of( strategies ) ); + } + + public EitherStrategy( final ResolutionStrategy strategy1, final ResolutionStrategy strategy2 ) { + this( List.of( strategy1, strategy2 ) ); + } + + @Override + public AspectModelFile apply( final AspectModelUrn input, final ResolutionStrategySupport resolutionStrategySupport ) { + return strategies.stream() + .map( strategy -> Try.of( () -> strategy.apply( input, resolutionStrategySupport ) ) ) + .filter( Try::isSuccess ) + .findFirst() + .map( Try::get ) + .orElseThrow( () -> + new ModelResolutionException( "No strategy could resolve the input: " + strategies.stream().map( Object::toString ) + .collect( Collectors.joining() ) ) ); + } + + @Override + public String toString() { + return new StringJoiner( ", ", EitherStrategy.class.getSimpleName() + "[", "]" ) + .add( "strategies=" + strategies ) + .toString(); + } +} diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java similarity index 68% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java index 63b8486a7..21d0da0ac 100644 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ExternalResolverStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -13,15 +13,9 @@ package org.eclipse.esmf.aspectmodel.resolver; -import java.io.ByteArrayInputStream; -import java.nio.charset.StandardCharsets; - -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; - /** * A ResolutionStrategy that executes an external command, which will be executed using a {@link CommandExecutor}. */ @@ -33,9 +27,9 @@ public ExternalResolverStrategy( final String command ) { } @Override - public Try apply( final AspectModelUrn aspectModelUrn ) { + public AspectModelFile apply( final AspectModelUrn aspectModelUrn, final ResolutionStrategySupport resolutionStrategySupport ) { final String commandWithParameters = command + " " + aspectModelUrn.toString(); final String result = CommandExecutor.executeCommand( commandWithParameters ); - return TurtleLoader.loadTurtle( new ByteArrayInputStream( result.getBytes( StandardCharsets.UTF_8 ) ) ); + return AspectModelFileLoader.load( result ); } } diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java similarity index 82% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java index 96f0af7d0..35f79bab0 100644 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FileSystemStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.resolver.fs.ModelsRoot; import org.eclipse.esmf.aspectmodel.resolver.fs.StructuredModelsRoot; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; @@ -32,7 +33,7 @@ /** * Resolution strategy for Aspect model URNs that finds Aspect model files in the local file system. */ -public class FileSystemStrategy extends AbstractResolutionStrategy { +public class FileSystemStrategy implements ResolutionStrategy { private static final Logger LOG = LoggerFactory.getLogger( FileSystemStrategy.class ); protected final ModelsRoot modelsRoot; @@ -76,11 +77,11 @@ public FileSystemStrategy( final ModelsRoot modelsRoot ) { * {@link FileNotFoundException} if no file containing the element was found */ @Override - public Try apply( final AspectModelUrn aspectModelUrn ) { + public AspectModelFile apply( final AspectModelUrn aspectModelUrn, final ResolutionStrategySupport resolutionStrategySupport ) { final Path directory = modelsRoot.directoryForNamespace( aspectModelUrn ); final File namedResourceFile = directory.resolve( aspectModelUrn.getName() + ".ttl" ).toFile(); if ( namedResourceFile.exists() ) { - return loadFromUri( namedResourceFile.toURI() ); + return AspectModelFileLoader.load( namedResourceFile ); } LOG.warn( "Looking for {}, but no {}.ttl was found. Inspecting files in {}", aspectModelUrn.getName(), @@ -94,20 +95,19 @@ public Try apply( final AspectModelUrn aspectModelUrn ) { continue; } LOG.debug( "Looking for {} in {}", aspectModelUrn, file ); - final Try tryModel = loadFromUri( file.toURI() ); + final Try tryModel = Try.of( () -> AspectModelFileLoader.load( file ) ); if ( tryModel.isFailure() ) { LOG.debug( "Could not load model from {}", file, tryModel.getCause() ); } else { - final Model model = tryModel.get(); - if ( AspectModelResolver.containsDefinition( model, aspectModelUrn ) ) { - return Try.success( model ); + final AspectModelFile model = tryModel.get(); + if ( resolutionStrategySupport.containsDefinition( model, aspectModelUrn ) ) { + return model; } else { LOG.debug( "File {} does not contain {}", file, aspectModelUrn ); } } } - return Try.failure( - new FileNotFoundException( "No model file containing " + aspectModelUrn + " could be found in directory: " + directory ) ); + throw new ModelResolutionException( "No model file containing " + aspectModelUrn + " could be found in directory: " + directory ); } @Override diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FromLoadedFileStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FromLoadedFileStrategy.java new file mode 100644 index 000000000..9f25705b5 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/FromLoadedFileStrategy.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; + +/** + * Simple resolution strategy that resolves a URN by returning a previously loaded AspectModelFile. + */ +public class FromLoadedFileStrategy implements ResolutionStrategy { + private final AspectModelFile aspectModelFile; + + public FromLoadedFileStrategy( final AspectModelFile aspectModelFile ) { + this.aspectModelFile = aspectModelFile; + } + + @Override + public AspectModelFile apply( final AspectModelUrn aspectModelUrn, final ResolutionStrategySupport resolutionStrategySupport ) + throws ModelResolutionException { + + if ( resolutionStrategySupport.containsDefinition( aspectModelFile, aspectModelUrn ) ) { + return aspectModelFile; + } + throw new ModelResolutionException( "File " + aspectModelFile + " should contain defintion, but does not: " + aspectModelUrn ); + } +} diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ModelResolutionException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ModelResolutionException.java similarity index 100% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ModelResolutionException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ModelResolutionException.java diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java similarity index 53% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java index da4619e9b..f158a48b1 100644 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -13,15 +13,13 @@ package org.eclipse.esmf.aspectmodel.resolver; -import java.util.function.Function; - +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; - -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; +import org.eclipse.esmf.functions.ThrowingBiFunction; /** - * Represents one way to load and resolve an Aspect model from a given source. + * Represents one way to load and resolve an Aspect Model File from a given source. */ -public interface ResolutionStrategy extends Function> { +public interface ResolutionStrategy + extends ThrowingBiFunction { } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategySupport.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategySupport.java new file mode 100644 index 000000000..840a063a2 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/ResolutionStrategySupport.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; + +/** + * An instance of this interface provides utilies for the implementation of a {@link ResolutionStrategy}. + */ +public interface ResolutionStrategySupport { + /** + * Checks if a given Aspect Model File contains a given element definition. + * + * @param aspectModelFile the file + * @param urn the element + * @return true of the file contains the model element definition + */ + boolean containsDefinition( final AspectModelFile aspectModelFile, final AspectModelUrn urn ); +} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidModelException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidModelException.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidModelException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidModelException.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidNamespaceException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidNamespaceException.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidNamespaceException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidNamespaceException.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidRootElementCountException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidRootElementCountException.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidRootElementCountException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidRootElementCountException.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidVersionException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidVersionException.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidVersionException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/InvalidVersionException.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/MissingModelElementException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/MissingModelElementException.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/MissingModelElementException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/MissingModelElementException.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java similarity index 93% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java index 27ce22c05..faa981f48 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/exceptions/ParserException.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.resolver.exceptions; -public class ParserException extends Exception { +public class ParserException extends RuntimeException { private final String sourceDocument; public ParserException( final Throwable cause, final String sourceDocument ) { diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/FlatModelsRoot.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/FlatModelsRoot.java similarity index 100% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/FlatModelsRoot.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/FlatModelsRoot.java diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRoot.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRoot.java similarity index 100% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRoot.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/ModelsRoot.java diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/StructuredModelsRoot.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/StructuredModelsRoot.java similarity index 100% rename from core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/StructuredModelsRoot.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/fs/StructuredModelsRoot.java diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/DefaultAspectModelFile.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/DefaultAspectModelFile.java new file mode 100644 index 000000000..4e4820cd4 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/DefaultAspectModelFile.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver.modelfile; + +import java.net.URI; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.metamodel.ModelElement; + +import org.apache.jena.rdf.model.Model; + +public final class DefaultAspectModelFile implements AspectModelFile { + private final Model sourceModel; + private final List headerComment; + private final Optional sourceLocation; + private List elements; + + public DefaultAspectModelFile( final Model sourceModel, final List headerComment, final Optional sourceLocation ) { + this.sourceModel = sourceModel; + this.headerComment = headerComment; + this.sourceLocation = sourceLocation; + } + + public DefaultAspectModelFile( final Model sourceModel, final List headerComment, final Optional sourceLocation, + final List elements ) { + this( sourceModel, headerComment, sourceLocation ); + this.elements = elements; + } + + @Override + public Model sourceModel() { + return sourceModel; + } + + @Override + public List headerComment() { + return headerComment; + } + + @Override + public Optional sourceLocation() { + return sourceLocation; + } + + @Override + public List elements() { + return elements; + } + + public void setElements( final List elements ) { + this.elements = elements; + } + + @Override + public boolean equals( final Object obj ) { + if ( obj == this ) { + return true; + } + if ( obj == null || obj.getClass() != getClass() ) { + return false; + } + final DefaultAspectModelFile that = (DefaultAspectModelFile) obj; + return Objects.equals( sourceModel, that.sourceModel ) + && Objects.equals( headerComment, that.headerComment ) + && Objects.equals( sourceLocation, that.sourceLocation ) + && Objects.equals( elements, that.elements ); + } + + @Override + public int hashCode() { + return Objects.hash( sourceModel, headerComment, sourceLocation, elements ); + } + + @Override + public String toString() { + return "DefaultAspectModelFile[" + + "sourceModel=" + sourceModel + ", " + + "headerComment=" + headerComment + ", " + + "sourceLocation=" + sourceLocation + ", " + + "elements=" + elements + ']'; + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/MetaModelFile.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/MetaModelFile.java new file mode 100644 index 000000000..e21bf29b0 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/MetaModelFile.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver.modelfile; + +import java.io.IOException; +import java.net.URI; +import java.net.URL; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.eclipse.esmf.aspectmodel.AspectLoadingException; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; +import org.eclipse.esmf.samm.KnownVersion; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Streams; +import io.vavr.Tuple2; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.rdf.model.Statement; + +/** + * Enumeration of the {@link AspectModelFile}s that contain the SAMM meta model definition. + */ +public enum MetaModelFile implements AspectModelFile { + UNITS( "unit", "units.ttl", SammNs.UNIT.getUri(), MetaModelFileType.ELEMENT_DEFINITION ), + FILE_RESOURCE( "entity", "FileResource.ttl", SammNs.SAMME.getUri(), MetaModelFileType.ELEMENT_DEFINITION ), + POINT_3D( "entity", "Point3d.ttl", SammNs.SAMME.getUri(), MetaModelFileType.ELEMENT_DEFINITION ), + TIME_SERIES_ENTITY( "entity", "TimeSeriesEntity.ttl", SammNs.SAMME.getUri(), MetaModelFileType.ELEMENT_DEFINITION ), + CHARACTERISTIC_INSTANCES( "characteristic", "characteristic-instances.ttl", SammNs.SAMMC.getUri(), + MetaModelFileType.ELEMENT_DEFINITION ), + + TYPE_CONVERSIONS( "meta-model", "type-conversions.ttl", SammNs.SAMM.getUri(), MetaModelFileType.META_MODEL_DEFINITION ), + ASPECT_META_MODEL_DEFINITIONS( "meta-model", "aspect-meta-model-definitions.ttl", SammNs.SAMM.getUri(), + MetaModelFileType.META_MODEL_DEFINITION ), + CHARACTERISTIC_DEFINITIONS( "characteristic", "characteristic-definitions.ttl", SammNs.SAMMC.getUri(), + MetaModelFileType.META_MODEL_DEFINITION ), + + ASPECT_META_MODEL_SHAPES( "meta-model", "aspect-meta-model-shapes.ttl", SammNs.SAMM.getUri(), MetaModelFileType.SHAPE_DEFINITION ), + PREFIX_DECLARATIONS( "meta-model", "prefix-declarations.ttl", SammNs.SAMM.getUri(), MetaModelFileType.SHAPE_DEFINITION ), + CHARACTERISTIC_SHAPES( "characteristic", "characteristic-shapes.ttl", SammNs.SAMMC.getUri(), MetaModelFileType.SHAPE_DEFINITION ); + + private enum MetaModelFileType { + ELEMENT_DEFINITION, + META_MODEL_DEFINITION, + SHAPE_DEFINITION + } + + private final String urn; + private final MetaModelFileType metaModelFileType; + private final Model sourceModel; + + MetaModelFile( final String section, final String filename, final String urn, final MetaModelFileType metaModelFileType ) { + this.urn = urn; + this.metaModelFileType = metaModelFileType; + sourceModel = TurtleLoader.loadTurtle( url( section, filename ) ) + .map( model -> { + final Set> changeSet = determineSammUrlsToReplace( model ); + changeSet.forEach( urlReplacement -> { + model.remove( urlReplacement._1() ); + model.add( urlReplacement._2() ); + } ); + return model; + } ).getOrElseThrow( () -> new AspectLoadingException( "Could not load meta model file: " + filename ) ); + } + + /** + * Determines all statements that refer to a samm:// URL and their replacements where the samm:// URL has + * been replaced with a URL that is resolvable in the current context (e.g. to the class path or via HTTP). + * + * @param model the input model + * @return the tuples of the original statement to replace and the replacement statement + */ + private Set> determineSammUrlsToReplace( final Model model ) { + final Property shaclJsLibraryUrl = ResourceFactory.createProperty( "http://www.w3.org/ns/shacl#jsLibraryURL" ); + return Streams.stream( model.listStatements( null, shaclJsLibraryUrl, (RDFNode) null ) ) + .filter( statement -> statement.getObject().isLiteral() ) + .filter( statement -> statement.getObject().asLiteral().getString().startsWith( "samm://" ) ) + .flatMap( statement -> rewriteSammUrl( statement.getObject().asLiteral().getString() ) + .stream() + .map( newUrl -> + ResourceFactory.createStatement( statement.getSubject(), statement.getPredicate(), + ResourceFactory.createTypedLiteral( newUrl, SammXsdType.ANY_URI ) ) ) + .map( newStatement -> new Tuple2<>( statement, newStatement ) ) ) + .collect( Collectors.toSet() ); + } + + /** + * URLs inside meta model shapes, in particular those used with sh:jsLibraryURL, are given as samm:// URLs + * in order to decouple them from the way they are resolved (i.e. currently to a file in the class path, but + * in the future this could be resolved using the URL of a suitable service). This method takes a samm:// URL + * and rewrites it to the respective URL of the object on the class path. + * + * @param sammUrl the samm URL in the format samm://PART/VERSION/FILENAME + * @return The corresponding class path URL to resolve the meta model resource + */ + private Optional rewriteSammUrl( final String sammUrl ) { + final Matcher matcher = Pattern.compile( "^samm://([\\p{Alpha}-]*)/(\\d+\\.\\d+\\.\\d+)/(.*)$" ) + .matcher( sammUrl ); + if ( matcher.find() ) { + return KnownVersion.fromVersionString( matcher.group( 2 ) ) + .map( metaModelVersion -> url( matcher.group( 1 ), matcher.group( 3 ) ) ) + .map( URL::toString ); + } + if ( sammUrl.startsWith( "samm://scripts/" ) ) { + final String resourcePath = sammUrl.replace( "samm://", "samm/" ); + final URL resource = MetaModelFile.class.getClassLoader().getResource( resourcePath ); + return Optional.ofNullable( resource ).map( URL::toString ); + } + return Optional.empty(); + } + + @Override + public Model sourceModel() { + return sourceModel; + } + + @Override + public Optional sourceLocation() { + return Optional.of( URI.create( urn ) ); + } + + public static List getElementDefinitionsFiles() { + return Arrays.stream( values() ).filter( file -> file.metaModelFileType == MetaModelFileType.ELEMENT_DEFINITION ).toList(); + } + + public static List getMetaModelDefinitionsFiles() { + return Arrays.stream( values() ).filter( file -> file.metaModelFileType == MetaModelFileType.META_MODEL_DEFINITION ).toList(); + } + + public static List getShapeDefinitionsFiles() { + return Arrays.stream( values() ).filter( file -> file.metaModelFileType == MetaModelFileType.SHAPE_DEFINITION ).toList(); + } + + /** + * The SAMM meta model definitions as a single RDF model. + * + * @return the meta model definitions + */ + public static Model metaModelDefinitions() { + final Model model = ModelFactory.createDefaultModel(); + getMetaModelDefinitionsFiles().stream().map( MetaModelFile::sourceModel ).forEach( model::add ); + getElementDefinitionsFiles().stream().map( MetaModelFile::sourceModel ).forEach( model::add ); + return model; + } + + /** + * The SAMM meta model shapes as a single RDF model. + * + * @return the meta model shapes + */ + public static Model metaModelShapes() { + final Model model = ModelFactory.createDefaultModel(); + getShapeDefinitionsFiles().stream().map( MetaModelFile::sourceModel ).forEach( model::add ); + return model; + } + + /** + * Create a URL referring to a meta model resource + * + * @param section The meta model section + * @param filename the file name + * @return The resource URL + */ + private URL url( final String section, final String filename ) { + final String spec = String.format( "samm/%s/%s/%s", section, KnownVersion.getLatest().toVersionString(), filename ); + try { + final List urls = ImmutableList.copyOf( MetaModelFile.class.getClassLoader().getResources( spec ).asIterator() ); + if ( urls.size() == 1 ) { + return urls.get( 0 ); + } + if ( urls.isEmpty() ) { + throw new AspectLoadingException( "Could not resolve meta model file: " + filename ); + } + + // If multiple resources with the given spec are found: + // - return the one from the file system, if it exists + // - otherwise, the one from jar + // - otherwise, any of the found resources + URL jarUrl = null; + for ( final URL url : urls ) { + if ( url.getProtocol().equals( "file" ) ) { + return url; + } + if ( url.getProtocol().equals( "jar" ) ) { + jarUrl = url; + } + } + return jarUrl == null ? urls.get( 0 ) : jarUrl; + } catch ( final IOException e ) { + throw new AspectLoadingException( "Could not resolve meta model file: " + filename ); + } + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/ModelFiles.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/ModelFiles.java new file mode 100644 index 000000000..94628ce69 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/ModelFiles.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver.modelfile; + +public final class ModelFiles { + private ModelFiles() { + } + +// public static AspectModelFile fromModel( final Model model, final URI sourceLocation ) { +// return new DefaultAspectModelFile( model, sourceLocation ); +// } + +// public static AspectModelFile fromModel( final Model model ) { +// return new DefaultAspectModelFile( model ); +// } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/RawAspectModelFile.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/RawAspectModelFile.java new file mode 100644 index 000000000..4fc7d3076 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/modelfile/RawAspectModelFile.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver.modelfile; + +import java.net.URI; +import java.util.List; +import java.util.Optional; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; + +import org.apache.jena.rdf.model.Model; + +@SuppressWarnings( "OptionalUsedAsFieldOrParameterType" ) +public record RawAspectModelFile( + Model sourceModel, + List headerComment, + Optional sourceLocation ) + implements AspectModelFile { +} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/PlainTextFormatter.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/PlainTextFormatter.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/PlainTextFormatter.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/PlainTextFormatter.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/RdfTextFormatter.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/RdfTextFormatter.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/RdfTextFormatter.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/RdfTextFormatter.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/ReaderRiotTurtle.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/ReaderRiotTurtle.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/ReaderRiotTurtle.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/ReaderRiotTurtle.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/SmartToken.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/SmartToken.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/SmartToken.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/SmartToken.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParser.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParser.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParser.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParser.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParserProfile.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParserProfile.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParserProfile.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleParserProfile.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleTokenizer.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleTokenizer.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleTokenizer.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/parser/TurtleTokenizer.java diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java similarity index 78% rename from core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java index f2db31ea1..42091b4df 100644 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -19,11 +19,13 @@ import java.io.InputStreamReader; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.util.Objects; import java.util.stream.Collectors; import javax.annotation.Nullable; import org.eclipse.esmf.aspectmodel.resolver.exceptions.ParserException; import org.eclipse.esmf.aspectmodel.resolver.parser.ReaderRiotTurtle; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import io.vavr.control.Try; import org.apache.jena.rdf.model.Model; @@ -41,7 +43,6 @@ public final class TurtleLoader { private static volatile boolean isTurtleRegistered = false; private TurtleLoader() { - } /** @@ -51,17 +52,40 @@ private TurtleLoader() { * @return The model on success, a corresponding exception otherwise */ public static Try loadTurtle( @Nullable final InputStream inputStream ) { - DataType.setupTypeMapping(); - if ( inputStream == null ) { return Try.failure( new IllegalArgumentException() ); } - final String modelContent = new BufferedReader( new InputStreamReader( inputStream, StandardCharsets.UTF_8 ) ) .lines() .collect( Collectors.joining( "\n" ) ); + return loadTurtle( modelContent ); + } + /** + * Loads a Turtle model from a given URL. Note that this does not honor proxies nor redirects and is intended for resolving resource:// + * URLs. + * + * @param url The input url + * @return The model on success, a corresponding exception otherwise + */ + public static Try loadTurtle( final URL url ) { + try { + return loadTurtle( url.openStream() ); + } catch ( final IOException exception ) { + return Try.failure( exception ); + } + } + + /** + * Loads a Turtle model from an input stream + * + * @param modelContent The model content + * @return The model on success, a corresponding exception otherwise + */ + public static Try loadTurtle( @Nullable final String modelContent ) { + Objects.requireNonNull( modelContent, "Model content must not be null." ); + SammXsdType.setupTypeMapping(); final Model streamModel = ModelFactory.createDefaultModel(); registerTurtle(); try ( final InputStream turtleInputStream = new ByteArrayInputStream( modelContent.getBytes( StandardCharsets.UTF_8 ) ) ) { diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractMigrator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractMigrator.java similarity index 92% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractMigrator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractMigrator.java index 827d9adb2..d84288dcb 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractMigrator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractMigrator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractSammMigrator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractSammMigrator.java similarity index 91% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractSammMigrator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractSammMigrator.java index 48f42d626..b4dadd9b2 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractSammMigrator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractSammMigrator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import org.eclipse.esmf.aspectmodel.VersionNumber; import org.eclipse.esmf.samm.KnownVersion; diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractUriRewriter.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractUriRewriter.java similarity index 93% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractUriRewriter.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractUriRewriter.java index edadf2b8b..efc83188e 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/AbstractUriRewriter.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/AbstractUriRewriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.HashMap; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; import org.eclipse.esmf.samm.KnownVersion; import com.google.common.collect.Streams; @@ -77,7 +77,7 @@ protected RDFNode updateRdfNode( final RDFNode rdfNode, final Map buildReplacementPrefixMap( final Model sourceModel, final Map targetPrefixes ) { - final Map sourcePrefixes = Namespace.createPrefixMap( getSourceKnownVersion() ); + final Map sourcePrefixes = RdfNamespace.createPrefixMap( getSourceKnownVersion() ); final Map oldToNewNamespaces = new HashMap<>(); for ( final Map.Entry targetEntry : targetPrefixes.entrySet() ) { final String prefix = targetEntry.getKey(); @@ -111,7 +111,7 @@ Map. entry( prefix, targetPrefixes.getOrDefault( prefix, sourceM public Model migrate( final Model sourceModel ) { final Model targetModel = ModelFactory.createDefaultModel(); - final Map targetPrefixes = Namespace.createPrefixMap( getTargetKnownVersion() ); + final Map targetPrefixes = RdfNamespace.createPrefixMap( getTargetKnownVersion() ); final Map oldToNewNamespaces = buildReplacementPrefixMap( sourceModel, targetPrefixes ); Streams.stream( sourceModel.listStatements() ).map( statement -> targetModel diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/BammUriRewriter.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/BammUriRewriter.java similarity index 95% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/BammUriRewriter.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/BammUriRewriter.java index 224fc538c..455859fab 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/BammUriRewriter.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/BammUriRewriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.ArrayList; import java.util.List; @@ -22,7 +22,7 @@ import java.util.stream.Stream; import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidVersionException; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; import org.eclipse.esmf.samm.KnownVersion; import com.google.common.collect.Streams; @@ -105,7 +105,7 @@ public Model migrate( final Model sourceModel ) { return sourceModel; } - final Map targetPrefixes = Namespace.createPrefixMap( getTargetKnownVersion() ); + final Map targetPrefixes = RdfNamespace.createPrefixMap( getTargetKnownVersion() ); final Map oldToNewNamespaces = buildReplacementPrefixMap( sourceModel, targetPrefixes ); final List remappedStatements = new ArrayList<>(); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MetaModelVersionMigrator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MetaModelVersionMigrator.java new file mode 100644 index 000000000..9c292fbfd --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MetaModelVersionMigrator.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ +package org.eclipse.esmf.aspectmodel.versionupdate; + +import java.util.Comparator; +import java.util.List; +import java.util.Set; +import java.util.function.UnaryOperator; +import java.util.stream.Collectors; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.VersionNumber; +import org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException; +import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidVersionException; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.RawAspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.urn.ElementType; +import org.eclipse.esmf.samm.KnownVersion; + +import com.google.common.collect.ImmutableList; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The service that migrates all migrators in the correct order. + */ +public class MetaModelVersionMigrator implements UnaryOperator { + public static final MetaModelVersionMigrator INSTANCE = new MetaModelVersionMigrator(); + private static final Logger LOG = LoggerFactory.getLogger( MetaModelVersionMigrator.class ); + + private MetaModelVersionMigrator() { + } + + private final List migrators = ImmutableList. builder() + .add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_2_0_0, KnownVersion.SAMM_2_1_0 ) ) + .add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) ) + .add( new SammRemoveSammNameMigrator( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) ) + .add( new UnitInSammNamespaceMigrator() ) + .build(); + + private Model execute( final Migrator migrator, final Model sourceModel ) { + LOG.info( "Start Migration for {} to {}", migrator.sourceVersion(), migrator.targetVersion() ); + final String description = migrator.getDescription().orElse( "" ); + LOG.info( "Migration step {} {}", migrator.getClass().getSimpleName(), description ); + final Model targetModel = migrator.migrate( sourceModel ); + LOG.info( "End Migration" ); + return targetModel; + } + + private Model convertBammToSamm( final Model model ) { + final BammUriRewriter bamm100UriRewriter = new BammUriRewriter( BammUriRewriter.BammVersion.BAMM_1_0_0 ); + final BammUriRewriter bamm200UriRewriter = new BammUriRewriter( BammUriRewriter.BammVersion.BAMM_2_0_0 ); + return bamm200UriRewriter.migrate( bamm100UriRewriter.migrate( model ) ); + } + + /** + * Returns the meta model version used in the model + * + * @param model an Aspect model file + * @return the meta model versions + */ + private VersionNumber getUsedMetaModelVersion( final Model model ) { + final String sammUrnStart = String.format( "%s:%s", AspectModelUrn.VALID_PROTOCOL, AspectModelUrn.VALID_NAMESPACE_IDENTIFIER ); + final Set result = model.listObjects() + .toList() + .stream() + .filter( RDFNode::isURIResource ) + .map( RDFNode::asResource ) + .map( Resource::getURI ) + .filter( uri -> uri.startsWith( sammUrnStart ) ) + .flatMap( uri -> AspectModelUrn.from( uri ).toJavaStream() ) + .filter( urn -> (urn.getElementType().equals( ElementType.META_MODEL ) || urn.getElementType() + .equals( ElementType.CHARACTERISTIC )) ) + .map( AspectModelUrn::getVersion ) + .map( VersionNumber::parse ) + .collect( Collectors.toSet() ); + if ( result.size() == 1 ) { + return result.iterator().next(); + } else if ( result.size() > 1 ) { + throw new ModelResolutionException( "Aspect Model refers more than one SAMM version" ); + } else { + // Model does not contain any elements. Default to the latest meta model version. + return VersionNumber.parse( KnownVersion.getLatest().toVersionString() ); + } + } + + /** + * Semantically migrates an Aspect model file from its current meta model version to a given target meta model version. + * This is done by composing the {@link Migrator}s that update from one version to the next into one function + * which is then applied to the given source model. + * + * @param modelFile the source model file + * @return the resulting {@link AspectModelFile} that corresponds to the input Aspect model file, but with the new meta model version + */ + // public AspectModelFile updateMetaModelVersion( final AspectModelFile modelFile ) { + @Override + public AspectModelFile apply( final AspectModelFile modelFile ) { + // Before any semantic migration, perform the mechanical translation of legacy BAMM models + final Model input = convertBammToSamm( modelFile.sourceModel() ); + + final VersionNumber latestKnownVersion = VersionNumber.parse( KnownVersion.getLatest().toVersionString() ); + final VersionNumber sourceVersion = getUsedMetaModelVersion( input ); + Model migrationModel = modelFile.sourceModel(); + + if ( sourceVersion.greaterThan( latestKnownVersion ) ) { + // looks like unreachable + throw new InvalidVersionException( + String.format( "Model version %s can not be updated to version %s", sourceVersion, latestKnownVersion ) ); + } + + if ( !sourceVersion.equals( latestKnownVersion ) ) { + migrationModel = migrate( migrators, sourceVersion, latestKnownVersion, migrationModel ); + } + + return new RawAspectModelFile( migrationModel, modelFile.headerComment(), modelFile.sourceLocation() ); + } + + private Model migrate( final List migrators, final VersionNumber sourceVersion, final VersionNumber targetVersion, + final Model targetModel ) { + if ( migrators.isEmpty() ) { + return targetModel; + } + + final Comparator comparator = Comparator.comparing( Migrator::sourceVersion ); + final List migratorSet = migrators.stream() + .sorted( comparator.thenComparing( Migrator::order ) ) + .dropWhile( migrator -> !migrator.sourceVersion().equals( sourceVersion ) ) + .takeWhile( migrator -> !migrator.targetVersion().greaterThan( targetVersion ) ) + .toList(); + + Model migratorTargetModel = targetModel; + for ( final Migrator migrator : migratorSet ) { + migratorTargetModel = execute( migrator, migratorTargetModel ); + } + return migratorTargetModel; + } +} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammMetaModelVersionUriRewriter.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMetaModelVersionUriRewriter.java similarity index 92% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammMetaModelVersionUriRewriter.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMetaModelVersionUriRewriter.java index de60e10b4..d79960849 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammMetaModelVersionUriRewriter.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMetaModelVersionUriRewriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.Map; import java.util.Optional; diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammRemoveSammNameMigrator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammRemoveSammNameMigrator.java similarity index 88% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammRemoveSammNameMigrator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammRemoveSammNameMigrator.java index a68ff8dae..a9d438caf 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/SammRemoveSammNameMigrator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammRemoveSammNameMigrator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,11 +11,11 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.Map; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; import org.eclipse.esmf.samm.KnownVersion; import org.apache.jena.rdf.model.Model; diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/UnitInSammNamespaceMigrator.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/UnitInSammNamespaceMigrator.java similarity index 87% rename from core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/UnitInSammNamespaceMigrator.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/UnitInSammNamespaceMigrator.java index 4c9b803bc..01276e1f2 100644 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/migrator/UnitInSammNamespaceMigrator.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/UnitInSammNamespaceMigrator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,14 +11,14 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.aspectmodel.versionupdate.migrator; +package org.eclipse.esmf.aspectmodel.versionupdate; import java.util.List; import java.util.Map; import java.util.Optional; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.UNIT; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.UNIT; import org.eclipse.esmf.samm.KnownVersion; /** diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitor.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitor.java similarity index 93% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitor.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitor.java index e40d65dc8..b4b33f0e5 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitor.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,7 +10,7 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.visitor; +package org.eclipse.esmf.aspectmodel.visitor; import java.util.Collection; import java.util.HashSet; @@ -19,11 +19,6 @@ import java.util.function.Function; import java.util.stream.Stream; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.Trait; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; @@ -36,6 +31,11 @@ import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.StructureElement; import org.eclipse.esmf.metamodel.Unit; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.Trait; /** * Aspect Meta Model visitor that recursively traverses all elements of the model @@ -174,7 +174,8 @@ public Stream visitCollectionValue( final CollectionValue collecti } @Override - public Stream visitCollection( final org.eclipse.esmf.characteristic.Collection collection, final Void context ) { + public Stream visitCollection( final org.eclipse.esmf.metamodel.characteristic.Collection collection, + final Void context ) { return Stream.concat( visitCharacteristic( (Characteristic) collection, null ), visit( collection.getElementCharacteristic() ) ); diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/functions/ThrowingBiFunction.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/functions/ThrowingBiFunction.java new file mode 100644 index 000000000..019287577 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/functions/ThrowingBiFunction.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.functions; + +/** + * A BiFunction similar to {@link java.util.function.BiFunction} except a {@link Throwable} can be thrown + * + * @param the type of the first input to the function + * @param the type of the second input to the function + * @param the type of the result of the function + * @param the type of Throwable that is thrown + */ +@FunctionalInterface +public interface ThrowingBiFunction { + R apply( T t, U u ) throws E; +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AspectContext.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AspectContext.java deleted file mode 100644 index 66ba19346..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/AspectContext.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel; - -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; - -/** - * The AspectContext wraps a loaded/resolved Aspect Model and a single Aspect that was instantiated from this model, i.e., - * which must be defined in the RDF model. - * - * @param rdfModel the RDF model - * @param aspect the Aspect - */ -public record AspectContext( VersionedModel rdfModel, Aspect aspect ) { -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java deleted file mode 100644 index ece018734..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/ModelElement.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel; - -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; - -/** - * The Base interface provides all facilities that all Aspect Model elements have. - */ -public interface ModelElement { - /** - * @return the version of the Aspect Meta Model on which the Aspect Model is based. - */ - KnownVersion getMetaModelVersion(); - - T accept( AspectVisitor visitor, C context ); - - default boolean is( final Class clazz ) { - return clazz.isAssignableFrom( getClass() ); - } - - default T as( final Class clazz ) { - return clazz.cast( this ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCode.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCode.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCode.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCode.java index 72429ffed..d6dc90cd7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCode.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Code; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.Code; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultCode extends DefaultCharacteristic implements Code { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCollection.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCollection.java similarity index 92% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCollection.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCollection.java index 049137c2e..e50f992af 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultCollection.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultCollection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,19 +10,19 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Collection; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.Collection; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultCollection extends DefaultCharacteristic implements Collection { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultDuration.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultDuration.java similarity index 80% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultDuration.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultDuration.java index 21f8b2d02..6b99ac0ae 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultDuration.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,16 +10,16 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Duration; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.Duration; public class DefaultDuration extends DefaultQuantifiable implements Duration { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEither.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEither.java similarity index 89% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEither.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEither.java index ea99b79f2..3f4df27a5 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEither.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEither.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,18 +10,18 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Either; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.Either; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultEither extends DefaultCharacteristic implements Either { private final Characteristic left; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEnumeration.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEnumeration.java similarity index 88% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEnumeration.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEnumeration.java index d501994af..8d7484f43 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultEnumeration.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,19 +10,19 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Enumeration; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; @SuppressWarnings( "squid:S1150" ) // Sonar thinks this implements java.util.Enumeration, which it does not public class DefaultEnumeration extends DefaultCharacteristic implements Enumeration { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultList.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultList.java similarity index 83% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultList.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultList.java index 40d14d006..dc3e7531d 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultList.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.List; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.List; public class DefaultList extends DefaultCollection implements List { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultMeasurement.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultMeasurement.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultMeasurement.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultMeasurement.java index 90c53f21c..933efb27b 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultMeasurement.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultMeasurement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,16 +10,16 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Measurement; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.Measurement; public class DefaultMeasurement extends DefaultQuantifiable implements Measurement { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultQuantifiable.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultQuantifiable.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultQuantifiable.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultQuantifiable.java index 2d9d163aa..b409409f9 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultQuantifiable.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultQuantifiable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,18 +10,18 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Quantifiable; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultQuantifiable extends DefaultCharacteristic implements Quantifiable { private final Optional unit; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSet.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSet.java similarity index 83% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSet.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSet.java index 3ed171675..7caf145be 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSet.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Set; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.Set; public class DefaultSet extends DefaultCollection implements Set { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSingleEntity.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSingleEntity.java similarity index 79% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSingleEntity.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSingleEntity.java index a49a491a3..dc69a8b9c 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSingleEntity.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSingleEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.SingleEntity; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultSingleEntity extends DefaultCharacteristic implements SingleEntity { @@ -43,6 +43,7 @@ public T accept( final AspectVisitor visitor, final C context ) { @Override public String toString() { return new StringJoiner( ", ", DefaultSingleEntity.class.getSimpleName() + "[", "]" ) + .add( getName() ) .toString(); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSortedSet.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSortedSet.java similarity index 83% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSortedSet.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSortedSet.java index 9d62275db..9b621b2dc 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultSortedSet.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultSortedSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,17 +11,17 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.SortedSet; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; public class DefaultSortedSet extends DefaultCollection implements SortedSet { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultState.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultState.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultState.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultState.java index 8b55cecfe..5d61cfc79 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultState.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,17 +10,17 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.List; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.State; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.State; public class DefaultState extends DefaultEnumeration implements State { private final Value defaultValue; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultStructuredValue.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultStructuredValue.java similarity index 89% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultStructuredValue.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultStructuredValue.java index 9efc563ef..c983a1523 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultStructuredValue.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultStructuredValue.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,18 +11,18 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.StructuredValue; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultStructuredValue extends DefaultCharacteristic implements StructuredValue { private final String deconstructionRule; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTimeSeries.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTimeSeries.java similarity index 81% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTimeSeries.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTimeSeries.java index b29795dfe..290bccc70 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTimeSeries.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTimeSeries.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,16 +11,16 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.TimeSeries; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; public class DefaultTimeSeries extends DefaultSortedSet implements TimeSeries { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTrait.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTrait.java similarity index 90% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTrait.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTrait.java index 04525a762..449d2cd1b 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/characteristic/impl/DefaultTrait.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/characteristic/impl/DefaultTrait.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,20 +11,20 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.characteristic.impl; +package org.eclipse.esmf.metamodel.characteristic.impl; import java.util.List; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.characteristic.Trait; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultTrait extends DefaultCharacteristic implements Trait { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultEncodingConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultEncodingConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultEncodingConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultEncodingConstraint.java index eb00a79c4..6eb9bff73 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultEncodingConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultEncodingConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,16 +10,16 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.nio.charset.Charset; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.EncodingConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultEncodingConstraint extends DefaultConstraint implements EncodingConstraint { private final Charset value; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultFixedPointConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultFixedPointConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultFixedPointConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultFixedPointConstraint.java index 5417f43c9..03756b514 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultFixedPointConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultFixedPointConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,15 +11,15 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.FixedPointConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultFixedPointConstraint extends DefaultConstraint implements FixedPointConstraint { diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLanguageConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLanguageConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLanguageConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLanguageConstraint.java index 80920daf1..df4aa7612 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLanguageConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLanguageConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,16 +10,16 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.util.Locale; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.LanguageConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultLanguageConstraint extends DefaultConstraint implements LanguageConstraint { private final Locale languageCode; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLengthConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLengthConstraint.java similarity index 89% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLengthConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLengthConstraint.java index 92039b0f1..27ef78baa 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLengthConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLengthConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,17 +10,17 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.math.BigInteger; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.LengthConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultLengthConstraint extends DefaultConstraint implements LengthConstraint { private final Optional minValue; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLocaleConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLocaleConstraint.java similarity index 87% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLocaleConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLocaleConstraint.java index 7bcc85465..8f12aabe2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultLocaleConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultLocaleConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,16 +10,16 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.util.Locale; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.LocaleConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.LocaleConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultLocaleConstraint extends DefaultConstraint implements LocaleConstraint { private final Locale localeCode; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRangeConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRangeConstraint.java similarity index 90% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRangeConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRangeConstraint.java index 48c97d9db..1a7c02ef1 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRangeConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRangeConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,18 +10,18 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.RangeConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultRangeConstraint extends DefaultConstraint implements RangeConstraint { private final Optional minValue; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRegularExpressionConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRegularExpressionConstraint.java similarity index 86% rename from core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRegularExpressionConstraint.java rename to core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRegularExpressionConstraint.java index 35457e68d..c4dd771d5 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/constraint/impl/DefaultRegularExpressionConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/constraint/impl/DefaultRegularExpressionConstraint.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -10,15 +10,15 @@ * * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.constraint.impl; +package org.eclipse.esmf.metamodel.constraint.impl; import java.util.Objects; import java.util.StringJoiner; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; import org.eclipse.esmf.metamodel.impl.DefaultConstraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultRegularExpressionConstraint extends DefaultConstraint implements RegularExpressionConstraint { private final String value; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAbstractEntity.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAbstractEntity.java index 18fb63dde..764b753bc 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAbstractEntity.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAbstractEntity.java @@ -16,13 +16,13 @@ import java.util.List; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultAbstractEntity extends DefaultComplexType implements AbstractEntity { public static DefaultAbstractEntity createDefaultAbstractEntity( @@ -37,7 +37,8 @@ public DefaultAbstractEntity( final MetaModelBaseAttributes metaModelBaseAttribu final List properties, @SuppressWarnings( "checkstyle:ParameterName" ) final Optional extends_, final List extendingElements, - final ModelElementFactory loadedElements ) { + final ModelElementFactory loadedElements + ) { super( metaModelBaseAttributes, properties, extends_, extendingElements, loadedElements ); } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspect.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspect.java index b506e39c1..ccdda1d93 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspect.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspect.java @@ -17,12 +17,12 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultAspect extends ModelElementImpl implements Aspect { private final List properties; @@ -30,7 +30,8 @@ public class DefaultAspect extends ModelElementImpl implements Aspect { private final List events; private final boolean isCollectionAspect; - public DefaultAspect( final MetaModelBaseAttributes metaModelBaseAttributes, + public DefaultAspect( + final MetaModelBaseAttributes metaModelBaseAttributes, final List properties, final List operations, final List events, diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspectModel.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspectModel.java new file mode 100644 index 000000000..28cd2eddf --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultAspectModel.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel.impl; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.Namespace; + +import org.apache.jena.rdf.model.Model; + +public class DefaultAspectModel implements AspectModel { + private final Model mergedModel; + private final List elements; + + public DefaultAspectModel( final Model mergedModel, final List elements ) { + this.mergedModel = mergedModel; + this.elements = elements; + } + + @Override + public List namespaces() { + return elements().stream() + .filter( element -> !Namespace.ANONYMOUS.equals( element.urn().getUrnPrefix() ) ) + .collect( Collectors.groupingBy( element -> element.urn().getUrnPrefix() ) ) + .entrySet() + .stream() + . map( entry -> new DefaultNamespace( entry.getKey(), entry.getValue(), Optional.empty() ) ) + .toList(); + } + + @Override + public List elements() { + return elements; + } + + @Override + public Model mergedModel() { + return mergedModel; + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCharacteristic.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCharacteristic.java index d9f4ed979..175996f52 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCharacteristic.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCharacteristic.java @@ -12,19 +12,21 @@ */ package org.eclipse.esmf.metamodel.impl; -import java.util.Objects; import java.util.Optional; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultCharacteristic extends ModelElementImpl implements Characteristic { private final Optional dataType; - public DefaultCharacteristic( final MetaModelBaseAttributes metaModelBaseAttributes, final Optional dataType ) { + public DefaultCharacteristic( + final MetaModelBaseAttributes metaModelBaseAttributes, + final Optional dataType + ) { super( metaModelBaseAttributes ); this.dataType = dataType; } @@ -57,20 +59,4 @@ public String toString() { .add( "dataType=" + dataType ) .toString(); } - - @Override - public boolean equals( final Object o ) { - if ( this == o ) { - return true; - } - if ( o == null || getClass() != o.getClass() ) { - return false; - } - return super.equals( o ); - } - - @Override - public int hashCode() { - return Objects.hash( super.hashCode() ); - } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCollectionValue.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCollectionValue.java index 28e053951..c632ce2cd 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCollectionValue.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultCollectionValue.java @@ -17,19 +17,22 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; public class DefaultCollectionValue implements CollectionValue { private final Collection values; private final CollectionType collectionType; private final Type elementType; - public DefaultCollectionValue( final Collection values, final CollectionType collectionType, - final Type elementType ) { + public DefaultCollectionValue( + final Collection values, + final CollectionType collectionType, + final Type elementType + ) { this.values = values; this.collectionType = collectionType; this.elementType = elementType; @@ -50,9 +53,14 @@ public CollectionType getCollectionType() { return collectionType; } + /** + * Similar to {@link DefaultScalarValue#getSourceFile()}, collection values are not defined in Aspect Model files, so this returns null. + * + * @return null + */ @Override - public KnownVersion getMetaModelVersion() { - return elementType.getMetaModelVersion(); + public AspectModelFile getSourceFile() { + return null; } @Override diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultComplexType.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultComplexType.java index dd3b3731c..cd942d241 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultComplexType.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultComplexType.java @@ -15,28 +15,30 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultComplexType extends ModelElementImpl implements ComplexType { - private final List properties; + protected final List properties; @SuppressWarnings( "checkstyle:MemberName" ) - private final Optional extends_; - private final List extendingElements; - private final ModelElementFactory loadedElements; + protected final Optional extends_; + protected final List extendingElements; + protected final ModelElementFactory loadedElements; protected DefaultComplexType( final MetaModelBaseAttributes metaModelBaseAttributes, final List properties, @SuppressWarnings( "checkstyle:ParameterName" ) final Optional extends_, final List extendingElements, - final ModelElementFactory loadedElements ) { + final ModelElementFactory loadedElements + ) { super( metaModelBaseAttributes ); this.properties = new ArrayList<>( properties ); this.extends_ = extends_; @@ -74,4 +76,22 @@ public List getExtendingElements() { public T accept( final AspectVisitor visitor, final C context ) { return visitor.visitComplexType( this, context ); } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final DefaultComplexType that = (DefaultComplexType) o; + return Objects.equals( properties, that.properties ) && Objects.equals( extends_, that.extends_ ) + && Objects.equals( extendingElements, that.extendingElements ); + } + + @Override + public int hashCode() { + return Objects.hash( properties, extends_, extendingElements ); + } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultConstraint.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultConstraint.java index 4c3883351..5a0b781a1 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultConstraint.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultConstraint.java @@ -14,12 +14,11 @@ import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Constraint; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultConstraint extends ModelElementImpl implements Constraint { - public DefaultConstraint( final MetaModelBaseAttributes metaModelBaseAttributes ) { super( metaModelBaseAttributes ); } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntity.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntity.java index 944b8de1b..ab80e68b7 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntity.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntity.java @@ -14,18 +14,18 @@ import java.util.Collections; import java.util.List; +import java.util.Objects; import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ModelElementFactory; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ModelElementFactory; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultEntity extends DefaultComplexType implements Entity { - public static DefaultEntity createDefaultEntity( final MetaModelBaseAttributes metaModelBaseAttributes, final List properties, @SuppressWarnings( "checkstyle:ParameterName" ) final Optional extends_ ) { return new DefaultEntity( metaModelBaseAttributes, properties, extends_, Collections.emptyList(), null ); @@ -57,4 +57,23 @@ public DefaultEntity( public T accept( final AspectVisitor visitor, final C context ) { return visitor.visitEntity( this, context ); } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final DefaultEntity that = (DefaultEntity) o; + return Objects.equals( properties, that.properties ) && Objects.equals( extends_, that.extends_ ) + && Objects.equals( extendingElements, that.extendingElements ) + && Objects.equals( baseAttributes, that.baseAttributes ); + } + + @Override + public int hashCode() { + return Objects.hash( properties, extends_, extendingElements, baseAttributes ); + } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntityInstance.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntityInstance.java index 0dddc8535..4ac037ff6 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntityInstance.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEntityInstance.java @@ -17,12 +17,12 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultEntityInstance extends ModelElementImpl implements EntityInstance { private final Map assertions; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEvent.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEvent.java index 76a807a42..675357158 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEvent.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultEvent.java @@ -14,11 +14,12 @@ package org.eclipse.esmf.metamodel.impl; import java.util.List; +import java.util.Objects; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultEvent extends ModelElementImpl implements Event { private final List properties; @@ -45,4 +46,21 @@ public List getProperties() { public T accept( final AspectVisitor visitor, final C context ) { return visitor.visitEvent( this, context ); } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final DefaultEvent that = (DefaultEvent) o; + return Objects.equals( properties, that.properties ); + } + + @Override + public int hashCode() { + return Objects.hash( properties ); + } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultModelNamespace.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultModelNamespace.java deleted file mode 100644 index fc3af33cb..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultModelNamespace.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.ModelNamespace; - -public class DefaultModelNamespace implements ModelNamespace { - private final String packagePart; - private final VersionNumber versionNumber; - private final List elements = new ArrayList<>(); - - public DefaultModelNamespace( final String packagePart, final VersionNumber versionNumber, final List elements ) { - this.packagePart = packagePart; - this.versionNumber = versionNumber; - this.elements.addAll( elements ); - } - - /** - * Accepts a namespace URI such as 'urn:samm:com.example:1.0.0' - * - * @param uri the namspace uri - * @param elements the list of elements in the namspace - * @return the model namespace - */ - public static ModelNamespace from( final String uri, final List elements ) { - final String[] parts = uri.split( ":" ); - return new DefaultModelNamespace( parts[2], VersionNumber.parse( parts[3] ), elements ); - } - - /** - * Accepts a namespace URI such as 'urn:samm:com.example:1.0.0' - * - * @param uri the namspace uri - * @return the model namespace - */ - public static ModelNamespace from( final String uri ) { - return from( uri, List.of() ); - } - - @Override - public String packagePart() { - return packagePart; - } - - @Override - public VersionNumber version() { - return versionNumber; - } - - @Override - public List elements() { - return Collections.unmodifiableList( elements ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultNamespace.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultNamespace.java new file mode 100644 index 000000000..38018b6d6 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultNamespace.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.metamodel.impl; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.VersionNumber; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.Namespace; + +public class DefaultNamespace implements Namespace { + private final String packagePart; + private final VersionNumber versionNumber; + private final List elements; + private final Optional source; + + public DefaultNamespace( final String packagePart, final VersionNumber versionNumber, final List elements, + final Optional source ) { + this.packagePart = packagePart; + this.versionNumber = versionNumber; + this.source = source; + this.elements = elements; + } + + /** + * Accepts a namespace URI such as 'urn:samm:com.example:1.0.0' + * + * @param uri the namespace uri + * @param elements the list of elements in the namspace + */ + public DefaultNamespace( final String uri, final List elements, final Optional source ) { + this( uri.split( ":" )[2], VersionNumber.parse( uri.split( ":" )[3] ), elements, source ); + } + + // /** + // * Accepts a namespace URI such as 'urn:samm:com.example:1.0.0' + // * + // * @param uri the namspace uri + // * @return the model namespace + // */ + // public static Namespace from( final String uri ) { + // return from( uri, List.of(), Optional.empty() ); + // } + + @Override + public String packagePart() { + return packagePart; + } + + @Override + public Optional source() { + return source; + } + + @Override + public VersionNumber version() { + return versionNumber; + } + + @Override + public List elements() { + return Collections.unmodifiableList( elements ); + } + + @Override + public String getName() { + return "urn:samm:%s:%s".formatted( packagePart, versionNumber ); + } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final DefaultNamespace that = (DefaultNamespace) o; + return Objects.equals( packagePart, that.packagePart ) && Objects.equals( versionNumber, that.versionNumber ) + && Objects.equals( elements, that.elements ) && Objects.equals( source, that.source ); + } + + @Override + public int hashCode() { + return Objects.hash( packagePart, versionNumber, elements, source ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultOperation.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultOperation.java index bbde1a595..74522fb4c 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultOperation.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultOperation.java @@ -17,10 +17,10 @@ import java.util.Optional; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultOperation extends ModelElementImpl implements Operation { private final List input; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultProperty.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultProperty.java index 9da4051f4..8508711e2 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultProperty.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultProperty.java @@ -16,11 +16,11 @@ import java.util.Optional; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultProperty extends ModelElementImpl implements Property { private final Optional characteristic; @@ -118,6 +118,7 @@ public T accept( final AspectVisitor visitor, final C context ) { @Override public String toString() { return new StringJoiner( ", ", DefaultProperty.class.getSimpleName() + "[", "]" ) + .add( "urn=" + urn() ) .add( "characteristic=" + characteristic ) .add( "exampleValue=" + exampleValue ) .add( "optional=" + optional ) @@ -141,7 +142,7 @@ public boolean equals( final Object o ) { } final DefaultProperty that = (DefaultProperty) o; return Objects.equals( getName(), that.getName() ) - && Objects.equals( getAspectModelUrn(), that.getAspectModelUrn() ) + && Objects.equals( urn(), that.urn() ) && optional == that.optional && notInPayload == that.notInPayload && isAbstract == that.isAbstract diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultQuantityKind.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultQuantityKind.java index 36bc00733..770112d25 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultQuantityKind.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultQuantityKind.java @@ -16,9 +16,9 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.QuantityKind; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; public class DefaultQuantityKind extends ModelElementImpl implements QuantityKind { private final String label; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalar.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalar.java index a432e2e08..f5759b107 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalar.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalar.java @@ -16,17 +16,15 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Scalar; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; public class DefaultScalar implements Scalar { - private final KnownVersion metaModelVersion; private final String urn; - public DefaultScalar( final String urn, final KnownVersion metaModelVersion ) { + public DefaultScalar( final String urn ) { this.urn = urn; - this.metaModelVersion = metaModelVersion; } @Override @@ -34,19 +32,23 @@ public String getUrn() { return urn; } - @Override - public KnownVersion getMetaModelVersion() { - return metaModelVersion; - } - @Override public String toString() { return new StringJoiner( ", ", DefaultScalar.class.getSimpleName() + "[", "]" ) - .add( "metaModelVersion=" + metaModelVersion ) .add( "urn='" + urn + "'" ) .toString(); } + /** + * Scalars (e.g., xsd:string) are not defined in Aspect Model files, so this returns null. + * + * @return null + */ + @Override + public AspectModelFile getSourceFile() { + return null; + } + /** * Accepts an Aspect visitor * @@ -68,12 +70,11 @@ public boolean equals( final Object o ) { return false; } final DefaultScalar that = (DefaultScalar) o; - return metaModelVersion == that.metaModelVersion - && Objects.equals( urn, that.urn ); + return Objects.equals( urn, that.urn ); } @Override public int hashCode() { - return Objects.hash( metaModelVersion, urn ); + return Objects.hash( urn ); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalarValue.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalarValue.java index fe66694ce..258576f03 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalarValue.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultScalarValue.java @@ -16,10 +16,10 @@ import java.util.Objects; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; public class DefaultScalarValue implements ScalarValue { private final Object value; @@ -40,9 +40,14 @@ public Scalar getType() { return type; } + /** + * Similar to {@link DefaultScalar#getSourceFile()}, scalar values are not defined in Aspect Model files, so this returns null. + * + * @return null + */ @Override - public KnownVersion getMetaModelVersion() { - return type.getMetaModelVersion(); + public AspectModelFile getSourceFile() { + return null; } @Override diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultUnit.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultUnit.java index 3240aa51e..fe7ab1d60 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultUnit.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/DefaultUnit.java @@ -17,10 +17,10 @@ import java.util.Set; import java.util.StringJoiner; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.QuantityKind; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; import com.google.common.base.Objects; diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/ModelElementImpl.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/ModelElementImpl.java index 6d845afdc..15a253348 100644 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/ModelElementImpl.java +++ b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/impl/ModelElementImpl.java @@ -12,68 +12,47 @@ */ package org.eclipse.esmf.metamodel.impl; -import java.util.Comparator; import java.util.List; -import java.util.Objects; -import java.util.Optional; import java.util.Set; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.datatype.LangString; /** * The base implemenation of all model elements. */ -public abstract class ModelElementImpl implements ModelElement, NamedElement, Comparable { - private final KnownVersion metaModelVersion; - private final Optional urn; - private final String name; - private final Set preferredNames; - private final Set descriptions; - private final List see; - private final boolean hasSyntheticName; +public abstract class ModelElementImpl implements ModelElement, Comparable { + protected final MetaModelBaseAttributes baseAttributes; - ModelElementImpl( final MetaModelBaseAttributes metaModelBaseAttributes ) { - metaModelVersion = metaModelBaseAttributes.getMetaModelVersion(); - urn = metaModelBaseAttributes.getUrn(); - name = metaModelBaseAttributes.getName(); - preferredNames = metaModelBaseAttributes.getPreferredNames(); - descriptions = metaModelBaseAttributes.getDescriptions(); - see = metaModelBaseAttributes.getSee(); - hasSyntheticName = metaModelBaseAttributes.hasSyntheticName(); + ModelElementImpl( final MetaModelBaseAttributes baseAttributes ) { + this.baseAttributes = baseAttributes; } - /** - * The URN for the element, if present. Certain elements (such as Constraints) are allowed to not have URNs, which is why the URN is - * optional. - * - * @return the URN. - */ @Override - public Optional getAspectModelUrn() { - return urn; + public AspectModelUrn urn() { + return baseAttributes.isAnonymous() && baseAttributes.urn() == null + ? ModelElement.super.urn() + : baseAttributes.urn(); } - /** - * Returns the metamodel version this model element is defined against - */ @Override - public KnownVersion getMetaModelVersion() { - return metaModelVersion; + public String getName() { + return baseAttributes.isAnonymous() && baseAttributes.urn() == null + ? urn().getName() + : baseAttributes.getName(); } - /** - * The name of the element. - * - * @return the name. - */ @Override - public String getName() { - return name; + public boolean isAnonymous() { + return baseAttributes.isAnonymous(); + } + + @Override + public AspectModelFile getSourceFile() { + return baseAttributes.getSourceFile(); } /** @@ -83,7 +62,7 @@ public String getName() { */ @Override public Set getPreferredNames() { - return preferredNames; + return baseAttributes.getPreferredNames(); } /** @@ -93,46 +72,33 @@ public Set getPreferredNames() { */ @Override public Set getDescriptions() { - return descriptions; + return baseAttributes.getDescriptions(); } @Override public List getSee() { - return see; + return baseAttributes.getSee(); } @Override - public boolean hasSyntheticName() { - return hasSyntheticName; + public int compareTo( final ModelElement o ) { + return urn().compareTo( o.urn() ); } @Override - public boolean equals( final Object o ) { - if ( this == o ) { + public boolean equals( final Object obj ) { + if ( this == obj ) { return true; } - if ( o == null || getClass() != o.getClass() ) { + if ( obj == null || getClass() != obj.getClass() ) { return false; } - final ModelElementImpl base = (ModelElementImpl) o; - return Objects.equals( urn, base.urn ) - && Objects.equals( name, base.name ); + final ModelElementImpl that = (ModelElementImpl) obj; + return urn().equals( that.urn() ); } @Override public int hashCode() { - return Objects.hash( urn, name ); - } - - @Override - public int compareTo( final ModelElementImpl o ) { - if ( urn.isPresent() && o.urn.isPresent() ) { - return urn.get().compareTo( o.urn.get() ); - } - return Comparator - .comparing( ModelElementImpl::getMetaModelVersion ) - .thenComparing( ModelElementImpl::getName ) - .thenComparing( ModelElementImpl::hasSyntheticName ) - .compare( this, o ); + return urn().hashCode(); } } diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectModelLoader.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectModelLoader.java deleted file mode 100644 index 8d86aec4d..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/AspectModelLoader.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.loader; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.eclipse.esmf.aspectmodel.UnsupportedVersionException; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidModelException; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidNamespaceException; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidRootElementCountException; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.ModelNamespace; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.impl.DefaultModelNamespace; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.ImmutableSet; -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides functionality to load an Aspect Model from a {@link VersionedModel} and use the correct SAMM resources to - * instantiate it. To load a regular Aspect Model, use {@link #getElements(VersionedModel)} or - * {@link #getElementsUnchecked(VersionedModel)}. - * To load elements from an RDF model that might contain elements from multiple namespaces, use {@link #getNamespaces(VersionedModel)}. - * Instances of {@code VersionedModel} are gained through an {@link AspectModelResolver}. - */ -public class AspectModelLoader { - private static final Logger LOG = LoggerFactory.getLogger( AspectModelLoader.class ); - - private static final Set SUPPORTED_VERSIONS = ImmutableSet.of( - KnownVersion.SAMM_1_0_0, - KnownVersion.SAMM_2_0_0, - KnownVersion.SAMM_2_1_0 - ); - - private static final MigratorService MIGRATOR_SERVICE = new MigratorService(); - - private AspectModelLoader() { - } - - private static void validateNamespaceOfCustomUnits( final SAMM samm, final Model rawModel ) { - final List customUnitsWithSammNamespace = new ArrayList<>(); - rawModel.listStatements( null, RDF.type, samm.Unit() ) - .mapWith( Statement::getSubject ) - .filterKeep( subject -> subject.getNameSpace().equals( samm.getNamespace() ) ) - .mapWith( Resource::getLocalName ) - .forEach( customUnitsWithSammNamespace::add ); - - if ( !customUnitsWithSammNamespace.isEmpty() ) { - throw new InvalidNamespaceException( - String.format( "Aspect model contains unit(s) %s not specified in the unit catalog but referred with samm namespace", - customUnitsWithSammNamespace ) ); - } - } - - /** - * Loads elements from an RDF model that possibly contains multiple namespaces, and organize the result into a - * collection of {@link ModelNamespace}. Use this method only when you expect the RDF model to contain more than - * one namespace (which is not the case when aspect models contain the usual element definitions with one namespace per file), - * otherwise use {@link #getElements(VersionedModel)}. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the list of namespaces - */ - public static Try> getNamespaces( final VersionedModel versionedModel ) { - return getElements( versionedModel ).map( elements -> - elements.stream() - .filter( element -> element.is( NamedElement.class ) && element.as( NamedElement.class ).getAspectModelUrn().isPresent() ) - .collect( Collectors.groupingBy( namedElement -> { - final String urn = namedElement.as( NamedElement.class ).getAspectModelUrn().orElseThrow().toString(); - return urn.substring( 0, urn.indexOf( "#" ) ); - } ) ) - .entrySet() - .stream() - .map( entry -> DefaultModelNamespace.from( entry.getKey(), entry.getValue() ) ) - .toList() - ); - } - - /** - * Creates Java instances for model element classes from the RDF input model - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the list of loaded model elements on success - */ - public static Try> getElements( final VersionedModel versionedModel ) { - final Optional metaModelVersion = KnownVersion.fromVersionString( versionedModel.getMetaModelVersion().toString() ); - if ( metaModelVersion.isEmpty() || !SUPPORTED_VERSIONS.contains( metaModelVersion.get() ) ) { - return Try.failure( new UnsupportedVersionException( versionedModel.getMetaModelVersion() ) ); - } - - final Try updatedModel = metaModelVersion.get().isOlderThan( KnownVersion.getLatest() ) - ? MIGRATOR_SERVICE.updateMetaModelVersion( versionedModel ) - : Try.success( versionedModel ); - if ( updatedModel.isFailure() ) { - return Try.failure( updatedModel.getCause() ); - } - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - - try { - validateNamespaceOfCustomUnits( samm, versionedModel.getRawModel() ); - } catch ( final InvalidNamespaceException exception ) { - return Try.failure( exception ); - } - - try { - final VersionedModel model = updatedModel.get(); - final ModelElementFactory modelElementFactory = new ModelElementFactory( KnownVersion.getLatest(), model.getModel(), Map.of() ); - // List element definitions (... rdf:type ...) from the raw model (i.e. the actual aspect model to load) - // but then load them from the resolved model, because it contains all necessary context (e.g. unit definitions) - return Try.success( model.getRawModel().listStatements( null, RDF.type, (RDFNode) null ).toList().stream() - .map( Statement::getSubject ) - .filter( RDFNode::isURIResource ) - .map( resource -> model.getModel().createResource( resource.getURI() ) ) - .map( resource -> modelElementFactory.create( ModelElement.class, resource ) ) - .toList() ); - } catch ( final RuntimeException exception ) { - return Try.failure( new InvalidModelException( "Could not load Aspect model, please make sure the model is valid", exception ) ); - } - } - - /** - * Does the same as {@link #getElements(VersionedModel)} but throws an exception in case of failures. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the list of model elements - * @throws AspectLoadingException when elements can not be loaded - */ - public static List getElementsUnchecked( final VersionedModel versionedModel ) { - return getElements( versionedModel ).getOrElseThrow( cause -> { - LOG.error( "Could not load elements", cause ); - throw new AspectLoadingException( cause ); - } ); - } - - /** - * Convenience method that does the same as {@link #getElements(VersionedModel)} except it will return only the aspects contained in the - * model. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the list of model aspects - */ - public static Try> getAspects( final VersionedModel versionedModel ) { - return getElements( versionedModel ).map( elements -> - elements.stream().filter( element -> element.is( Aspect.class ) ) - .map( element -> element.as( Aspect.class ) ) - .toList() ); - } - - /** - * Does the same as {@link #getAspects(VersionedModel)} but throws an exception in case of failures. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the list of model aspects - * @throws AspectLoadingException when elements can not be loaded - */ - public static List getAspectsUnchecked( final VersionedModel versionedModel ) { - return getAspects( versionedModel ).getOrElseThrow( cause -> { - LOG.error( "Could not load aspects", cause ); - throw new AspectLoadingException( cause ); - } ); - } - - /** - * Convenience method to load the single Aspect from a model, when the model contains exactly one Aspect. - * Caution: The method handles this special case. Aspect Models are allowed to contain any number of Aspects (including zero), - * so for the general case you should use {@link #getElements(VersionedModel)} instead. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the single Aspect contained in the model - */ - public static Try getSingleAspect( final VersionedModel versionedModel ) { - return getSingleAspect( versionedModel, aspect -> true ); - } - - /** - * Convenience method to load the single Aspect from a model, when the model contains exactly one Aspect. Does the same as - * {@link #getSingleAspect(VersionedModel)} but throws an exception on failure. - * Caution: The method handles this special case. Aspect Models are allowed to contain any number of Aspects (including zero), - * so for the general case you should use {@link #getElementsUnchecked(VersionedModel)} instead. - * - * @param versionedModel The RDF model representation of the Aspect model - * @return the single Aspect contained in the model - */ - public static Aspect getSingleAspectUnchecked( final VersionedModel versionedModel ) { - return getSingleAspect( versionedModel ).getOrElseThrow( cause -> { - LOG.error( "Could not load aspect", cause ); - throw new AspectLoadingException( cause ); - } ); - } - - /** - * Similar to {@link #getSingleAspect(VersionedModel)}, except that a predicate can be provided to select which of potentially - * multiple aspects should be selected - * - * @param versionedModel the RDF model reprensentation of the Aspect model - * @param selector the predicate to select an Aspect - * @return the selected Aspect, or a failure if 0 or more than 1 matching Aspects were found - */ - public static Try getSingleAspect( final VersionedModel versionedModel, final Predicate selector ) { - return getAspects( versionedModel ).flatMap( allAspects -> { - final List aspects = allAspects.stream().filter( selector ).toList(); - return switch ( aspects.size() ) { - case 1 -> Try.success( aspects.iterator().next() ); - case 0 -> Try.failure( new InvalidRootElementCountException( "No Aspects were found in the model" ) ); - default -> Try.failure( new AspectLoadingException( "Multiple Aspects were found in the resolved model" ) ); - }; - } ); - } - - /** - * Convenience method to create an {@link AspectContext} directly from a model file. This method makes the following assumptions: - *
    - *
  • The model file is located in a directory structure as required by the {@link FileSystemStrategy}
  • - *
  • The closure of the loaded model contains exactly one Aspect
  • - *
  • The Aspect has the same name as the file's basename
  • - *
- * The method is intended for use in tests and comparable use cases, not as a general replacement for loading Aspect Models, since it - * does not - * handle model files with less or more than one Aspect. - * - * @param input the model file - * @return the loaded Aspect Context - */ - public static Try getAspectContext( final File input ) { - return AspectModelResolver.loadAndResolveModel( input ).flatMap( versionedModel -> - getSingleAspect( versionedModel, aspect -> input.getName().equals( aspect.getName() + ".ttl" ) ) - .map( aspect -> new AspectContext( versionedModel, aspect ) ) ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/MetaModelBaseAttributes.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/MetaModelBaseAttributes.java deleted file mode 100644 index 0277d897a..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/MetaModelBaseAttributes.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.loader; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; - -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.Streams; -import org.apache.commons.lang3.StringUtils; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.apache.jena.vocabulary.RDF; - -/** - * Wrapper class for the attributes all Aspect Meta Model elements have. - */ -public class MetaModelBaseAttributes { - private static final SammAspectMetaModelResourceResolver META_MODEL_RESOURCE_RESOLVER = new SammAspectMetaModelResourceResolver(); - private final KnownVersion metaModelVersion; - private final Optional urn; - private final String name; - private final Set preferredNames; - private final Set descriptions; - private final List see; - private final boolean hasSyntheticName; - - public MetaModelBaseAttributes( - final AspectModelUrn urn, - final String name, - final Set preferredNames, - final Set descriptions, - final List see ) { - this( KnownVersion.getLatest(), urn, name, preferredNames, descriptions, see, false ); - } - - public MetaModelBaseAttributes( - final KnownVersion metaModelVersion, - final AspectModelUrn urn, - final String name, - final Set preferredNames, - final Set descriptions, - final List see ) { - this( metaModelVersion, urn, name, preferredNames, descriptions, see, false ); - } - - public MetaModelBaseAttributes( final KnownVersion metaModelVersion, - final AspectModelUrn urn, - final String name, - final Set preferredNames, - final Set descriptions, - final List see, - final boolean hasSyntheticName ) { - this.metaModelVersion = metaModelVersion; - this.urn = Optional.ofNullable( urn ); - this.name = name; - this.preferredNames = preferredNames; - this.descriptions = descriptions; - this.see = see; - this.hasSyntheticName = hasSyntheticName; - } - - public KnownVersion getMetaModelVersion() { - return metaModelVersion; - } - - public Optional getUrn() { - return urn; - } - - public String getName() { - return name; - } - - public Set getPreferredNames() { - return preferredNames; - } - - public Set getDescriptions() { - return descriptions; - } - - public List getSee() { - return see; - } - - public boolean hasSyntheticName() { - return hasSyntheticName; - } - - /** - * Creates a builder for the given meta model element name. - * - * @param name the meta model element name - * @return the builder instance - */ - public static Builder builderFor( final String name ) { - return new Builder( name ); - } - - /** - * Creates an instance from a meta model version, an URN and a name. - * - * @param metaModelVersion the used meta model version - * @param urn the meta model element URN - * @param name the meta model element name - * @return the newly created instance - */ - public static MetaModelBaseAttributes from( final KnownVersion metaModelVersion, final AspectModelUrn urn, final String name ) { - return builderFor( name ).withMetaModelVersion( metaModelVersion ).withUrn( urn ).build(); - } - - /** - * Creates an instance from a meta model version, an URN, a name and - * a preferredName for {@link Locale#ENGLISH}. - * - * @param metaModelVersion the used meta model version - * @param urn the meta model element URN - * @param name the meta model element name - * @return the newly created instance - */ - public static MetaModelBaseAttributes from( final KnownVersion metaModelVersion, final AspectModelUrn urn, final String name, - final String preferredName ) { - return builderFor( name ).withMetaModelVersion( metaModelVersion ).withUrn( urn ) - .withPreferredName( Locale.ENGLISH, preferredName ).build(); - } - - /** - * Creates an instance for a specific Meta Model element. - * - * @param metaModelVersion the used meta model version - * @param modelElement the Aspect model element to be processed. - * @param model the RDF {@link Model} representing the entire Aspect Meta Model. - * @param samm the Aspect Meta Model vocabulary - * @return the newly created instance - */ - public static MetaModelBaseAttributes fromModelElement( final KnownVersion metaModelVersion, - final Resource modelElement, final Model model, final SAMM samm ) { - final AttributeValueRetriever valueRetriever = new AttributeValueRetriever( samm ); - - final Optional urn = getUrn( modelElement, samm ); - final Set preferredNames = getLanguages( modelElement, samm.preferredName(), valueRetriever ); - final Set descriptions = getLanguages( modelElement, samm.description(), valueRetriever ); - final List seeValues = getSeeValues( modelElement, samm, valueRetriever ); - final String name = getName( modelElement, samm ) - .orElseGet( () -> getSyntheticName( modelElement, model, samm ) ); - final boolean isSyntheticName = urn.isEmpty(); - return new MetaModelBaseAttributes( metaModelVersion, urn.orElse( null ), name, preferredNames, descriptions, seeValues, - isSyntheticName ); - } - - /** - * Creates an instance of {@link MetaModelBaseAttributes} by copying them from a given {@link NamedElement}. - * - * @param modelElement the named model element to copy the base attributes from - * @return the newly created instance - */ - public static MetaModelBaseAttributes fromModelElement( final NamedElement modelElement ) { - return new MetaModelBaseAttributes( modelElement.getMetaModelVersion(), modelElement.getAspectModelUrn().get(), - modelElement.getName(), modelElement.getPreferredNames(), modelElement.getDescriptions(), modelElement.getSee() ); - } - - private static Optional getUrn( final Resource modelElement, final SAMM samm ) { - if ( modelElement.isAnon() ) { - final Statement propertyStatement = modelElement.getProperty( samm.property() ); - if ( propertyStatement != null ) { - return getUrn( propertyStatement.getObject().asResource(), samm ); - } - return Optional.empty(); - } - return Optional.of( AspectModelUrn.fromUrn( modelElement.getURI() ) ); - } - - /** - * Returns a model element's name: If it's a named resource, the name is part of its URN; otherwise - * (e.g., [ samm:extends :foo ; ... ]) go up the inheritance tree recursively. - * - * @param modelElement the model element to retrieve the name for - * @param samm the meta model vocabulary - * @return the element's local name - */ - private static Optional getName( final Resource modelElement, final SAMM samm ) { - if ( !modelElement.isAnon() ) { - return Optional.of( AspectModelUrn.fromUrn( modelElement.getURI() ).getName() ); - } - - final Statement propertyStatement = modelElement.getProperty( samm.property() ); - if ( propertyStatement != null ) { - return getName( propertyStatement.getObject().asResource(), samm ); - } - - final Optional extendsStatement = Streams.stream( - modelElement.getModel().listStatements( modelElement, samm._extends(), (RDFNode) null ) ).findAny(); - return extendsStatement.flatMap( statement -> getName( statement.getObject().asResource(), samm ) ); - } - - private static String getSyntheticName( final Resource modelElement, final Model model, final SAMM samm ) { - final Resource namedParent = getNamedParent( modelElement, model ); - if ( namedParent == null ) { - throw new AspectLoadingException( "At least one anonymous node in the model does not have a parent with a regular name." ); - } - final String parentModelElementUri = namedParent.getURI(); - final String parentModelElementName = AspectModelUrn.from( parentModelElementUri ) - .toJavaOptional() - .map( AspectModelUrn::getName ) - .map( StringUtils::capitalize ) - .orElse( "" ); - - final Resource modelElementType = getModelElementType( modelElement, samm ); - final String modelElementTypeUri = modelElementType.getURI(); - final String modelElementTypeName = AspectModelUrn.from( modelElementTypeUri ) - .toJavaOptional() - .map( AspectModelUrn::getName ) - .orElse( "" ); - - return parentModelElementName + modelElementTypeName; - } - - // We have to be careful when searching for the parent nodes with a regular name - the "listStatements" API returns the matching nodes - // in no particular order; with some very specific models this could lead to non-deterministic behavior. - // In the following very simplified example we are looking for ":NumberList" as the parent of "_:blankNode", but could get the - // anonymous node [] instead. - // [ - // aux:contains _:blankNode ; - // ] . - // :NumberList a samm-c:List ; - // samm-c:elementCharacteristic _:blankNode . - // _:blankNode a samm-c:Trait ; - private static Resource getNamedParent( final Resource modelElement, final Model model ) { - final StmtIterator elements = model.listStatements( null, null, modelElement ); - while ( elements.hasNext() ) { - final Resource parentModelElement = elements.next().getSubject(); - if ( parentModelElement.isAnon() ) { - final Resource grandParent = getNamedParent( parentModelElement, model ); - if ( null != grandParent ) { - return grandParent; - } - } else { - return parentModelElement; - } - } - return null; // element has no named parent - } - - private static Resource getModelElementType( final Resource modelElement, final SAMM samm ) { - final Statement typeStatement = modelElement.getProperty( RDF.type ); - if ( typeStatement != null ) { - return typeStatement.getObject().asResource(); - } - - // If the model element is a Property reference, the actual type will be found when we follow samm:property - final Statement propertyStatement = modelElement.getProperty( samm.property() ); - if ( propertyStatement != null ) { - return getModelElementType( propertyStatement.getObject().asResource(), samm ); - } - - // This model element has no type, but maybe it extends another element - final Statement extendsStatement = modelElement.getProperty( samm._extends() ); - if ( extendsStatement == null ) { - throw new AspectLoadingException( "Model element has no type and does not extend another type: " + modelElement ); - } - - final Resource superElement = extendsStatement.getObject().asResource(); - return getModelElementType( superElement, samm ); - } - - /** - * @param modelElement the RDF {@link Resource} representing the Aspect Model element to be processed - * @param attribute the RDF {@link org.apache.jena.rdf.model.Property} for which the values will be retrieved - * @param valueRetriever the {@link AttributeValueRetriever} used to retrieve the attribute values - * @return a {@link List} containing all values for the given Property in the given Aspect Model element - */ - private static Set getLanguages( final Resource modelElement, - final org.apache.jena.rdf.model.Property attribute, final AttributeValueRetriever valueRetriever ) { - return valueRetriever.attributeValues( modelElement, attribute ).stream() - .filter( languageStatement -> !"und".equals( Locale.forLanguageTag( languageStatement.getLanguage() ).toLanguageTag() ) ) - .map( statement -> new LangString( statement.getString(), Locale.forLanguageTag( statement.getLanguage() ) ) ) - .collect( Collectors.toSet() ); - } - - /** - * @param resource the RDF {@link Resource} representing the Aspect Model element to be processed - * @param samm the Aspect Meta Model vocabulary - * @param valueRetriever the {@link AttributeValueRetriever} used to retrieve the attribute values - * @return a {@link List} containing all {@link SAMM#see()} values for a Aspect Model element - */ - private static List getSeeValues( final Resource resource, final SAMM samm, final AttributeValueRetriever valueRetriever ) { - return valueRetriever.attributeValues( resource, samm.see() ).stream() - .map( statement -> statement.getObject().toString() ) - .sorted() - .collect( Collectors.toList() ); - } - - public static class Builder { - private AspectModelUrn urn; - private final String name; - private final Set preferredNames = new HashSet<>(); - private final Set descriptions = new HashSet<>(); - private final List see = new ArrayList<>(); - private KnownVersion metaModelVersion; - private boolean hasSyntheticName; - - public Builder( final String name ) { - super(); - this.name = name; - } - - public Builder withUrn( final AspectModelUrn urn ) { - this.urn = urn; - return this; - } - - public Builder withPreferredName( final Locale locale, final String preferredName ) { - preferredNames.add( new LangString( preferredName, locale ) ); - return this; - } - - public Builder withDescription( final Locale locale, final String description ) { - descriptions.add( new LangString( description, locale ) ); - return this; - } - - public Builder withSee( final String see ) { - this.see.add( see ); - return this; - } - - public Builder withMetaModelVersion( final KnownVersion metaModelVersion ) { - this.metaModelVersion = metaModelVersion; - return this; - } - - public Builder hasSyntheticName( final boolean hasSyntheticName ) { - this.hasSyntheticName = hasSyntheticName; - return this; - } - - public MetaModelBaseAttributes build() { - return new MetaModelBaseAttributes( metaModelVersion, urn, name, preferredNames, descriptions, see, hasSyntheticName ); - } - } -} diff --git a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ModelElementFactory.java b/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ModelElementFactory.java deleted file mode 100644 index b191ec8da..000000000 --- a/core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/loader/ModelElementFactory.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.loader; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.aspectmodel.vocabulary.UNIT; -import org.eclipse.esmf.metamodel.ComplexType; -import org.eclipse.esmf.metamodel.Entity; -import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.ModelNamespace; -import org.eclipse.esmf.metamodel.QuantityKind; -import org.eclipse.esmf.metamodel.QuantityKinds; -import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.Units; -import org.eclipse.esmf.metamodel.impl.DefaultQuantityKind; -import org.eclipse.esmf.metamodel.impl.DefaultUnit; -import org.eclipse.esmf.metamodel.loader.instantiator.AbstractEntityInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.AspectInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.CharacteristicInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.CodeInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.CollectionInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.ConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.DurationInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EitherInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EncodingConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EntityInstanceInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EntityInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EnumerationInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.EventInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.FixedPointConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.LanguageConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.LengthConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.ListInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.LocaleConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.MeasurementInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.OperationInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.PropertyInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.QuantifiableInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.RangeConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.RegularExpressionConstraintInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.SetInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.SingleEntityInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.SortedSetInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.StateInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.StructuredValueInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.TimeSeriesInstantiator; -import org.eclipse.esmf.metamodel.loader.instantiator.TraitInstantiator; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.Streams; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.apache.jena.vocabulary.RDFS; - -public class ModelElementFactory extends AttributeValueRetriever { - private final KnownVersion metaModelVersion; - private final Model model; - private final SAMMC sammc; - private final UNIT unit; - private final Map> instantiators = new HashMap<>(); - private final Map loadedElements = new HashMap<>(); - private Set namespaces; - - public ModelElementFactory( final KnownVersion metaModelVersion, final Model model, - final Map> additionalInstantiators ) { - super( new SAMM( metaModelVersion ) ); - this.metaModelVersion = metaModelVersion; - this.model = model; - sammc = new SAMMC( metaModelVersion ); - unit = new UNIT( metaModelVersion, samm ); - - registerInstantiator( samm.AbstractEntity(), new AbstractEntityInstantiator( this ) ); - registerInstantiator( samm.AbstractProperty(), new PropertyInstantiator( this ) ); - registerInstantiator( samm.Aspect(), new AspectInstantiator( this ) ); - registerInstantiator( samm.Characteristic(), new CharacteristicInstantiator( this ) ); - registerInstantiator( samm.Constraint(), new ConstraintInstantiator( this ) ); - registerInstantiator( samm.Entity(), new EntityInstantiator( this ) ); - registerInstantiator( samm.Event(), new EventInstantiator( this ) ); - registerInstantiator( samm.Operation(), new OperationInstantiator( this ) ); - registerInstantiator( samm.Property(), new PropertyInstantiator( this ) ); - - registerInstantiator( sammc.Code(), new CodeInstantiator( this ) ); - registerInstantiator( sammc.Collection(), new CollectionInstantiator( this ) ); - registerInstantiator( sammc.Duration(), new DurationInstantiator( this ) ); - registerInstantiator( sammc.Either(), new EitherInstantiator( this ) ); - registerInstantiator( sammc.EncodingConstraint(), new EncodingConstraintInstantiator( this ) ); - registerInstantiator( sammc.Enumeration(), new EnumerationInstantiator( this ) ); - registerInstantiator( sammc.FixedPointConstraint(), new FixedPointConstraintInstantiator( this ) ); - registerInstantiator( sammc.LanguageConstraint(), new LanguageConstraintInstantiator( this ) ); - registerInstantiator( sammc.LengthConstraint(), new LengthConstraintInstantiator( this ) ); - registerInstantiator( sammc.List(), new ListInstantiator( this ) ); - registerInstantiator( sammc.LocaleConstraint(), new LocaleConstraintInstantiator( this ) ); - registerInstantiator( sammc.Measurement(), new MeasurementInstantiator( this ) ); - registerInstantiator( sammc.Quantifiable(), new QuantifiableInstantiator( this ) ); - registerInstantiator( sammc.RangeConstraint(), new RangeConstraintInstantiator( this ) ); - registerInstantiator( sammc.RegularExpressionConstraint(), new RegularExpressionConstraintInstantiator( this ) ); - registerInstantiator( sammc.Set(), new SetInstantiator( this ) ); - registerInstantiator( sammc.SingleEntity(), new SingleEntityInstantiator( this ) ); - registerInstantiator( sammc.SortedSet(), new SortedSetInstantiator( this ) ); - registerInstantiator( sammc.State(), new StateInstantiator( this ) ); - registerInstantiator( sammc.StructuredValue(), new StructuredValueInstantiator( this ) ); - registerInstantiator( sammc.TimeSeries(), new TimeSeriesInstantiator( this ) ); - registerInstantiator( sammc.Trait(), new TraitInstantiator( this ) ); - - instantiators.putAll( additionalInstantiators ); - } - - private void registerInstantiator( final Resource resource, final Instantiator instantiator ) { - instantiators.put( resource, instantiator ); - } - - @SuppressWarnings( "unchecked" ) - public T create( final Class clazz, final Resource modelElement ) { - ModelElement element = loadedElements.get( modelElement ); - if ( element != null ) { - return (T) element; - } - final Resource targetType = resourceType( modelElement ); - if ( samm.Unit().equals( targetType ) ) { - return (T) findOrCreateUnit( modelElement ); - } - if ( samm.QuantityKind().equals( targetType ) ) { - return (T) findOrCreateQuantityKind( modelElement ); - } - final Instantiator instantiator = (Instantiator) instantiators.get( targetType ); - if ( instantiator != null ) { - element = instantiator.apply( modelElement ); - loadedElements.put( modelElement, element ); - return (T) element; - } - - // No generic instantiator could be found. This means the element is an entity instance - if ( !model.contains( targetType, RDF.type, (RDFNode) null ) ) { - throw new AspectLoadingException( "Could not load " + modelElement + ": Unknown type " + targetType ); - } - final Entity entity = create( Entity.class, targetType ); - if ( entity == null ) { - throw new AspectLoadingException( "Could not load " + modelElement + ": Expected " + targetType + " to be an Entity" ); - } - return (T) new EntityInstanceInstantiator( this, entity ).apply( modelElement ); - } - - public QuantityKind findOrCreateQuantityKind( final Resource quantityKindResource ) { - final Optional predefinedQuantityKind = QuantityKinds.fromName( quantityKindResource.getLocalName() ); - return predefinedQuantityKind.orElseGet( () -> new DefaultQuantityKind( - MetaModelBaseAttributes.fromModelElement( metaModelVersion, quantityKindResource, model, samm ), - attributeValue( quantityKindResource, samm.preferredName() ).getLiteral().getLexicalForm() ) ); - } - - public Unit findOrCreateUnit( final Resource unitResource ) { - if ( unit.getNamespace().equals( unitResource.getNameSpace() ) ) { - final AspectModelUrn unitUrn = AspectModelUrn.fromUrn( unitResource.getURI() ); - return Units.fromName( unitUrn.getName() ).orElseThrow( () -> - new AspectLoadingException( "Unit definition for " + unitUrn + " is invalid" ) ); - } - - final Set quantityKinds = Streams.stream( model.listStatements( unitResource, samm.quantityKind(), (RDFNode) null ) ) - .map( quantityKindStatement -> findOrCreateQuantityKind( quantityKindStatement.getObject().asResource() ) ) - .collect( Collectors.toSet() ); - return new DefaultUnit( - MetaModelBaseAttributes.fromModelElement( metaModelVersion, unitResource, model, samm ), - optionalAttributeValue( unitResource, samm.symbol() ).map( Statement::getString ), - optionalAttributeValue( unitResource, samm.commonCode() ).map( Statement::getString ), - optionalAttributeValue( unitResource, samm.referenceUnit() ).map( Statement::getResource ).map( Resource::getLocalName ), - optionalAttributeValue( unitResource, samm.conversionFactor() ).map( Statement::getString ), - quantityKinds ); - } - - private Resource resourceType( final Resource resource ) { - final Supplier> directType = () -> - optionalAttributeValue( resource, RDF.type ).map( Statement::getResource ); - final Supplier> propertyUsageType = () -> - optionalAttributeValue( resource, samm.property() ).map( statement -> resourceType( statement.getResource() ) ); - final Supplier> subClassType = () -> - optionalAttributeValue( resource, RDFS.subClassOf ).map( Statement::getResource ).map( this::resourceType ); - final Supplier> extendsType = () -> - optionalAttributeValue( resource, samm._extends() ).map( Statement::getResource ).map( this::resourceType ); - - return Stream.of( directType, propertyUsageType, subClassType, extendsType ) - .map( Supplier::get ) - .filter( Optional::isPresent ) - .map( Optional::get ) - .findFirst() - .orElseThrow( () -> new AspectLoadingException( "Resource " + resource + " has no type" ) ); - } - - protected KnownVersion getMetaModelVersion() { - return metaModelVersion; - } - - protected Model getModel() { - return model; - } - - protected SAMM getSamm() { - return samm; - } - - protected SAMMC getSammc() { - return sammc; - } - - public UNIT getUnit() { - return unit; - } - - public List getExtendingElements( final List extendingElements ) { - return extendingElements.stream().map( urn -> getModel().createResource( urn.toString() ) ) - .map( loadedElements::get ) - .filter( Objects::nonNull ) - .map( modelElement -> (ComplexType) modelElement ) - .collect( Collectors.toList() ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AbstractAspectModelInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AbstractAspectModelInstantiatorTest.java new file mode 100644 index 000000000..4c17e6bce --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AbstractAspectModelInstantiatorTest.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Locale; + +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.test.TestAspect; +import org.eclipse.esmf.test.TestResources; + +public abstract class AbstractAspectModelInstantiatorTest { + Aspect loadAspect( final TestAspect aspectName ) { + return TestResources.load( aspectName ).aspect(); + } + + void assertBaseAttributes( final ModelElement base, final AspectModelUrn expectedAspectModelUrn, final String expectedName, + final String expectedPreferredName, final String expectedDescription, final String... expectedSee ) { + assertThat( base.getName() ).isEqualTo( expectedName ); + assertThat( base.urn() ).isEqualTo( expectedAspectModelUrn ); + assertBaseAttributes( base, expectedPreferredName, expectedDescription, expectedSee ); + } + + void assertBaseAttributes( final ModelElement base, final String expectedPreferredName, final String expectedDescription, + final String... expectedSee ) { + if ( expectedPreferredName != null ) { + assertThat( base.getPreferredName( Locale.ENGLISH ) ).isEqualTo( expectedPreferredName ); + } + if ( expectedDescription != null ) { + assertThat( base.getDescription( Locale.ENGLISH ) ).isEqualTo( expectedDescription ); + } + assertThat( base.getSee() ).containsOnly( expectedSee ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectMetaModelInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelInstantiatorTest.java similarity index 75% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectMetaModelInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelInstantiatorTest.java index 87c1c09f3..483e9e558 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectMetaModelInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; @@ -21,9 +21,6 @@ import java.util.Optional; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.SingleEntity; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.ComplexType; @@ -31,39 +28,37 @@ import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; import org.eclipse.esmf.metamodel.impl.DefaultEntity; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; import org.apache.jena.vocabulary.XSD; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; -public class AspectMetaModelInstantiatorTest extends MetaModelInstantiatorTest { +public class AspectModelInstantiatorTest extends AbstractAspectModelInstantiatorTest { @ParameterizedTest @EnumSource( value = TestAspect.class ) public void testLoadAspectExpectSuccess( final TestAspect aspect ) { - assertThatCode( () -> - loadAspect( aspect, KnownVersion.getLatest() ) - ).doesNotThrowAnyException(); + assertThatCode( () -> loadAspect( aspect ) ).doesNotThrowAnyException(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectTransformationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SEE, metaModelVersion ); + @Test + public void testAspectTransformationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SEE ); final AspectModelUrn expectedAspectModelUrn = TestAspect.ASPECT_WITH_SEE.getUrn(); assertBaseAttributes( aspect, expectedAspectModelUrn, "AspectWithSee", "Test Aspect With See", "This is a test description", "http://example.com/" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testPropertyInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testPropertyInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "testProperty" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_PROPERTY, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_PROPERTY ); assertThat( aspect.getProperties() ).hasSize( 1 ); assertThat( aspect.isCollectionAspect() ).isFalse(); @@ -79,11 +74,10 @@ public void testPropertyInstantiationExpectSuccess( final KnownVersion metaModel assertThat( property.getDataType().get() ).isInstanceOf( Scalar.class ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testOptionalPropertyInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testOptionalPropertyInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "testProperty" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_OPTIONAL_PROPERTY, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_OPTIONAL_PROPERTY ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -99,11 +93,10 @@ public void testOptionalPropertyInstantiationExpectSuccess( final KnownVersion m assertThat( property.getCharacteristic().get().getName() ).isEqualTo( "Text" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testNotInPayloadPropertyInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testNotInPayloadPropertyInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "description" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES ); final Property entityEnumProperty = aspect.getProperties().get( 0 ); final Entity entity = (Entity) entityEnumProperty.getDataType().get(); @@ -118,11 +111,10 @@ public void testNotInPayloadPropertyInstantiationExpectSuccess( final KnownVersi assertThat( property.getCharacteristic().get().getName() ).isEqualTo( "Text" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testPropertyWithPayloadNameInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testPropertyWithPayloadNameInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "testProperty" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -138,11 +130,10 @@ public void testPropertyWithPayloadNameInstantiationExpectSuccess( final KnownVe assertThat( property.getCharacteristic().get().getName() ).isEqualTo( "Text" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEitherCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testEitherCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestEither" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_EITHER, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_EITHER ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -156,11 +147,10 @@ public void testEitherCharacteristicInstantiationExpectSuccess( final KnownVersi assertThat( either.getRight().getName() ).isEqualTo( "Boolean" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testSingleEntityCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testSingleEntityCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "EntityCharacteristic" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -172,11 +162,10 @@ public void testSingleEntityCharacteristicInstantiationExpectSuccess( final Know assertThat( singleEntity.getDataType().get() ).isInstanceOf( Entity.class ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testAbstractEntityInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testAbstractEntityInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "AbstractTestEntity" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -189,27 +178,25 @@ public void testAbstractEntityInstantiationExpectSuccess( final KnownVersion met assertThat( extendingElements.get( 0 ) ).isEqualTo( entity ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testCollectionWithAbstractEntityInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testCollectionWithAbstractEntityInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "AbstractTestEntity" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY ); assertThat( aspect.getProperties() ).hasSize( 1 ); final AbstractEntity abstractEntity = (AbstractEntity) aspect.getProperties().get( 0 ).getCharacteristic().get().getDataType().get(); assertThat( abstractEntity.getExtends() ).isEmpty(); - assertBaseAttributes( abstractEntity, expectedAspectModelUrn, "AbstractTestEntity", "AbstractTestEntity", + assertBaseAttributes( abstractEntity, expectedAspectModelUrn, "AbstractTestEntity", null, "This is an abstract test entity" ); final List extendingElements = abstractEntity.getExtendingElements(); assertThat( extendingElements ).hasSize( 1 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCodeCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testCodeCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestCode" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_CODE, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_CODE ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -222,10 +209,9 @@ public void testCodeCharacteristicInstantiationExpectSuccess( final KnownVersion assertThat( scalar.getUrn() ).isEqualTo( XSD.xint.getURI() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCollectionAspectInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST, metaModelVersion ); + @Test + public void testCollectionAspectInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST ); final AspectModelUrn expectedAspectModelUrn = TestAspect.ASPECT_WITH_LIST.getUrn(); assertBaseAttributes( aspect, expectedAspectModelUrn, "AspectWithList", "Test Aspect", @@ -236,10 +222,9 @@ public void testCollectionAspectInstantiationExpectSuccess( final KnownVersion m assertThat( aspect.isCollectionAspect() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithTwoCollectionsInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_TWO_LISTS, metaModelVersion ); + @Test + public void testAspectWithTwoCollectionsInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_TWO_LISTS ); final AspectModelUrn expectedAspectModelUrn = TestAspect.ASPECT_WITH_TWO_LISTS.getUrn(); @@ -251,10 +236,9 @@ public void testAspectWithTwoCollectionsInstantiationExpectSuccess( final KnownV assertThat( aspect.isCollectionAspect() ).isFalse(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithListAndAdditionalPropertyInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST_AND_ADDITIONAL_PROPERTY, metaModelVersion ); + @Test + public void testAspectWithListAndAdditionalPropertyInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST_AND_ADDITIONAL_PROPERTY ); final AspectModelUrn expectedAspectModelUrn = TestAspect.ASPECT_WITH_LIST_AND_ADDITIONAL_PROPERTY.getUrn(); @@ -265,10 +249,9 @@ public void testAspectWithListAndAdditionalPropertyInstantiationExpectSuccess( f assertThat( aspect.isCollectionAspect() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithRecursivePropertyWithOptional( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL, metaModelVersion ); + @Test + public void testAspectWithRecursivePropertyWithOptional() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL ); assertThat( aspect.getProperties().size() ).isEqualTo( 1 ); final Property firstProperty = aspect.getProperties().get( 0 ); final Property secondProperty = ((DefaultEntity) firstProperty.getCharacteristic().get().getDataType().get()).getProperties() @@ -277,37 +260,31 @@ public void testAspectWithRecursivePropertyWithOptional( final KnownVersion meta .get( 0 ); assertThat( firstProperty ).isNotEqualTo( secondProperty ); assertThat( secondProperty ).isEqualTo( thirdProperty ); - assertThat( firstProperty.getCharacteristic() ).isEqualTo( secondProperty.getCharacteristic() ); - assertThat( secondProperty.getCharacteristic() ).isEqualTo( thirdProperty.getCharacteristic() ); + assertThat( firstProperty.getCharacteristic().get().urn() ).isEqualTo( secondProperty.getCharacteristic().get().urn() ); + assertThat( secondProperty.getCharacteristic().get().urn() ).isEqualTo( thirdProperty.getCharacteristic().get().urn() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesFactoryMethod( final KnownVersion metaModelVersion ) { + @Test + public void testMetaModelBaseAttributesFactoryMethod() { final AspectModelUrn urn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.samm:1.0.0#TestAspect" ); - final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.from( metaModelVersion, urn, "someName" ); - - assertThat( baseAttributes.getUrn() ).contains( urn ); - assertThat( baseAttributes.getName() ).isEqualTo( "someName" ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder().withUrn( urn ).build(); + assertThat( baseAttributes.urn() ).isEqualTo( urn ); assertThat( baseAttributes.getPreferredNames() ).isEmpty(); assertThat( baseAttributes.getDescriptions() ).isEmpty(); assertThat( baseAttributes.getSee() ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesBuilder( final KnownVersion metaModelVersion ) { + @Test + public void testMetaModelBaseAttributesBuilder() { final AspectModelUrn urn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.samm:1.0.0#TestAspect" ); - final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builderFor( "someName" ) - .withMetaModelVersion( metaModelVersion ) + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() .withUrn( urn ) .withDescription( Locale.ENGLISH, "description" ) .withPreferredName( Locale.ENGLISH, "preferredName" ) .withSee( "see1" ).withSee( "see2" ) .build(); - assertThat( baseAttributes.getUrn() ).contains( urn ); - assertThat( baseAttributes.getName() ).isEqualTo( "someName" ); + assertThat( baseAttributes.urn() ).isEqualTo( urn ); assertThat( baseAttributes.getPreferredNames() ).hasSize( 1 ) .allMatch( preferredName -> preferredName.getLanguageTag().equals( Locale.ENGLISH ) ); assertThat( baseAttributes.getDescriptions() ).hasSize( 1 ) diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoaderTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoaderTest.java new file mode 100644 index 000000000..5ebe7306e --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/AspectModelLoaderTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.loader; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.eclipse.esmf.metamodel.AbstractEntity; +import org.eclipse.esmf.metamodel.ComplexType; +import org.eclipse.esmf.test.TestAspect; +import org.eclipse.esmf.test.TestResources; + +import org.junit.jupiter.api.Test; + +class AspectModelLoaderTest { + @Test + public void testOfAbstractEntityCyclomaticCreation() { + final Map entities = + TestResources.load( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_SAME_EXTEND ).elements().stream() + .filter( ComplexType.class::isInstance ) + .map( ComplexType.class::cast ) + .collect( Collectors.toMap( ComplexType::getName, Function.identity() ) ); + + assertThat( entities ).extracting( "AbstractTestEntity" ).isInstanceOf( AbstractEntity.class ); + final AbstractEntity abstractEntity = (AbstractEntity) entities.get( "AbstractTestEntity" ); + assertThat( entities ).extracting( "testEntityOne" ).isInstanceOfSatisfying( ComplexType.class, type -> + assertThat( type ).extracting( ComplexType::getExtends ).extracting( Optional::get ).isSameAs( abstractEntity ) ); + assertThat( entities ).extracting( "testEntityTwo" ).isInstanceOfSatisfying( ComplexType.class, type -> + assertThat( type ).extracting( ComplexType::getExtends ).extracting( Optional::get ).isSameAs( abstractEntity ) ); + } +} \ No newline at end of file diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/BlankNodeInstantiationTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/BlankNodeInstantiationTest.java similarity index 56% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/BlankNodeInstantiationTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/BlankNodeInstantiationTest.java index acd94efed..96939131f 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/BlankNodeInstantiationTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/BlankNodeInstantiationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,28 +11,25 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; -import org.eclipse.esmf.characteristic.List; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.List; import org.eclipse.esmf.test.TestAspect; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class BlankNodeInstantiationTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testBlankNodeInstantiationAndSyntheticNameCalculation( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.MODEL_WITH_BLANK_AND_ADDITIONAL_NODES, metaModelVersion ); +public class BlankNodeInstantiationTest extends AbstractAspectModelInstantiatorTest { + @Test + void testBlankNodeInstantiation() { + final Aspect aspect = loadAspect( TestAspect.MODEL_WITH_BLANK_AND_ADDITIONAL_NODES ); assertThat( aspect.getProperties() ).hasSize( 1 ); final List list = (List) aspect.getProperties().get( 0 ).getCharacteristic().get(); final Characteristic characteristic = list.getElementCharacteristic().get(); - assertThat( characteristic.getName() ).isEqualTo( "NumberListTrait" ); + assertThat( characteristic.isAnonymous() ).isTrue(); + assertThat( characteristic.getName() ).startsWith( "x" ); } } diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/CollectionInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/CollectionInstantiatorTest.java similarity index 79% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/CollectionInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/CollectionInstantiatorTest.java index ca6e8e3ea..6510301cb 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/CollectionInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/CollectionInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,37 +11,33 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.List; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.TimeSeries; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Scalar; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.List; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; import org.apache.jena.vocabulary.XSD; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class CollectionInstantiatorTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCollectionCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { +public class CollectionInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testCollectionCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestCollection" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -58,11 +54,10 @@ public void testCollectionCharacteristicInstantiationExpectSuccess( final KnownV assertThat( collection.getElementCharacteristic() ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCollectionCharacteristicWithEntityDataTypeExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testCollectionCharacteristicWithEntityDataTypeExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestCollection" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_COLLECTION, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_COLLECTION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -77,11 +72,10 @@ public void testCollectionCharacteristicWithEntityDataTypeExpectSuccess( final K assertThat( collection.isOrdered() ).isFalse(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testListCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testListCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestList" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -97,11 +91,10 @@ public void testListCharacteristicInstantiationExpectSuccess( final KnownVersion assertThat( list.isOrdered() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testSetCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testSetCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestSet" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SET, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SET ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -117,11 +110,10 @@ public void testSetCharacteristicInstantiationExpectSuccess( final KnownVersion assertThat( set.isOrdered() ).isFalse(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testSortedSetCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testSortedSetCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestSortedSet" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SORTED_SET, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_SORTED_SET ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -137,11 +129,10 @@ public void testSortedSetCharacteristicInstantiationExpectSuccess( final KnownVe assertThat( sortedSet.isOrdered() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testTimeSeriesInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testTimeSeriesInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestTimeSeries" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_TIME_SERIES, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_TIME_SERIES ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -156,11 +147,10 @@ public void testTimeSeriesInstantiationExpectSuccess( final KnownVersion metaMod assertThat( timeSeries.isOrdered() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCollectionInstantiationWithElementCharacteristicExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testCollectionInstantiationWithElementCharacteristicExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestCollection" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ELEMENT_CHARACTERISTIC, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ELEMENT_CHARACTERISTIC ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Collection collection = (Collection) aspect.getProperties().get( 0 ).getCharacteristic().get(); @@ -178,11 +168,10 @@ public void testCollectionInstantiationWithElementCharacteristicExpectSuccess( f assertThat( elementCharacteristic ).isExactlyInstanceOf( DefaultCharacteristic.class ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testCollectionInstantiationWithElementConstraintExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testCollectionInstantiationWithElementConstraintExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestCollection" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ELEMENT_CONSTRAINT, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION_WITH_ELEMENT_CONSTRAINT ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Collection collection = (Collection) aspect.getProperties().get( 0 ).getCharacteristic().get(); diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/ConstraintInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/ConstraintInstantiatorTest.java similarity index 73% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/ConstraintInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/ConstraintInstantiatorTest.java index fa820a6ce..5a5c3a3b0 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/ConstraintInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/ConstraintInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; @@ -19,24 +19,20 @@ import java.nio.charset.StandardCharsets; import java.util.Locale; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; import org.eclipse.esmf.test.TestAspect; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class ConstraintInstantiatorTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testLanguageConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LANGUAGE_CONSTRAINT, metaModelVersion ); +public class ConstraintInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testLanguageConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LANGUAGE_CONSTRAINT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -51,10 +47,9 @@ public void testLanguageConstraintInstantiationExpectSuccess( final KnownVersion assertThat( languageConstraint.getLanguageCode() ).isEqualTo( Locale.forLanguageTag( "de" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEncodingConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENCODING_CONSTRAINT, metaModelVersion ); + @Test + public void testEncodingConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENCODING_CONSTRAINT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -69,10 +64,9 @@ public void testEncodingConstraintInstantiationExpectSuccess( final KnownVersion assertThat( encodingConstraint.getValue() ).isEqualTo( StandardCharsets.UTF_8 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testLengthConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LENGTH_CONSTRAINT, metaModelVersion ); + @Test + public void testLengthConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LENGTH_CONSTRAINT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -90,10 +84,9 @@ public void testLengthConstraintInstantiationExpectSuccess( final KnownVersion m assertThat( lengthConstraint.getMinValue().get() ).isEqualTo( new BigInteger( "5" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRegularExpressionConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_REGULAR_EXPRESSION_CONSTRAINT, metaModelVersion ); + @Test + public void testRegularExpressionConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_REGULAR_EXPRESSION_CONSTRAINT ); assertThat( aspect.getProperties() ).hasSize( 1 ); diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/EnumerationInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/EnumerationInstantiatorTest.java similarity index 84% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/EnumerationInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/EnumerationInstantiatorTest.java index fdef0382d..8b939ee82 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/EnumerationInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/EnumerationInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; @@ -21,9 +21,6 @@ import java.util.stream.Collectors; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.impl.DefaultSet; -import org.eclipse.esmf.characteristic.impl.DefaultSingleEntity; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Entity; @@ -33,23 +30,22 @@ import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSingleEntity; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; import org.apache.jena.vocabulary.RDF; import org.apache.jena.vocabulary.XSD; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class EnumerationInstantiatorTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { +public class EnumerationInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testEnumerationCharacteristicInstantiationExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestEnumeration" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENUMERATION, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENUMERATION ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Enumeration enumeration = (Enumeration) aspect.getProperties().get( 0 ).getCharacteristic().get(); @@ -61,11 +57,10 @@ public void testEnumerationCharacteristicInstantiationExpectSuccess( final Known assertThat( enumeration.getValues() ).hasSize( 3 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicWithEntityDataTypeExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testEnumerationCharacteristicWithEntityDataTypeExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestEnumeration" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -82,12 +77,9 @@ public void testEnumerationCharacteristicWithEntityDataTypeExpectSuccess( final assertThat( entityValue ).isEqualTo( "This is a test." ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicWithEntityDataTypeWithOptionalAndNotInPayloadPropertiesExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_OPTIONAL_AND_NOT_IN_PAYLOAD_PROPERTIES, - metaModelVersion ); + @Test + public void testEnumerationCharacteristicWithEntityDataTypeWithOptionalAndNotInPayloadPropertiesExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_OPTIONAL_AND_NOT_IN_PAYLOAD_PROPERTIES ); final Enumeration enumeration = (Enumeration) aspect.getProperties().get( 0 ).getCharacteristic().get(); final Type dataType = enumeration.getDataType().get(); @@ -113,12 +105,11 @@ public void testEnumerationCharacteristicWithEntityDataTypeWithOptionalAndNotInP assertThat( notInPayloadEntityProperty.isNotInPayload() ).isTrue(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicWithListOfEntityDataTypeExpectSuccess( final KnownVersion metaModelVersion ) { + @Test + public void testEnumerationCharacteristicWithListOfEntityDataTypeExpectSuccess() { final AspectModelUrn expectedAspectModelUrn = AspectModelUrn .fromUrn( TestModel.TEST_NAMESPACE + "TestEnumeration" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST_ENTITY_ENUMERATION, metaModelVersion ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_LIST_ENTITY_ENUMERATION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -138,10 +129,9 @@ public void testEnumerationCharacteristicWithListOfEntityDataTypeExpectSuccess( assertThat( joined ).isEqualTo( "foo,bar,baz" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicWithNestedEntityAndNotInPayloadDataTypeExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_NESTED_ENTITY_ENUMERATION_WITH_NOT_IN_PAYLOAD, metaModelVersion ); + @Test + public void testEnumerationCharacteristicWithNestedEntityAndNotInPayloadDataTypeExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_NESTED_ENTITY_ENUMERATION_WITH_NOT_IN_PAYLOAD ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Enumeration enumeration = (Enumeration) aspect.getProperties().get( 0 ).getCharacteristic().get(); @@ -168,11 +158,9 @@ public void testEnumerationCharacteristicWithNestedEntityAndNotInPayloadDataType .toString() ).isEqualTo( "foo" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationCharacteristicWithNestedEntityListAndNotInPayloadDataTypeExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_NESTED_ENTITY_LIST_ENUMERATION_WITH_NOT_IN_PAYLOAD, metaModelVersion ); + @Test + public void testEnumerationCharacteristicWithNestedEntityListAndNotInPayloadDataTypeExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_NESTED_ENTITY_LIST_ENUMERATION_WITH_NOT_IN_PAYLOAD ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Enumeration enumeration = aspect.getProperties().get( 0 ).getCharacteristic().get().as( Enumeration.class ); @@ -202,10 +190,9 @@ public void testEnumerationCharacteristicWithNestedEntityListAndNotInPayloadData assertThat( nestedEntityInstance.getAssertions().get( nestedEntityProperty ).as( ScalarValue.class ).getValue() ).isEqualTo( "foo" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testEnumerationWithNestedEntityWithLangStringExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_LANG_STRING, metaModelVersion ); + @Test + public void testEnumerationWithNestedEntityWithLangStringExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_LANG_STRING ); assertThat( aspect.getProperties() ).hasSize( 1 ); final Enumeration enumeration = aspect.getProperties().get( 0 ).getCharacteristic().get().as( Enumeration.class ); diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/FixedPointConstraintInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/FixedPointConstraintInstantiatorTest.java similarity index 67% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/FixedPointConstraintInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/FixedPointConstraintInstantiatorTest.java index 0de8148e7..54a0990b2 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/FixedPointConstraintInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/FixedPointConstraintInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,25 +11,21 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.FixedPointConstraint; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; import org.eclipse.esmf.test.TestAspect; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class FixedPointConstraintInstantiatorTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testFixedPointConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_FIXED_POINT, metaModelVersion ); +public class FixedPointConstraintInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testFixedPointConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_FIXED_POINT ); final Trait trait = (Trait) aspect.getProperties().get( 0 ).getCharacteristic().get(); final FixedPointConstraint fixedPointConstraint = (FixedPointConstraint) trait.getConstraints().get( 0 ); diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/QuantifiableInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/QuantifiableInstantiatorTest.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/QuantifiableInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/QuantifiableInstantiatorTest.java index 60fc8ed55..d92ed82f4 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/QuantifiableInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/QuantifiableInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,44 +11,30 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Optional; -import java.util.Set; - import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.QuantityKinds; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.DefaultUnit; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; import org.apache.jena.vocabulary.XSD; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class QuantifiableInstantiatorTest extends MetaModelInstantiatorTest { +import org.junit.jupiter.api.Test; - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testQuantifiableCharacteristicWithUnitInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final AspectModelUrn expectedAspectModelUrn = AspectModelUrn - .fromUrn( TestModel.TEST_NAMESPACE + "TestQuantifiable" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_QUANTIFIABLE_AND_UNIT, metaModelVersion ); +public class QuantifiableInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testQuantifiableCharacteristicWithUnitInstantiationExpectSuccess() { + final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestQuantifiable" ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_QUANTIFIABLE_AND_UNIT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -67,13 +53,10 @@ public void testQuantifiableCharacteristicWithUnitInstantiationExpectSuccess( fi assertThat( unit.getQuantityKinds() ).contains( QuantityKinds.FREQUENCY ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testQuantifiableCharacteristicWithoutUnitInstantiationExpectSuccess( - final KnownVersion metaModelVersion ) { - final AspectModelUrn expectedAspectModelUrn = AspectModelUrn - .fromUrn( TestModel.TEST_NAMESPACE + "TestQuantifiable" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT, metaModelVersion ); + @Test + public void testQuantifiableCharacteristicWithoutUnitInstantiationExpectSuccess() { + final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestQuantifiable" ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -86,12 +69,10 @@ public void testQuantifiableCharacteristicWithoutUnitInstantiationExpectSuccess( assertThat( quantifiable.getUnit() ).isNotPresent(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMeasurementCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final AspectModelUrn expectedAspectModelUrn = AspectModelUrn - .fromUrn( TestModel.TEST_NAMESPACE + "TestMeasurement" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_MEASUREMENT, metaModelVersion ); + @Test + public void testMeasurementCharacteristicInstantiationExpectSuccess() { + final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestMeasurement" ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_MEASUREMENT ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -109,12 +90,10 @@ public void testMeasurementCharacteristicInstantiationExpectSuccess( final Known assertThat( unit.getQuantityKinds() ).hasSize( 6 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testDurationCharacteristicInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final AspectModelUrn expectedAspectModelUrn = AspectModelUrn - .fromUrn( TestModel.TEST_NAMESPACE + "TestDuration" ); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_DURATION, metaModelVersion ); + @Test + public void testDurationCharacteristicInstantiationExpectSuccess() { + final AspectModelUrn expectedAspectModelUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "TestDuration" ); + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_DURATION ); assertThat( aspect.getProperties() ).hasSize( 1 ); diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/RangeConstraintInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/RangeConstraintInstantiatorTest.java similarity index 72% rename from core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/RangeConstraintInstantiatorTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/RangeConstraintInstantiatorTest.java index f9bca0be0..5b81d2899 100644 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/RangeConstraintInstantiatorTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/loader/RangeConstraintInstantiatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -11,36 +11,29 @@ * SPDX-License-Identifier: MPL-2.0 */ -package org.eclipse.esmf.metamodel.loader; +package org.eclipse.esmf.aspectmodel.loader; import static org.assertj.core.api.Assertions.assertThat; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.RangeConstraint; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.BoundDefinition; +import org.eclipse.esmf.metamodel.ModelElement; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; import org.eclipse.esmf.test.TestAspect; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class RangeConstraintInstantiatorTest extends MetaModelInstantiatorTest { - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT, metaModelVersion ); +public class RangeConstraintInstantiatorTest extends AbstractAspectModelInstantiatorTest { + @Test + public void testRangeConstraintInstantiationExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT ); assertRangeConstraintWithMinAndMaxValue( aspect, BoundDefinition.AT_LEAST, BoundDefinition.AT_MOST ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationInclBoundDefinitionPropertiesExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_INCL_BOUND_DEFINITION_PROPERTIES, - metaModelVersion ); + @Test + public void testRangeConstraintInstantiationInclBoundDefinitionPropertiesExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_INCL_BOUND_DEFINITION_PROPERTIES ); assertRangeConstraintWithMinAndMaxValue( aspect, BoundDefinition.GREATER_THAN, BoundDefinition.LESS_THAN ); } @@ -60,12 +53,9 @@ private void assertRangeConstraintWithMinAndMaxValue( final Aspect aspect, assertThat( rangeConstraint.getUpperBoundDefinition() ).isEqualTo( boundDefinitionForUpperBound ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationWithOnlyLowerBoundInclBoundDefinitionExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( - TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND_INCL_BOUND_DEFINITION, metaModelVersion ); + @Test + public void testRangeConstraintInstantiationWithOnlyLowerBoundInclBoundDefinitionExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND_INCL_BOUND_DEFINITION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -81,12 +71,9 @@ public void testRangeConstraintInstantiationWithOnlyLowerBoundInclBoundDefinitio assertThat( rangeConstraint.getUpperBoundDefinition() ).isEqualTo( BoundDefinition.OPEN ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationWithOnlyUpperBoundInclBoundDefinitionExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( - TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND_INCL_BOUND_DEFINITION, metaModelVersion ); + @Test + public void testRangeConstraintInstantiationWithOnlyUpperBoundInclBoundDefinitionExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND_INCL_BOUND_DEFINITION ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -102,12 +89,9 @@ public void testRangeConstraintInstantiationWithOnlyUpperBoundInclBoundDefinitio assertThat( rangeConstraint.getUpperBoundDefinition() ).isEqualTo( BoundDefinition.LESS_THAN ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationWithOnlyLowerBoundDefinitionExpectSuccess( - final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND, - metaModelVersion ); + @Test + public void testRangeConstraintInstantiationWithOnlyLowerBoundDefinitionExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_LOWER_BOUND ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -123,11 +107,9 @@ public void testRangeConstraintInstantiationWithOnlyLowerBoundDefinitionExpectSu assertThat( rangeConstraint.getUpperBoundDefinition() ).isEqualTo( BoundDefinition.OPEN ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRangeConstraintInstantiationWithOnlyUpperBoundExpectSuccess( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND, - metaModelVersion ); + @Test + public void testRangeConstraintInstantiationWithOnlyUpperBoundExpectSuccess() { + final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_UPPER_BOUND ); assertThat( aspect.getProperties() ).hasSize( 1 ); @@ -143,7 +125,7 @@ public void testRangeConstraintInstantiationWithOnlyUpperBoundExpectSuccess( fin assertThat( rangeConstraint.getUpperBoundDefinition() ).isEqualTo( BoundDefinition.AT_MOST ); } - private void assertBaseAttributes( final NamedElement base ) { + private void assertBaseAttributes( final ModelElement base ) { assertBaseAttributes( base, "Test Range Constraint", "This is a test range constraint.", diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java new file mode 100644 index 000000000..909927c19 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.resolver; + +import static org.apache.jena.rdf.model.ResourceFactory.createResource; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import java.io.File; +import java.net.URISyntaxException; + +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; +import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.test.TestModel; + +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.junit.jupiter.api.Test; + +public class AspectModelResolverTest { + @Test + public void testLoadDataModelExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader() + .getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "Test" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + final Resource aspect = createResource( TestModel.TEST_NAMESPACE + "Test" ); + assertThat( result.mergedModel().listStatements( aspect, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testLoadLegacyBammModelWithoutPrefixesExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader() + .getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "BammAspectWithoutPrefixes" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + assertThat( result.mergedModel().listStatements( null, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testLoadLegacyBammModelExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader() + .getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( "urn:bamm:org.eclipse.esmf.test:2.0.0#BammTest" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + final Resource aspect = createResource( "urn:samm:org.eclipse.esmf.test:2.0.0#BammTest" ); + assertThat( result.mergedModel().listStatements( aspect, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testLoadModelWithVersionEqualToUnsupportedMetaModelVersionExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader() + .getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.test:1.1.0#Test" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + final Resource aspect = createResource( "urn:samm:org.eclipse.esmf.test:1.1.0#Test" ); + assertThat( result.mergedModel().listStatements( aspect, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testResolveReferencedModelFromMemoryExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader().getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + + final AspectModelUrn inputUrn = AspectModelUrn + .fromUrn( TestModel.TEST_NAMESPACE + "AnotherTest" ); + final Model model = TurtleLoader.loadTurtle( + AspectModelResolverTest.class.getResourceAsStream( + "/" + KnownVersion.getLatest().toString().toLowerCase() + + "/org.eclipse.esmf.test/1.0.0/Test.ttl" ) ).get(); + + final ResolutionStrategy inMemoryStrategy = new FromLoadedFileStrategy( AspectModelFileLoader.load( + AspectModelResolverTest.class.getResourceAsStream( + "/" + KnownVersion.getLatest().toString().toLowerCase() + + "/org.eclipse.esmf.test/1.0.0/Test.ttl" ) ) ); + final EitherStrategy inMemoryResolutionStrategy = new EitherStrategy( urnStrategy, inMemoryStrategy ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "AnotherTest" ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( inMemoryResolutionStrategy ).load( testUrn ); + final Resource aspect = createResource( testUrn.toString() ); + assertThat( result.mergedModel().listStatements( aspect, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testResolveReferencedModelExpectSuccess() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader().getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "AnotherTest" ); + assertThatCode( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + final Resource aspect = createResource( testUrn.toString() ); + assertThat( result.mergedModel().listStatements( aspect, RDF.type, SammNs.SAMM.Aspect() ).nextOptional() ).isNotEmpty(); + + final Resource propertyFromReferencedAspect = createResource( TestModel.TEST_NAMESPACE + "foo" ); + assertThat( result.mergedModel().listStatements( propertyFromReferencedAspect, RDF.type, SammNs.SAMM.Property() ) + .nextOptional() ).isNotEmpty(); + } ).doesNotThrowAnyException(); + } + + @Test + public void testResolutionMissingAspectExpectFailure() throws URISyntaxException { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader() + .getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "AnotherFailingTest" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatThrownBy( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + } ).isInstanceOf( ModelResolutionException.class ); + } + + @Test + public void testResolutionMissingModelElementExpectFailure() throws Throwable { + final File aspectModelsRootDirectory = new File( + AspectModelResolverTest.class.getClassLoader().getResource( KnownVersion.getLatest().toString().toLowerCase() ) + .toURI().getPath() ); + + final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TestModel.TEST_NAMESPACE + "FailingTest" ); + + final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); + assertThatThrownBy( () -> { + final AspectModel result = new AspectModelLoader( urnStrategy ).load( testUrn ); + } ).isInstanceOf( ModelResolutionException.class ); + } +} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java similarity index 79% rename from core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java index 401787f1d..ef74e768f 100644 --- a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/DataTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH * * See the AUTHORS file(s) distributed with this work for additional * information regarding authorship. @@ -25,7 +25,9 @@ import java.util.stream.Stream; import javax.xml.datatype.DatatypeConstants; -import org.eclipse.esmf.metamodel.datatypes.Curie; +import org.eclipse.esmf.metamodel.datatype.Curie; +import org.eclipse.esmf.metamodel.datatype.SammType; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import lombok.Value; import org.junit.jupiter.api.BeforeAll; @@ -35,7 +37,7 @@ public class DataTypeTest { @BeforeAll public static void setup() { - DataType.setupTypeMapping(); + SammXsdType.setupTypeMapping(); } @ParameterizedTest @@ -59,7 +61,7 @@ public void testSerialization( final TestConfiguration testConfiguration @MethodSource( value = "getTestConfigurationsWithLexicalErrors" ) public void testConfigurableParserChecks( final TestConfiguration testConfiguration ) { testConfiguration.predicates.keySet().forEach( testValue -> { - ExtendedXsdDataType.setChecking( false ); + SammXsdType.setChecking( false ); final Object parsedUntypedObject = testConfiguration.type.parse( testValue ); assertThat( parsedUntypedObject ).isEqualTo( testValue ); @@ -67,7 +69,7 @@ public void testConfigurableParserChecks( final TestConfiguration testCon assertThat( parseTyped ).isEmpty().as( "For datatype %s check invalid lexical value: %s", testConfiguration.type.getURI(), testValue ); - ExtendedXsdDataType.setChecking( true ); + SammXsdType.setChecking( true ); assertThatThrownBy( () -> testConfiguration.type.parse( testValue ) ) .isNotNull() .as( "For datatype %s untyped invalid lexical value %s throws exception", @@ -81,7 +83,7 @@ public void testConfigurableParserChecks( final TestConfiguration testCon @Value private static class TestConfiguration { - TypedRdfDatatype type; + SammType type; Map> predicates; @Override @@ -92,11 +94,11 @@ public String toString() { static Stream> getTestConfigurationsWithLexicalErrors() { return Stream.of( - new TestConfiguration<>( ExtendedXsdDataType.DOUBLE, Map.of( + new TestConfiguration<>( SammXsdType.DOUBLE, Map.of( "foo", v -> false ) ), - new TestConfiguration<>( ExtendedXsdDataType.FLOAT, Map.of( + new TestConfiguration<>( SammXsdType.FLOAT, Map.of( "foo", v -> false ) ) ); @@ -104,7 +106,7 @@ static Stream> getTestConfigurationsWithLexicalErrors() { static Stream> getValidTestConfigurations() { final Stream> extendedXsdTypes = Stream.of( - new TestConfiguration<>( ExtendedXsdDataType.BOOLEAN, Map.of( + new TestConfiguration<>( SammXsdType.BOOLEAN, Map.of( "true", v -> v, "false", v -> !v, "TRUE", v -> v, @@ -113,13 +115,13 @@ static Stream> getValidTestConfigurations() { "False", v -> !v ) ), - new TestConfiguration<>( ExtendedXsdDataType.DECIMAL, Map.of( + new TestConfiguration<>( SammXsdType.DECIMAL, Map.of( "-1.23", v -> v.equals( new BigDecimal( "-1.23" ) ), "126789672374892739424.543233", v -> v.equals( new BigDecimal( "126789672374892739424.543233" ) ), "+100000.00", v -> v.equals( new BigDecimal( "100000.00" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.INTEGER, Map.of( + new TestConfiguration<>( SammXsdType.INTEGER, Map.of( "-1", v -> v.equals( new BigInteger( "-1" ) ), "0", v -> v.equals( BigInteger.ZERO ), "126789675432332938792837429837429837429", @@ -127,7 +129,7 @@ static Stream> getValidTestConfigurations() { "+10000", v -> v.equals( new BigInteger( "10000" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.DOUBLE, Map.of( + new TestConfiguration<>( SammXsdType.DOUBLE, Map.of( "-1.0", v -> v.equals( -1.0d ), "+0.0", v -> v.equals( 0.0d ), "-0.0", v -> v.equals( -0.0d ), @@ -137,7 +139,7 @@ static Stream> getValidTestConfigurations() { "NaN", v -> v.equals( Double.NaN ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.FLOAT, Map.of( + new TestConfiguration<>( SammXsdType.FLOAT, Map.of( "-1.0", v -> v.equals( -1.0f ), "+0.0", v -> v.equals( 0.0f ), "-0.0", v -> v.equals( -0.0f ), @@ -147,7 +149,7 @@ static Stream> getValidTestConfigurations() { "NaN", v -> v.equals( Float.NaN ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.DATE, Map.of( + new TestConfiguration<>( SammXsdType.DATE, Map.of( "2000-01-01", v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getDay() == 1, "2000-01-01Z", v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getDay() == 1 && v.getTimezone() != DatatypeConstants.FIELD_UNDEFINED, @@ -155,7 +157,7 @@ static Stream> getValidTestConfigurations() { v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getDay() == 1 && v.getTimezone() == 12 * 60 + 5 ) ), - new TestConfiguration<>( ExtendedXsdDataType.TIME, Map.of( + new TestConfiguration<>( SammXsdType.TIME, Map.of( "14:23:00", v -> v.getHour() == 14 && v.getMinute() == 23 && v.getSecond() == 0, "14:23:00.527634Z", v -> v.getHour() == 14 && v.getMinute() == 23 && v.getSecond() == 0 && v.getFractionalSecond().equals( @@ -163,7 +165,7 @@ static Stream> getValidTestConfigurations() { "14:23:00+03:00", v -> v.getHour() == 14 && v.getMinute() == 23 && v.getSecond() == 0 ) ), - new TestConfiguration<>( ExtendedXsdDataType.DATE_TIME, Map.of( + new TestConfiguration<>( SammXsdType.DATE_TIME, Map.of( "2000-01-01T14:23:00", v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getDay() == 1 && v.getHour() == 14 && v.getMinute() == 23 && v.getSecond() == 0, @@ -173,140 +175,140 @@ static Stream> getValidTestConfigurations() { && v.getFractionalSecond().equals( new BigDecimal( "0.66372" ) ) && v.getTimezone() == 14 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.DATE_TIME_STAMP, Map.of( + new TestConfiguration<>( SammXsdType.DATE_TIME_STAMP, Map.of( "2000-01-01T14:23:00.66372+14:00", v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getDay() == 1 && v.getHour() == 14 && v.getMinute() == 23 && v.getSecond() == 0 && v.getFractionalSecond().equals( new BigDecimal( "0.66372" ) ) && v.getTimezone() == 14 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.G_YEAR, Map.of( + new TestConfiguration<>( SammXsdType.G_YEAR, Map.of( "2000", v -> v.getYear() == 2000, "2000+03:00", v -> v.getYear() == 2000 && v.getTimezone() == 3 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.G_MONTH, Map.of( + new TestConfiguration<>( SammXsdType.G_MONTH, Map.of( "--04", v -> v.getMonth() == 4, "--04+03:00", v -> v.getMonth() == 4 && v.getTimezone() == 3 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.G_DAY, Map.of( + new TestConfiguration<>( SammXsdType.G_DAY, Map.of( "---04", v -> v.getDay() == 4, "---04+03:00", v -> v.getDay() == 4 && v.getTimezone() == 3 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.G_YEAR_MONTH, Map.of( + new TestConfiguration<>( SammXsdType.G_YEAR_MONTH, Map.of( "2000-01", v -> v.getYear() == 2000 && v.getMonth() == 1, "2000-01+03:00", v -> v.getYear() == 2000 && v.getMonth() == 1 && v.getTimezone() == 3 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.G_MONTH_DAY, Map.of( + new TestConfiguration<>( SammXsdType.G_MONTH_DAY, Map.of( "--01-01", v -> v.getMonth() == 1 && v.getDay() == 1, "--01-01+03:00", v -> v.getMonth() == 1 && v.getDay() == 1 && v.getTimezone() == 3 * 60 ) ), - new TestConfiguration<>( ExtendedXsdDataType.DURATION, Map.of( + new TestConfiguration<>( SammXsdType.DURATION, Map.of( "P30D", v -> v.getDays() == 30, "-P1Y2M3DT1H", v -> v.getYears() == 1 && v.getMonths() == 2 && v.getDays() == 3 && v.getHours() == 1 && v.getSign() == -1, "PT1H5M0S", v -> v.getHours() == 1 && v.getMinutes() == 5 && v.getSeconds() == 0 ) ), - new TestConfiguration<>( ExtendedXsdDataType.YEAR_MONTH_DURATION, Map.of( + new TestConfiguration<>( SammXsdType.YEAR_MONTH_DURATION, Map.of( "P10M", v -> v.getMonths() == 10, "P5Y2M", v -> v.getYears() == 5 && v.getMonths() == 2 ) ), - new TestConfiguration<>( ExtendedXsdDataType.DAY_TIME_DURATION, Map.of( + new TestConfiguration<>( SammXsdType.DAY_TIME_DURATION, Map.of( "P30D", v -> v.getDays() == 30, "P1DT5H", v -> v.getDays() == 1 && v.getHours() == 5, "PT1H5M0S", v -> v.getHours() == 1 && v.getMinutes() == 5 && v.getSeconds() == 0 ) ), - new TestConfiguration<>( ExtendedXsdDataType.BYTE, Map.of( + new TestConfiguration<>( SammXsdType.BYTE, Map.of( "-1", v -> v == -1, "0", v -> v == 0, "127", v -> v == 127 ) ), - new TestConfiguration<>( ExtendedXsdDataType.SHORT, Map.of( + new TestConfiguration<>( SammXsdType.SHORT, Map.of( "-1", v -> v == -1, "0", v -> v == 0, "32767", v -> v == 32767 ) ), - new TestConfiguration<>( ExtendedXsdDataType.INT, Map.of( + new TestConfiguration<>( SammXsdType.INT, Map.of( "-1", v -> v == -1, "0", v -> v == 0, "2147483647", v -> v == 2147483647 ) ), - new TestConfiguration<>( ExtendedXsdDataType.LONG, Map.of( + new TestConfiguration<>( SammXsdType.LONG, Map.of( "-1", v -> v == -1, "0", v -> v == 0, "9223372036854775807", v -> v == 9223372036854775807L ) ), - new TestConfiguration<>( ExtendedXsdDataType.UNSIGNED_BYTE, Map.of( + new TestConfiguration<>( SammXsdType.UNSIGNED_BYTE, Map.of( "0", v -> v == 0, "1", v -> v == 1, "255", v -> v == 255 ) ), - new TestConfiguration<>( ExtendedXsdDataType.UNSIGNED_SHORT, Map.of( + new TestConfiguration<>( SammXsdType.UNSIGNED_SHORT, Map.of( "0", v -> v == 0, "1", v -> v == 1, "65535", v -> v == 65535 ) ), - new TestConfiguration<>( ExtendedXsdDataType.UNSIGNED_INT, Map.of( + new TestConfiguration<>( SammXsdType.UNSIGNED_INT, Map.of( "0", v -> v == 0, "1", v -> v == 1, "4294967295", v -> v == 4294967295L ) ), - new TestConfiguration<>( ExtendedXsdDataType.UNSIGNED_LONG, Map.of( + new TestConfiguration<>( SammXsdType.UNSIGNED_LONG, Map.of( "0", v -> v.equals( BigInteger.ZERO ), "1", v -> v.equals( BigInteger.ONE ), "18446744073709551615", v -> v.equals( new BigInteger( "18446744073709551615" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.POSITIVE_INTEGER, Map.of( + new TestConfiguration<>( SammXsdType.POSITIVE_INTEGER, Map.of( "1", v -> v.equals( BigInteger.ONE ), "7345683746578364857368475638745", v -> v.equals( new BigInteger( "7345683746578364857368475638745" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.NON_NEGATIVE_INTEGER, Map.of( + new TestConfiguration<>( SammXsdType.NON_NEGATIVE_INTEGER, Map.of( "0", v -> v.equals( BigInteger.ZERO ), "1", v -> v.equals( BigInteger.ONE ), "7345683746578364857368475638745", v -> v.equals( new BigInteger( "7345683746578364857368475638745" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.NEGATIVE_INTEGER, Map.of( + new TestConfiguration<>( SammXsdType.NEGATIVE_INTEGER, Map.of( "-1", v -> v.equals( new BigInteger( "-1" ) ), "-23487263847628376482736487263847", v -> v.equals( new BigInteger( "-23487263847628376482736487263847" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.NON_POSITIVE_INTEGER, Map.of( + new TestConfiguration<>( SammXsdType.NON_POSITIVE_INTEGER, Map.of( "-1", v -> v.equals( new BigInteger( "-1" ) ), "0", v -> v.equals( BigInteger.ZERO ), "-93845837498573987498798987394", v -> v.equals( new BigInteger( "-93845837498573987498798987394" ) ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.HEX_BINARY, Map.of( + new TestConfiguration<>( SammXsdType.HEX_BINARY, Map.of( "5468697320697320612074657374", v -> new String( v, StandardCharsets.US_ASCII ).equals( "This is a test" ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.BASE64_BINARY, Map.of( + new TestConfiguration<>( SammXsdType.BASE64_BINARY, Map.of( "VGhpcyBpcyBhIHRlc3Q=", v -> new String( v, StandardCharsets.US_ASCII ).equals( "This is a test" ) ) ), - new TestConfiguration<>( ExtendedXsdDataType.ANY_URI, Map.of( + new TestConfiguration<>( SammXsdType.ANY_URI, Map.of( "http://example.org/", v -> v.toString().equals( "http://example.org/" ), "urn:samm:org.eclipse.esmf.samm:Errors:1.0.0#errorState", v -> v.toString() @@ -315,13 +317,13 @@ static Stream> getValidTestConfigurations() { ); final Stream> curieTypes = - DataType.getAllSupportedTypes().stream() + SammXsdType.ALL_TYPES.stream() .filter( dataType -> dataType.getJavaClass() != null && dataType.getJavaClass().equals( Curie.class ) ) - .map( dataType -> (TypedRdfDatatype) dataType ) + .map( dataType -> (SammType) dataType ) .map( curieType -> new TestConfiguration<>( curieType, Map.of( - "xsd:string", v -> ((Curie) v).getValue().equals( "xsd:string" ), - "unit:hectopascal", v -> ((Curie) v).getValue().equals( "unit:hectopascal" ) + "xsd:string", v -> ((Curie) v).value().equals( "xsd:string" ), + "unit:hectopascal", v -> ((Curie) v).value().equals( "unit:hectopascal" ) ) ) ); return Stream.concat( extendedXsdTypes, curieTypes ); diff --git a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoaderTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoaderTest.java similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoaderTest.java rename to core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/TurtleLoaderTest.java diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitorTest.java new file mode 100644 index 000000000..8cc42e9e0 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/aspectmodel/visitor/AspectStreamTraversalVisitorTest.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.aspectmodel.visitor; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.test.TestAspect; +import org.eclipse.esmf.test.TestResources; + +import com.google.common.collect.Streams; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +public class AspectStreamTraversalVisitorTest { + @ParameterizedTest + @EnumSource( value = TestAspect.class ) + public void testLoadAspectExpectSuccess( final TestAspect testAspect ) { + final AspectModel aspectModel = TestResources.load( testAspect ); + assertThat( aspectModel.files() ).hasSize( 1 ); + final AspectModelFile file = aspectModel.files().iterator().next(); + final Model model = file.sourceModel(); + assertThat( file.aspects() ).hasSize( 1 ); + final Aspect aspect = file.aspects().iterator().next(); + + final Set modelElementUris = Streams.stream( model.listStatements( null, RDF.type, (RDFNode) null ) ) + .map( Statement::getSubject ) + .filter( RDFNode::isURIResource ) + .map( RDFNode::asResource ) + .map( Resource::getURI ) + .collect( Collectors.toSet() ); + + final Set urisFromVisitor = aspect.accept( new AspectStreamTraversalVisitor(), null ) + .flatMap( modelElement -> modelElement.isAnonymous() ? Stream.empty() : Stream.of( modelElement.urn() ) ) + .filter( urn -> !urn.isSammUrn() ) + .map( AspectModelUrn::toString ) + .collect( Collectors.toSet() ); + + assertThat( modelElementUris ).containsAll( urisFromVisitor ); + } +} diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectModelLoaderTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectModelLoaderTest.java deleted file mode 100644 index 6d3011aed..000000000 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/AspectModelLoaderTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.loader; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.function.Function; -import java.util.stream.Collectors; - -import org.eclipse.esmf.metamodel.AbstractEntity; -import org.eclipse.esmf.metamodel.ComplexType; -import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; -import org.eclipse.esmf.test.TestAspect; -import org.eclipse.esmf.test.TestResources; - -import io.vavr.control.Try; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; - -class AspectModelLoaderTest extends MetaModelVersions { - @ParameterizedTest - @EnumSource( TestAspect.class ) - void testModelCanBeInstantiated( final TestAspect testAspect ) { - final Try> elements = TestResources.getModel( testAspect, KnownVersion.getLatest() ) - .flatMap( AspectModelLoader::getElements ); - assertThat( elements.isSuccess() ).isTrue(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testOfAbstractEntityCyclomaticCreation( final KnownVersion version ) { - final Map entities = TestResources.getModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_SAME_EXTEND, version ) - .flatMap( AspectModelLoader::getElements ) - .get() - .stream() - .filter( ComplexType.class::isInstance ) - .map( ComplexType.class::cast ) - .collect( Collectors.toMap( ComplexType::getName, Function.identity() ) ); - - assertThat( entities ).extracting( "AbstractTestEntity" ).isInstanceOf( AbstractEntity.class ); - final AbstractEntity abstractEntity = (AbstractEntity) entities.get( "AbstractTestEntity" ); - assertThat( entities ).extracting( "testEntityOne" ).isInstanceOfSatisfying( ComplexType.class, - type -> assertThat( type ).extracting( ComplexType::getExtends ).extracting( Optional::get ).isSameAs( abstractEntity ) ); - assertThat( entities ).extracting( "testEntityTwo" ).isInstanceOfSatisfying( ComplexType.class, - type -> assertThat( type ).extracting( ComplexType::getExtends ).extracting( Optional::get ).isSameAs( abstractEntity ) ); - } -} \ No newline at end of file diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/MetaModelInstantiatorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/MetaModelInstantiatorTest.java deleted file mode 100644 index b13b7fe3c..000000000 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/loader/MetaModelInstantiatorTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.loader; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Locale; - -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; -import org.eclipse.esmf.test.TestAspect; -import org.eclipse.esmf.test.TestResources; - -import io.vavr.control.Try; - -public abstract class MetaModelInstantiatorTest extends MetaModelVersions { - - Aspect loadAspect( final TestAspect aspectName, final KnownVersion version ) { - final VersionedModel versionedModel = TestResources.getModel( aspectName, version ).get(); - - final MigratorService migratorService = new MigratorService(); - - final Try aspect = migratorService - .updateMetaModelVersion( versionedModel ) - .flatMap( AspectModelLoader::getSingleAspect ); - return aspect.getOrElseThrow( () -> new RuntimeException( aspect.getCause() ) ); - } - - void assertBaseAttributes( final NamedElement base, - final AspectModelUrn expectedAspectModelUrn, - final String expectedName, final String expectedPreferredName, final String expectedDescription, - final String... expectedSee ) { - - assertThat( base.getName() ).isEqualTo( expectedName ); - assertThat( base.getAspectModelUrn().get() ).isEqualTo( expectedAspectModelUrn ); - assertBaseAttributes( base, expectedPreferredName, expectedDescription, expectedSee ); - } - - void assertBaseAttributes( final NamedElement base, - final String expectedPreferredName, final String expectedDescription, - final String... expectedSee ) { - - assertThat( base.getPreferredName( Locale.ENGLISH ) ).isEqualTo( expectedPreferredName ); - assertThat( base.getDescription( Locale.ENGLISH ) ).isEqualTo( expectedDescription ); - assertThat( base.getSee() ).containsOnly( expectedSee ); - assertThat( base.getMetaModelVersion() ).isEqualTo( KnownVersion.getLatest() ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitorTest.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitorTest.java deleted file mode 100644 index ab6891de3..000000000 --- a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/metamodel/visitor/AspectStreamTraversalVisitorTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.metamodel.visitor; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.TestAspect; -import org.eclipse.esmf.test.TestResources; - -import com.google.common.collect.Streams; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; - -public class AspectStreamTraversalVisitorTest { - @ParameterizedTest - @EnumSource( value = TestAspect.class ) - public void testLoadAspectExpectSuccess( final TestAspect testAspect ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( testAspect, metaModelVersion ); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( versionedModel ); - final SAMM samm = new SAMM( metaModelVersion ); - final SAMMC sammc = new SAMMC( metaModelVersion ); - final Model model = versionedModel.getModel(); - - final Set modelElementNames = Streams.stream( model.listStatements( null, RDF.type, (RDFNode) null ) ) - .map( Statement::getSubject ) - .filter( RDFNode::isURIResource ) - .map( RDFNode::asResource ) - .map( Resource::getURI ) - .map( uri -> uri.substring( uri.indexOf( '#' ) + 1 ) ) - .collect( Collectors.toSet() ); - - final Set namesFromVisitor = aspect.accept( new AspectStreamTraversalVisitor(), null ) - .flatMap( modelElement -> { - if ( modelElement instanceof final NamedElement namedElement ) { - return namedElement.hasSyntheticName() ? Stream.empty() : Stream.of( namedElement.getName() ); - } - return Stream.empty(); - } ) - .filter( name -> !name.equals( "UnnamedCharacteristic" ) ) - .collect( Collectors.toSet() ); - - assertThat( modelElementNames ).containsAll( namesFromVisitor ); - } -} diff --git a/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/test/TestResources.java b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/test/TestResources.java new file mode 100644 index 000000000..a39e7ae16 --- /dev/null +++ b/core/esmf-aspect-meta-model-java/src/test/java/org/eclipse/esmf/test/TestResources.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.test; + +import java.io.InputStream; + +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.resolver.ClasspathStrategy; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.samm.KnownVersion; + +public class TestResources { + public static AspectModel load( final TestAspect model ) { + final KnownVersion metaModelVersion = KnownVersion.getLatest(); + final String path = String.format( "valid/%s/%s/%s.ttl", model.getUrn().getNamespace(), model.getUrn().getVersion(), + model.getName() ); + final InputStream inputStream = TestResources.class.getClassLoader().getResourceAsStream( path ); + final ResolutionStrategy testModelsResolutionStrategy = new ClasspathStrategy( + "valid/" + metaModelVersion.toString().toLowerCase() ); + return new AspectModelLoader( testModelsResolutionStrategy ).load( inputStream ); + } +} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_meta_model_urn_element.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_meta_model_urn_element.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_meta_model_urn_element.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_meta_model_urn_element.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_urn.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_urn.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_urn.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_urn.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_urn_prefix.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_urn_prefix.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_aspect_urn_prefix.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_aspect_urn_prefix.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_multiple_aspects.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_multiple_aspects.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/invalid_multiple_aspects.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/invalid_multiple_aspects.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/valid_aspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/valid_aspect.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/valid_aspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/valid_aspect.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/valid_entity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/valid_entity.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_1_0_0/valid_entity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_1_0_0/valid_entity.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_meta_model_urn_element.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_meta_model_urn_element.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_meta_model_urn_element.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_meta_model_urn_element.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_urn.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_urn.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_urn.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_urn.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_urn_prefix.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_urn_prefix.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_aspect_urn_prefix.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_aspect_urn_prefix.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_multiple_aspects.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_multiple_aspects.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/invalid_multiple_aspects.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/invalid_multiple_aspects.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/1.1.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/org.eclipse.esmf.test/2.0.0/Test.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/valid_aspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/valid_aspect.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/valid_aspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/valid_aspect.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/valid_entity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/valid_entity.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_0_0/valid_entity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_0_0/valid_entity.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_meta_model_urn_element.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_meta_model_urn_element.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_meta_model_urn_element.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_meta_model_urn_element.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_urn.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_urn.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_urn.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_urn.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_urn_prefix.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_urn_prefix.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_aspect_urn_prefix.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_aspect_urn_prefix.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_multiple_aspects.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_multiple_aspects.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/invalid_multiple_aspects.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/invalid_multiple_aspects.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AnotherTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectInPreviousNamespace.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/BammAspectWithoutPrefixes.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/BammAspectWithoutPrefixes.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/BammAspectWithoutPrefixes.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/BammAspectWithoutPrefixes.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/FailingTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelDef.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/PrimaryAspect.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ReferenceEntityTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondReferenceCharacteristicTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SecondaryAspect.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestCharacteristic.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TestEntity.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/TransitiveReferenceTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/VehicleInstance.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.0.0/legacyProperty.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.1.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.1.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.1.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/1.1.0/Test.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/BammTest.ttl diff --git a/core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/Test.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/Test.ttl similarity index 100% rename from core/esmf-aspect-model-resolver/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/Test.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/org.eclipse.esmf.test/2.0.0/Test.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/valid_aspect.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/valid_aspect.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/valid_aspect.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/valid_aspect.ttl diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/valid_entity.ttl b/core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/valid_entity.ttl similarity index 100% rename from core/esmf-aspect-meta-model-resolver/src/test/resources/samm_2_1_0/valid_entity.ttl rename to core/esmf-aspect-meta-model-java/src/test/resources/samm_2_1_0/valid_entity.ttl diff --git a/core/esmf-aspect-meta-model-resolver/pom.xml b/core/esmf-aspect-meta-model-resolver/pom.xml deleted file mode 100644 index 5ee345bbb..000000000 --- a/core/esmf-aspect-meta-model-resolver/pom.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - 4.0.0 - - - org.eclipse.esmf - esmf-sdk-parent - DEV-SNAPSHOT - ../../pom.xml - - - esmf-aspect-meta-model-resolver - ESMF Aspect Meta Model Resolver - jar - - - - https://raw.githubusercontent.com/eclipse-esmf/esmf-semantic-aspect-meta-model/179f97e7f12e3f05d5daa1211ff414d07d3b2f9e/esmf-semantic-aspect-meta-model - - - - - - org.eclipse.esmf - esmf-semantic-aspect-meta-model - - - org.eclipse.esmf - esmf-aspect-meta-model-interface - - - org.eclipse.esmf - esmf-aspect-meta-model-types - - - org.eclipse.esmf - esmf-aspect-model-urn - - - org.apache.jena - jena-core - - - org.apache.jena - jena-arq - - - io.vavr - vavr - - - jakarta.xml.bind - jakarta.xml.bind-api - - - - - org.eclipse.esmf - esmf-test-aspect-models - test - - - org.junit.jupiter - junit-jupiter - test - - - org.assertj - assertj-core - test - - - org.assertj - assertj-vavr - test - - - org.projectlombok - lombok - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin-version} - - - - org.projectlombok - lombok - ${lombok-version} - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - ${maven-dependency-plugin-version} - - - unpack - generate-sources - - unpack - - - - - org.eclipse.esmf - esmf-semantic-aspect-meta-model - ${aspect-meta-model-version} - jar - false - ${project.build.directory}/classes - - samm/meta-model/1.0.0/aspect-meta-model-shapes.ttl,samm/characteristic/1.0.0/characteristic-shapes.ttl,samm/meta-model/2.0.0/aspect-meta-model-shapes.ttl,samm/characteristic/2.0.0/characteristic-shapes.ttl - - - - - - - - - - - - com.googlecode.maven-download-plugin - download-maven-plugin - ${download-maven-plugin-version} - - - download-meta-model-shapes-1-0-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/meta-model/1.0.0/aspect-meta-model-shapes.ttl - - aspect-meta-model-shapes.ttl - ${project.build.directory}/classes/samm/meta-model/1.0.0 - true - true - true - - - - download-meta-model-shapes-2-0-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/meta-model/2.0.0/aspect-meta-model-shapes.ttl - - aspect-meta-model-shapes.ttl - ${project.build.directory}/classes/samm/meta-model/2.0.0 - true - true - true - - - - download-meta-model-shapes-2-1-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/meta-model/2.1.0/aspect-meta-model-shapes.ttl - - aspect-meta-model-shapes.ttl - ${project.build.directory}/classes/samm/meta-model/2.1.0 - true - true - true - - - - download-characteristics-shapes-1-0-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/characteristic/1.0.0/characteristic-shapes.ttl - - characteristic-shapes.ttl - ${project.build.directory}/classes/samm/characteristic/1.0.0 - true - true - true - - - - download-characteristics-shapes-2-0-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/characteristic/2.0.0/characteristic-shapes.ttl - - characteristic-shapes.ttl - ${project.build.directory}/classes/samm/characteristic/2.0.0 - true - true - true - - - - download-characteristics-shapes-2-1-0 - process-resources - - wget - - - - ${samm-revision}/src/main/resources/samm/characteristic/2.1.0/characteristic-shapes.ttl - - characteristic-shapes.ttl - ${project.build.directory}/classes/samm/characteristic/2.1.0 - true - true - true - - - - - - - - diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolver.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolver.java deleted file mode 100644 index 560677d17..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolver.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.net.URL; -import java.util.Optional; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.samm.KnownVersion; - -/** - * Returns the set of samm:// URLs that comprise the meta model shape files for a given meta model version - */ -@SuppressWarnings( "squid:S2112" ) // URL is specifically required here -public class ClassPathMetaModelShapesUrnResolver implements Function> { - @Override - public Set apply( final KnownVersion metaModelVersion ) { - return Stream.of( - MetaModelUrls.url( "meta-model", metaModelVersion, "prefix-declarations.ttl" ), - MetaModelUrls.url( "meta-model", metaModelVersion, "aspect-meta-model-shapes.ttl" ), - MetaModelUrls.url( "characteristic", metaModelVersion, "characteristic-shapes.ttl" ) - ).filter( Optional::isPresent ).map( Optional::get ).collect( Collectors.toSet() ); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolver.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolver.java deleted file mode 100644 index a01b3e447..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolver.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.net.URL; -import java.util.Optional; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.samm.KnownVersion; - -/** - * Returns the set of samm:// URLs that comprise the meta model definition files for a given meta model version - */ -@SuppressWarnings( "squid:S2112" ) // URL is specifically required here -public class ClassPathMetaModelUrnResolver implements Function> { - @Override - public Set apply( final KnownVersion metaModelVersion ) { - return Stream.of( - MetaModelUrls.url( "meta-model", metaModelVersion, "aspect-meta-model-definitions.ttl" ), - MetaModelUrls.url( "meta-model", metaModelVersion, "type-conversions.ttl" ), - MetaModelUrls.url( "characteristic", metaModelVersion, "characteristic-definitions.ttl" ), - MetaModelUrls.url( "characteristic", metaModelVersion, "characteristic-instances.ttl" ), - MetaModelUrls.url( "entity", metaModelVersion, "TimeSeriesEntity.ttl" ), - MetaModelUrls.url( "entity", metaModelVersion, "FileResource.ttl" ), - MetaModelUrls.url( "entity", metaModelVersion, "Point3d.ttl" ), - MetaModelUrls.url( "unit", metaModelVersion, "units.ttl" ), - Optional. empty() - ).filter( Optional::isPresent ).map( Optional::get ).collect( Collectors.toSet() ); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/DataType.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/DataType.java deleted file mode 100644 index cff963d53..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/DataType.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.util.List; -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; - -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import org.apache.jena.datatypes.RDFDatatype; -import org.apache.jena.datatypes.TypeMapper; -import org.apache.jena.rdf.model.Resource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class acts as the bridge between the scalar types used in RDF (XSD/RDF/SAMM-specific (i.e. samm:curie)) and - * their representations in Java. It implements {@link RDFDatatype} in order to register the types directly - * in the Jena RDF parser. The actual registration is performed by calling {@link #setupTypeMapping()}. - */ -public class DataType { - private static final Logger LOG = LoggerFactory.getLogger( DataType.class ); - private static boolean setupPerformed = false; - - private DataType() { - } - - /** - * Idempotent method to register the SAMM type mapping in the Jena RDF parser. - */ - public static synchronized void setupTypeMapping() { - if ( !setupPerformed ) { - try { - ExtendedXsdDataType.datatypeFactory = DatatypeFactory.newInstance(); - } catch ( final DatatypeConfigurationException exception ) { - LOG.error( "Could not instantiate DatatypeFactory", exception ); - } - - final TypeMapper typeMapper = TypeMapper.getInstance(); - DataType.getAllSupportedTypes().forEach( typeMapper::registerDatatype ); - setupPerformed = true; - } - } - - /** - * Returns all XSD types supported in Aspect models - * - * @return the list of supported XSD types - */ - public static List getSupportedXsdTypes() { - return ExtendedXsdDataType.SUPPORTED_XSD_TYPES; - } - - /** - * Returns the list of all supported DataTypes, which is equivalent to the union of {@link #getSupportedXsdTypes()} - * and DataTypes for samm:curie of all known meta model versions ({@see KnownVersion}). - * - * @return the list of all supported types - */ - public static List getAllSupportedTypes() { - return getSupportedXsdTypes(); - } - - /** - * Returns the list of all supported DataTypes of a given meta model version, which is equivalent to the union - * of {@link #getSupportedXsdTypes()} and the DataType for samm:curie corresponding to the meta model version. - * - * @param metaModelVersion the given meta model version - * @return the list of all supported types in the meta model version - */ - public static List getAllSupportedTypesForMetaModelVersion( final KnownVersion metaModelVersion ) { - return ImmutableList - .copyOf( Iterables.concat( getAllSupportedTypes(), List.of( SammDataType.curie( metaModelVersion ) ) ) ); - } - - /** - * Returns the Java class corresponding to a XSD type in a given meta model version. - * - * @param type the resource of the data type - * @param metaModelVersion the given meta model version - * @return the java class - */ - public static Class getJavaTypeForMetaModelType( final Resource type, final KnownVersion metaModelVersion ) { - return DataType.getAllSupportedTypesForMetaModelVersion( metaModelVersion ) - .stream() - .filter( xsdType -> xsdType.getURI().equals( type.getURI() ) ) - .map( RDFDatatype::getJavaClass ) - .findAny() - .orElseThrow( - () -> new IllegalStateException( "Invalid data type " + type + " found in model." ) ); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/MetaModelUrls.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/MetaModelUrls.java deleted file mode 100644 index 7560941e0..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/MetaModelUrls.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.io.IOException; -import java.net.URL; -import java.util.List; -import java.util.Optional; - -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.ImmutableList; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides the facility for the resolution of meta model resources - */ -public class MetaModelUrls { - private static final Logger LOG = LoggerFactory.getLogger( MetaModelUrls.class ); - - private MetaModelUrls() { - } - - /** - * Create a URL referring to a meta model resource - * - * @param part The meta model section, e.g. aspect-meta-model or characteristics - * @param version The meta model version - * @param fileName The respective file name - * @return The resource URL - */ - public static Optional url( final String part, final KnownVersion version, final String fileName ) { - final String spec = String.format( "samm/%s/%s/%s", part, version.toVersionString(), fileName ); - try { - final List urls = ImmutableList.copyOf( MetaModelUrls.class.getClassLoader().getResources( spec ).asIterator() ); - if ( urls.size() == 1 ) { - return Optional.of( urls.get( 0 ) ); - } - if ( urls.isEmpty() ) { - return nothingFound( spec ); - } - - // If multiple resources with the given spec are found: - // - return the one from the file system, if it exists - // - otherwise, the one from jar - // - otherwise, any of the found resources - URL jarUrl = null; - for ( final URL url : urls ) { - if ( url.getProtocol().equals( "file" ) ) { - return Optional.of( url ); - } - if ( url.getProtocol().equals( "jar" ) ) { - jarUrl = url; - } - } - return Optional.of( jarUrl == null ? urls.get( 0 ) : jarUrl ); - } catch ( final IOException e ) { - return nothingFound( spec ); - } - } - - private static Optional nothingFound( final String spec ) { - LOG.warn( "Could not resolve meta model resource {}", spec ); - return Optional.empty(); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolver.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolver.java deleted file mode 100644 index c5d223cd6..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolver.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.io.InputStream; -import java.net.URL; -import java.util.Optional; -import java.util.Set; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.aspectmodel.UnsupportedVersionException; -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.AspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.urn.ElementType; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Streams; -import io.vavr.Tuple2; -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -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.vocabulary.RDF; - -/** - * Provides functionality to resolve Aspect Meta Model resources which reside in the classpath. - */ -public class SammAspectMetaModelResourceResolver implements AspectMetaModelResourceResolver { - - /** - * Extends the given {@link Model} with elements contained in the given {@link InputStream}s. - * - * @param model the {@link Model} to be extended - * @param streams the {@link InputStream}s containing the additional model elements - * @return the extended {@link Model} - */ - private Try addToModel( final Model model, final Stream streams ) { - return streams.map( TurtleLoader::loadTurtle ).map( loadedModel -> loadedModel.flatMap( otherModel -> { - model.add( otherModel ); - return Try.success( model ); - } ) ).reduce( Try.success( model ), Try::orElse ); - } - - /** - * Loads an RDF model using a function that knows how to turn a target meta model version into a set of URLs - * - * @param version The meta model version - * @param resolver The resolver function - * @return The model - */ - private Try loadUrlSet( final KnownVersion version, final Function> resolver ) { - final Model model = ModelFactory.createDefaultModel(); - return addToModel( model, resolver.apply( version ).stream().map( TurtleLoader::openUrl ) ); - } - - /** - * Loads the Meta Model according to a given {@link KnownVersion} - * - * @param metaModelVersion The Meta Model - * @return The meta model - */ - public Try loadMetaModel( final KnownVersion metaModelVersion ) { - return loadUrlSet( metaModelVersion, new ClassPathMetaModelUrnResolver() ).map( model -> { - model.clearNsPrefixMap(); - model.setNsPrefixes( Namespace.createPrefixMap( metaModelVersion ) ); - return model; - } ); - } - - private Model deepCopy( final Model model ) { - final Model copy = ModelFactory.createDefaultModel(); - Streams.stream( model.listStatements() ).forEach( copy::add ); - copy.setNsPrefixes( ImmutableMap.copyOf( model.getNsPrefixMap() ) ); - return copy; - } - - /** - * Returns the {@link VersionedModel} for a loaded raw Aspect model that includes the given rawModeland - * the model which is the rawModel merged with the corresponding meta model - * - * @param rawModel The given raw Aspect model - * @param metaModelVersion The meta model version the model corresponds to - * @return the VersionedModel containing the model, meta model version and raw model - */ - @Override - public Try mergeMetaModelIntoRawModel( final Model rawModel, final VersionNumber metaModelVersion ) { - final Try sammKnownVersion = KnownVersion.fromVersionString( metaModelVersion.toString() ) - .map( Try::success ) - .orElse( Try.failure( new UnsupportedVersionException( metaModelVersion ) ) ); - - return sammKnownVersion.flatMap( this::loadMetaModel ).map( metaModel -> { - final Model model = deepCopy( rawModel ); - model.add( metaModel ); - return new VersionedModel( model, metaModelVersion, rawModel ); - } ); - } - - @Override - public Stream listAspectStatements( final Model modelToAdd, final Model target ) { - return getMetaModelVersion( modelToAdd ) - .map( versionNumber -> KnownVersion.fromVersionString( versionNumber.toString() ).orElseThrow( - () -> new UnsupportedVersionException( versionNumber ) ) ) - .toJavaStream().flatMap( metaModelVersion -> { - final SAMM samm = new SAMM( metaModelVersion ); - if ( !target.contains( null, RDF.type, samm.Aspect() ) ) { - return Streams.stream( modelToAdd.listStatements() ); - } - return getModelStatementsWithoutAspectAssertion( modelToAdd, samm ); - } ); - } - - private Stream getModelStatementsWithoutAspectAssertion( final Model model, final SAMM samm ) { - return Streams.stream( model.listStatements() ).filter( statement -> - !(statement.getPredicate().equals( RDF.type ) - && statement.getObject().isURIResource() - && statement.getObject().asResource().equals( samm.Aspect() )) ); - } - - /** - * Loads the Meta Model shapes according to a given {@link KnownVersion} - * - * @param metaModelVersion The target Meta Model version - * @return a {@link Model} containing the Shapes - */ - public Try loadShapesModel( final KnownVersion metaModelVersion ) { - return loadUrlSet( metaModelVersion, new ClassPathMetaModelShapesUrnResolver() ).map( model -> { - final Set> changeSet = determineSammUrlsToReplace( model ); - changeSet.forEach( urlReplacement -> { - model.remove( urlReplacement._1() ); - model.add( urlReplacement._2() ); - } ); - return model; - } ); - } - - /** - * Determines all statements that refer to a samm:// URL and their replacements where the samm:// URL has - * been replaced with a URL that is resolvable in the current context (e.g. to the class path or via HTTP). - * - * @param model the input model - * @return the tuples of the original statement to replace and the replacement statement - */ - private Set> determineSammUrlsToReplace( final Model model ) { - final Property shaclJsLibraryUrl = ResourceFactory.createProperty( "http://www.w3.org/ns/shacl#jsLibraryURL" ); - return Streams.stream( model.listStatements( null, shaclJsLibraryUrl, (RDFNode) null ) ) - .filter( statement -> statement.getObject().isLiteral() ) - .filter( statement -> statement.getObject().asLiteral().getString().startsWith( "samm://" ) ) - .flatMap( statement -> rewriteSammUrl( statement.getObject().asLiteral().getString() ) - .stream() - .map( newUrl -> - ResourceFactory.createStatement( statement.getSubject(), statement.getPredicate(), - ResourceFactory.createTypedLiteral( newUrl, ExtendedXsdDataType.ANY_URI ) ) ) - .map( newStatement -> new Tuple2<>( statement, newStatement ) ) ) - .collect( Collectors.toSet() ); - } - - /** - * URLs inside meta model shapes, in particular those used with sh:jsLibraryURL, are given as samm:// URLs - * in order to decouple them from the way they are resolved (i.e. currently to a file in the class path, but - * in the future this could be resolved using the URL of a suitable service). This method takes a samm:// URL - * and rewrites it to the respective URL of the object on the class path. - * - * @param sammUrl the samm URL in the format samm://PART/VERSION/FILENAME - * @return The corresponding class path URL to resolve the meta model resource - */ - private Optional rewriteSammUrl( final String sammUrl ) { - final Matcher matcher = Pattern.compile( "^samm://([\\p{Alpha}-]*)/(\\d+\\.\\d+\\.\\d+)/(.*)$" ) - .matcher( sammUrl ); - if ( matcher.find() ) { - return KnownVersion.fromVersionString( matcher.group( 2 ) ).flatMap( metaModelVersion -> - MetaModelUrls.url( matcher.group( 1 ), metaModelVersion, matcher.group( 3 ) ) ) - .map( URL::toString ); - } - if ( sammUrl.startsWith( "samm://scripts/" ) ) { - final String resourcePath = sammUrl.replace( "samm://", "samm/" ); - final URL resource = SammAspectMetaModelResourceResolver.class.getClassLoader().getResource( resourcePath ); - return Optional.ofNullable( resource ).map( URL::toString ); - } - return Optional.empty(); - } - - /** - * Returns the set of meta model versions referenced in the model - * - * @param model an Aspect model - * @return the set of meta model versions - */ - @Override - public Set getUsedMetaModelVersions( final Model model ) { - final String sammUrnStart = String.format( "%s:%s", AspectModelUrn.VALID_PROTOCOL, AspectModelUrn.VALID_NAMESPACE_IDENTIFIER ); - Set result = model.listObjects() - .toList() - .stream() - .filter( RDFNode::isURIResource ) - .map( RDFNode::asResource ) - .map( Resource::getURI ) - .filter( uri -> uri.startsWith( sammUrnStart ) ) - .flatMap( uri -> AspectModelUrn.from( uri ).toJavaStream() ) - .filter( urn -> (urn.getElementType().equals( ElementType.META_MODEL ) || urn.getElementType() - .equals( ElementType.CHARACTERISTIC )) ) - .map( AspectModelUrn::getVersion ) - .map( VersionNumber::parse ) - .collect( Collectors.toSet() ); - return result; - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammDataType.java b/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammDataType.java deleted file mode 100644 index 404f2d998..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/services/SammDataType.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import java.util.Optional; -import java.util.function.Function; -import java.util.function.Predicate; - -import org.eclipse.esmf.metamodel.datatypes.Curie; -import org.eclipse.esmf.samm.KnownVersion; - -import org.apache.jena.datatypes.BaseDatatype; - -public class SammDataType extends BaseDatatype implements TypedRdfDatatype { - private final Class javaClass; - private final Function parser; - private final Function unparser; - private final Predicate lexicalValidator; - - public static final String CURIE_REGEX = "[a-zA-Z]*:[a-zA-Z]+"; - - private SammDataType( final String uri, final Class javaClass, final Function parser, - final Function unparser, final Predicate lexicalValidator ) { - super( uri ); - this.javaClass = javaClass; - this.parser = parser; - this.unparser = unparser; - this.lexicalValidator = lexicalValidator; - } - - /** - * Returns the DataType for samm:curie of a given meta model version. - * - * @param metaModelVersion the respective meta model version - * @return the corresponding DataType - */ - public static TypedRdfDatatype curie( final KnownVersion metaModelVersion ) { - final String curieUrn = String - .format( "urn:samm:org.eclipse.esmf.samm:meta-model:%s#curie", metaModelVersion.toVersionString() ); - return new SammDataType<>( curieUrn, Curie.class, Curie::new, Curie::getValue, - value -> value.matches( CURIE_REGEX ) ); - } - - @Override - public Object parse( final String lexicalForm ) { - try { - return parser.apply( lexicalForm ); - } catch ( final Exception exception ) { - if ( ExtendedXsdDataType.isCheckingEnabled() ) { - throw exception; - } - } - return lexicalForm; - } - - @Override - public Optional parseTyped( final String lexicalForm ) { - try { - return Optional.of( parser.apply( lexicalForm ) ); - } catch ( final RuntimeException exception ) { - if ( ExtendedXsdDataType.isCheckingEnabled() ) { - throw exception; - } - } - return Optional.empty(); - } - - @Override - @SuppressWarnings( "unchecked" ) - public String unparse( final Object value ) { - if ( value instanceof String ) { - return (String) value; - } - return unparseTyped( (T) value ); - } - - @Override - public String unparseTyped( final T value ) { - return unparser.apply( value ); - } - - @Override - public boolean isValid( final String lexicalForm ) { - return lexicalValidator.test( lexicalForm ); - } - - @Override - public Class getJavaClass() { - return javaClass; - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolverTest.java b/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolverTest.java deleted file mode 100644 index c7860ecc6..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelShapesUrnResolverTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.net.URL; -import java.util.Optional; - -import org.eclipse.esmf.samm.KnownVersion; - -import org.junit.jupiter.api.Test; - -public class ClassPathMetaModelShapesUrnResolverTest { - @Test - public void testUrlConstruction() { - for ( final KnownVersion version : KnownVersion.getVersions() ) { - final Optional url = MetaModelUrls.url( "meta-model", version, "aspect-meta-model-shapes.ttl" ); - assertThat( url ).isNotEmpty(); - } - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolverTest.java b/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolverTest.java deleted file mode 100644 index a289b5f6c..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/ClassPathMetaModelUrnResolverTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.net.URL; -import java.util.Optional; - -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class ClassPathMetaModelUrnResolverTest extends MetaModelVersions { - @Test - public void testUrlConstruction() { - for ( final KnownVersion version : KnownVersion.getVersions() ) { - final Optional url = MetaModelUrls.url( "meta-model", version, "aspect-meta-model-definitions.ttl" ); - assertThat( url ).isNotEmpty(); - } - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testContainsEntityDefinitions( final KnownVersion metaModelVersion ) { - assertThat( MetaModelUrls.url( "entity", metaModelVersion, "Point3d.ttl" ) ).isNotEmpty(); - assertThat( MetaModelUrls.url( "entity", metaModelVersion, "FileResource.ttl" ) ).isNotEmpty(); - assertThat( MetaModelUrls.url( "entity", metaModelVersion, "TimeSeriesEntity.ttl" ) ).isNotEmpty(); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolverTest.java b/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolverTest.java deleted file mode 100644 index 4a84fb7c4..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/services/SammAspectMetaModelResourceResolverTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver.services; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.InputStream; - -import org.eclipse.esmf.aspectmodel.MissingMetaModelVersionException; -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; - -import io.vavr.control.Try; -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.ResourceFactory; -import org.apache.jena.vocabulary.RDF; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class SammAspectMetaModelResourceResolverTest extends MetaModelVersions { - private final SammAspectMetaModelResourceResolver aspectMetaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - - private Model getModel( final String resource, final KnownVersion version ) { - final InputStream aspectModel = - SammAspectMetaModelResourceResolverTest.class.getClassLoader().getResourceAsStream( - version.toString().toLowerCase() + "/" + resource ); - return TurtleLoader.loadTurtle( aspectModel ).get(); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetMetaModelVersionExpectSuccess( final KnownVersion metaModelVersion ) { - final Model model = getModel( "valid_aspect.ttl", metaModelVersion ); - assertThat( aspectMetaModelResourceResolver.getMetaModelVersion( model ) ).isNotEmpty(); - assertThat( aspectMetaModelResourceResolver.getMetaModelVersion( model ) ) - .contains( VersionNumber.parse( metaModelVersion.toVersionString() ) ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetMetaModelVersionInvalidPrefixExpectFailure( final KnownVersion metaModelVersion ) { - final Model model = getModel( "invalid_aspect_urn_prefix.ttl", metaModelVersion ); - final Try modelVersion = aspectMetaModelResourceResolver.getMetaModelVersion( model ); - assertThat( modelVersion ).isEmpty(); - assertThat( modelVersion.getCause() ).isInstanceOf( MissingMetaModelVersionException.class ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetMetaModelVersionInvalidUrnExpectFailure( final KnownVersion metaModelVersion ) { - final Model model = getModel( "invalid_aspect_urn.ttl", metaModelVersion ); - final Try modelVersion = aspectMetaModelResourceResolver.getMetaModelVersion( model ); - assertThat( modelVersion ).isEmpty(); - assertThat( modelVersion.getCause() ).isInstanceOf( MissingMetaModelVersionException.class ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetMetaModelVersionInvalidMetaModelUrnElementExpectFailure( final KnownVersion metaModelVersion ) { - final Model model = getModel( "invalid_aspect_meta_model_urn_element.ttl", metaModelVersion ); - final Try modelVersion = aspectMetaModelResourceResolver.getMetaModelVersion( model ); - assertThat( modelVersion ).isEmpty(); - assertThat( modelVersion.getCause() ).isInstanceOf( MissingMetaModelVersionException.class ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetAspectModelUrnExpectSuccess( final KnownVersion metaModelVersion ) { - final Try aspectModelUrn = AspectModelUrn.from( - "urn:samm:org.eclipse.esmf.samm:meta-model:" + metaModelVersion.toVersionString() + "#Aspect" ); - assertThat( aspectModelUrn ).isNotEmpty(); - assertThat( aspectModelUrn.get().getUrn().toString() ) - .isEqualTo( "urn:samm:org.eclipse.esmf.samm:meta-model:" + metaModelVersion - .toVersionString() + "#Aspect" ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetAspectModelUrnInvalidUrnExpectFailure( final KnownVersion metaModelVersion ) { - final Try aspectModelUrn = AspectModelUrn.from( - "urn:foo:org.eclipse.esmf.samm:meta-model:" + metaModelVersion.toVersionString() ); - assertThat( aspectModelUrn ).isEmpty(); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGetKnownVersionExpectSuccess( final KnownVersion metaModelVersion ) { - final KnownVersion parsedVersion = KnownVersion.fromVersionString( metaModelVersion.toVersionString() ).get(); - assertThat( parsedVersion ).isEqualTo( metaModelVersion ); - } - - @Test - public void testGetUnknownVersionExpectFailure() { - final Model model = ModelFactory.createDefaultModel(); - model.setNsPrefix( "samm", "urn:samm:org.eclipse.esmf.samm:meta-model:5.0.0#" ); - final Try metaModelVersion = aspectMetaModelResourceResolver.getMetaModelVersion( model ); - assertThat( metaModelVersion ).isEmpty(); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testLoadMetaModelExpectSuccess( final KnownVersion metaModelVersion ) { - final Model model = aspectMetaModelResourceResolver.loadMetaModel( metaModelVersion ).get(); - - assertThat( model.contains( ResourceFactory.createResource( - "urn:samm:org.eclipse.esmf.samm:meta-model:" + metaModelVersion.toVersionString() + "#value" ), - RDF.type, (RDFNode) null ) ).isTrue(); - } -} diff --git a/core/esmf-aspect-meta-model-resolver/src/test/resources/logback.xml b/core/esmf-aspect-meta-model-resolver/src/test/resources/logback.xml deleted file mode 100644 index 3d4dffa73..000000000 --- a/core/esmf-aspect-meta-model-resolver/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/core/esmf-aspect-meta-model-types/pom.xml b/core/esmf-aspect-meta-model-types/pom.xml deleted file mode 100644 index 8f3508b6a..000000000 --- a/core/esmf-aspect-meta-model-types/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - 4.0.0 - - org.eclipse.esmf - esmf-sdk-parent - DEV-SNAPSHOT - ../../pom.xml - - - esmf-aspect-meta-model-types - ESMF Aspect Meta Model Types - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - ${maven-surefire-report-plugin-version} - - true - true - - - - - org.apache.maven.plugins - maven-site-plugin - ${maven-site-plugin-version} - - true - - - - - - diff --git a/core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/Curie.java b/core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/Curie.java deleted file mode 100644 index b671034d5..000000000 --- a/core/esmf-aspect-meta-model-types/src/main/java/org/eclipse/esmf/metamodel/datatypes/Curie.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.metamodel.datatypes; - -import java.util.Objects; - -/** - * Represents the samm:curie data type - */ -public class Curie { - private final String value; - - public Curie( final String value ) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public boolean equals( final Object o ) { - if ( this == o ) { - return true; - } - if ( o == null || getClass() != o.getClass() ) { - return false; - } - - final Curie curie = (Curie) o; - return Objects.equals( value, curie.value ); - } - - @Override - public int hashCode() { - return value != null ? value.hashCode() : 0; - } - - @Override - public String toString() { - return value; - } -} diff --git a/core/esmf-aspect-meta-model-types/src/test/resources/logback.xml b/core/esmf-aspect-meta-model-types/src/test/resources/logback.xml deleted file mode 100644 index 3d4dffa73..000000000 --- a/core/esmf-aspect-meta-model-types/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/core/esmf-aspect-meta-model-version-migrator/pom.xml b/core/esmf-aspect-meta-model-version-migrator/pom.xml deleted file mode 100644 index 869cae60d..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - org.eclipse.esmf - esmf-sdk-parent - DEV-SNAPSHOT - ../../pom.xml - - 4.0.0 - - esmf-aspect-meta-model-version-migrator - ESMF Aspect Meta Model Version Migrator - jar - - - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - - - org.eclipse.esmf - esmf-aspect-meta-model-interface - - - org.eclipse.esmf - esmf-semantic-aspect-meta-model - - - io.github.classgraph - classgraph - - - io.vavr - vavr - - - - - org.junit.jupiter - junit-jupiter - test - - - org.assertj - assertj-vavr - test - - - org.eclipse.esmf - esmf-test-aspect-models - test - - - - - diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorService.java b/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorService.java deleted file mode 100644 index 8897ac24c..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorService.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.util.Comparator; -import java.util.List; -import java.util.Optional; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidVersionException; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.Migrator; -import org.eclipse.esmf.samm.KnownVersion; - -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The service that migrates all migrators in the correct order. - */ -public class MigratorService { - private static final Logger LOG = LoggerFactory.getLogger( MigratorService.class ); - private final Optional migratorFactory; - private final SammMigratorFactory sammMigratorFactory = new SammMigratorFactory(); - - public MigratorService() { - migratorFactory = Optional.empty(); - } - - public MigratorService( final MigratorFactory migratorFactory ) { - this.migratorFactory = Optional.of( migratorFactory ); - } - - public Optional getMigratorFactory() { - return migratorFactory; - } - - public SammMigratorFactory getSdsMigratorFactory() { - return sammMigratorFactory; - } - - private Model execute( final Migrator migrator, final Model sourceModel ) { - LOG.info( "Start Migration for {} to {}", migrator.sourceVersion(), migrator.targetVersion() ); - final String description = migrator.getDescription().orElse( "" ); - LOG.info( "Migration step {} {}", migrator.getClass().getSimpleName(), description ); - final Model targetModel = migrator.migrate( sourceModel ); - LOG.info( "End Migration" ); - return targetModel; - } - - /** - * Semantically migrates an Aspect model from its current meta model version to a given target meta model version. - * This is done by composing the {@link Migrator}s that update from one version to the next into one function - * which is then applied to the given source model. - * - * @param versionedModel the source model - * @return the resulting {@link VersionedModel} that corresponds to the input Aspect model, but with the new meta model version - */ - public Try updateMetaModelVersion( final VersionedModel versionedModel ) { - final VersionNumber latestKnownVersion = VersionNumber.parse( KnownVersion.getLatest().toVersionString() ); - VersionNumber sourceVersion = versionedModel.getMetaModelVersion(); - Model migrationModel = versionedModel.getRawModel(); - - if ( migratorFactory.isPresent() ) { - migrationModel = customMigration( migratorFactory.get(), sourceVersion, versionedModel ); - sourceVersion = VersionNumber.parse( KnownVersion.SAMM_1_0_0.toVersionString() ); - } - - if ( sourceVersion.greaterThan( latestKnownVersion ) ) { - // looks like unreachable - return Try.failure( new InvalidVersionException( - String.format( "Model version %s can not be updated to version %s", sourceVersion, latestKnownVersion ) ) ); - } - - if ( !sourceVersion.equals( latestKnownVersion ) ) { - migrationModel = migrate( sammMigratorFactory.createMigrators(), sourceVersion, latestKnownVersion, migrationModel ); - } - - return getSdsMigratorFactory().createAspectMetaModelResourceResolver() - .mergeMetaModelIntoRawModel( migrationModel, latestKnownVersion ); - } - - private Model customMigration( final MigratorFactory migratorFactory, final VersionNumber sourceVersion, - final VersionedModel versionedModel ) { - return migrate( migratorFactory.createMigrators(), sourceVersion, migratorFactory.getLatestVersion(), versionedModel.getRawModel() ); - } - - private Model migrate( final List migrators, final VersionNumber sourceVersion, final VersionNumber targetVersion, - final Model targetModel ) { - if ( migrators.isEmpty() ) { - return targetModel; - } - - final Comparator comparator = Comparator.comparing( Migrator::sourceVersion ); - final List migratorSet = migrators.stream() - .sorted( comparator.thenComparing( Migrator::order ) ) - .dropWhile( migrator -> !migrator.sourceVersion().equals( sourceVersion ) ) - .takeWhile( migrator -> !migrator.targetVersion().greaterThan( targetVersion ) ) - .toList(); - - Model migratorTargetModel = targetModel; - for ( final Migrator migrator : migratorSet ) { - migratorTargetModel = execute( migrator, migratorTargetModel ); - } - return migratorTargetModel; - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoader.java b/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoader.java deleted file mode 100644 index f9705867b..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoader.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.lang.reflect.InvocationTargetException; - -import io.github.classgraph.ClassGraph; -import io.github.classgraph.ClassInfoList; -import io.github.classgraph.ScanResult; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Collects a custom migration factory in the classpath and uses it to build a {@link MigratorService} - */ -public class MigratorServiceLoader { - private static final Logger LOG = LoggerFactory.getLogger( MigratorServiceLoader.class ); - private static MigratorServiceLoader instance; - private MigratorService migratorService; - - public static synchronized MigratorServiceLoader getInstance() { - if ( instance == null ) { - instance = new MigratorServiceLoader(); - instance.loadMigratorService(); - } - return instance; - } - - public MigratorService getMigratorService() { - return migratorService; - } - - private MigratorFactory createMigratorFactory( final Class clazz ) { - try { - return (MigratorFactory) clazz.getDeclaredConstructor().newInstance(); - } catch ( final InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e ) { - LOG.error( "Cannot create {}. No default constructor available?", clazz, e ); - throw new IllegalArgumentException( "Cannot create" + clazz + " No default constructor available?" ); - } - } - - private void loadMigratorService() { - try ( final ScanResult scanResult = new ClassGraph().enableAllInfo().acceptPackages( - MigratorFactory.class.getPackageName() ).scan() ) { - final ClassInfoList migratorFactoryClasses = scanResult - .getClassesImplementing( MigratorFactory.class.getName() ); - - migratorService = migratorFactoryClasses - .loadClasses( MigratorFactory.class ).stream().map( this::createMigratorFactory ) - .map( MigratorService::new ).findAny().orElse( new MigratorService() ); - } - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMigratorFactory.java b/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMigratorFactory.java deleted file mode 100644 index f7f0265a4..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/SammMigratorFactory.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.util.List; - -import org.eclipse.esmf.aspectmodel.resolver.AspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.Migrator; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.SammMetaModelVersionUriRewriter; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.SammRemoveSammNameMigrator; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.UnitInSammNamespaceMigrator; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.ImmutableList; - -/** - * Includes all SAMM migrators - */ -public class SammMigratorFactory { - private final SammAspectMetaModelResourceResolver metaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - private final List migrators = ImmutableList. builder() - .add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_2_0_0, KnownVersion.SAMM_2_1_0 ) ) - .add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) ) - .add( new SammRemoveSammNameMigrator( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) ) - .add( new UnitInSammNamespaceMigrator() ) - .build(); - - public List createMigrators() { - return migrators; - } - - public AspectMetaModelResourceResolver createAspectMetaModelResourceResolver() { - return metaModelResourceResolver; - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoaderTest.java b/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoaderTest.java deleted file mode 100644 index ec53533e9..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorServiceLoaderTest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.versionupdate; - -import static org.assertj.core.api.Assertions.assertThat; - -import org.junit.jupiter.api.Test; - -public class MigratorServiceLoaderTest { - private final MigratorService migratorService = MigratorServiceLoader.getInstance().getMigratorService(); - - @Test - public void testLoadService() { - assertThat( migratorService.getMigratorFactory().get() ).isInstanceOf( TestMigratorFactory1.class ); - assertThat( migratorService.getMigratorFactory().get().createMigrators() ).hasSize( 4 ); - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorTest.java b/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorTest.java deleted file mode 100644 index 6b291e7b5..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/MigratorTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.versionupdate; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; -import org.eclipse.esmf.test.TestAspect; - -import com.google.common.collect.Streams; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class MigratorTest extends MetaModelVersions { - - private final MigratorService migratorService = new MigratorService(); - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testRawModelIsMigrated( final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT, metaModelVersion ); - final VersionedModel rewrittenModel = migratorService.updateMetaModelVersion( versionedModel ).get(); - assertThat( versionedModel.getRawModel().size() ).isEqualTo( rewrittenModel.getRawModel().size() ); - if ( metaModelVersion.equals( KnownVersion.getLatest() ) ) { - return; - } - final SAMM originalSamm = new SAMM( metaModelVersion ); - final SAMM latestSamm = new SAMM( KnownVersion.getLatest() ); - assertThat( rewrittenModel.getRawModel().contains( null, RDF.type, originalSamm.Aspect() ) ).isFalse(); - assertThat( rewrittenModel.getRawModel().contains( null, RDF.type, latestSamm.Aspect() ) ).isTrue(); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testUriRewriting( final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT, metaModelVersion ); - final VersionedModel rewrittenModel = migratorService.updateMetaModelVersion( versionedModel ).get(); - - assertThat( rewrittenModel.getMetaModelVersion() ).isEqualTo( VersionNumber.parse( KnownVersion.getLatest().toVersionString() ) ); - final Model model = rewrittenModel.getRawModel(); - assertThat( model.getNsPrefixURI( "samm" ) ).contains( KnownVersion.getLatest().toVersionString() ); - - if ( metaModelVersion.equals( KnownVersion.getLatest() ) ) { - return; - } - - final String metaModelNameSpace = String.format( "urn:samm:org.eclipse.esmf.samm:meta-model:%s", metaModelVersion.toVersionString() ); - assertThat( getAllUris( model ) ).noneMatch( uri -> uri.contains( metaModelNameSpace ) ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testUriRewritingDoesNotChangeCustomNamespaces( final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT_WITH_CUSTOM_NAMESPACE, - metaModelVersion ); - final VersionedModel rewrittenModel = migratorService.updateMetaModelVersion( versionedModel ).get(); - - assertThat( rewrittenModel.getRawModel().getNsPrefixMap() ).containsKey( "custom" ); - } - - @Test - public void testMigrateUnitsToSammNamespace() { - final VersionedModel oldModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT_WITH_CUSTOM_UNIT, - KnownVersion.SAMM_1_0_0 ); - final Model rewrittenModel = migratorService.updateMetaModelVersion( oldModel ).get().getRawModel(); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - - assertThat( rewrittenModel.contains( null, RDF.type, samm.Unit() ) ).isTrue(); - assertThat( rewrittenModel.contains( null, samm.symbol(), (RDFNode) null ) ).isTrue(); - assertThat( rewrittenModel.contains( null, samm.quantityKind(), (RDFNode) null ) ).isTrue(); - final Set uris = getAllUris( rewrittenModel ); - final String sammVersion = KnownVersion.getLatest().toVersionString(); - assertThat( uris ).noneMatch( uri -> uri.contains( "urn:samm:org.eclipse.esmf.samm:unit:" + sammVersion + "#Unit" ) ); - assertThat( uris ).noneMatch( uri -> uri.contains( "urn:samm:org.eclipse.esmf.samm:unit:" + sammVersion + "#symbol" ) ); - assertThat( uris ).noneMatch( uri -> uri.contains( "urn:samm:org.eclipse.esmf.samm:unit:" + sammVersion + "#quantityKind" ) ); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testRemoveSammName( final KnownVersion metaModelVersion ) { - final SAMM samm = new SAMM( metaModelVersion ); - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT, metaModelVersion ); - final VersionedModel rewrittenModel = migratorService.updateMetaModelVersion( versionedModel ).get(); - - final String sammNameUrn = samm.getNamespace() + "name"; - final List sammNameStatements = rewrittenModel.getModel().listStatements().toList().stream() - .filter( statement -> statement.getPredicate().getURI().equals( sammNameUrn ) ) - .collect( Collectors.toList() ); - assertThat( sammNameStatements ).isEmpty(); - } - - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testCurieMigration( final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModelWithoutResolution( TestAspect.ASPECT_WITH_CURIE, metaModelVersion ); - final VersionedModel rewrittenModel = migratorService.updateMetaModelVersion( versionedModel ).get(); - final SAMM latestSamm = new SAMM( KnownVersion.getLatest() ); - assertThat( rewrittenModel.getRawModel().listStatements( null, latestSamm.exampleValue(), (RDFNode) null ).nextStatement().getObject() - .asLiteral() - .getDatatypeURI() ).isEqualTo( latestSamm.curie().getURI() ); - } - - private Set getAllUris( final Model model ) { - return Streams.stream( model.listStatements() ).flatMap( statement -> { - final Stream subjectUri = Stream.of( statement.getSubject().getURI() ); - final Stream predicateUri = Stream.of( statement.getPredicate().getURI() ); - final Stream objectUri = statement.getObject().isURIResource() - ? Stream.of( statement.getObject().asResource().getURI() ) - : Stream.empty(); - return Stream.of( subjectUri, predicateUri, objectUri ).flatMap( Function.identity() ); - } ).filter( Objects::nonNull ).collect( Collectors.toSet() ); - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestMigratorFactory1.java b/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestMigratorFactory1.java deleted file mode 100644 index c0d9d1ca3..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestMigratorFactory1.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.util.List; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.AspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.AbstractMigrator; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.Migrator; -import org.eclipse.esmf.samm.KnownVersion; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; - -public class TestMigratorFactory1 implements MigratorFactory { - - @Override - public VersionNumber getLatestVersion() { - return VersionNumber.parse( KnownVersion.SAMM_1_0_0.toVersionString() ); - } - - @Override - public List createMigrators() { - return List.of( new TestMigrator1(), new TestMigrator2(), new TestMigrator3(), new TestMigrator4() ); - } - - @Override - public AspectMetaModelResourceResolver createAspectMetaModelResourceResolver() { - return new SammAspectMetaModelResourceResolver(); - } - - public static class TestMigrator1 extends AbstractMigrator { - - protected TestMigrator1() { - super( VersionNumber.parse( "1.1.0" ), VersionNumber.parse( "1.2.0" ), 100 ); - } - - @Override - public Model migrate( final Model sourceModel ) { - return ModelFactory.createDefaultModel(); - } - } - - public static class TestMigrator2 extends AbstractMigrator { - - protected TestMigrator2() { - super( VersionNumber.parse( "1.1.0" ), VersionNumber.parse( "1.2.0" ), 50 ); - } - - @Override - public Model migrate( final Model sourceModel ) { - return ModelFactory.createDefaultModel(); - } - } - - public static class TestMigrator3 extends AbstractMigrator { - - protected TestMigrator3() { - super( VersionNumber.parse( "1.2.0" ), VersionNumber.parse( "1.3.0" ) ); - } - - @Override - public Model migrate( final Model sourceModel ) { - return ModelFactory.createDefaultModel(); - } - } - - public static class TestMigrator4 extends AbstractMigrator { - - protected TestMigrator4() { - super( VersionNumber.parse( "1.0.0" ), VersionNumber.parse( "1.1.0" ) ); - } - - @Override - public Model migrate( final Model sourceModel ) { - return ModelFactory.createDefaultModel(); - } - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestResources.java b/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestResources.java deleted file mode 100644 index 777b1bf46..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/test/java/org/eclipse/esmf/aspectmodel/versionupdate/TestResources.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.versionupdate; - -import java.io.InputStream; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.TestAspect; - -public class TestResources { - public static VersionedModel getModelWithoutResolution( final TestAspect model, final KnownVersion knownVersion ) { - final SammAspectMetaModelResourceResolver metaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - final String path = String.format( "valid/%s/%s/%s/%s.ttl", knownVersion.toString().toLowerCase(), - model.getUrn().getNamespace(), model.getUrn().getVersion(), model.getName() ); - final InputStream inputStream = TestResources.class.getClassLoader().getResourceAsStream( path ); - return TurtleLoader.loadTurtle( inputStream ).flatMap( rawModel -> - metaModelResourceResolver.mergeMetaModelIntoRawModel( rawModel, VersionNumber.parse( knownVersion.toVersionString() ) ) ).get(); - } -} diff --git a/core/esmf-aspect-meta-model-version-migrator/src/test/resources/logback.xml b/core/esmf-aspect-meta-model-version-migrator/src/test/resources/logback.xml deleted file mode 100644 index 3d4dffa73..000000000 --- a/core/esmf-aspect-meta-model-version-migrator/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/core/esmf-aspect-model-aas-generator/pom.xml b/core/esmf-aspect-model-aas-generator/pom.xml index f4fe53349..90eb6ddc7 100644 --- a/core/esmf-aspect-model-aas-generator/pom.xml +++ b/core/esmf-aspect-model-aas-generator/pom.xml @@ -42,6 +42,7 @@ org.apache.poi poi + org.eclipse.esmf esmf-test-resources diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGenerator.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGenerator.java index 8363653ff..6c59e7798 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGenerator.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGenerator.java @@ -31,15 +31,11 @@ import java.util.stream.Stream; import org.eclipse.esmf.aspectmodel.VersionNumber; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.ValueInstantiator; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.impl.DefaultList; -import org.eclipse.esmf.characteristic.impl.DefaultSingleEntity; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRangeConstraint; import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Event; @@ -48,8 +44,13 @@ import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultList; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSingleEntity; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRangeConstraint; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.metamodel.impl.DefaultAspect; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultEntity; @@ -57,9 +58,7 @@ import org.eclipse.esmf.metamodel.impl.DefaultOperation; import org.eclipse.esmf.metamodel.impl.DefaultProperty; import org.eclipse.esmf.metamodel.impl.DefaultScalar; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.loader.ValueInstantiator; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import com.google.common.base.CaseFormat; import org.apache.commons.codec.digest.DigestUtils; @@ -104,8 +103,7 @@ public class AasToAspectModelGenerator { private static final Logger LOG = LoggerFactory.getLogger( AasToAspectModelGenerator.class ); private final Environment aasEnvironment; private final Map properties = new HashMap<>(); - private final SAMMC sammc = new SAMMC( KnownVersion.getLatest() ); - private final ValueInstantiator valueInstantiator = new ValueInstantiator( KnownVersion.getLatest() ); + private final ValueInstantiator valueInstantiator = new ValueInstantiator(); private AspectModelUrn aspectUrn; private record ElementName( String name, boolean isSynthetic ) {} @@ -298,12 +296,13 @@ private Aspect submodelToAspect( final Submodel submodel ) { determineAspectModelUrnVersion( submodel ), aspectName.name() ) ) ); - final MetaModelBaseAttributes aspectMetaModelBaseAttributes = new MetaModelBaseAttributes( - KnownVersion.getLatest(), aspectUrn, aspectUrn.getName(), - langStringSet( submodel.getDisplayName() ), - langStringSet( submodel.getDescription() ), - seeReferences( submodel ), - aspectName.isSynthetic() ); + final MetaModelBaseAttributes aspectMetaModelBaseAttributes = MetaModelBaseAttributes.builder() + .withUrn( aspectUrn ) + .withPreferredNames( langStringSet( submodel.getDisplayName() ) ) + .withDescriptions( langStringSet( submodel.getDescription() ) ) + .withSee( seeReferences( submodel ) ) + .isAnonymous( aspectName.isSynthetic() ) + .build(); final List properties = createProperties( submodel ); return new DefaultAspect( aspectMetaModelBaseAttributes, @@ -391,12 +390,13 @@ private MetaModelBaseAttributes baseAttributes( final SubmodelElement element, f throw new AspectModelGenerationException( "Unknown ElementNamingStrategy" ); } - return new MetaModelBaseAttributes( KnownVersion.getLatest(), - urn, elementName.name(), - langStringSet( element.getDisplayName() ), - langStringSet( element.getDescription() ), - seeReferences( element ), - elementName.isSynthetic() ); + return MetaModelBaseAttributes.builder() + .withUrn( urn ) + .withPreferredNames( langStringSet( element.getDisplayName() ) ) + .withDescriptions( langStringSet( element.getDescription() ) ) + .withSee( seeReferences( element ) ) + .isAnonymous( elementName.isSynthetic() ) + .build(); } private Property createProperty( final org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement submodelElement ) { @@ -406,8 +406,7 @@ private Property createProperty( final org.eclipse.digitaltwin.aas4j.v3.model.Su } final MetaModelBaseAttributes metaModelBaseAttributes = baseAttributes( submodelElement, new DetermineAutomatically() ); - final Characteristic characteristic = createCharacteristic( submodelElement, metaModelBaseAttributes.getUrn() - .orElseThrow( () -> new AspectModelGenerationException( "Encountered property without URN" ) ) ); + final Characteristic characteristic = createCharacteristic( submodelElement, metaModelBaseAttributes.urn() ); final Optional exampleValue = submodelElement instanceof final org.eclipse.digitaltwin.aas4j.v3.model.Property property ? Optional.ofNullable( property.getValue() ) @@ -461,7 +460,7 @@ private Event createEvent( final EventElement event ) { final MetaModelBaseAttributes metaModelBaseAttributes = baseAttributes( event, new DetermineAutomatically() ); // Since an AAS EventElement/BasicEvent does not have Properties but only info about the broker, we can't create anything // meaningful here - LOG.warn( "Creating event {} with empty list of properties", metaModelBaseAttributes.getName() ); + LOG.warn( "Creating event {} with empty list of properties", metaModelBaseAttributes.urn().getName() ); return new DefaultEvent( metaModelBaseAttributes, List.of() ); } @@ -508,17 +507,17 @@ private Characteristic createCharacteristicFromRelationShipElement( final Relati .flatMap( Optional::stream ); final List seeReferences = Stream.concat( seeReferences( relationshipElement ).stream(), relationShipSeeReferences ).toList(); - final MetaModelBaseAttributes metaModelBaseAttributes = new MetaModelBaseAttributes( KnownVersion.getLatest(), - urn, elementName.name(), - langStringSet( relationshipElement.getDisplayName() ), - Set.of( new LangString( characteristicDescription, Locale.ENGLISH ) ), - seeReferences, - elementName.isSynthetic() ); + final MetaModelBaseAttributes metaModelBaseAttributes = MetaModelBaseAttributes.builder() + .withUrn( urn ) + .withPreferredNames( langStringSet( relationshipElement.getDisplayName() ) ) + .withDescription( Locale.ENGLISH, characteristicDescription ) + .withSee( seeReferences ) + .isAnonymous( elementName.isSynthetic() ) + .build(); // The RelationShipElement Characteristic dataType is pinned to string for now, see discussion // here https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/issues/133 - return new DefaultCharacteristic( metaModelBaseAttributes, - Optional.of( new DefaultScalar( XSD.xstring.getURI(), KnownVersion.getLatest() ) ) ); + return new DefaultCharacteristic( metaModelBaseAttributes, Optional.of( new DefaultScalar( XSD.xstring.getURI() ) ) ); } private Characteristic createCharacteristicFromBlob( final Blob blob, final AspectModelUrn propertyUrn ) { @@ -528,12 +527,12 @@ private Characteristic createCharacteristicFromBlob( final Blob blob, final Aspe private Characteristic createCharacteristicFromFile( final File file ) { return createDefaultScalarCharacteristic( file, XSD.anyURI.getURI(), - new UseGivenUrn( AspectModelUrn.fromUrn( sammc.ResourcePath().getURI() ) ) ); + new UseGivenUrn( AspectModelUrn.fromUrn( SammNs.SAMMC.ResourcePath().getURI() ) ) ); } private Characteristic createCharacteristicFromMultiLanguageProperty( final MultiLanguageProperty multiLanguageProperty ) { return createDefaultScalarCharacteristic( multiLanguageProperty, RDF.langString.getURI(), - new UseGivenUrn( AspectModelUrn.fromUrn( sammc.MultiLanguageText().getURI() ) ) ); + new UseGivenUrn( AspectModelUrn.fromUrn( SammNs.SAMMC.MultiLanguageText().getURI() ) ) ); } private Characteristic createCharacteristicFromProperty( final org.eclipse.digitaltwin.aas4j.v3.model.Property property, @@ -541,9 +540,9 @@ private Characteristic createCharacteristicFromProperty( final org.eclipse.digit final String dataTypeUri = AasDataTypeMapper.mapAasXsdDataTypeToAspectType( property.getValueType() ).getURI(); final ElementNamingStrategy elementNamingStrategy; if ( dataTypeUri.equals( XSD.xboolean.getURI() ) ) { - elementNamingStrategy = new UseGivenUrn( AspectModelUrn.fromUrn( sammc.Boolean().getURI() ) ); + elementNamingStrategy = new UseGivenUrn( AspectModelUrn.fromUrn( SammNs.SAMMC.Boolean().getURI() ) ); } else if ( dataTypeUri.equals( XSD.dateTime.getURI() ) ) { - elementNamingStrategy = new UseGivenUrn( AspectModelUrn.fromUrn( sammc.Timestamp().getURI() ) ); + elementNamingStrategy = new UseGivenUrn( AspectModelUrn.fromUrn( SammNs.SAMMC.Timestamp().getURI() ) ); } else { elementNamingStrategy = new DetermineAutomatically( propertyUrn.getName() + "Property" ); } @@ -557,15 +556,13 @@ private Characteristic createCharacteristicFromRange( final Range range, final A final Optional minValue = Optional.ofNullable( range.getMin() ) .flatMap( minLexical -> valueInstantiator.buildScalarValue( minLexical, null, dataTypeUri ) ); - final MetaModelBaseAttributes constraintMetaModelBaseAttributes = new MetaModelBaseAttributes( KnownVersion.getLatest(), - null, "RangeConstraint" + randomElementName( range ), Set.of(), Set.of(), List.of(), true ); + final MetaModelBaseAttributes constraintMetaModelBaseAttributes = MetaModelBaseAttributes.builder().isAnonymous().build(); final RangeConstraint constraint = new DefaultRangeConstraint( constraintMetaModelBaseAttributes, minValue, maxValue, BoundDefinition.AT_LEAST, BoundDefinition.AT_MOST ); - final MetaModelBaseAttributes baseCharacteristicBaseAttributes = new MetaModelBaseAttributes( KnownVersion.getLatest(), - null, "BaseCharacteristic" + randomElementName( range ), Set.of(), Set.of(), List.of(), true ); + final MetaModelBaseAttributes baseCharacteristicBaseAttributes = MetaModelBaseAttributes.builder().isAnonymous().build(); final Characteristic baseCharacteristic = new DefaultCharacteristic( baseCharacteristicBaseAttributes, - Optional.of( new DefaultScalar( dataTypeUri, KnownVersion.getLatest() ) ) ); + Optional.of( new DefaultScalar( dataTypeUri ) ) ); final MetaModelBaseAttributes traitMetaModelBaseAttributes = baseAttributes( range, new DetermineAutomatically( propertyUrn.getName() + "Trait" ) ); @@ -633,8 +630,7 @@ private AasSubmodelElements submodelElementType( final SubmodelElement element ) private Characteristic createDefaultScalarCharacteristic( final SubmodelElement submodelElement, final String dataTypeUri, final ElementNamingStrategy elementNamingStrategy ) { final MetaModelBaseAttributes metaModelBaseAttributes = baseAttributes( submodelElement, elementNamingStrategy ); - return new DefaultCharacteristic( metaModelBaseAttributes, - Optional.of( new DefaultScalar( dataTypeUri, KnownVersion.getLatest() ) ) ); + return new DefaultCharacteristic( metaModelBaseAttributes, Optional.of( new DefaultScalar( dataTypeUri ) ) ); } private Characteristic createCharacteristic( final SubmodelElement element, final AspectModelUrn propertyUrn ) { diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGenerator.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGenerator.java index 92c7dd628..2735208b7 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGenerator.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGenerator.java @@ -34,6 +34,16 @@ * Generator that generates an AAS file containing an AAS submodel for a given Aspect model. */ public class AspectModelAasGenerator { + + private List> propertyMappers = List.of(); + + public AspectModelAasGenerator() { + } + + public AspectModelAasGenerator( final List> propertyMappers ) { + this.propertyMappers = propertyMappers; + } + /** * Generates an AAS file for a given Aspect. * @@ -93,6 +103,7 @@ public void generate( final AasFileFormat format, final Aspect aspect, @Nullable final Function nameMapper ) { try ( final OutputStream output = nameMapper.apply( aspect.getName() ) ) { final AspectModelAasVisitor visitor = new AspectModelAasVisitor().withPropertyMapper( new LangStringPropertyMapper() ); + propertyMappers.forEach( visitor::withPropertyMapper ); final Context context; if ( aspectData != null ) { final Submodel submodel = new DefaultSubmodel.Builder().build(); diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasVisitor.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasVisitor.java index 24dc24065..cb1368e9f 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasVisitor.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasVisitor.java @@ -23,36 +23,31 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.Trait; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.google.common.collect.ImmutableMap; import org.apache.commons.collections4.CollectionUtils; @@ -139,7 +134,7 @@ ImmutableMap. builder() .put( RDF.langString, DataTypeIec61360.STRING ) .build(); - private interface SubmodelElementBuilder { + interface SubmodelElementBuilder { SubmodelElement build( Property property ); } @@ -157,14 +152,18 @@ public AspectModelAasVisitor withPropertyMapper( final PropertyMapper propert @SuppressWarnings( "unchecked" ) protected PropertyMapper findPropertyMapper( final Property property ) { - return (PropertyMapper) getCustomPropertyMappers().stream() + return this. tryFindPropertyMapper( property ).orElse( (PropertyMapper) DEFAULT_MAPPER ); + } + + protected Optional> tryFindPropertyMapper( final Property property ) { + return getCustomPropertyMappers().stream() .filter( mapper -> mapper.canHandle( property ) ) - .findAny() - .orElse( DEFAULT_MAPPER ); + .map( mapper -> (PropertyMapper) mapper ) + .findFirst(); } protected List> getCustomPropertyMappers() { - return customPropertyMappers; + return customPropertyMappers.stream().sorted().toList(); } @Override @@ -172,7 +171,7 @@ public Environment visitBase( final ModelElement base, final Context context ) { return context.getEnvironment(); } - protected List buildGlobalReferenceForSeeReferences( final NamedElement modelElement ) { + protected List buildGlobalReferenceForSeeReferences( final ModelElement modelElement ) { return modelElement.getSee().stream().map( seeReference -> (Reference) new DefaultReference.Builder() .type( ReferenceTypes.EXTERNAL_REFERENCE ) .keys( new DefaultKey.Builder() @@ -184,7 +183,7 @@ protected List buildGlobalReferenceForSeeReferences( final NamedEleme } private List updateGlobalReferenceWithSeeReferences( final SubmodelElement submodelElement, - final NamedElement modelElement ) { + final ModelElement modelElement ) { final List newReferences = buildGlobalReferenceForSeeReferences( modelElement ); final List supplementalSemanticIds = submodelElement.getSupplementalSemanticIds(); if ( supplementalSemanticIds == null ) { @@ -203,7 +202,7 @@ public Environment visitAspect( final Aspect aspect, final Context context ) { return result; } ); - final String submodelId = aspect.getAspectModelUrn().get().getUrn().toString() + "/submodel"; + final String submodelId = aspect.urn().getUrn().toString() + "/submodel"; final Submodel submodel = usedContext.getSubmodel(); submodel.setIdShort( aspect.getName() ); @@ -258,14 +257,13 @@ private Optional mapText( final Property property, final Contex // property will be excluded from generation. recursiveProperty.remove( property ); if ( property.isOptional() ) { - LOG.warn( String.format( "Having a recursive Property %s which is optional. Will be excluded from AAS mapping.", - property.getAspectModelUrn().map( AspectModelUrn::toString ).orElse( "(unknown)" ) ) ); + LOG.warn( + String.format( "Having a recursive Property %s which is optional. Will be excluded from AAS mapping.", property.urn() ) ); return defaultResultForProperty; } else { LOG.error( String.format( "Having a recursive property: %s which is not optional is not valid. Check the model. Property will be excluded from " - + "AAS mapping.", - property.getAspectModelUrn().map( AspectModelUrn::toString ).orElse( "(unknown)" ) ) ); + + "AAS mapping.", property.urn() ) ); } return defaultResultForProperty; } @@ -399,7 +397,7 @@ private void createConceptDescription( final Property property, final Context co return; } // check if the concept description is already created. If not create a new one. - if ( !context.hasEnvironmentConceptDescription( property.getAspectModelUrn().toString() ) ) { + if ( !context.hasEnvironmentConceptDescription( property.urn().toString() ) ) { final ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() .idShort( property.getName() ) @@ -413,7 +411,7 @@ private void createConceptDescription( final Property property, final Context co private void createConceptDescription( final org.eclipse.esmf.metamodel.Operation operation, final Context context ) { // check if the concept description is already created. If not create a new one. - if ( !context.hasEnvironmentConceptDescription( operation.getAspectModelUrn().toString() ) ) { + if ( !context.hasEnvironmentConceptDescription( operation.urn().toString() ) ) { final ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() .idShort( operation.getName() ) @@ -427,7 +425,7 @@ private void createConceptDescription( final org.eclipse.esmf.metamodel.Operatio private void createConceptDescription( final Aspect aspect, final Context context ) { // check if the concept description is already created. If not create a new one. - if ( !context.hasEnvironmentConceptDescription( aspect.getAspectModelUrn().toString() ) ) { + if ( !context.hasEnvironmentConceptDescription( aspect.urn().toString() ) ) { final ConceptDescription conceptDescription = new DefaultConceptDescription.Builder() .idShort( aspect.getName() ) @@ -535,12 +533,12 @@ public Environment visitCollection( final Collection collection, final Context c } @Override - public Environment visitList( final org.eclipse.esmf.characteristic.List list, final Context context ) { + public Environment visitList( final org.eclipse.esmf.metamodel.characteristic.List list, final Context context ) { return visitCollectionProperty( list, context ); } @Override - public Environment visitSet( final org.eclipse.esmf.characteristic.Set set, final Context context ) { + public Environment visitSet( final org.eclipse.esmf.metamodel.characteristic.Set set, final Context context ) { return visitCollectionProperty( set, context ); // this type is not available in AAS4J } @@ -551,45 +549,45 @@ public Environment visitSortedSet( final SortedSet sortedSet, final Context cont } private Environment visitCollectionProperty( final T collection, final Context context ) { - final SubmodelElementBuilder builder = property -> { + final SubmodelElementBuilder defaultBuilder = property -> { final DefaultSubmodelElementList.Builder submodelBuilder = new DefaultSubmodelElementList.Builder() .idShort( property.getName() ) - .typeValueListElement( AasSubmodelElements.DATA_ELEMENT ) .displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) ) .description( LangStringMapper.TEXT.map( property.getDescriptions() ) ) .value( List.of( decideOnMapping( property, context ) ) ) .typeValueListElement( AasSubmodelElements.SUBMODEL_ELEMENT ) .supplementalSemanticIds( buildGlobalReferenceForSeeReferences( collection ) ); - if ( collection.getAspectModelUrn().isPresent() ) { - submodelBuilder.semanticId( buildReferenceForCollection( collection.getAspectModelUrn().get().getUrn().toString() ) ); + if ( !collection.isAnonymous() ) { + submodelBuilder.semanticId( buildReferenceForCollection( collection.urn().getUrn().toString() ) ); } return submodelBuilder.build(); }; - final Optional rawValue = context.getRawPropertyValue(); - return rawValue.map( node -> { - if ( node instanceof final ArrayNode arrayNode ) { - final SubmodelElementBuilder listBuilder = property -> { - final List values = getValues( collection, property, context, arrayNode ); - return new DefaultSubmodelElementList.Builder() - .idShort( property.getName() ) - .displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) ) - .description( LangStringMapper.TEXT.map( property.getDescriptions() ) ) - .value( values ) - .typeValueListElement( AasSubmodelElements.SUBMODEL_ELEMENT ) - .build(); - }; - createSubmodelElement( listBuilder, context ); - return context.getEnvironment(); - } - createSubmodelElement( builder, context ); - return context.getEnvironment(); - } ).orElseGet( () -> { - createSubmodelElement( builder, context ); - return context.getEnvironment(); - } ); + final SubmodelElementBuilder listBuilder = + tryFindPropertyMapper( context.getProperty() ) + .flatMap( mapper -> collection.getDataType() + .map( type -> (SubmodelElementBuilder) ( Property property ) -> mapper.mapToAasProperty( type, property, + context ) ) ) + .or( () -> context.getRawPropertyValue() + .filter( ArrayNode.class::isInstance ) + .map( ArrayNode.class::cast ) + .map( arrayNode -> ( Property property ) -> { + final List values = getValues( collection, property, context, arrayNode ); + return new DefaultSubmodelElementList.Builder() + .idShort( property.getName() ) + .displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) ) + .description( LangStringMapper.TEXT.map( property.getDescriptions() ) ) + .value( values ) + .typeValueListElement( AasSubmodelElements.SUBMODEL_ELEMENT ) + .build(); + } ) ) + .orElse( defaultBuilder ); + + createSubmodelElement( listBuilder, context ); + + return context.getEnvironment(); } private List getValues( final T collection, final Property property, final Context context, @@ -598,9 +596,10 @@ private List getValues( final T collecti .map( dataType -> { if ( Scalar.class.isAssignableFrom( dataType.getClass() ) ) { return List.of( (SubmodelElement) new DefaultBlob.Builder().value( StreamSupport.stream( arrayNode.spliterator(), false ) - .map( JsonNode::asText ) - .collect( Collectors.joining( "," ) ) - .getBytes( StandardCharsets.UTF_8 ) ).build() ); + .map( node -> node.isValueNode() ? node.asText() : node.toString() ) + .collect( Collectors.joining( "," ) ) + .getBytes( StandardCharsets.UTF_8 ) ) + .contentType( "text/plain" ).build() ); } else { final List values = StreamSupport.stream( arrayNode.spliterator(), false ) .map( node -> { @@ -656,7 +655,12 @@ private Optional handleEitherField( final String field, final C final Property eitherProperty, final Context context ) { Optional result = Optional.empty(); if ( context.getModelingKind().equals( ModellingKind.INSTANCE ) ) { - final Property fieldProperty = createProperty( eitherProperty.getMetaModelVersion(), field, fieldCharacteristic ); + final MetaModelBaseAttributes propertyAttributes = MetaModelBaseAttributes.builder() + .withUrn( eitherProperty.urn().getUrnPrefix() + eitherProperty.getPayloadName() + field.toUpperCase() ) + .build(); + final Property fieldProperty = new org.eclipse.esmf.metamodel.impl.DefaultProperty( propertyAttributes, + Optional.of( fieldCharacteristic ), Optional.empty(), true, + false, Optional.of( field ), false, Optional.empty() ); context.setProperty( fieldProperty ); if ( context.getRawPropertyValue().isPresent() ) { result = fieldCharacteristic.getDataType().map( dataType -> decideOnMapping( dataType, context.getProperty(), context ) ); @@ -669,15 +673,6 @@ private Optional handleEitherField( final String field, final C return result; } - private Property createProperty( final KnownVersion modelVersion, final String propertyName, final Characteristic characteristic ) { - final MetaModelBaseAttributes propertyAttributes = - MetaModelBaseAttributes.from( modelVersion, AspectModelUrn.fromUrn( new SAMM( modelVersion ).Property().getURI() ), - propertyName ); - return new org.eclipse.esmf.metamodel.impl.DefaultProperty( propertyAttributes, Optional.of( characteristic ), Optional.empty(), true, - false, - Optional.empty(), false, Optional.empty() ); - } - @Override public Environment visitQuantifiable( final Quantifiable quantifiable, final Context context ) { createSubmodelElement( property -> decideOnMapping( property, context ), context ); diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringMapper.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringMapper.java index ec2c8ceb4..318248b37 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringMapper.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringMapper.java @@ -17,7 +17,7 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringPropertyMapper.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringPropertyMapper.java index d60552e31..5c8663017 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringPropertyMapper.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/LangStringPropertyMapper.java @@ -15,11 +15,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Type; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import org.apache.jena.vocabulary.RDF; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.MultiLanguageProperty; @@ -49,17 +52,16 @@ public MultiLanguageProperty mapToAasProperty( final Type type, final Property p } private List extractLangStrings( final Property property, final Context context ) { - return context.getRawPropertyValue() + return context.getRawPropertyValue().stream() + .flatMap( node -> node.isArray() ? StreamSupport.stream( node.spliterator(), false ) : Stream.of( node ) ) .filter( JsonNode::isObject ) - .map( node -> { + .map( ObjectNode.class::cast ) + .flatMap( node -> { final Map entries = new HashMap<>(); node.fields().forEachRemaining( field -> entries.put( field.getKey(), field.getValue().asText() ) ); - return entries; + return entries.entrySet().stream(); } ) - .map( rawEntries -> rawEntries.entrySet() - .stream() - .map( entry -> LangStringMapper.TEXT.createLangString( entry.getValue(), entry.getKey() ) ) - .toList() ) - .orElseGet( List::of ); + .map( entry -> LangStringMapper.TEXT.createLangString( entry.getValue(), entry.getKey() ) ) + .toList(); } } diff --git a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/PropertyMapper.java b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/PropertyMapper.java index ecf206927..9d61aa6a1 100644 --- a/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/PropertyMapper.java +++ b/core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/PropertyMapper.java @@ -12,8 +12,7 @@ */ package org.eclipse.esmf.aspectmodel.aas; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.metamodel.NamedElement; +import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Type; @@ -30,7 +29,7 @@ * * @param the concrete type of {@link SubmodelElement} the implementing mapper produces */ -public interface PropertyMapper { +public interface PropertyMapper extends Comparable> { static String UNKNOWN_TYPE = "Unknown"; static String UNKNOWN_EXAMPLE = ""; @@ -55,6 +54,26 @@ default boolean canHandle( final Property property ) { return true; } + /** + * Returns the ordering value for this property mapper. + * + *

The order is used to determine the correct mapper if multiple matches can occur. By default mappers have + * {@link Integer#MAX_VALUE} applied as their order value, meaning they will be sorted to the very end. + * + *

One example for the need of a proper ordering is, if a general mapper for a specific property type is used, but an even more + * specific mapper should be used for one exact property, that also has this type. + * + * @return the order value + */ + default int getOrder() { + return Integer.MAX_VALUE; + } + + @Override + default int compareTo( PropertyMapper otherPropertyMapper ) { + return Integer.compare( getOrder(), otherPropertyMapper.getOrder() ); + } + /** * Builds a concept description reference for the given property. * @@ -70,14 +89,12 @@ default Reference buildReferenceToGlobalReference( final Property property ) { } /** - * Determines the identifier for the given {@link NamedElement}. + * Determines the identifier for the given {@link ModelElement}. * * @param element the element to get the identifier for * @return the identifier */ - default String determineIdentifierFor( final NamedElement element ) { - return element.getAspectModelUrn() - .map( AspectModelUrn::toString ) - .orElseGet( element::getName ); + default String determineIdentifierFor( final ModelElement element ) { + return element.urn().toString(); } } diff --git a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGeneratorTest.java b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGeneratorTest.java index ab85fc2a9..303a086a2 100644 --- a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGeneratorTest.java +++ b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AasToAspectModelGeneratorTest.java @@ -23,10 +23,7 @@ import java.util.List; import java.util.function.Consumer; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -40,8 +37,10 @@ import org.junit.jupiter.params.provider.EnumSource; public class AasToAspectModelGeneratorTest { + + // IDTA-provided sample files can currently not be read with AAS4J @Test - @Disabled // IDTA-provided sample files can currently not be read with AAS4J + @Disabled void testTranslateDigitalNameplate() { final InputStream aasx = AasToAspectModelGeneratorTest.class.getClassLoader() .getResourceAsStream( "Sample_ZVEI_Digital_Nameplate_V10.aasx" ); @@ -52,13 +51,12 @@ void testTranslateDigitalNameplate() { @ParameterizedTest @EnumSource( TestAspect.class ) void testRoundtripConversion( final TestAspect testAspect ) throws DeserializationException { - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( - TestResources.getModel( testAspect, KnownVersion.getLatest() ).get() ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); final Consumer assertForValidator = aspectModelGenerator -> assertThatCode( () -> { final List aspects = aspectModelGenerator.generateAspects(); assertThat( aspects ).singleElement().satisfies( generatedAspect -> - assertThat( generatedAspect.getAspectModelUrn().get() ).isEqualTo( aspect.getAspectModelUrn().get() ) ); + assertThat( generatedAspect.urn() ).isEqualTo( aspect.urn() ) ); } ).doesNotThrowAnyException(); final Environment aasEnvironmentFromXml = new XmlDeserializer().read( @@ -77,7 +75,7 @@ void testGetAspectModelUrnFromSubmodelIdentifier() { final Environment aasEnvironment = loadEnvironment( "SMTWithAspectModelUrnId.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ).contains( "urn:samm:com.example:1.0.0#Submodel1" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example:1.0.0#Submodel1" ) ); } @Test @@ -86,7 +84,7 @@ void testGetAspectModelUrnFromConceptDescription() { final Environment aasEnvironment = loadEnvironment( "SMTWithAspectModelUrnInConceptDescription.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ).contains( "urn:samm:com.example:1.0.0#Submodel1" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example:1.0.0#Submodel1" ) ); } @Test @@ -96,8 +94,7 @@ void testConstructAspectModelUrn1() { final Environment aasEnvironment = loadEnvironment( "SMTAspectModelUrnInConstruction1.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ) - .contains( "urn:samm:com.example.www:1.2.3#Submodel1" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example.www:1.2.3#Submodel1" ) ); } @Test @@ -107,7 +104,7 @@ void testConstructAspectModelUrn2() { final Environment aasEnvironment = loadEnvironment( "SMTAspectModelUrnInConstruction2.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ).contains( "urn:samm:com.example:1.2.3#Submodel1" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example:1.2.3#Submodel1" ) ); } @Test @@ -117,7 +114,7 @@ void testConstructAspectModelUrn3() { final Environment aasEnvironment = loadEnvironment( "SMTAspectModelUrnInConstruction3.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ).contains( "urn:samm:com.example:1.0.0#Submodel1" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example:1.0.0#Submodel1" ) ); } @Test @@ -127,8 +124,7 @@ void testConstructAspectModelUrn4() { final Environment aasEnvironment = loadEnvironment( "SMTAspectModelUrnInConstruction4.aas.xml" ); final AasToAspectModelGenerator aspectModelGenerator = AasToAspectModelGenerator.fromEnvironment( aasEnvironment ); assertThat( aspectModelGenerator.generateAspects() ).singleElement().satisfies( aspect -> - assertThat( aspect.getAspectModelUrn() ).map( AspectModelUrn::toString ) - .contains( "urn:samm:com.example:1.0.0#AAAAAA000abf2fd07" ) ); + assertThat( aspect.urn().toString() ).isEqualTo( "urn:samm:com.example:1.0.0#AAAAAA000abf2fd07" ) ); } private Environment loadEnvironment( final String name ) { diff --git a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGeneratorTest.java b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGeneratorTest.java index 9307ff3de..dec31857f 100644 --- a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGeneratorTest.java +++ b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAasGeneratorTest.java @@ -29,7 +29,7 @@ import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -40,6 +40,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; +import org.eclipse.digitaltwin.aas4j.v3.model.Blob; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; @@ -55,6 +56,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -123,6 +125,42 @@ void generateAasxWithAspectDataForNestedEntityLists() throws DeserializationExce .isEqualTo( "2.25" ) ) ) ) ); } + @Test + void generateAasxWithAspectDataForCollectionProperty() throws DeserializationException { + final Environment env = getAssetAdministrationShellFromAspectWithData( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE ); + assertThat( env.getSubmodels() ) + .singleElement() + .satisfies( subModel -> assertThat( subModel.getSubmodelElements() ) + .anySatisfy( sme -> + assertThat( sme ).asInstanceOf( type( SubmodelElementList.class ) ) + .extracting( SubmodelElementList::getValue ) + .asInstanceOf( InstanceOfAssertFactories.LIST ) + .singleElement() + .satisfies( element -> + assertThat( element ).asInstanceOf( type( Blob.class ) ) + .extracting( Blob::getValue ) + .satisfies( blobData -> assertThat( new String( blobData ) ).isEqualTo( "1,2,3,4,5,6" ) ) ) ) ); + } + + @Test + void generateAasxWithAspectDataForCollectionPropertyWithCustomMapper() throws DeserializationException { + AspectModelAasGenerator customGenerator = new AspectModelAasGenerator( List.of( new IntegerCollectionMapper() ) ); + final Environment env = getAssetAdministrationShellFromAspectWithData( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE, + customGenerator ); + assertThat( env.getSubmodels() ) + .singleElement() + .satisfies( subModel -> assertThat( subModel.getSubmodelElements() ) + .anySatisfy( sme -> + assertThat( sme ).asInstanceOf( type( SubmodelElementList.class ) ) + .extracting( SubmodelElementList::getValue ) + .asInstanceOf( InstanceOfAssertFactories.LIST ) + .allSatisfy( element -> + assertThat( element ).asInstanceOf( type( DefaultProperty.class ) ) + .extracting( DefaultProperty::getValue ) + .satisfies( + intString -> assertThat( Integer.parseInt( intString ) ).isBetween( 1, 6 ) ) ) ) ); + } + @Test void testGenerateAasxFromAspectModelWithListAndAdditionalProperty() throws DeserializationException { final Environment env = getAssetAdministrationShellFromAspect( TestAspect.ASPECT_WITH_LIST_AND_ADDITIONAL_PROPERTY ); @@ -349,7 +387,7 @@ void testGenerateAasxFromAspectModelWithOperations() throws DeserializationExcep assertThat( environment.getConceptDescriptions().stream().filter( cd -> cd.getIdShort().equals( operation2.getIdShort() ) ) ).isNotNull(); - assertThat( environment.getConceptDescriptions() ).hasSize( 7 ); + assertThat( environment.getConceptDescriptions() ).hasSizeGreaterThanOrEqualTo( 5 ); } @Test @@ -408,6 +446,11 @@ private Environment getAssetAdministrationShellFromAspect( final TestAspect test } private Environment getAssetAdministrationShellFromAspectWithData( final TestAspect testAspect ) throws DeserializationException { + return getAssetAdministrationShellFromAspectWithData( testAspect, generator ); + } + + private Environment getAssetAdministrationShellFromAspectWithData( final TestAspect testAspect, final AspectModelAasGenerator generator ) + throws DeserializationException { final Aspect aspect = loadAspect( testAspect ); final JsonNode aspectData = loadPayload( testAspect ); return loadAasx( generator.generateAsByteArray( AasFileFormat.XML, aspect, aspectData ) ); diff --git a/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/IntegerCollectionMapper.java b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/IntegerCollectionMapper.java new file mode 100644 index 000000000..ef2d1fda7 --- /dev/null +++ b/core/esmf-aspect-model-aas-generator/src/test/java/org/eclipse/esmf/aspectmodel/aas/IntegerCollectionMapper.java @@ -0,0 +1,53 @@ +package org.eclipse.esmf.aspectmodel.aas; + +import java.util.List; +import java.util.stream.StreamSupport; + +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.Property; +import org.eclipse.esmf.metamodel.Type; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ArrayNode; +import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; + +public class IntegerCollectionMapper implements PropertyMapper { + @Override + public SubmodelElementList mapToAasProperty( final Type type, final Property property, final Context context ) { + final List values = context.getRawPropertyValue() + .stream() + .filter( JsonNode::isArray ) + .map( ArrayNode.class::cast ) + .flatMap( arrayNode -> StreamSupport.stream( arrayNode.spliterator(), false ) + .map( value -> new DefaultProperty.Builder().idShort( "intValue" ) + .valueType( DataTypeDefXsd.INT ) + .value( value.asText() ) + .build() ) ) + .toList(); + + return new DefaultSubmodelElementList.Builder() + .idShort( property.getName() ) + .displayName( LangStringMapper.NAME.map( property.getPreferredNames() ) ) + .description( LangStringMapper.TEXT.map( property.getDescriptions() ) ) + .value( (List) values ) + .typeValueListElement( AasSubmodelElements.SUBMODEL_ELEMENT ) + .build(); + } + + @Override + public boolean canHandle( final Property property ) { + return property.getAspectModelUrn() + .map( urn -> urn.equals( AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.test:1.0.0#testList" ) ) ) + .orElse( false ); + } + + @Override + public int getOrder() { + return 0; + } +} diff --git a/core/esmf-aspect-model-document-generators/pom.xml b/core/esmf-aspect-model-document-generators/pom.xml index e8d4335ba..c8de39da7 100644 --- a/core/esmf-aspect-model-document-generators/pom.xml +++ b/core/esmf-aspect-model-document-generators/pom.xml @@ -33,10 +33,6 @@ org.eclipse.esmf esmf-aspect-meta-model-java - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - org.eclipse.esmf esmf-aspect-model-jackson diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/AspectModelHelper.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/AspectModelHelper.java index abce93297..5a07d0b65 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/AspectModelHelper.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/AspectModelHelper.java @@ -21,52 +21,40 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.Trait; public class AspectModelHelper { - private final KnownVersion metaModelVersion; - - public AspectModelHelper( final KnownVersion metaModelVersion ) { - this.metaModelVersion = metaModelVersion; - } - - public KnownVersion getMetaModelVersion() { - return metaModelVersion; - } - - public static List sortPropertiesByPreferredName( final List properties, final Locale locale ) { + public List sortPropertiesByPreferredName( final List properties, final Locale locale ) { if ( properties != null ) { properties.sort( Comparator.comparing( property -> property.getPreferredName( locale ) ) ); } return properties; } - public static List sortEntitiesByPreferredName( final List entities, final Locale locale ) { + public List sortEntitiesByPreferredName( final List entities, final Locale locale ) { if ( entities != null ) { entities.sort( Comparator.comparing( entity -> entity.getPreferredName( locale ) ) ); } return entities; } - public static List sortOperationsByPreferredName( final List operations, final Locale locale ) { + public List sortOperationsByPreferredName( final List operations, final Locale locale ) { if ( operations != null ) { operations.sort( Comparator.comparing( operation -> operation.getPreferredName( locale ) ) ); } return operations; } - public static List getEntities( final Aspect aspectModel ) { + public List getEntities( final Aspect aspectModel ) { return new AspectStreamTraversalVisitor() .visitAspect( aspectModel, null ) .filter( base -> ComplexType.class.isAssignableFrom( base.getClass() ) ) @@ -75,7 +63,7 @@ public static List getEntities( final Aspect aspectModel ) { .collect( Collectors.toList() ); } - public static Set getConstraints( final Property property ) { + public Set getConstraints( final Property property ) { final Set constraints = new HashSet<>(); property.getCharacteristic().filter( characteristic -> characteristic.is( Trait.class ) ) .map( characteristic -> characteristic.as( Trait.class ) ) @@ -83,7 +71,7 @@ public static Set getConstraints( final Property property ) { return constraints; } - public static ComplexType resolveEntity( final SingleEntity singleEntity, final List entities ) { + public ComplexType resolveEntity( final SingleEntity singleEntity, final List entities ) { return entities.stream() .filter( entity -> singleEntity.getDataType() .map( Type::getUrn ) @@ -93,12 +81,12 @@ public static ComplexType resolveEntity( final SingleEntity singleEntity, final + " in list of entities: " + entities ) ); } - public static String getNameFromUrn( final String urn ) { + public String getNameFromUrn( final String urn ) { final String[] parts = urn.split( "#" ); return parts.length == 2 ? parts[1] : urn; } - public static Class getClassForObject( final Object o ) { + public Class getClassForObject( final Object o ) { final Class[] interfaces = o.getClass().getInterfaces(); if ( interfaces.length <= 0 ) { return Object.class; @@ -106,27 +94,27 @@ public static Class getClassForObject( final Object o ) { return interfaces[0]; } - public static boolean isProperty( final Object object ) { + public boolean isProperty( final Object object ) { return object instanceof Property; } - public static int increment( final int number ) { + public int increment( final int number ) { return number + 1; } - private static String namespaceAnchorPart( final NamedElement modelElement ) { + private String namespaceAnchorPart( final ModelElement modelElement ) { return Optional.ofNullable( modelElement ) - .flatMap( NamedElement::getAspectModelUrn ) + .map( ModelElement::urn ) .map( urn -> urn.getNamespace().replace( ".", "-" ) ).orElse( "" ); } - public static String buildAnchor( final NamedElement modelElement, final NamedElement parentElement, final String suffix ) { + public String buildAnchor( final ModelElement modelElement, final ModelElement parentElement, final String suffix ) { final String parentNamespaceAnchorPart = namespaceAnchorPart( parentElement ); final String parentPart = suffix.equals( "property" ) ? parentNamespaceAnchorPart + "-" - + Optional.ofNullable( parentElement ).map( NamedElement::getName ).orElse( "" ) + "-" : ""; + + Optional.ofNullable( parentElement ).map( ModelElement::getName ).orElse( "" ) + "-" : ""; - if ( ((ModelElement) modelElement).is( Property.class ) ) { - final Property property = ((ModelElement) modelElement).as( Property.class ); + if ( modelElement.is( Property.class ) ) { + final Property property = modelElement.as( Property.class ); if ( property.getExtends().isPresent() ) { // The Property actually extends another (possibly Abstract) Property, so it won't have an Aspect Model URN on its own. // Use the parent element's namespace for the anchor. diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollector.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollector.java index 36ab30d74..283a538e7 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollector.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollector.java @@ -13,26 +13,17 @@ package org.eclipse.esmf.aspectmodel.generator; -import java.util.Collections; +import static java.util.stream.Collectors.toSet; + +import java.util.Collection; import java.util.Locale; import java.util.Set; -import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.esmf.aspectmodel.UnsupportedVersionException; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.datatype.LangString; -import com.google.common.collect.ImmutableList; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,48 +44,13 @@ private LanguageCollector() { */ public static Set collectUsedLanguages( final Aspect aspect ) { final Stream fromModel = new AspectStreamTraversalVisitor().visitAspect( aspect, null ) - .flatMap( element -> { - if ( element instanceof final NamedElement described ) { - return Stream.concat( - described.getPreferredNames().stream().map( LangString::getLanguageTag ), - described.getDescriptions().stream().map( LangString::getLanguageTag ) ); - } - return Stream.of(); - } ); - return Stream.concat( fromModel, Stream.of( Locale.ENGLISH ) ).collect( Collectors.toSet() ); + .flatMap( element -> Stream.concat( + element.getPreferredNames().stream().map( LangString::getLanguageTag ), + element.getDescriptions().stream().map( LangString::getLanguageTag ) ) ); + return Stream.concat( fromModel, Stream.of( Locale.ENGLISH ) ).collect( toSet() ); } - /** - * Returns the set of language tags used in the Aspect Model - * - * @param model The Aspect Model - * @return The set of language tags used in the Aspect Model - */ - public static Set collectUsedLanguages( final Model model ) { - final SammAspectMetaModelResourceResolver resolver = new SammAspectMetaModelResourceResolver(); - return resolver.getMetaModelVersion( model ).map( metaModelVersion -> { - final SAMM samm = new SAMM( KnownVersion.fromVersionString( metaModelVersion.toString() ) - .orElseThrow( () -> new UnsupportedVersionException( metaModelVersion ) ) ); - - final String nameSpace = model.listStatements( null, RDF.type, samm.Aspect() ).nextStatement().getSubject() - .getNameSpace(); - final Set locales = Stream.concat( - ImmutableList.copyOf( model.listStatements( null, samm.preferredName(), (RDFNode) null ) ).stream(), - ImmutableList.copyOf( model.listStatements( null, samm.description(), (RDFNode) null ) ).stream() ) - .filter( statement -> !statement.getSubject().isAnon() ) - .filter( statement -> statement.getSubject().getNameSpace() - .contains( nameSpace ) ) - .map( Statement::getLanguage ) - .filter( language -> !language.isEmpty() ) - .map( Locale::forLanguageTag ) - .collect( Collectors.toSet() ); - if ( locales.isEmpty() ) { - locales.add( Locale.ENGLISH ); - } - return locales; - } ).recover( throwable -> { - LOG.warn( "Could not retrieve language tags", throwable ); - return Collections.emptySet(); - } ).get(); + public static Set collectUsedLanguages( final Collection aspects ) { + return aspects.stream().map( LanguageCollector::collectUsedLanguages ).flatMap( Set::stream ).collect( toSet() ); } } diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraits.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraits.java index 7da22eefe..f536c9243 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraits.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraits.java @@ -20,9 +20,8 @@ import java.util.function.Function; import org.eclipse.esmf.aspectmodel.generator.jsonschema.AspectModelJsonSchemaVisitor; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.NumericNode; @@ -118,13 +117,12 @@ public static Number getNativeMaxValue( final java.lang.reflect.Type valueType ) * Because not all model types have their native equivalent in Java (for example unsigned types), * we need to find out what range constraints apply to the particular model type when calculating the valid range for the (native) type. * - * @param modelVersion version of the model * @param dataType meta model data type * @return min value for the given meta model type */ - public static Number getModelMinValue( final KnownVersion modelVersion, final Type dataType ) { + public static Number getModelMinValue( final Type dataType ) { final Resource dataTypeResource = ResourceFactory.createResource( dataType.getUrn() ); - final Class nativeType = DataType.getJavaTypeForMetaModelType( dataTypeResource, modelVersion ); + final Class nativeType = SammXsdType.getJavaTypeForMetaModelType( dataTypeResource ); return getModelMinValue( dataTypeResource, nativeType ); } @@ -144,13 +142,12 @@ public static Number getModelMinValue( final Resource dataTypeResource, final ja * Because not all model types have their native equivalent in Java (for example unsigned types), * we need to find out what range constraints apply to the particular model type when calculating the valid range for the (native) type. * - * @param modelVersion version of the model * @param dataType meta model data type * @return max value for the given meta model type */ - public static Number getModelMaxValue( final KnownVersion modelVersion, final Type dataType ) { + public static Number getModelMaxValue( final Type dataType ) { final Resource dataTypeResource = ResourceFactory.createResource( dataType.getUrn() ); - final Class nativeType = DataType.getJavaTypeForMetaModelType( dataTypeResource, modelVersion ); + final Class nativeType = SammXsdType.getJavaTypeForMetaModelType( dataTypeResource ); return getModelMaxValue( dataTypeResource, nativeType ); } diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGenerator.java index 21069d75c..97946cc85 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGenerator.java @@ -30,7 +30,6 @@ import java.nio.charset.StandardCharsets; import java.util.AbstractMap; import java.util.Base64; -import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Optional; @@ -41,7 +40,7 @@ import org.eclipse.esmf.aspectmodel.generator.DocumentGenerationException; import org.eclipse.esmf.aspectmodel.generator.LanguageCollector; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.batik.transcoder.TranscoderException; import org.apache.batik.transcoder.TranscoderInput; @@ -85,10 +84,10 @@ public static String allValues() { private static final String FONT_NAME = "Roboto Condensed"; private static final String FONT_FILE = "diagram/RobotoCondensed-Regular.ttf"; - private final AspectContext aspectContext; + private final Aspect aspect; - public AspectModelDiagramGenerator( final AspectContext aspectContext ) { - this.aspectContext = aspectContext; + public AspectModelDiagramGenerator( final Aspect aspect ) { + this.aspect = aspect; } InputStream getInputStream( final String resource ) { @@ -152,7 +151,7 @@ private String base64EncodeInputStream( final InputStream in ) throws IOExceptio */ public void generateSvg( final Locale language, final OutputStream out ) throws IOException { final DiagramVisitor diagramVisitor = new DiagramVisitor( language ); - final Diagram diagram = aspectContext.aspect().accept( diagramVisitor, Optional.empty() ); + final Diagram diagram = aspect.accept( diagramVisitor, Optional.empty() ); final Graphviz graphviz = render( diagram ); try ( final InputStream fontStream = getInputStream( FONT_FILE ) ) { @@ -215,9 +214,9 @@ public void generateDiagram( final Format outputFormat, final Locale language, f */ public void generateDiagrams( final Format outputFormat, final Function nameMapper ) throws IOException { - for ( final Locale language : LanguageCollector.collectUsedLanguages( aspectContext.aspect() ) ) { + for ( final Locale language : LanguageCollector.collectUsedLanguages( aspect ) ) { try ( final OutputStream outputStream = nameMapper - .apply( outputFormat.getArtifactFilename( aspectContext.aspect().getName(), language ) ) ) { + .apply( outputFormat.getArtifactFilename( aspect.getName(), language ) ) ) { generateDiagram( outputFormat, language, outputStream ); } } @@ -240,7 +239,7 @@ public void generateDiagrams( final Set targetFormats, final Locale lang final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); generateSvg( language, buffer ); final String svgDocument = buffer.toString( StandardCharsets.UTF_8 ); - final String aspectName = aspectContext.aspect().getName(); + final String aspectName = aspect.getName(); for ( final Format format : targetFormats ) { try ( final OutputStream outputStream = nameMapper.apply( format.getArtifactFilename( aspectName, language ) ) ) { @@ -264,15 +263,13 @@ public void generateDiagrams( final Set targetFormats, final Locale lang * @throws IOException if a write error occurs */ public void generateDiagrams( final Set targetFormats, final Function nameMapper ) throws IOException { - for ( final Locale language : LanguageCollector.collectUsedLanguages( aspectContext.aspect() ) ) { + for ( final Locale language : LanguageCollector.collectUsedLanguages( aspect ) ) { generateDiagrams( targetFormats, language, nameMapper ); } } private Graphviz render( final Diagram diagram ) { - final Color bgColor = Color.ofRGB( "#cfdbed" ); final String fontName = "Roboto Condensed"; - final Map nodes = new HashMap<>(); final Graphviz.GraphvizBuilder graphvizBuilder = Graphviz.digraph() .fontSize( 12f ) diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/DiagramVisitor.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/DiagramVisitor.java index 515cff2ec..c2d2401e4 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/DiagramVisitor.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/diagram/DiagramVisitor.java @@ -23,29 +23,10 @@ import java.util.Optional; import java.util.function.Supplier; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.TimeSeries; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.ComplexType; @@ -54,7 +35,6 @@ import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.Scalar; @@ -62,10 +42,28 @@ import org.eclipse.esmf.metamodel.StructureElement; import org.eclipse.esmf.metamodel.Unit; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import com.google.common.collect.ImmutableList; import org.apache.commons.text.WordUtils; @@ -143,10 +141,8 @@ public Diagram visitProperty( final Property property, final Optional c final Diagram result = defaultBox( property, ( property.isAbstract() ? "Abstract" : "" ) + "Property", Diagram.Color.PROPERTY ); final Diagram.Box box = result.getFocusBox(); property.getCharacteristic() - .filter( characteristic -> !( characteristic.getAspectModelUrn().isEmpty() && characteristic.getName() - .equals( "UnnamedCharacteristic" ) ) ) - .map( characteristic -> - childElementDiagram( box, characteristic, "characteristic" ) ) + .filter( characteristic -> !( characteristic.isAnonymous() && characteristic.getName().equals( "UnnamedCharacteristic" ) ) ) + .map( characteristic -> childElementDiagram( box, characteristic, "characteristic" ) ) .ifPresent( result::add ); property.getExtends().ifPresent( superProperty -> result.add( childElementDiagram( box, superProperty, "extends" ) ) ); return result; @@ -164,7 +160,7 @@ public Diagram visitCharacteristic( final Characteristic characteristic, final O if ( type.isScalar() ) { final Scalar scalar = type.as( Scalar.class ); final String typeName = scalar.getUrn().replace( XSD.NS, "" ).replace( RDF.uri, "" ) - .replace( new SAMM( KnownVersion.getLatest() ).getNamespace(), "" ); + .replace( SammNs.SAMM.getNamespace(), "" ); result.getFocusBox().addEntry( attribute( "dataType", String.class, () -> typeName ) ); } else { result.add( childElementDiagram( box, type.as( ComplexType.class ), "dataType" ) ); @@ -388,7 +384,7 @@ public Diagram visitCollection( final Collection collection, final Optional context ) { + public Diagram visitList( final org.eclipse.esmf.metamodel.characteristic.List list, final Optional context ) { if ( seenElements.containsKey( list ) ) { return new Diagram( seenElements.get( list ) ); } @@ -591,8 +587,9 @@ private Diagram childElementDiagram( final Diagram.Box parent, final ModelElemen return result; } - private Diagram defaultBox( final NamedElement element, final String prototype, final Diagram.Color background ) { - final Diagram.Box box = new Diagram.Box( prototype, element.getAspectModelUrn().isPresent() ? element.getName() : "", background ); + private Diagram defaultBox( final ModelElement element, final String prototype, final Diagram.Color background ) { + final String name = element.isAnonymous() ? "" : element.urn().getName(); + final Diagram.Box box = new Diagram.Box( prototype, name, background ); final ImmutableList.Builder standardAttributes = ImmutableList.builder(); element.getPreferredNames().stream() .filter( preferredName -> preferredName.getLanguageTag().equals( locale ) ) diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java index 965e5d98f..881c25014 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java @@ -35,11 +35,10 @@ import org.eclipse.esmf.aspectmodel.generator.LanguageCollector; import org.eclipse.esmf.aspectmodel.generator.TemplateEngine; import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.NamedElement; +import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.Scalar; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; import com.google.common.io.CharStreams; import org.apache.velocity.runtime.RuntimeConstants; @@ -75,15 +74,15 @@ public String getArtifactFilename( final String artifactName ) { } } - private final AspectContext context; + private final Aspect aspect; private Locale selectedLanguage = null; - public AspectModelDocumentationGenerator( final AspectContext context ) { - this.context = context; + public AspectModelDocumentationGenerator( final Aspect aspect ) { + this.aspect = aspect; } - public AspectModelDocumentationGenerator( final String language, final AspectContext context ) { - this( context ); + public AspectModelDocumentationGenerator( final String language, final Aspect aspect ) { + this( aspect ); selectedLanguage = Locale.forLanguageTag( language ); } @@ -116,8 +115,7 @@ public void generate( final Function nameMapper, final Map * @throws IOException when serialization or deserialization fails */ public void generate( final Function nameMapper, final Map generationOptions, - final Locale language ) - throws IOException { + final Locale language ) throws IOException { final BufferingNameMapper bufferingMapper = new BufferingNameMapper(); generateHtmlDocu( bufferingMapper, Format.NONE, language ); generateInternal( nameMapper, generationOptions, bufferingMapper ); @@ -161,7 +159,7 @@ private void generateInternal( final Function nameMapper, } private void generateHtmlDocu( final Function nameMapper, final Format format, final Locale desiredLanguage ) { - final Set languagesInModel = LanguageCollector.collectUsedLanguages( context.aspect() ); + final Set languagesInModel = LanguageCollector.collectUsedLanguages( aspect ); if ( !languagesInModel.contains( desiredLanguage ) ) { throw new RuntimeException( String.format( "The model does not contain the desired language: %s.", desiredLanguage.toString() ) ); } @@ -170,15 +168,15 @@ private void generateHtmlDocu( final Function nameMapper, } private void generateHtmlDocu( final Function nameMapper, final Format format ) { - final Set languagesInModel = LanguageCollector.collectUsedLanguages( context.aspect() ); + final Set languagesInModel = LanguageCollector.collectUsedLanguages( aspect ); final Set languages = languagesInModel.isEmpty() ? Set.of( Locale.ENGLISH ) : languagesInModel; generateHtmlDocu( nameMapper, format, languages ); } private void generateHtmlDocu( final Function nameMapper, final Format format, final Set languages ) { final Map configuration = new HashMap<>(); - configuration.put( "aspectModel", context.aspect() ); - configuration.put( "aspectModelHelper", new AspectModelHelper( context.aspect().getMetaModelVersion() ) ); + configuration.put( "aspectModel", aspect ); + configuration.put( "aspectModelHelper", new AspectModelHelper() ); final Properties engineConfiguration = new Properties(); engineConfiguration.put( RuntimeConstants.FILE_RESOURCE_LOADER_PATH, ".," + DOCU_TEMPLATE_ROOT_DIR + "/html" ); @@ -196,15 +194,15 @@ private void generateHtmlDocu( final Function nameMapper, .equals( selectedLanguage.getLanguage() ); languages.stream().filter( byLanguage ).forEach( language -> { - logMissingTranslations( context.aspect(), language ); + logMissingTranslations( aspect, language ); configuration.put( "i18n", new I18nLanguageBundle( language ) ); configuration.put( "Scalar", Scalar.class ); final TemplateEngine templateEngine = new TemplateEngine( configuration, engineConfiguration ); - final String artifactName = getArtifactName( context.aspect(), language ); + final String artifactName = getArtifactName( aspect, language ); if ( nameMapper instanceof BufferingNameMapper ) { - ((BufferingNameMapper) nameMapper).setLanguageForArtifact( artifactName, language ); + ( (BufferingNameMapper) nameMapper ).setLanguageForArtifact( artifactName, language ); } try ( final OutputStream outputStream = nameMapper.apply( format.getArtifactFilename( artifactName ) ) ) { @@ -238,15 +236,15 @@ public OutputStream apply( final String artifactName ) { private String byteArrayOutputStreamToString( final ByteArrayOutputStream outputStream ) throws IOException { try ( final ByteArrayOutputStream stream = outputStream ) { - return stream.toString( StandardCharsets.UTF_8.name() ); + return stream.toString( StandardCharsets.UTF_8 ); } catch ( final UnsupportedEncodingException e ) { // Will not happen, because encoding is hardcoded throw new RuntimeException( e ); } } - private String insertAspectModelDiagram( final String html, final Locale language ) throws IOException { - final AspectModelDiagramGenerator diagramGenerator = new AspectModelDiagramGenerator( context ); + private String insertAspectModelDiagram( final String html, final Locale language ) { + final AspectModelDiagramGenerator diagramGenerator = new AspectModelDiagramGenerator( aspect ); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); diagramGenerator.generateDiagram( AspectModelDiagramGenerator.Format.SVG, language, buffer ); final String encodedImage = "data:image/svg+xml;base64," + Base64.getEncoder().encodeToString( buffer.toByteArray() ); @@ -313,10 +311,10 @@ private String insertTailwindLicense( final String html ) throws IOException { } } - private void logMissingTranslations( final Aspect aspectMetaModel, final Locale locale ) { - aspectMetaModel.accept( new AspectStreamTraversalVisitor(), null ) - .filter( NamedElement.class::isInstance ) - .map( NamedElement.class::cast ) + private void logMissingTranslations( final Aspect aspect, final Locale locale ) { + aspect.accept( new AspectStreamTraversalVisitor(), null ) + .filter( ModelElement.class::isInstance ) + .map( ModelElement.class::cast ) .forEach( modelElement -> { final boolean hasPreferredNameWithLocale = modelElement.getPreferredNames().stream() .anyMatch( preferredName -> preferredName.getLanguageTag().equals( locale ) ); diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGenerator.java index 7d4d53650..600a23dca 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGenerator.java @@ -43,19 +43,9 @@ import org.eclipse.esmf.aspectmodel.generator.AbstractGenerator; import org.eclipse.esmf.aspectmodel.generator.NumericTypeTraits; import org.eclipse.esmf.aspectmodel.jackson.AspectModelJacksonModule; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Constraint; @@ -65,8 +55,16 @@ import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.Curie; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.datatype.Curie; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -98,18 +96,10 @@ public class AspectModelJsonPayloadGenerator extends AbstractGenerator { private final Aspect aspect; public AspectModelJsonPayloadGenerator( final Aspect aspect ) { - this( aspect, new SAMM( aspect.getMetaModelVersion() ), new Random() ); - } - - public AspectModelJsonPayloadGenerator( final AspectContext context ) { - this( context.aspect() ); + this( aspect, new Random() ); } public AspectModelJsonPayloadGenerator( final Aspect aspect, final Random randomStrategy ) { - this( aspect, new SAMM( aspect.getMetaModelVersion() ), randomStrategy ); - } - - private AspectModelJsonPayloadGenerator( final Aspect aspect, final SAMM samm, final Random randomStrategy ) { this.aspect = aspect; exampleValueGenerator = new ExampleValueGenerator( randomStrategy ); objectMapper = AspectModelJsonPayloadGenerator.createObjectMapper(); @@ -314,8 +304,10 @@ private Object getExampleValueOrElseRandom( final BasicProperty property, final return generateExampleValue( effectiveCharacteristics ); } - return property.getExampleValue().map( exampleValue -> - exampleValue.as( ScalarValue.class ).getValue() ).orElseGet( () -> generateExampleValue( effectiveCharacteristics ) ); + return property.getExampleValue() + .map( exampleValue -> exampleValue.as( ScalarValue.class ).getValue() ) + .map( value -> value instanceof Curie ? ( (Curie) value ).value() : value ) + .orElseGet( () -> generateExampleValue( effectiveCharacteristics ) ); } private Map toMap( final String key, final Object value ) { @@ -450,7 +442,7 @@ private Object generateExampleValue( final Characteristic characteristic ) { final Scalar scalar = dataType.as( Scalar.class ); final Resource dataTypeResource = ResourceFactory.createResource( scalar.getUrn() ); - final Class exampleValueType = DataType.getJavaTypeForMetaModelType( dataTypeResource, characteristic.getMetaModelVersion() ); + final Class exampleValueType = SammXsdType.getJavaTypeForMetaModelType( dataTypeResource ); if ( Curie.class.equals( exampleValueType ) ) { return getRandomEntry( ExampleValueGenerator.CURIE_VALUES ); } diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/ValueToPayloadStructure.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/ValueToPayloadStructure.java index c71fe5d0e..e9c49fa1c 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/ValueToPayloadStructure.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/json/ValueToPayloadStructure.java @@ -17,15 +17,15 @@ import java.util.Map; import java.util.stream.Collectors; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.Curie; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.datatype.Curie; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.google.common.collect.ImmutableMap; import org.apache.jena.vocabulary.RDF; @@ -48,7 +48,7 @@ public Object visitScalarValue( final ScalarValue scalarValue, final Void contex return ImmutableMap.of( langString.getLanguageTag().toLanguageTag(), langString.getValue() ); } if ( scalarValue.getValue() instanceof Curie curie ) { - return curie.getValue(); + return curie.value(); } return scalarValue.getValue(); } diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGenerator.java index b6dc7acbf..3276b0ef0 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGenerator.java @@ -13,8 +13,6 @@ package org.eclipse.esmf.aspectmodel.generator.jsonschema; -import java.util.Locale; - import org.eclipse.esmf.aspectmodel.generator.ArtifactGenerator; import org.eclipse.esmf.metamodel.Aspect; @@ -27,37 +25,6 @@ public class AspectModelJsonSchemaGenerator implements ArtifactGenerator { public static final AspectModelJsonSchemaGenerator INSTANCE = new AspectModelJsonSchemaGenerator(); - /** - * @deprecated Use {@link #INSTANCE} instead - */ - @Deprecated( forRemoval = true ) - public AspectModelJsonSchemaGenerator() { - } - - /** - * @deprecated Use {@link #apply(Aspect, JsonSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public JsonNode apply( final Aspect aspect, final Locale locale ) { - final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() - .locale( locale ) - .build(); - return apply( aspect, config ).getContent(); - } - - /** - * @deprecated Use {@link #apply(Aspect, JsonSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public JsonNode applyForOpenApi( final Aspect aspect, final Locale locale, final boolean generateCommentForSeeAttributes ) { - final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() - .locale( locale ) - .generateForOpenApi( true ) - .generateCommentForSeeAttributes( generateCommentForSeeAttributes ) - .build(); - return apply( aspect, config ).getContent(); - } - @Override public JsonSchemaArtifact apply( final Aspect aspect, final JsonSchemaGenerationConfig config ) { final AspectModelJsonSchemaVisitor visitor = new AspectModelJsonSchemaVisitor( config ); diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaVisitor.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaVisitor.java index 4c75e8083..40e98881d 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaVisitor.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaVisitor.java @@ -161,27 +161,6 @@ public AspectModelJsonSchemaVisitor( final JsonSchemaGenerationConfig config ) { typeData = config.useExtendedTypes() ? extendedTypeData : OPEN_API_TYPE_DATA; } - /** - * @deprecated Use {@link AspectModelJsonSchemaVisitor#AspectModelJsonSchemaVisitor(JsonSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public AspectModelJsonSchemaVisitor( final boolean useExtendedTypes, final Locale locale ) { - this( JsonSchemaGenerationConfigBuilder.builder() - .useExtendedTypes( useExtendedTypes ) - .locale( locale ) - .build() ); - } - - /** - * @deprecated Use {@link AspectModelJsonSchemaVisitor#AspectModelJsonSchemaVisitor(JsonSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public AspectModelJsonSchemaVisitor( final boolean useExtendedTypes ) { - this( JsonSchemaGenerationConfigBuilder.builder() - .useExtendedTypes( useExtendedTypes ) - .build() ); - } - public ObjectNode getRootNode() { return rootNode; } diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGenerator.java index 12edd8280..8e4a8d13d 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGenerator.java @@ -53,7 +53,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.google.common.base.CaseFormat; -import io.vavr.CheckedFunction1; import org.apache.commons.collections4.IterableUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.stream.Streams; @@ -131,7 +130,7 @@ public OpenApiSchemaArtifact apply( final Aspect aspect, final OpenApiSchemaGene final ObjectNode rootNode = getRootJsonNode( config.generateCommentForSeeAttributes() ); final String apiVersion = getApiVersion( aspect, config.useSemanticVersion() ); - ( (ObjectNode) rootNode.get( "info" ) ) + ((ObjectNode) rootNode.get( "info" )) .put( "title", aspect.getPreferredName( config.locale() ) ) .put( "version", apiVersion ) .put( AbstractGenerator.SAMM_EXTENSION, @@ -150,105 +149,6 @@ public OpenApiSchemaArtifact apply( final Aspect aspect, final OpenApiSchemaGene return new OpenApiSchemaArtifact( aspect.getName(), FACTORY.objectNode() ); } - /** - * Generates an OpenAPI specification for the given Aspect Model in JSON. - * - * @param aspect the Aspect Model for which the OpenAPI specification will be generated. - * @param useSemanticVersion if set to true, the complete semantic version of the Aspect Model will be used as the version of the API. - * Otherwise, only the major part of the Aspect Version is used as the version of the API. - * @param baseUrl the base URL for the Aspect API - * @param resourcePath the resource path for the Aspect API endpoints. If no resource path is given, the resource path will be derived - * from the Aspect name - * @param jsonProperties A string containing the needed properties for the resource path, defined in JSON. - * @param includeQueryApi if set to true, a path section for the Query API Endpoint of the Aspect API will be included in the - * specification - * @param pagingOption if defined, the chosen paging type will be in the JSON. - * @return a JsonNode containing the JSON for the given Aspect. - * @deprecated Use {@link #apply(Aspect, OpenApiSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public JsonNode applyForJson( final Aspect aspect, final boolean useSemanticVersion, final String baseUrl, - final Optional resourcePath, final Optional jsonProperties, final boolean includeQueryApi, - final Optional pagingOption ) { - final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() - .useSemanticVersion( useSemanticVersion ) - .baseUrl( baseUrl ) - .resourcePath( resourcePath.orElse( null ) ) - .properties( (ObjectNode) jsonProperties.orElse( null ) ) - .includeQueryApi( includeQueryApi ) - .pagingOption( pagingOption.orElse( null ) ) - .build(); - return apply( aspect, config ).getContent(); - } - - /** - * Generates an OpenAPI specification for the given Aspect Model in JSON. - * - * @param aspect the Aspect Model for which the OpenAPI specification will be generated. - * @param useSemanticVersion if set to true, the complete semantic version of the Aspect Model will be used as the version of the API. - * Otherwise, only the major part of the Aspect Version is used as the version of the API. - * @param baseUrl the base URL for the Aspect API - * @param resourcePath the resource path for the Aspect API endpoints. If no resource path is given, the resource path will be derived - * from the Aspect name. - * @param jsonProperties A string containing the needed properties for the resource path, defined in JSON. - * @param includeQueryApi if set to true, a path section for the Query API Endpoint of the Aspect API will be included in the - * specification - * @param pagingOption if defined, the chosen paging type will be in the JSON. - * @param locale the locale for choosing the preferred language for description and preferred name. - * @return a JsonNode containing the JSON for the given Aspect. - * @deprecated Use {@link #apply(Aspect, OpenApiSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public JsonNode applyForJson( final Aspect aspect, final boolean useSemanticVersion, final String baseUrl, - final Optional resourcePath, final Optional jsonProperties, final boolean includeQueryApi, - final Optional pagingOption, final Locale locale ) { - final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() - .useSemanticVersion( useSemanticVersion ) - .baseUrl( baseUrl ) - .resourcePath( resourcePath.orElse( null ) ) - .properties( (ObjectNode) jsonProperties.orElse( null ) ) - .includeQueryApi( includeQueryApi ) - .pagingOption( pagingOption.orElse( null ) ) - .locale( locale ) - .build(); - return apply( aspect, config ).getContent(); - } - - /** - * Generates an OpenAPI specification for the given Aspect Model in JSON. - * - * @param aspect the Aspect Model for which the OpenAPI specification will be generated. - * @param useSemanticVersion if set to true, the complete semantic version of the Aspect Model will be used as the version of the API. - * Otherwise, only the major part of the Aspect Version is used as the version of the API. - * @param baseUrl the base URL for the Aspect API - * @param resourcePath the resource path for the Aspect API endpoints. If no resource path is given, the resource path will be derived - * from the Aspect name - * @param jsonProperties A string containing the needed properties for the resource path, defined in JSON. - * @param includeQueryApi if set to true, a path section for the Query API Endpoint of the Aspect API will be included in the - * specification - * @param pagingOption if defined, the chosen paging type will be in the JSON. - * @param locale the locale for choosing the preferred language for description and preferred name. - * @param generateCommentForSeeAttributes generate $comment OpenAPI element for samm:see attributes in the model - * @return a JsonNode containing the JSON for the given Aspect. - * @deprecated Use {@link #apply(Aspect, OpenApiSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public JsonNode applyForJson( final Aspect aspect, final boolean useSemanticVersion, final String baseUrl, - final Optional resourcePath, final Optional jsonProperties, final boolean includeQueryApi, - final Optional pagingOption, final Locale locale, final boolean generateCommentForSeeAttributes ) { - final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() - .useSemanticVersion( useSemanticVersion ) - .baseUrl( baseUrl ) - .resourcePath( resourcePath.orElse( null ) ) - .properties( (ObjectNode) jsonProperties.orElse( null ) ) - .includeQueryApi( includeQueryApi ) - .pagingOption( pagingOption.orElse( null ) ) - .locale( locale ) - .generateCommentForSeeAttributes( generateCommentForSeeAttributes ) - .build(); - return apply( aspect, config ).getContent(); - } - private void setServers( final ObjectNode objectNode, final String baseUrl, final String apiVersion, final String endPointPath ) { final ArrayNode arrayNode = objectNode.putArray( "servers" ); final ObjectNode node = FACTORY.objectNode(); @@ -344,7 +244,7 @@ private String getApiVersion( final Aspect aspect, final boolean useSemanticVers private void setResponseBodies( final Aspect aspect, final ObjectNode jsonNode, final boolean includePaging ) { final ObjectNode componentsResponseNode = (ObjectNode) jsonNode.get( FIELD_COMPONENTS ).get( FIELD_RESPONSES ); final ObjectNode referenceNode = FACTORY.objectNode() - .put( REF, COMPONENTS_SCHEMAS + ( includePaging ? FIELD_PAGING_SCHEMA : aspect.getName() ) ); + .put( REF, COMPONENTS_SCHEMAS + (includePaging ? FIELD_PAGING_SCHEMA : aspect.getName()) ); final ObjectNode contentNode = getApplicationNode( referenceNode ); componentsResponseNode.set( aspect.getName(), contentNode ); contentNode.put( FIELD_DESCRIPTION, "The request was successful." ); @@ -430,75 +330,6 @@ private ObjectNode getRootJsonNode( final boolean generateCommentForSeeAttribute } } - /** - * Generates an OpenAPI specification for the given Aspect Model in YAML. - * - * @param aspect the Aspect Model for which the OpenAPI specification will be generated. - * @param useSemanticVersion if set to true, the complete semantic version of the Aspect Model will be used as the version of the API. - * Otherwise, only the major part of the Aspect Version is used as the version of the API. - * @param baseUrl the base URL for the Aspect API - * @param resourcePath the resource path for the Aspect API endpoints. If no resource path is given, the resource path will be derived - * from the Aspect name - * @param yamlProperties the properties for the resource. Needs to be defined as YAML. - * @param includeQueryApi if set to true, a path section for the Query API Endpoint of the Aspect API will be included in the - * specification - * @param pagingOption if defined, the chosen paging type will be in the YAML. - * @return a string containing the YAML for the given aspect. - * @deprecated Use {@link #apply(Aspect, OpenApiSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public String applyForYaml( final Aspect aspect, final boolean useSemanticVersion, final String baseUrl, - final Optional resourcePath, final Optional yamlProperties, final boolean includeQueryApi, - final Optional pagingOption ) { - final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() - .useSemanticVersion( useSemanticVersion ) - .baseUrl( baseUrl ) - .resourcePath( resourcePath.orElse( null ) ) - .properties( - (ObjectNode) yamlProperties.map( - CheckedFunction1.of( ( String content ) -> YAML_MAPPER.readTree( content ) ).unchecked() ).orElse( null ) ) - .includeQueryApi( includeQueryApi ) - .pagingOption( pagingOption.orElse( null ) ) - .build(); - return apply( aspect, config ).getContentAsYaml(); - } - - /** - * Generates an OpenAPI specification for the given Aspect Model in YAML. - * - * @param aspect the Aspect Model for which the OpenAPI specification will be generated. - * @param useSemanticVersion if set to true, the complete semantic version of the Aspect Model will be used as the version of the API. - * Otherwise, only the major part of the Aspect Version is used as the version of the API. - * @param baseUrl the base URL for the Aspect API - * @param resourcePath the resource path for the Aspect API endpoints. If no resource path is given, the resource path will be derived - * from the Aspect name - * @param yamlProperties the properties for the resource. Needs to be defined as YAML. - * @param includeQueryApi if set to true, a path section for the Query API Endpoint of the Aspect API will be included in the - * specification - * @param pagingOption if defined, the chosen paging type will be in the YAML. - * @param locale the locale for choosing the preferred language for description and preferred name. - * @return a string containing the YAML for the given aspect. - * @deprecated Use {@link #apply(Aspect, OpenApiSchemaGenerationConfig)} instead - */ - @Deprecated( forRemoval = true ) - public String applyForYaml( final Aspect aspect, final boolean useSemanticVersion, final String baseUrl, - final Optional resourcePath, final Optional yamlProperties, final boolean includeQueryApi, - final Optional pagingOption, final Locale locale ) { - - final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() - .useSemanticVersion( useSemanticVersion ) - .baseUrl( baseUrl ) - .resourcePath( resourcePath.orElse( null ) ) - .properties( - (ObjectNode) yamlProperties.map( - CheckedFunction1.of( ( String content ) -> YAML_MAPPER.readTree( content ) ).unchecked() ).orElse( null ) ) - .includeQueryApi( includeQueryApi ) - .pagingOption( pagingOption.orElse( null ) ) - .locale( locale ) - .build(); - return apply( aspect, config ).getContentAsYaml(); - } - private ObjectNode getPathsNode( final Aspect aspect, final OpenApiSchemaGenerationConfig config, final String apiVersion, final ObjectNode properties, final ObjectNode queriesTemplate ) throws IOException { final ObjectNode endpointPathsNode = FACTORY.objectNode(); @@ -520,7 +351,7 @@ private ObjectNode getPathsNode( final Aspect aspect, final OpenApiSchemaGenerat merge( getRequestEndpointsRead( aspect, propertiesNode, config.resourcePath() ), queriesTemplate, FIELD_GET ) ); - boolean includeCrud = config.includeCrud(); + final boolean includeCrud = config.includeCrud(); if ( includeCrud || config.includePost() ) { pathNode.set( FIELD_POST, getRequestEndpointsCreate( aspect, propertiesNode, config.resourcePath() ) ); @@ -554,7 +385,7 @@ private String deriveResourcePathFromAspectName( final String aspectName ) { } private Optional getRequestEndpointOperations( final Aspect aspect, final ObjectNode parameterNode, final String baseUrl, - final String apiVersion, final String resourcePath, ObjectNode queriesTemplate ) { + final String apiVersion, final String resourcePath, final ObjectNode queriesTemplate ) { if ( !aspect.getOperations().isEmpty() ) { final ObjectNode objectNode = FACTORY.objectNode(); @@ -667,7 +498,7 @@ private ObjectNode getRequestEndpointsUpdate( final Aspect aspect, final ObjectN final boolean isPut ) { final ObjectNode objectNode = FACTORY.objectNode(); objectNode.set( "tags", FACTORY.arrayNode().add( aspect.getName() ) ); - objectNode.put( FIELD_OPERATION_ID, ( isPut ? FIELD_PUT : FIELD_PATCH ) + aspect.getName() ); + objectNode.put( FIELD_OPERATION_ID, (isPut ? FIELD_PUT : FIELD_PATCH) + aspect.getName() ); objectNode.set( FIELD_PARAMETERS, getRequiredParameters( parameterNode, isEmpty( resourcePath ) ) ); objectNode.set( FIELD_REQUEST_BODY, FACTORY.objectNode().put( REF, COMPONENTS_REQUESTS + aspect.getName() ) ); objectNode.set( FIELD_RESPONSES, getResponsesForGet( aspect ) ); diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelPagingGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelPagingGenerator.java index 1b1587a07..ce6b829b5 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelPagingGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelPagingGenerator.java @@ -24,14 +24,14 @@ import java.util.UUID; import java.util.stream.Collectors; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.TimeSeries; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.HasProperties; import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/AspectModelDatabricksDenormalizedSqlVisitor.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/AspectModelDatabricksDenormalizedSqlVisitor.java index bfd1759ad..473c16c77 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/AspectModelDatabricksDenormalizedSqlVisitor.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/AspectModelDatabricksDenormalizedSqlVisitor.java @@ -22,10 +22,7 @@ import java.util.stream.Stream; import org.eclipse.esmf.aspectmodel.generator.AbstractGenerator; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.ComplexType; @@ -36,7 +33,10 @@ import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.StructureElement; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; import org.eclipse.esmf.samm.KnownVersion; import com.google.common.base.CaseFormat; diff --git a/core/esmf-aspect-model-document-generators/src/main/java/velocity_implicit.vm b/core/esmf-aspect-model-document-generators/src/main/java/velocity_implicit.vm index e2e7f5447..efe0e43fc 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/velocity_implicit.vm +++ b/core/esmf-aspect-model-document-generators/src/main/java/velocity_implicit.vm @@ -9,27 +9,27 @@ #* @vtlvariable name="operation" type="org.eclipse.esmf.metamodel.Operation" *# #* @vtlvariable name="aspectModelHelper" type="org.eclipse.esmf.aspectmodel.generator.AspectModelHelper" *# #* @vtlvariable name="Class" type="java.lang.Class" *# -#* @vtlvariable name="measurement" type="org.eclipse.esmf.characteristic.Measurement" *# +#* @vtlvariable name="measurement" type="org.eclipse.esmf.metamodel.characteristic.Measurement" *# #* @vtlvariable name="unit" type="org.eclipse.esmf.metamodel.Unit" *# #* @vtlvariable name="quantityKind" type="org.eclipse.esmf.metamodel.QuantityKind" *# -#* @vtlvariable name="state" type="org.eclipse.esmf.characteristic.State" *# -#* @vtlvariable name="duration" type="org.eclipse.esmf.characteristic.Duration" *# -#* @vtlvariable name="Quantifiable" type="org.eclipse.esmf.characteristic.Quantifiable" *# -#* @vtlvariable name="encodingConstraint" type="org.eclipse.esmf.constraint.EncodingConstraint" *# -#* @vtlvariable name="regularExpressionConstraint" type="org.eclipse.esmf.constraint.RegularExpressionConstraint" *# -#* @vtlvariable name="lengthConstraint" type="org.eclipse.esmf.constraint.LengthConstraint" *# -#* @vtlvariable name="fixedPointConstraint" type="org.eclipse.esmf.constraint.FixedPointConstraint" *# -#* @vtlvariable name="structuredValue" type="org.eclipse.esmf.characteristic.StructuredValue" *# -#* @vtlvariable name="collection" type="org.eclipse.esmf.characteristic.Collection" *# -#* @vtlvariable name="enumeration" type="org.eclipse.esmf.characteristic.Enumeration" *# -#* @vtlvariable name="rangeConstraint" type="org.eclipse.esmf.constraint.RangeConstraint" *# -#* @vtlvariable name="either" type="org.eclipse.esmf.characteristic.Either" *# +#* @vtlvariable name="state" type="org.eclipse.esmf.metamodel.characteristic.State" *# +#* @vtlvariable name="duration" type="org.eclipse.esmf.metamodel.characteristic.Duration" *# +#* @vtlvariable name="Quantifiable" type="org.eclipse.esmf.metamodel.characteristic.Quantifiable" *# +#* @vtlvariable name="encodingConstraint" type="org.eclipse.esmf.metamodel.constraint.EncodingConstraint" *# +#* @vtlvariable name="regularExpressionConstraint" type="org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint" *# +#* @vtlvariable name="lengthConstraint" type="org.eclipse.esmf.metamodel.constraint.LengthConstraint" *# +#* @vtlvariable name="fixedPointConstraint" type="org.eclipse.esmf.metamodel.constraint.FixedPointConstraint" *# +#* @vtlvariable name="structuredValue" type="org.eclipse.esmf.metamodel.characteristic.StructuredValue" *# +#* @vtlvariable name="collection" type="org.eclipse.esmf.metamodel.characteristic.Collection" *# +#* @vtlvariable name="enumeration" type="org.eclipse.esmf.metamodel.characteristic.Enumeration" *# +#* @vtlvariable name="rangeConstraint" type="org.eclipse.esmf.metamodel.constraint.RangeConstraint" *# +#* @vtlvariable name="either" type="org.eclipse.esmf.metamodel.characteristic.Either" *# #* @vtlvariable name="scalar" type="org.eclipse.esmf.metamodel.Scalar" *# #* @vtlvariable name="entity" type="org.eclipse.esmf.metamodel.Entity" *# -#* @vtlvariable name="singleEntity" type="org.eclipse.esmf.characteristic.SingleEntity" *# +#* @vtlvariable name="singleEntity" type="org.eclipse.esmf.metamodel.characteristic.SingleEntity" *# #* @vtlvariable name="map" type="java.util.HashMap" *# -#* @vtlvariable name="timeSeries" type="org.eclipse.esmf.characteristic.TimeSeries" *# -#* @vtlvariable name="localeConstraint" type="org.eclipse.esmf.constraint.LocaleConstraint" *# -#* @vtlvariable name="languageConstraint" type="org.eclipse.esmf.constraint.LanguageConstraint" *# -#* @vtlvariable name="list" type="org.eclipse.esmf.characteristic.List" *# -#* @vtlvariable name="code" type="org.eclipse.esmf.characteristic.Code" *# +#* @vtlvariable name="timeSeries" type="org.eclipse.esmf.metamodel.characteristic.TimeSeries" *# +#* @vtlvariable name="localeConstraint" type="org.eclipse.esmf.metamodel.constraint.LocaleConstraint" *# +#* @vtlvariable name="languageConstraint" type="org.eclipse.esmf.metamodel.constraint.LanguageConstraint" *# +#* @vtlvariable name="list" type="org.eclipse.esmf.metamodel.characteristic.List" *# +#* @vtlvariable name="code" type="org.eclipse.esmf.metamodel.characteristic.Code" *# diff --git a/core/esmf-aspect-model-document-generators/src/main/resources/docu/templates/html/aspect-model-documentation.vm b/core/esmf-aspect-model-document-generators/src/main/resources/docu/templates/html/aspect-model-documentation.vm index 54e84885e..d7ff72bbb 100644 --- a/core/esmf-aspect-model-document-generators/src/main/resources/docu/templates/html/aspect-model-documentation.vm +++ b/core/esmf-aspect-model-document-generators/src/main/resources/docu/templates/html/aspect-model-documentation.vm @@ -46,7 +46,7 @@

Aspect Model $aspectModel.getPreferredName($i18n.getLocale())

-
$aspectModel.getAspectModelUrn().get()
+
$aspectModel.urn()
diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollectorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollectorTest.java index 7d68ba1b5..fb17b28f4 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollectorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/LanguageCollectorTest.java @@ -19,11 +19,8 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -31,12 +28,11 @@ import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Statement; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; - -public class LanguageCollectorTest extends MetaModelVersions { +public class LanguageCollectorTest { @ParameterizedTest @EnumSource( value = TestAspect.class, mode = EnumSource.Mode.EXCLUDE, @@ -45,9 +41,8 @@ public class LanguageCollectorTest extends MetaModelVersions { "ASPECT_WITH_MULTILANGUAGE_EXAMPLE_VALUE" } ) public void testCollectLanguagesExpectSuccess( final TestAspect testAspect ) { - final Model model = TestResources.getModelWithoutResolution( testAspect, KnownVersion.getLatest() ).getModel(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( TestResources.getModelWithoutResolution( testAspect, - KnownVersion.getLatest() ) ); + final AspectModel aspectModel = TestResources.load( testAspect ); + final Model model = aspectModel.mergedModel(); final Set langTagsInModel = Streams.stream( model.listStatements() ) .filter( statement -> statement.getObject().isLiteral() ) @@ -57,100 +52,44 @@ public void testCollectLanguagesExpectSuccess( final TestAspect testAspect ) { .map( Locale::forLanguageTag ) .collect( Collectors.toSet() ); - final Set localesFromAspect = LanguageCollector.collectUsedLanguages( aspect ); - final Set localesFromModel = LanguageCollector.collectUsedLanguages( model ); + final Set localesFromAspect = LanguageCollector.collectUsedLanguages( aspectModel.aspect() ); // Sets are not necessarily identical; e.g., if a model refers to samm-c:Text, the language collector will find // samm-c:Text's description's language, but the simple string matcher will find nothing. - assertThat( localesFromAspect ).isEqualTo( localesFromModel ); assertThat( localesFromAspect ).containsAll( langTagsInModel ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRdfModelOnlyEnglish( final KnownVersion metaModelVersion ) { - final Model model = TestResources.getModel( TestAspect.ASPECT_WITH_ENGLISH_DESCRIPTION, metaModelVersion ) - .get().getModel(); - final Set languages = LanguageCollector.collectUsedLanguages( model ); - assertThat( languages ).containsExactly( Locale.forLanguageTag( "en" ) ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRdfModelEnglishAndGermanInProperty( final KnownVersion metaModelVersion ) { - final Model model = TestResources.getModel( TestAspect.ASPECT_WITH_DESCRIPTION_IN_PROPERTY, metaModelVersion ) - .get().getModel(); - final Set languages = LanguageCollector.collectUsedLanguages( model ); - assertThat( languages ) - .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectModelEnglishAndGermanInProperty( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources - .getModel( TestAspect.ASPECT_WITH_DESCRIPTION_IN_PROPERTY, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( model ).get(); + @Test + public void testAspectModelEnglishAndGermanInProperty() { + final AspectModel aspectModel = TestResources.load( TestAspect.ASPECT_WITH_DESCRIPTION_IN_PROPERTY ); + final Aspect aspect = aspectModel.aspect(); final Set languages = LanguageCollector.collectUsedLanguages( aspect ); assertThat( languages ) .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectModelOnlyEnglish( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources - .getModel( TestAspect.ASPECT_WITH_ENGLISH_DESCRIPTION, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( model ).get(); + @Test + public void testAspectModelOnlyEnglish() { + final AspectModel aspectModel = TestResources.load( TestAspect.ASPECT_WITH_ENGLISH_DESCRIPTION ); + final Aspect aspect = aspectModel.aspect(); final Set languages = LanguageCollector.collectUsedLanguages( aspect ); assertThat( languages ).containsExactly( Locale.forLanguageTag( "en" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRdfModelEnglishAndGerman( final KnownVersion metaModelVersion ) { - final Model model = TestResources - .getModel( TestAspect.ASPECT_WITH_ENGLISH_AND_GERMAN_DESCRIPTION, metaModelVersion ).get() - .getModel(); - final Set languages = LanguageCollector.collectUsedLanguages( model ); - assertThat( languages ) - .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectModelEnglishAndGerman( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources - .getModel( TestAspect.ASPECT_WITH_ENGLISH_AND_GERMAN_DESCRIPTION, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( model ).get(); + @Test + public void testAspectModelEnglishAndGerman() { + final AspectModel aspectModel = TestResources.load( TestAspect.ASPECT_WITH_ENGLISH_AND_GERMAN_DESCRIPTION ); + final Aspect aspect = aspectModel.aspect(); final Set languages = LanguageCollector.collectUsedLanguages( aspect ); assertThat( languages ) .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectModelWithBlankNodeEnglishAndGerman( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources.getModel( TestAspect.ASPECT_WITH_BLANK_NODE, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( model ).get(); + @Test + public void testAspectModelWithBlankNodeEnglishAndGerman() { + final AspectModel aspectModel = TestResources.load( TestAspect.ASPECT_WITH_ENGLISH_AND_GERMAN_DESCRIPTION ); + final Aspect aspect = aspectModel.aspect(); final Set languages = LanguageCollector.collectUsedLanguages( aspect ); assertThat( languages ) .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRdfModelWithBlankNodeEnglishAndGerman( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources.getModel( TestAspect.ASPECT_WITH_BLANK_NODE, metaModelVersion ).get(); - final Set languages = LanguageCollector.collectUsedLanguages( model.getModel() ); - assertThat( languages ) - .containsExactlyInAnyOrder( Locale.forLanguageTag( "en" ), Locale.forLanguageTag( "de" ) ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testRdfModelWithoutLanguageTag( final KnownVersion metaModelVersion ) { - final VersionedModel model = TestResources.getModel( TestAspect.ASPECT_WITH_BINARY, metaModelVersion ).get(); - final Set languages = LanguageCollector.collectUsedLanguages( model.getModel() ); - assertThat( languages ).contains( Locale.forLanguageTag( "en" ) ); - } } diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraitsTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraitsTest.java index 70a012559..0b9fc2d2e 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraitsTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/NumericTypeTraitsTest.java @@ -17,18 +17,13 @@ import java.math.BigDecimal; import java.math.BigInteger; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; import org.eclipse.esmf.metamodel.Type; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.eclipse.esmf.metamodel.impl.DefaultScalar; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class NumericTypeTraitsTest extends MetaModelVersions { +public class NumericTypeTraitsTest { @Test void testIsFloatingPointNumberType() { // all floating point types @@ -65,36 +60,34 @@ void testGetNativeMaxValue() { assertThat( NumericTypeTraits.getNativeMaxValue( BigDecimal.class ).doubleValue() ).isEqualTo( Double.MAX_VALUE ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGetModelMinValue( final KnownVersion metaModelVersion ) { + @Test + void testGetModelMinValue() { // int maps to normal integer, so native type range should apply - final Type intType = new DefaultScalar( ExtendedXsdDataType.INT.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMinValue( metaModelVersion, intType ) ).isEqualTo( Integer.MIN_VALUE ); + final Type intType = new DefaultScalar( SammXsdType.INT.getURI() ); + assertThat( NumericTypeTraits.getModelMinValue( intType ) ).isEqualTo( Integer.MIN_VALUE ); // unsigned model types do not have native Java equivalents, so they map to the next wider type with model range set - final Type unsignedShort = new DefaultScalar( ExtendedXsdDataType.UNSIGNED_SHORT.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMinValue( metaModelVersion, unsignedShort ) ).isEqualTo( 0 ); + final Type unsignedShort = new DefaultScalar( SammXsdType.UNSIGNED_SHORT.getURI() ); + assertThat( NumericTypeTraits.getModelMinValue( unsignedShort ) ).isEqualTo( 0 ); // no lower bound - final Type negativeInteger = new DefaultScalar( ExtendedXsdDataType.NEGATIVE_INTEGER.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMinValue( metaModelVersion, negativeInteger ).doubleValue() ) + final Type negativeInteger = new DefaultScalar( SammXsdType.NEGATIVE_INTEGER.getURI() ); + assertThat( NumericTypeTraits.getModelMinValue( negativeInteger ).doubleValue() ) .isEqualTo( -Double.MAX_VALUE ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGetModelMaxValue( final KnownVersion metaModelVersion ) { + @Test + void testGetModelMaxValue() { // int maps to normal integer, so native type range should apply - final Type intType = new DefaultScalar( ExtendedXsdDataType.INT.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMaxValue( metaModelVersion, intType ) ).isEqualTo( Integer.MAX_VALUE ); + final Type intType = new DefaultScalar( SammXsdType.INT.getURI() ); + assertThat( NumericTypeTraits.getModelMaxValue( intType ) ).isEqualTo( Integer.MAX_VALUE ); // unsigned model types do not have native Java equivalents, so they map to the next wider type with model range set - final Type unsignedShort = new DefaultScalar( ExtendedXsdDataType.UNSIGNED_SHORT.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMaxValue( metaModelVersion, unsignedShort ) ).isEqualTo( 65535 ); + final Type unsignedShort = new DefaultScalar( SammXsdType.UNSIGNED_SHORT.getURI() ); + assertThat( NumericTypeTraits.getModelMaxValue( unsignedShort ) ).isEqualTo( 65535 ); - final Type negativeInteger = new DefaultScalar( ExtendedXsdDataType.NEGATIVE_INTEGER.getURI(), metaModelVersion ); - assertThat( NumericTypeTraits.getModelMaxValue( metaModelVersion, negativeInteger ) ).isEqualTo( -1 ); + final Type negativeInteger = new DefaultScalar( SammXsdType.NEGATIVE_INTEGER.getURI() ); + assertThat( NumericTypeTraits.getModelMaxValue( negativeInteger ) ).isEqualTo( -1 ); } @Test @@ -116,6 +109,6 @@ void testConvertToBigDecimal() { NumericTypeTraits.convertToBigDecimal( Long.MAX_VALUE ).compareTo( BigDecimal.valueOf( Long.MAX_VALUE ) ) ) .isEqualTo( 0 ); assertThat( NumericTypeTraits.convertToBigDecimal( Double.MAX_VALUE ) - .compareTo( BigDecimal.valueOf( Double.MAX_VALUE ) ) ).isEqualTo( 0 ); + .compareTo( BigDecimal.valueOf( Double.MAX_VALUE ) ) ).isEqualTo( 0 ); } } diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/asyncapi/AspectModelAsyncApiGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/asyncapi/AspectModelAsyncApiGeneratorTest.java index a0d192a96..4ba9868f2 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/asyncapi/AspectModelAsyncApiGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/asyncapi/AspectModelAsyncApiGeneratorTest.java @@ -5,11 +5,7 @@ import java.io.IOException; import java.util.Locale; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -17,21 +13,17 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -class AspectModelAsyncApiGeneratorTest extends MetaModelVersions { +class AspectModelAsyncApiGeneratorTest { private final AspectModelAsyncApiGenerator asyncApiGenerator = new AspectModelAsyncApiGenerator(); private static final String APPLICATION_ID = "urn:samm:test:test:serve"; private static final String CHANNEL_ADDRESS = "123/456/test/1.0.0/TestAspect"; private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAsyncApiGeneratorEmptyAspect( final KnownVersion metaModelVersion ) throws IOException { - final Aspect aspect = loadAspect( TestAspect.ASPECT, metaModelVersion ); + @Test + void testAsyncApiGeneratorEmptyAspect() throws IOException { + final Aspect aspect = TestResources.load( TestAspect.ASPECT ).aspect(); final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( false ) .applicationId( APPLICATION_ID ) @@ -79,7 +71,7 @@ void testAsyncApiGeneratorEmptyAspect( final KnownVersion metaModelVersion ) thr @Test void testAsyncApiGeneratorWithoutApplicationIdDoesNotAddEmptyId() throws JsonProcessingException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_EVENT, KnownVersion.getLatest() ); + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_EVENT ).aspect(); final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( false ) .channelAddress( CHANNEL_ADDRESS ) @@ -93,10 +85,9 @@ void testAsyncApiGeneratorWithoutApplicationIdDoesNotAddEmptyId() throws JsonPro assertThat( asyncSpec.getContentAsYaml() ).doesNotContain( "id: \"\"" ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testAsyncApiGeneratorAspectWithEvent( final KnownVersion metaModelVersion ) throws IOException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_EVENT, metaModelVersion ); + @Test + void testAsyncApiGeneratorAspectWithEvent() throws IOException { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_EVENT ).aspect(); final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( false ) .applicationId( APPLICATION_ID ) @@ -161,10 +152,9 @@ void testAsyncApiGeneratorAspectWithEvent( final KnownVersion metaModelVersion ) expectedComponentsSchemas ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testAsyncApiGeneratorAspectWithOperation( final KnownVersion metaModelVersion ) throws IOException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_OPERATION, metaModelVersion ); + @Test + void testAsyncApiGeneratorAspectWithOperation() throws IOException { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_OPERATION ).aspect(); final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( false ) .applicationId( APPLICATION_ID ) @@ -247,9 +237,4 @@ void testAsyncApiGeneratorAspectWithOperation( final KnownVersion metaModelVersi assertThat( json.get( "components" ).get( "schemas" ).get( "input" ) ).isEqualTo( expectedComponentsSchemaInput ); assertThat( json.get( "components" ).get( "schemas" ).get( "output" ) ).isEqualTo( expectedComponentsSchemaOutput ); } - - private Aspect loadAspect( final TestAspect testAspect, final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModel( testAspect, metaModelVersion ).get(); - return AspectModelLoader.getSingleAspect( versionedModel ).get(); - } } diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGeneratorTest.java index 90acd6edc..fbebd058f 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/diagram/AspectModelDiagramGeneratorTest.java @@ -20,12 +20,7 @@ import java.nio.charset.StandardCharsets; import java.util.Locale; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -33,14 +28,12 @@ import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.ValueSource; -public class AspectModelDiagramGeneratorTest extends MetaModelVersions { +public class AspectModelDiagramGeneratorTest { @ParameterizedTest @EnumSource( value = TestAspect.class ) void testGen( final TestAspect testAspect ) { - final VersionedModel versionedModel = TestResources.getModel( testAspect, KnownVersion.getLatest() ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( versionedModel ).getOrElseThrow( () -> new RuntimeException() ); - final AspectContext context = new AspectContext( versionedModel, aspect ); - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( context ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspect ); assertThatCode( () -> { final ByteArrayOutputStream out = new ByteArrayOutputStream(); generator.generateDiagram( AspectModelDiagramGenerator.Format.SVG, Locale.ENGLISH, out ); @@ -53,10 +46,8 @@ void generateDiagramsShouldReturnUtf8StringRegardlessOfPlatformEncoding( final S final String platformEncoding = System.getProperty( "file.encoding" ); try { System.setProperty( "file.encoding", encoding ); - final VersionedModel versionedModel = TestResources.getModel( TestAspect.ASPECT, KnownVersion.getLatest() ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( versionedModel ).getOrElseThrow( () -> new RuntimeException() ); - final AspectContext context = new AspectContext( versionedModel, aspect ); - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( context ); + final Aspect aspect = TestResources.load( TestAspect.ASPECT ).aspect(); + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspect ); assertThatCode( () -> { final ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGeneratorTest.java index baa173e23..9721098b6 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGeneratorTest.java @@ -20,38 +20,31 @@ import java.io.IOException; import java.io.PrintStream; import java.nio.charset.StandardCharsets; -import java.util.Collections; +import java.util.Map; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; - -public class AspectModelDocumentationGeneratorTest extends MetaModelVersions { +public class AspectModelDocumentationGeneratorTest { @ParameterizedTest @EnumSource( value = TestAspect.class ) public void testGeneration( final TestAspect testAspect ) { assertThatCode( () -> { - final String html = generateHtmlDocumentation( testAspect, KnownVersion.getLatest() ); + final String html = generateHtmlDocumentation( testAspect ); assertThat( html ).doesNotContain( "UnnamedCharacteristic" ); // No unresolved template variables assertThat( html ).doesNotContainPattern( "$[a-zA-Z]" ); } ).doesNotThrowAnyException(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testAspectWithEntityCollection( final KnownVersion metaModelVersion ) throws Throwable { - final String htmlResult = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ENTITY_COLLECTION, metaModelVersion ); + @Test + public void testAspectWithEntityCollection() throws Throwable { + final String htmlResult = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ENTITY_COLLECTION ); assertThat( htmlResult ).isNotEmpty(); assertThat( htmlResult ).contains( "

Aspect Model Test Aspect

" ); @@ -61,10 +54,9 @@ public void testAspectWithEntityCollection( final KnownVersion metaModelVersion "
Entity Property
" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testAspectWithCollectionOfSimpleType( final KnownVersion metaModelVersion ) throws Throwable { - final String htmlResult = generateHtmlDocumentation( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE, metaModelVersion ); + @Test + public void testAspectWithCollectionOfSimpleType() throws Throwable { + final String htmlResult = generateHtmlDocumentation( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE ); assertThat( htmlResult ).isNotEmpty(); assertThat( htmlResult ).contains( "

Aspect Model AspectWithCollectionOfSimpleType

" ); @@ -74,53 +66,47 @@ public void testAspectWithCollectionOfSimpleType( final KnownVersion metaModelVe assertThat( htmlResult ).containsIgnoringWhitespaces( "
Example
35
" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testScriptTagIsEscaped( final KnownVersion metaModelVersion ) throws IOException { - assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_SCRIPT_TAGS, metaModelVersion ) ) + @Test + public void testScriptTagIsEscaped() throws IOException { + assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_SCRIPT_TAGS ) ) .isNotEmpty() .doesNotContain( "" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testRubyGemUpdateCommandIsNotExecuted( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testRubyGemUpdateCommandIsNotExecuted() throws IOException { try ( final ByteArrayOutputStream stdOut = new ByteArrayOutputStream() ) { System.setOut( new PrintStream( stdOut ) ); - generateHtmlDocumentation( TestAspect.ASPECT_WITH_RUBY_GEM_UPDATE_COMMAND, metaModelVersion ); + generateHtmlDocumentation( TestAspect.ASPECT_WITH_RUBY_GEM_UPDATE_COMMAND ); assertThat( stdOut.toString() ).doesNotContain( "gem" ); } } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testHtmlTagsAreEscaped( final KnownVersion metaModelVersion ) throws IOException { - assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS, metaModelVersion ) ) + @Test + public void testHtmlTagsAreEscaped() throws IOException { + assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS ) ) .isNotEmpty() .doesNotContain( "" ) .doesNotContain( "

inside html tag

" ) .doesNotContain( "Preferred Name '/>" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testEncodedTextIsNotDecoded( final KnownVersion metaModelVersion ) throws IOException { - assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_ENCODED_STRINGS, metaModelVersion ) ) + @Test + public void testEncodedTextIsNotDecoded() throws IOException { + assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_ENCODED_STRINGS ) ) .doesNotContain( "This is an Aspect with encoded text." ) .contains( "VGhpcyBpcyBhbiBBc3BlY3Qgd2l0aCBlbmNvZGVkIHRleHQu" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testAspectModelUrnIsDisplayed( final KnownVersion metaModelVersion ) throws IOException { - assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS, metaModelVersion ) ) + @Test + public void testAspectModelUrnIsDisplayed() throws IOException { + assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS ) ) .contains( "urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithHtmlTags" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testDocInfosAreDisplayed( final KnownVersion metaModelVersion ) throws IOException { - assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS, metaModelVersion ) ) + @Test + public void testDocInfosAreDisplayed() throws IOException { + assertThat( generateHtmlDocumentation( TestAspect.ASPECT_WITH_HTML_TAGS ) ) .contains( ".toc-list" ) .contains( "aspect-model-diagram" ) .contains( "function toggleLicenseDetails()" ) @@ -130,17 +116,15 @@ public void testDocInfosAreDisplayed( final KnownVersion metaModelVersion ) thro .contains( "enumerable" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testDocumentationIsNotEmptyForModelWithoutLanguageTags( final KnownVersion metaModelVersion ) throws IOException { - final String aspectWithoutLanguageTags = generateHtmlDocumentation( TestAspect.ASPECT_WITHOUT_LANGUAGE_TAGS, metaModelVersion ); + @Test + public void testDocumentationIsNotEmptyForModelWithoutLanguageTags() throws IOException { + final String aspectWithoutLanguageTags = generateHtmlDocumentation( TestAspect.ASPECT_WITHOUT_LANGUAGE_TAGS ); assertThat( aspectWithoutLanguageTags ).isNotEmpty(); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testAspectWithAbstractSingleEntityExpectSuccess( final KnownVersion metaModelVersion ) throws IOException { - final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ABSTRACT_SINGLE_ENTITY, metaModelVersion ); + @Test + public void testAspectWithAbstractSingleEntityExpectSuccess() throws IOException { + final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ABSTRACT_SINGLE_ENTITY ); assertThat( documentation ).contains( "

testProperty" ); @@ -151,10 +135,9 @@ public void testAspectWithAbstractSingleEntityExpectSuccess( final KnownVersion "

entityProperty
" ); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testAspectWithAbstractEntityExpectSuccess( final KnownVersion metaModelVersion ) throws IOException { - final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY, metaModelVersion ); + @Test + public void testAspectWithAbstractEntityExpectSuccess() throws IOException { + final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY ); assertThat( documentation ).contains( "

Test Property

" ); assertThat( documentation ).contains( @@ -164,10 +147,9 @@ public void testAspectWithAbstractEntityExpectSuccess( final KnownVersion metaMo "
Entity Property
" ); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testAspectWithCollectionWithAbstractEntityExpectSuccess( final KnownVersion metaModelVersion ) throws IOException { - final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY, metaModelVersion ); + @Test + public void testAspectWithCollectionWithAbstractEntityExpectSuccess() throws IOException { + final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY ); assertThat( documentation ).contains( "

testProperty

" ); @@ -178,20 +160,18 @@ public void testAspectWithCollectionWithAbstractEntityExpectSuccess( final Known "
entityProperty
" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testAspectWithQuantifiableWithoutUnit( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testAspectWithQuantifiableWithoutUnit() throws IOException { try ( final ByteArrayOutputStream stdOut = new ByteArrayOutputStream() ) { System.setOut( new PrintStream( stdOut ) ); - assertThatCode( () -> generateHtmlDocumentation( TestAspect.ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT, metaModelVersion ) ) + assertThatCode( () -> generateHtmlDocumentation( TestAspect.ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT ) ) .doesNotThrowAnyException(); } } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testAspectWithConstraintWithSeeAttribute( final KnownVersion metaModelVersion ) throws IOException { - final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_CONSTRAINT_WITH_SEE_ATTRIBUTE, metaModelVersion ); + @Test + public void testAspectWithConstraintWithSeeAttribute() throws IOException { + final String documentation = generateHtmlDocumentation( TestAspect.ASPECT_WITH_CONSTRAINT_WITH_SEE_ATTRIBUTE ); assertThat( documentation ).contains( "

testPropertyTwo

" ); @@ -201,15 +181,13 @@ public void testAspectWithConstraintWithSeeAttribute( final KnownVersion metaMod "
  • http://example.com/me2
  • " ); } - private String generateHtmlDocumentation( final TestAspect model, final KnownVersion testedVersion ) throws IOException { - final VersionedModel versionedModel = TestResources.getModel( model, testedVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( versionedModel ).getOrElseThrow( () -> new RuntimeException() ); - final AspectContext context = new AspectContext( versionedModel, aspect ); - final AspectModelDocumentationGenerator aspectModelDocumentationGenerator = new AspectModelDocumentationGenerator( context ); + private String generateHtmlDocumentation( final TestAspect testAspect ) throws IOException { + final Aspect aspect = TestResources.load( testAspect ).aspect(); + final AspectModelDocumentationGenerator aspectModelDocumentationGenerator = new AspectModelDocumentationGenerator( aspect ); try ( final ByteArrayOutputStream result = new ByteArrayOutputStream() ) { - aspectModelDocumentationGenerator.generate( name -> result, Collections.EMPTY_MAP ); - return result.toString( StandardCharsets.UTF_8.name() ); + aspectModelDocumentationGenerator.generate( name -> result, Map.of() ); + return result.toString( StandardCharsets.UTF_8 ); } } } diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGeneratorTest.java index c9b1e8f36..a416fd4c4 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/AspectModelJsonPayloadGeneratorTest.java @@ -76,32 +76,28 @@ import org.eclipse.esmf.aspectmodel.generator.json.testclasses.NestedEntity; import org.eclipse.esmf.aspectmodel.generator.json.testclasses.TestEntityWithSimpleTypes; import org.eclipse.esmf.aspectmodel.jackson.AspectModelJacksonModule; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRangeConstraint; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRangeConstraint; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.eclipse.esmf.metamodel.impl.DefaultAspect; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultProperty; import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.test.TestAspect; +import org.eclipse.esmf.test.TestModel; import org.eclipse.esmf.test.TestResources; import com.fasterxml.jackson.databind.ObjectMapper; @@ -117,11 +113,12 @@ import org.assertj.core.api.Condition; import org.assertj.core.data.Percentage; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -public class AspectModelJsonPayloadGeneratorTest extends MetaModelVersions { +public class AspectModelJsonPayloadGeneratorTest { private static DatatypeFactory datatypeFactory; @BeforeAll @@ -133,10 +130,9 @@ static void setup() { } } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithCollectionOfEntities( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_LIST, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithCollectionOfEntities() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_LIST ); final AspectWithEntityCollection aspectWithEntityCollection = parseJson( generatedJson, AspectWithEntityCollection.class ); @@ -148,10 +144,9 @@ public void testGenerateJsonForAspectWithCollectionOfEntities( final KnownVersio assertTestEntityWithSimpleTypes( testEntityWithSimpleTypes ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithSimpleProperties( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_SIMPLE_PROPERTIES, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithSimpleProperties() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_SIMPLE_PROPERTIES ); final AspectWithSimpleProperties aspectWithSimpleProperties = parseJson( generatedJson, AspectWithSimpleProperties.class ); @@ -167,10 +162,9 @@ public void testGenerateJsonForAspectWithSimpleProperties( final KnownVersion me assertThat( aspectWithSimpleProperties.getTestDurationWithoutExample() ).isNotNull(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithStateType( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_SIMPLE_PROPERTIES_AND_STATE, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithStateType() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_SIMPLE_PROPERTIES_AND_STATE ); final AspectWithSimpleTypesAndState aspectWithSimpleTypes = parseJson( generatedJson, AspectWithSimpleTypesAndState.class ); assertThat( aspectWithSimpleTypes.getRandomValue() ).isNotBlank(); @@ -182,38 +176,34 @@ public void testGenerateJsonForAspectWithStateType( final KnownVersion metaModel assertThat( aspectWithSimpleTypes.getAutomationProperty() ).isEqualTo( "Automation Default Prop" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithEntity( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_WITH_MULTIPLE_PROPERTIES, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithEntity() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_WITH_MULTIPLE_PROPERTIES ); final AspectWithEntity aspectWithEntity = parseJson( generatedJson, AspectWithEntity.class ); assertTestEntityWithSimpleTypes( aspectWithEntity.getTestEntity() ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithRecursivePropertyWithOptional( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithRecursivePropertyWithOptional() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL ); final AspectWithRecursivePropertyWithOptional aspectWithRecursivePropertyWithOptional = parseJson( generatedJson, AspectWithRecursivePropertyWithOptional.class ); assertThat( aspectWithRecursivePropertyWithOptional.getTestProperty().getTestProperty().get().getTestProperty() ).isNotPresent(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithMultipleEntities( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithMultipleEntities() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES ); final AspectWithMultipleEntities aspectWithMultipleEntities = parseJson( generatedJson, AspectWithMultipleEntities.class ); assertTestEntityWithSimpleTypes( aspectWithMultipleEntities.getTestEntityOne() ); assertTestEntityWithSimpleTypes( aspectWithMultipleEntities.getTestEntityTwo() ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithNestedEntity( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_NESTED_ENTITY, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithNestedEntity() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_NESTED_ENTITY ); final AspectWithNestedEntity aspectWithNestedEntity = parseJson( generatedJson, AspectWithNestedEntity.class ); @@ -224,10 +214,9 @@ public void testGenerateJsonForAspectWithNestedEntity( final KnownVersion metaMo assertThat( nestedEntity.getTestString() ).isEqualTo( "Example Value Test" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithMultipleCollectionsOfSimpleType( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_COLLECTIONS_OF_SIMPLE_TYPE, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithMultipleCollectionsOfSimpleType() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_COLLECTIONS_OF_SIMPLE_TYPE ); final AspectWithMultipleCollectionsOfSimpleType aspectWithCollectionOfSimpleType = parseJson( generatedJson, AspectWithMultipleCollectionsOfSimpleType.class ); @@ -237,10 +226,9 @@ public void testGenerateJsonForAspectWithMultipleCollectionsOfSimpleType( final assertThat( aspectWithCollectionOfSimpleType.getTestListString() ).containsExactly( "test string" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithCollectionOfSimpleType( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithCollectionOfSimpleType() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COLLECTION_OF_SIMPLE_TYPE ); final AspectWithCollectionOfSimpleType aspectWithCollectionOfSimpleType = parseJson( generatedJson, AspectWithCollectionOfSimpleType.class ); @@ -249,18 +237,16 @@ public void testGenerateJsonForAspectWithCollectionOfSimpleType( final KnownVers assertThat( aspectWithCollectionOfSimpleType.getTestList() ).containsExactly( 35 ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithEitherType( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_EITHER, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithEitherType() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_EITHER ); final AspectWithEither aspectWithEither = parseJson( generatedJson, AspectWithEither.class ); assertThat( aspectWithEither.getEither().getLeft() ).isNotBlank(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithEnumHavingNestedEntities( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENUM_HAVING_NESTED_ENTITIES, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithEnumHavingNestedEntities() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENUM_HAVING_NESTED_ENTITIES ); final AspectWithEnumHavingNestedEntities aspectWithEnum = parseJson( generatedJson, AspectWithEnumHavingNestedEntities.class ); @@ -271,10 +257,9 @@ public void testGenerateJsonForAspectWithEnumHavingNestedEntities( final KnownVe assertThat( details.getNumericCode() ).isEqualTo( Short.valueOf( "10" ) ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithEntityEnumerationAndLangString( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_LANG_STRING, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithEntityEnumerationAndLangString() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_LANG_STRING ); final AspectWithEntityEnumerationAndLangString aspectWithEnum = parseJson( generatedJson, AspectWithEntityEnumerationAndLangString.class ); @@ -282,10 +267,9 @@ public void testGenerateJsonForAspectWithEntityEnumerationAndLangString( final K assertThat( aspectWithEnum.getTestProperty().getValue().getEntityProperty().get( "en" ) ).isEqualTo( "This is a test." ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithComplexEnum( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_ENUM, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithComplexEnum() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_ENUM ); final AspectWithEnum aspectWithEnum = parseJson( generatedJson, AspectWithEnum.class ); @@ -294,10 +278,9 @@ public void testGenerateJsonForAspectWithComplexEnum( final KnownVersion metaMod assertThat( aspectWithEnum.getResult().getNumericCode() ).isNotZero(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithComplextEntityCollectionEnum( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_ENTITY_COLLECTION_ENUM, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithComplextEntityCollectionEnum() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_ENTITY_COLLECTION_ENUM ); final AspectWithComplexEntityCollectionEnum aspectWithComplexEntityCollectionEnum = parseJson( generatedJson, AspectWithComplexEntityCollectionEnum.class ); @@ -309,10 +292,9 @@ public void testGenerateJsonForAspectWithComplextEntityCollectionEnum( final Kno assertThat( myEntityTwoList.get( 0 ).getEntityPropertyTwo() ).isEqualTo( "foo" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithMultipleEntitiesComplexEitherType( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_AND_EITHER, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithMultipleEntitiesComplexEitherType() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_AND_EITHER ); final AspectWithMultipleEntitiesAndEither aspectWithCollectionOfSimpleType = parseJson( generatedJson, AspectWithMultipleEntitiesAndEither.class ); assertTestEntityWithSimpleTypes( aspectWithCollectionOfSimpleType.getTestEntityOne() ); @@ -320,10 +302,9 @@ public void testGenerateJsonForAspectWithMultipleEntitiesComplexEitherType( fina assertTestEntityWithSimpleTypes( aspectWithCollectionOfSimpleType.getTestEitherProperty().getLeft() ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithMultipleCollectionsOfEntities( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITY_COLLECTIONS, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithMultipleCollectionsOfEntities() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTIPLE_ENTITY_COLLECTIONS ); final AspectWithMultipleEntityCollections aspectWithEntityCollection = parseJson( generatedJson, AspectWithMultipleEntityCollections.class ); @@ -338,28 +319,25 @@ public void testGenerateJsonForAspectWithMultipleCollectionsOfEntities( final Kn assertTestEntityWithSimpleTypes( testEntityWithSimpleTypes ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectForCurie( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CURIE, metaModelVersion ); + @Test + public void testGenerateAspectForCurie() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CURIE ); final AspectWithCurie aspectWithCurie = parseJson( generatedJson, AspectWithCurie.class ); assertThat( aspectWithCurie.getTestCurie() ).isEqualTo( "unit:hectopascal" ); assertThat( aspectWithCurie.getTestCurieWithoutExampleValue() ).startsWith( "unit" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithMultiLanguageText( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT, metaModelVersion ); + @Test + public void testGenerateAspectWithMultiLanguageText() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT ); final AspectWithMultiLanguageText aspectWithMultiLanguageText = parseJson( generatedJson, AspectWithMultiLanguageText.class ); final Condition isEnglishLangString = new Condition<>( l -> l.getLanguageTag().equals( Locale.ENGLISH ), "is english" ); assertThat( aspectWithMultiLanguageText.getProp() ).has( isEnglishLangString ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithMultiLanguageExampleValue( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTILANGUAGE_EXAMPLE_VALUE, metaModelVersion ); + @Test + public void testGenerateAspectWithMultiLanguageExampleValue() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_MULTILANGUAGE_EXAMPLE_VALUE ); final AspectWithMultilanguageExampleValue aspectWithMultiLanguageText = parseJson( generatedJson, AspectWithMultilanguageExampleValue.class ); final Condition isGermanLangString = new Condition<>( l -> l.getLanguageTag().equals( Locale.GERMAN ), "is german" ); @@ -368,10 +346,9 @@ public void testGenerateAspectWithMultiLanguageExampleValue( final KnownVersion assertThat( aspectWithMultiLanguageText.getProp() ).has( text ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithConstraint( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINT, metaModelVersion ); + @Test + public void testGenerateAspectWithConstraint() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINT ); final AspectWithConstraintProperties aspectWithConstraint = parseJson( generatedJson, AspectWithConstraintProperties.class ); assertThat( aspectWithConstraint.getStringLcProperty().length() ).isBetween( 20, 22 ); assertThat( aspectWithConstraint.getBigIntRcProperty().intValue() ).isBetween( 10, 15 ); @@ -381,10 +358,9 @@ public void testGenerateAspectWithConstraint( final KnownVersion metaModelVersio assertThat( aspectWithConstraint.getStringRegexcProperty() ).matches( "[a-zA-Z]" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithConstraints( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINTS, metaModelVersion ); + @Test + public void testGenerateAspectWithConstraints() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINTS ); final AspectWithConstraints aspectWithConstraints = parseJson( generatedJson, AspectWithConstraints.class ); assertThat( aspectWithConstraints.getTestPropertyCollectionLengthConstraint().size() ).isBetween( 1, 10 ); assertThat( aspectWithConstraints.getTestPropertyWithMinLengthConstraint() ).isGreaterThanOrEqualTo( BigInteger.ONE ); @@ -399,18 +375,16 @@ public void testGenerateAspectWithConstraints( final KnownVersion metaModelVersi assertThat( aspectWithConstraints.getTestPropertyWithRegularExpression() ).matches( "^[a-zA-Z]\\.[0-9]" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithStructuredValue( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_STRUCTURED_VALUE, metaModelVersion ); + @Test + public void testGenerateAspectWithStructuredValue() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_STRUCTURED_VALUE ); final AspectWithStructuredValue aspectWithStructuredValue = parseJson( generatedJson, AspectWithStructuredValue.class ); assertThat( aspectWithStructuredValue.getDate().toString() ).isEqualTo( "2019-09-27" ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateAspectWithDateTimeTypeForRangeConstraints( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_G_TYPE_FOR_RANGE_CONSTRAINTS, metaModelVersion ); + @Test + public void testGenerateAspectWithDateTimeTypeForRangeConstraints() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_G_TYPE_FOR_RANGE_CONSTRAINTS ); final AspectWithGTypeForRangeConstraints aspectWithGtypeForRangeConstraints = parseJson( generatedJson, AspectWithGTypeForRangeConstraints.class ); final Pattern dayPattern = Pattern.compile( "---(0[1-9]|[12][0-9]|3[01])(Z|([+\\-])((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?" ); @@ -419,12 +393,9 @@ public void testGenerateAspectWithDateTimeTypeForRangeConstraints( final KnownVe assertThat( monthPattern.matcher( aspectWithGtypeForRangeConstraints.getTestPropertyWithGMonth().toString() ) ).matches(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithoutMinMaxIntegerValueOnRangeConstraint( final KnownVersion metaModelVersion ) - throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_INTEGER_VALUE, - metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithoutMinMaxIntegerValueOnRangeConstraint() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_INTEGER_VALUE ); final AspectWithRangeConstraintWithoutMinMaxIntegerValue aspectWithSimpleProperties = parseJson( generatedJson, AspectWithRangeConstraintWithoutMinMaxIntegerValue.class ); @@ -432,12 +403,9 @@ public void testGenerateJsonForAspectWithoutMinMaxIntegerValueOnRangeConstraint( assertThat( aspectWithSimpleProperties.getTestInt() ).isNotNull(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithoutMinMaxDoubleValueOnRangeConstraint( final KnownVersion metaModelVersion ) - throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_DOUBLE_VALUE, - metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithoutMinMaxDoubleValueOnRangeConstraint() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITHOUT_MIN_MAX_DOUBLE_VALUE ); final AspectWithRangeConstraintWithoutMinMaxDoubleValue aspectWithRangeConstraintWithoutMinMaxDoubleValue = parseJson( generatedJson, AspectWithRangeConstraintWithoutMinMaxDoubleValue.class ); @@ -445,24 +413,18 @@ public void testGenerateJsonForAspectWithoutMinMaxDoubleValueOnRangeConstraint( assertThat( aspectWithRangeConstraintWithoutMinMaxDoubleValue.getDoubleProperty() ).isNotNull(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithEntityEnumerationAndNotInPayloadProperties( final KnownVersion metaModelVersion ) - throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES, - metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithEntityEnumerationAndNotInPayloadProperties() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES ); final AspectWithEntityEnumerationAndNotInPayloadProperties aspectWithEntityAndNoInPayloadProperty = parseJson( generatedJson, AspectWithEntityEnumerationAndNotInPayloadProperties.class ); assertThat( aspectWithEntityAndNoInPayloadProperty.getSystemState().getValue().getState() ).isEqualTo( (short) 1 ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithExtendedEnumsWithNotInPayloadProperty( final KnownVersion metaModelVersion ) - throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_EXTENDED_ENUMS_WITH_NOT_IN_PAYLOAD_PROPERTY, - metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithExtendedEnumsWithNotInPayloadProperty() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_EXTENDED_ENUMS_WITH_NOT_IN_PAYLOAD_PROPERTY ); final AspectWithExtendedEnumsWithNotInPayloadProperty aspectWithExtendedEnumsWithNotInPayloadProperty = parseJson( generatedJson, AspectWithExtendedEnumsWithNotInPayloadProperty.class ); @@ -472,16 +434,12 @@ public void testGenerateJsonForAspectWithExtendedEnumsWithNotInPayloadProperty( @ParameterizedTest @MethodSource( value = "rangeTestSource" ) void testGeneratedNumbersAreWithinRange( final RDFDatatype numericModelType, final Optional boundKind ) { - // number types are the same in all versions of the meta model, so we do not need to iterate over all of them, - // just take the latest one - final KnownVersion modelVersion = KnownVersion.SAMM_1_0_0; - - final Type numericType = new DefaultScalar( numericModelType.getURI(), modelVersion ); + final Type numericType = new DefaultScalar( numericModelType.getURI() ); final Resource dataTypeResource = ResourceFactory.createResource( numericType.getUrn() ); - final Class nativeType = DataType.getJavaTypeForMetaModelType( dataTypeResource, modelVersion ); + final Class nativeType = SammXsdType.getJavaTypeForMetaModelType( dataTypeResource ); final Pair randomRange = generateRandomRangeForType( numericType, nativeType, boundKind.orElse( null ) ); - final Aspect dynamicAspect = createAspectWithDynamicNumericProperty( modelVersion, numericType, boundKind.orElse( null ), + final Aspect dynamicAspect = createAspectWithDynamicNumericProperty( numericType, boundKind.orElse( null ), randomRange ); final AspectModelJsonPayloadGenerator randomGenerator = new AspectModelJsonPayloadGenerator( dynamicAspect ); final AspectModelJsonPayloadGenerator minGenerator = new AspectModelJsonPayloadGenerator( dynamicAspect, @@ -570,20 +528,18 @@ private void assertMaxValue( final Number value, final Number rangeMaxValue, fin BoundDefinition.GREATER_THAN, "Exclusive range" ); - @ParameterizedTest - @MethodSource( "allVersions" ) - public void testGenerateJsonForAspectWithPropertyWithPayloadName( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithPropertyWithPayloadName() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME ); final AspectWithPropertyWithPayloadName aspectWithPropertyWithPayloadName = parseJson( generatedJson, AspectWithPropertyWithPayloadName.class ); assertThat( aspectWithPropertyWithPayloadName.getTest() ).isNotEmpty(); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testGenerateJsonForAspectWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithAbstractEntity() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ABSTRACT_ENTITY ); final AspectWithAbstractEntity aspectWithAbstractEntity = parseJson( generatedJson, AspectWithAbstractEntity.class ); final ExtendingTestEntity testProperty = aspectWithAbstractEntity.getTestProperty(); @@ -592,10 +548,9 @@ public void testGenerateJsonForAspectWithAbstractEntity( final KnownVersion meta assertThat( testProperty.getEntityProperty() ).isNotBlank(); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testGenerateJsonForAspectWithCollectionWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithCollectionWithAbstractEntity() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY ); final AspectWithCollectionWithAbstractEntity aspectWithCollectionWithAbstractEntity = parseJson( generatedJson, AspectWithCollectionWithAbstractEntity.class ); @@ -608,10 +563,9 @@ public void testGenerateJsonForAspectWithCollectionWithAbstractEntity( final Kno assertThat( extendingTestEntity.getEntityProperty() ).isNotBlank(); } - @ParameterizedTest - @MethodSource( "versionsStartingWith2_0_0" ) - public void testGenerateJsonForAspectWithAbstractSingleEntity( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ABSTRACT_SINGLE_ENTITY, metaModelVersion ); + @Test + public void testGenerateJsonForAspectWithAbstractSingleEntity() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_ABSTRACT_SINGLE_ENTITY ); final AspectWithAbstractSingleEntity aspectWithAbstractSingleEntity = parseJson( generatedJson, AspectWithAbstractSingleEntity.class ); @@ -620,19 +574,17 @@ public void testGenerateJsonForAspectWithAbstractSingleEntity( final KnownVersio assertThat( extendingTestEntity.getEntityProperty() ).isNotBlank(); } - @ParameterizedTest - @MethodSource( "allVersions" ) - void testGenerateJsonForAspectWithConstrainedSetProperty( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINED_SET, metaModelVersion ); + @Test + void testGenerateJsonForAspectWithConstrainedSetProperty() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_CONSTRAINED_SET ); final AspectWithConstrainedSet aspectWithConstrainedSet = parseJson( generatedJson, AspectWithConstrainedSet.class ); assertThat( generatedJson ).contains( "[" ).contains( "]" ); assertThat( aspectWithConstrainedSet.getTestProperty() ).hasSizeGreaterThan( 0 ); } - @ParameterizedTest - @MethodSource( "allVersions" ) - void testGenerateJsonForAspectWithComplexSet( final KnownVersion metaModelVersion ) throws IOException { - final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_SET, metaModelVersion ); + @Test + void testGenerateJsonForAspectWithComplexSet() throws IOException { + final String generatedJson = generateJsonForModel( TestAspect.ASPECT_WITH_COMPLEX_SET ); final AspectWithComplexSet aspectWithComplexSet = parseJson( generatedJson, AspectWithComplexSet.class ); assertThat( aspectWithComplexSet.getTestProperty() ).hasSize( 2 ); final Iterator values = aspectWithComplexSet.getTestProperty().iterator(); @@ -641,11 +593,9 @@ void testGenerateJsonForAspectWithComplexSet( final KnownVersion metaModelVersio assertThat( id1 ).isNotEqualTo( id2 ); } - private String generateJsonForModel( final TestAspect model, final KnownVersion testedVersion ) { - final VersionedModel versionedModel = TestResources.getModel( model, testedVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( versionedModel ); - final AspectModelJsonPayloadGenerator jsonGenerator = new AspectModelJsonPayloadGenerator( - new AspectContext( versionedModel, aspect ) ); + private String generateJsonForModel( final TestAspect testAspect ) { + final Aspect aspect = TestResources.load( testAspect ).aspect(); + final AspectModelJsonPayloadGenerator jsonGenerator = new AspectModelJsonPayloadGenerator( aspect ); try { return jsonGenerator.generateJson(); } catch ( final IOException e ) { @@ -682,8 +632,7 @@ private static List rangeTestSource() { } private static List getMetaModelNumericTypes() { - return DataType.getAllSupportedTypes() - .stream() + return SammXsdType.ALL_TYPES.stream() .filter( dataType -> dataType.getJavaClass() != null ) .filter( dataType -> Number.class.isAssignableFrom( dataType.getJavaClass() ) ) .collect( Collectors.toList() ); @@ -696,41 +645,37 @@ private static List getMetaModelNumericTypes() { Optional.of( BoundDefinition.GREATER_THAN ) // exclusive bounds ); - private Aspect createAspectWithDynamicNumericProperty( final KnownVersion modelVersion, final Type dataType, - final BoundDefinition boundKind, final Pair randomRange ) { - final SAMM samm = new SAMM( modelVersion ); - final Characteristic constraint = boundKind == null ? createBasicCharacteristic( modelVersion, dataType, samm ) - : createTraitWithRangeConstraint( modelVersion, dataType, boundKind, samm, randomRange ); - final List properties = List.of( createProperty( modelVersion, "testNumber", constraint, samm ) ); - final MetaModelBaseAttributes aspectAttributes = - MetaModelBaseAttributes.from( modelVersion, AspectModelUrn.fromUrn( samm.Aspect().getURI() ), "AspectWithNumericProperty" ); + private Aspect createAspectWithDynamicNumericProperty( final Type dataType, final BoundDefinition boundKind, + final Pair randomRange ) { + final Characteristic constraint = boundKind == null ? createBasicCharacteristic( dataType ) + : createTraitWithRangeConstraint( dataType, boundKind, randomRange ); + final List properties = List.of( createProperty( "testNumber", constraint ) ); + final MetaModelBaseAttributes aspectAttributes = MetaModelBaseAttributes.builder() + .withUrn( TestModel.TEST_NAMESPACE + "AspectWithNumericProperty" ).build(); return new DefaultAspect( aspectAttributes, properties, List.of(), List.of(), false ); } - private Property createProperty( final KnownVersion modelVersion, final String propertyName, final Characteristic characteristic, - final SAMM samm ) { - final MetaModelBaseAttributes propertyAttributes = - MetaModelBaseAttributes.from( modelVersion, AspectModelUrn.fromUrn( samm.Property().getURI() ), propertyName ); + private Property createProperty( final String propertyName, final Characteristic characteristic ) { + final MetaModelBaseAttributes propertyAttributes = MetaModelBaseAttributes.builder() + .withUrn( TestModel.TEST_NAMESPACE + propertyName ).build(); return new DefaultProperty( propertyAttributes, Optional.of( characteristic ), Optional.empty(), false, false, Optional.empty(), - false, - Optional.empty() ); + false, Optional.empty() ); } - Trait createTraitWithRangeConstraint( final KnownVersion modelVersion, final Type dataType, final BoundDefinition boundKind, - final SAMM samm, final Pair randomRange ) { - final MetaModelBaseAttributes constraintAttibutes = - MetaModelBaseAttributes.from( modelVersion, AspectModelUrn.fromUrn( samm.characteristic().getURI() ), "TestConstraint" ); + Trait createTraitWithRangeConstraint( final Type dataType, final BoundDefinition boundKind, final Pair randomRange ) { + final MetaModelBaseAttributes constraintAttibutes = MetaModelBaseAttributes.builder() + .withUrn( TestModel.TEST_NAMESPACE + "TestConstraint" ).build(); final Optional minValue = BoundDefinition.OPEN.equals( boundKind ) ? Optional.empty() - : Optional.of( new DefaultScalarValue( randomRange.getLeft(), new DefaultScalar( dataType.getUrn(), modelVersion ) ) ); + : Optional.of( new DefaultScalarValue( randomRange.getLeft(), new DefaultScalar( dataType.getUrn() ) ) ); final Optional maxValue = BoundDefinition.OPEN.equals( boundKind ) ? Optional.empty() - : Optional.of( new DefaultScalarValue( randomRange.getRight(), new DefaultScalar( dataType.getUrn(), modelVersion ) ) ); + : Optional.of( new DefaultScalarValue( randomRange.getRight(), new DefaultScalar( dataType.getUrn() ) ) ); final RangeConstraint rangeConstraint = new DefaultRangeConstraint( constraintAttibutes, minValue, maxValue, boundKind, getMatchingUpperBound( boundKind ) ); - final MetaModelBaseAttributes traitAttributes = MetaModelBaseAttributes - .from( modelVersion, AspectModelUrn.fromUrn( samm.characteristic().getURI() ), "TestTrait" ); - return new DefaultTrait( traitAttributes, createBasicCharacteristic( modelVersion, dataType, samm ), List.of( rangeConstraint ) ); + final MetaModelBaseAttributes traitAttributes = MetaModelBaseAttributes.builder().withUrn( TestModel.TEST_NAMESPACE + "TestTrait" ) + .build(); + return new DefaultTrait( traitAttributes, createBasicCharacteristic( dataType ), List.of( rangeConstraint ) ); } private BoundDefinition getMatchingUpperBound( final BoundDefinition boundKind ) { @@ -739,10 +684,9 @@ private BoundDefinition getMatchingUpperBound( final BoundDefinition boundKind ) BoundDefinition.OPEN; } - Characteristic createBasicCharacteristic( final KnownVersion modelVersion, final Type dataType, final SAMM samm ) { - return new DefaultCharacteristic( MetaModelBaseAttributes.builderFor( "NumberCharacteristic" ) - .withMetaModelVersion( modelVersion ) - .withUrn( AspectModelUrn.fromUrn( samm.baseCharacteristic().getURI() ) ) + Characteristic createBasicCharacteristic( final Type dataType ) { + return new DefaultCharacteristic( MetaModelBaseAttributes.builder().withUrn( TestModel.TEST_NAMESPACE + "NumberCharacteristic" ) + .withUrn( AspectModelUrn.fromUrn( SammNs.SAMMC.baseCharacteristic().getURI() ) ) .withPreferredName( Locale.forLanguageTag( "en" ), "NumberCharacteristic" ) .withDescription( Locale.forLanguageTag( "en" ), "A simple numeric property." ) .build(), diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithConstraints.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithConstraints.java index fe3ea17e0..0923114e2 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithConstraints.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithConstraints.java @@ -23,7 +23,7 @@ import org.eclipse.esmf.aspectmodel.java.customconstraint.FloatMin; import org.eclipse.esmf.aspectmodel.java.customconstraint.IntegerMax; import org.eclipse.esmf.aspectmodel.java.customconstraint.IntegerMin; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithDateTimeTypeForRangeConstraints.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithDateTimeTypeForRangeConstraints.java index abae601e1..a5a3bfa2c 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithDateTimeTypeForRangeConstraints.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithDateTimeTypeForRangeConstraints.java @@ -18,7 +18,7 @@ import org.eclipse.esmf.aspectmodel.java.customconstraint.GregorianCalendarMax; import org.eclipse.esmf.aspectmodel.java.customconstraint.GregorianCalendarMin; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithGTypeForRangeConstraints.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithGTypeForRangeConstraints.java index b68bd9708..fddb691c0 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithGTypeForRangeConstraints.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithGTypeForRangeConstraints.java @@ -18,7 +18,7 @@ import org.eclipse.esmf.aspectmodel.java.customconstraint.GregorianCalendarMax; import org.eclipse.esmf.aspectmodel.java.customconstraint.GregorianCalendarMin; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultiLanguageText.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultiLanguageText.java index 1c78f0467..41450d0d4 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultiLanguageText.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultiLanguageText.java @@ -15,7 +15,7 @@ import java.util.Objects; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultilanguageExampleValue.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultilanguageExampleValue.java index 3bab24718..fad97e788 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultilanguageExampleValue.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/json/testclasses/AspectWithMultilanguageExampleValue.java @@ -2,7 +2,7 @@ import java.util.Objects; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGeneratorTest.java index d5c18b0dc..6360939a5 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/jsonschema/AspectModelJsonSchemaGeneratorTest.java @@ -126,7 +126,7 @@ private void assertPayloadIsValid( final JsonNode schema, final JsonNode payload showJson( payload ); System.out.println( "Schema:" ); showJson( schema ); - fail(); + fail( throwable ); } } diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGeneratorTest.java index 609056096..e74c8d98f 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/openapi/AspectModelOpenApiGeneratorTest.java @@ -29,12 +29,8 @@ import java.util.stream.Collectors; import org.eclipse.esmf.aspectmodel.generator.AbstractGenerator; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -42,7 +38,6 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -50,7 +45,6 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import com.github.fge.jsonschema.core.exceptions.ProcessingException; import com.google.common.collect.Streams; import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.DocumentContext; @@ -67,12 +61,12 @@ import org.apache.commons.io.IOUtils; import org.assertj.core.api.InstanceOfAssertFactories; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.LoggerFactory; -public class AspectModelOpenApiGeneratorTest extends MetaModelVersions { +public class AspectModelOpenApiGeneratorTest { private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); private static final String TEST_BASE_URL = "https://test-aspect.example.com"; private static final String TEST_RESOURCE_PATH = "my-test-aspect"; @@ -88,7 +82,7 @@ public class AspectModelOpenApiGeneratorTest extends MetaModelVersions { @ParameterizedTest @EnumSource( value = TestAspect.class ) void testGeneration( final TestAspect testAspect ) throws IOException { - final Aspect aspect = loadAspect( testAspect, KnownVersion.getLatest() ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( false ) .baseUrl( TEST_BASE_URL ) @@ -134,10 +128,9 @@ private void showJson( final JsonNode node ) { System.out.println( out ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testUseSemanticVersion( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_PROPERTY, metaModelVersion ); + @Test + void testUseSemanticVersion() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_PROPERTY ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -155,10 +148,9 @@ void testUseSemanticVersion( final KnownVersion metaModelVersion ) { openApi.getServers().forEach( server -> assertThat( server.getUrl() ).contains( "v1.0.0" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testIncludeQueryApiWithSemanticVersion( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT, metaModelVersion ); + @Test + void testIncludeQueryApiWithSemanticVersion() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -173,10 +165,9 @@ void testIncludeQueryApiWithSemanticVersion( final KnownVersion metaModelVersion .isEqualTo( "https://test-aspect.example.com/query-api/v1.0.0" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testDefaultResourcePath( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testDefaultResourcePath() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -196,10 +187,9 @@ void testDefaultResourcePath( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testInvalidResourcePath( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testInvalidResourcePath() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -210,10 +200,9 @@ void testInvalidResourcePath( final KnownVersion metaModelVersion ) { assertThat( json ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testWithValidResourcePath( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testWithValidResourcePath() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -229,10 +218,9 @@ void testWithValidResourcePath( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0/" + TEST_RESOURCE_PATH ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testInvalidJsonParameter( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testInvalidJsonParameter() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -244,10 +232,9 @@ void testInvalidJsonParameter( final KnownVersion metaModelVersion ) { assertThat( json ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testValidParameter( final KnownVersion metaModelVersion ) throws IOException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testValidParameter() throws IOException { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -269,14 +256,13 @@ void testValidParameter( final KnownVersion metaModelVersion ) throws IOExceptio } ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testInValidParameterName( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testInValidParameterName() throws IOException { final ListAppender logAppender = new ListAppender<>(); final Logger logger = (Logger) LoggerFactory.getLogger( AspectModelOpenApiGenerator.class ); logger.addAppender( logAppender ); logAppender.start(); - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -294,10 +280,9 @@ void testInValidParameterName( final KnownVersion metaModelVersion ) throws IOEx assertThat( logResults ).contains( "There was an exception during the read of the root or the validation." ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testYamlGenerator( final KnownVersion metaModelVersion ) throws IOException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testYamlGenerator() throws IOException { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final YAMLMapper yamlMapper = new YAMLMapper().enable( YAMLGenerator.Feature.MINIMIZE_QUOTES ); final OpenApiSchemaGenerationConfig yamlConfig = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) @@ -318,10 +303,9 @@ void testYamlGenerator( final KnownVersion metaModelVersion ) throws IOException assertThat( result.getMessages().size() ).isZero(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasQuerySchema( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testHasQuerySchema() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -335,10 +319,9 @@ void testHasQuerySchema( final KnownVersion metaModelVersion ) { assertThat( openApi.getComponents().getRequestBodies() ).containsKey( "Filter" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasNoQuerySchema( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testHasNoQuerySchema() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -351,10 +334,9 @@ void testHasNoQuerySchema( final KnownVersion metaModelVersion ) { assertThat( openApi.getComponents().getRequestBodies().keySet() ).doesNotContain( "Filter" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasPagingWithChosenPaging( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + @Test + void testHasPagingWithChosenPaging() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_COLLECTION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -380,10 +362,9 @@ void testHasPagingWithChosenPaging( final KnownVersion metaModelVersion ) { .isEqualTo( "#/components/schemas/PagingSchema" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasPagingWithoutChosenPaging( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_TIME_SERIES, metaModelVersion ); + @Test + void testHasPagingWithoutChosenPaging() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_TIME_SERIES ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -406,10 +387,9 @@ void testHasPagingWithoutChosenPaging( final KnownVersion metaModelVersion ) { .get( "application/json" ).getSchema().get$ref() ).isEqualTo( "#/components/schemas/PagingSchema" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasPagingWitChosenCursorBasedPaging( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + @Test + void testHasPagingWitChosenCursorBasedPaging() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_COLLECTION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -440,10 +420,9 @@ void testHasPagingWitChosenCursorBasedPaging( final KnownVersion metaModelVersio assertThat( openApi.getComponents().getSchemas().get( "PagingSchema" ).getProperties() ).containsKey( "_links" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasPagingWithWithDefaultChosenPaging( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + @Test + void testHasPagingWithWithDefaultChosenPaging() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_COLLECTION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -466,10 +445,9 @@ void testHasPagingWithWithDefaultChosenPaging( final KnownVersion metaModelVersi .get( "application/json" ).getSchema().get$ref() ).isEqualTo( "#/components/schemas/PagingSchema" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testHasNoPagination( final KnownVersion metaModelVersion ) throws ProcessingException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + @Test + void testHasNoPagination() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_COLLECTION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -485,10 +463,9 @@ void testHasNoPagination( final KnownVersion metaModelVersion ) throws Processin .get( "application/json" ).getSchema().get$ref() ).isEqualTo( "#/components/schemas/AspectWithCollection" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithOperation( final KnownVersion metaModelVersion ) throws ProcessingException { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_OPERATION, metaModelVersion ); + @Test + void testAspectWithOperation() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_OPERATION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -508,10 +485,9 @@ void testAspectWithOperation( final KnownVersion metaModelVersion ) throws Proce assertThat( openApi.getComponents().getSchemas().get( "OperationResponse" ).getOneOf() ).hasSize( 2 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithOperationWithSeeAttribute( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_OPERATION_WITH_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithOperationWithSeeAttribute() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_OPERATION_WITH_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -528,10 +504,9 @@ void testAspectWithOperationWithSeeAttribute( final KnownVersion metaModelVersio .get( 1 )).getProperties() ).doesNotContainKey( "params" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithAllCrud( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithAllCrud() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -552,10 +527,9 @@ void testAspectWithAllCrud( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithPostOperation( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithPostOperation() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -576,10 +550,9 @@ void testAspectWithPostOperation( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithPutOperation( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithPutOperation() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -600,10 +573,9 @@ void testAspectWithPutOperation( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithPatchOperation( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithPatchOperation() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -624,10 +596,9 @@ void testAspectWithPatchOperation( final KnownVersion metaModelVersion ) { path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithPatchAndPostOperation( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE, metaModelVersion ); + @Test + void testAspectWithPatchAndPostOperation() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITHOUT_SEE_ATTRIBUTE ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -649,10 +620,9 @@ void testAspectWithPatchAndPostOperation( final KnownVersion metaModelVersion ) path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithCommentForSeeAttributes( final KnownVersion metaModelVersion ) { - final Aspect aspect = loadAspect( TestAspect.ASPECT_WITH_COLLECTION, metaModelVersion ); + @Test + void testAspectWithCommentForSeeAttributes() { + final Aspect aspect = TestResources.load( TestAspect.ASPECT_WITH_COLLECTION ).aspect(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( true ) .baseUrl( TEST_BASE_URL ) @@ -706,11 +676,6 @@ private void assertSpecificationIsValid( final JsonNode jsonNode, final String j validateYaml( aspect ); } - public static String prettyPrintJson( final String json ) throws JsonProcessingException { - final ObjectMapper m = new ObjectMapper(); - return m.writerWithDefaultPrettyPrinter().writeValueAsString( m.readTree( json ) ); - } - private void validateOpenApiSpec( final JsonNode node, final OpenAPI openApi, final Aspect aspect ) { assertThat( openApi.getSpecVersion() ).isEqualTo( SpecVersion.V30 ); assertThat( openApi.getInfo().getTitle() ).isEqualTo( aspect.getPreferredName( Locale.ENGLISH ) ); @@ -800,11 +765,6 @@ private void validateYaml( final Aspect aspect ) { } ).doesNotThrowAnyException(); } - private Aspect loadAspect( final TestAspect testAspect, final KnownVersion metaModelVersion ) { - final VersionedModel versionedModel = TestResources.getModel( testAspect, metaModelVersion ).get(); - return AspectModelLoader.getSingleAspect( versionedModel ).get(); - } - private ObjectNode getTestParameter() throws IOException { final InputStream inputStream = getClass().getResourceAsStream( "/openapi/parameter.json" ); final String inputString = IOUtils.toString( inputStream, StandardCharsets.UTF_8 ); diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/AspectModelSqlGeneratorTest.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/AspectModelSqlGeneratorTest.java index 528e889cf..49c55aa4b 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/AspectModelSqlGeneratorTest.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/AspectModelSqlGeneratorTest.java @@ -20,10 +20,7 @@ import org.eclipse.esmf.aspectmodel.generator.sql.databricks.DatabricksSqlGenerationConfig; import org.eclipse.esmf.aspectmodel.generator.sql.databricks.DatabricksSqlGenerationConfigBuilder; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -34,8 +31,7 @@ public class AspectModelSqlGeneratorTest { @ParameterizedTest @EnumSource( value = TestAspect.class ) void testDatabricksGeneration( final TestAspect testAspect ) { - final VersionedModel versionedModel = TestResources.getModel( testAspect, KnownVersion.getLatest() ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( versionedModel ).getOrElseThrow( () -> new RuntimeException() ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); assertThatCode( () -> { final DatabricksSqlGenerationConfig dialectSpecificConfig = DatabricksSqlGenerationConfigBuilder.builder() .includeTableComment( true ) diff --git a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/DatabricksTestBase.java b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/DatabricksTestBase.java index 94357b603..da87e8485 100644 --- a/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/DatabricksTestBase.java +++ b/core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/sql/databricks/DatabricksTestBase.java @@ -13,17 +13,13 @@ package org.eclipse.esmf.aspectmodel.generator.sql.databricks; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; public class DatabricksTestBase { protected String sql( final TestAspect testAspect, final DatabricksSqlGenerationConfig config ) { - final VersionedModel versionedModel = TestResources.getModel( testAspect, KnownVersion.getLatest() ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspect( versionedModel ).getOrElseThrow( () -> new RuntimeException() ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); return aspect.accept( new AspectModelDatabricksDenormalizedSqlVisitor( config ), AspectModelDatabricksDenormalizedSqlVisitorContextBuilder.builder().build() ); } diff --git a/core/esmf-aspect-model-generator/src/main/java/org/eclipse/esmf/aspectmodel/generator/Generator.java b/core/esmf-aspect-model-generator/src/main/java/org/eclipse/esmf/aspectmodel/generator/Generator.java index 73c245cec..c14d9e535 100644 --- a/core/esmf-aspect-model-generator/src/main/java/org/eclipse/esmf/aspectmodel/generator/Generator.java +++ b/core/esmf-aspect-model-generator/src/main/java/org/eclipse/esmf/aspectmodel/generator/Generator.java @@ -16,13 +16,14 @@ import java.io.OutputStream; import java.util.Comparator; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Stream; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; +import org.eclipse.esmf.metamodel.ModelElement; /** * Base class for the generation of {@link Artifact}s. @@ -38,17 +39,10 @@ protected Generator( final Aspect aspectModel ) { this.aspectModel = aspectModel; } - private static Comparator uniqueByModelElementIdentifier() { + private static Comparator uniqueByModelElementIdentifier() { return ( modelElementOne, modelElementTwo ) -> { - final String modelElementOneIdentifier = modelElementOne - .getAspectModelUrn() - .map( aspectModelUrn -> aspectModelUrn.getUrn().toString() ) - .orElse( generateIdentifierForAnonymousModelElement( modelElementOne ) ); - final String modelElementTwoIdentifier = modelElementTwo - .getAspectModelUrn() - .map( aspectModelUrn -> aspectModelUrn.getUrn().toString() ) - .orElse( generateIdentifierForAnonymousModelElement( modelElementTwo ) ); - + final String modelElementOneIdentifier = modelElementOne.urn().toString(); + final String modelElementTwoIdentifier = modelElementTwo.urn().toString(); return modelElementOneIdentifier.compareTo( modelElementTwoIdentifier ); }; } @@ -58,7 +52,7 @@ private static String generateIdentifierForAnonymousModelElement( final Object m "GeneratedElementId_" + GENERATED_MODEL_ELEMENT_IDENTIFIERS.size() ); } - protected Stream elements( final Class clazz ) { + protected Stream elements( final Class clazz ) { return aspectModel.accept( new AspectStreamTraversalVisitor(), null ) .filter( clazz::isInstance ) .map( clazz::cast ) @@ -66,7 +60,7 @@ protected Stream elements( final Class clazz ) { .distinct(); } - protected > Stream applyTemplate( + protected > Stream applyTemplate( final Class clazz, final ArtifactGenerator artifactGenerator, final C config ) { return elements( clazz ).map( element -> artifactGenerator.apply( element, config ) ); } @@ -79,7 +73,8 @@ protected nameMapper ) { - generateArtifacts().forEach( generationResult -> write( generationResult, nameMapper ) ); + final List> artifacts = generateArtifacts().toList(); + artifacts.forEach( generationResult -> write( generationResult, nameMapper ) ); } /** diff --git a/core/esmf-aspect-model-jackson/pom.xml b/core/esmf-aspect-model-jackson/pom.xml index 18f0c0d44..92ebcd6e1 100644 --- a/core/esmf-aspect-model-jackson/pom.xml +++ b/core/esmf-aspect-model-jackson/pom.xml @@ -31,7 +31,7 @@ org.eclipse.esmf - esmf-aspect-meta-model-resolver + esmf-aspect-meta-model-java com.fasterxml.jackson.core diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModule.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModule.java index 0a384ae05..023ce25cf 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModule.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModule.java @@ -15,7 +15,7 @@ import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.fasterxml.jackson.databind.module.SimpleModule; diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinaryDeserializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinaryDeserializer.java index 7137d73ed..d38dfde66 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinaryDeserializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinaryDeserializer.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.util.Optional; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonTokenId; @@ -34,7 +34,7 @@ private Base64BinaryDeserializer() { @Override public byte[] deserialize( final JsonParser parser, final DeserializationContext context ) throws IOException { if ( parser.currentTokenId() == JsonTokenId.ID_STRING ) { - final Optional value = ExtendedXsdDataType.BASE64_BINARY.parseTyped( parser.getText() ); + final Optional value = SammXsdType.BASE64_BINARY.parseTyped( parser.getText() ); if ( value.isPresent() ) { return value.get(); } diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinarySerializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinarySerializer.java index 2883af496..e745c3ffa 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinarySerializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/Base64BinarySerializer.java @@ -15,7 +15,7 @@ import java.io.IOException; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; @@ -32,6 +32,6 @@ private Base64BinarySerializer() { @Override public void serialize( final byte[] value, final JsonGenerator generator, final SerializerProvider provider ) throws IOException { - generator.writeString( ExtendedXsdDataType.BASE64_BINARY.unparseTyped( value ) ); + generator.writeString( SammXsdType.BASE64_BINARY.unparseTyped( value ) ); } } diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinaryDeserializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinaryDeserializer.java index a971afd66..2e5bd4349 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinaryDeserializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinaryDeserializer.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.util.Optional; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonTokenId; @@ -34,7 +34,7 @@ private HexBinaryDeserializer() { @Override public byte[] deserialize( final JsonParser parser, final DeserializationContext context ) throws IOException { if ( parser.currentTokenId() == JsonTokenId.ID_STRING ) { - final Optional value = ExtendedXsdDataType.HEX_BINARY.parseTyped( parser.getText() ); + final Optional value = SammXsdType.HEX_BINARY.parseTyped( parser.getText() ); if ( value.isPresent() ) { return value.get(); } diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinarySerializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinarySerializer.java index b958e382e..ee975869d 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinarySerializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/HexBinarySerializer.java @@ -15,7 +15,7 @@ import java.io.IOException; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; @@ -32,6 +32,6 @@ private HexBinarySerializer() { @Override public void serialize( final byte[] value, final JsonGenerator generator, final SerializerProvider provider ) throws IOException { - generator.writeString( ExtendedXsdDataType.HEX_BINARY.unparseTyped( value ) ); + generator.writeString( SammXsdType.HEX_BINARY.unparseTyped( value ) ); } } diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringDeserializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringDeserializer.java index 3457060d9..da6592113 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringDeserializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringDeserializer.java @@ -16,7 +16,7 @@ import java.io.IOException; import java.util.Locale; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonNode; diff --git a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringSerializer.java b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringSerializer.java index ee1bdf989..bfc22c733 100644 --- a/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringSerializer.java +++ b/core/esmf-aspect-model-jackson/src/main/java/org/eclipse/esmf/aspectmodel/jackson/LangStringSerializer.java @@ -15,7 +15,7 @@ import java.io.IOException; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; diff --git a/core/esmf-aspect-model-jackson/src/test/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModuleTest.java b/core/esmf-aspect-model-jackson/src/test/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModuleTest.java index 70eaf0392..fd1b8f5ec 100644 --- a/core/esmf-aspect-model-jackson/src/test/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModuleTest.java +++ b/core/esmf-aspect-model-jackson/src/test/java/org/eclipse/esmf/aspectmodel/jackson/AspectModelJacksonModuleTest.java @@ -39,13 +39,10 @@ import org.eclipse.esmf.aspectmodel.java.QualifiedName; import org.eclipse.esmf.aspectmodel.java.exception.EnumAttributeNotFoundException; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; import org.eclipse.esmf.test.shared.compiler.JavaCompiler; @@ -59,26 +56,23 @@ import com.google.common.reflect.TypeToken; import io.vavr.Tuple; import io.vavr.Tuple2; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; -public class AspectModelJacksonModuleTest extends MetaModelVersions { +public class AspectModelJacksonModuleTest { private static final String PACKAGE = "org.eclipse.esmf.test"; - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithMultiLanguageText( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT, metaModelVersion ); + @Test + public void testAspectWithMultiLanguageText() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT ); final Class clazz = instance.getClass(); final LangString prop = getValue( clazz, instance, "prop", LangString.class ); assertThat( prop.getLanguageTag() ).isEqualTo( Locale.ENGLISH ); assertThat( prop.getValue() ).isEqualTo( "Value in English" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithSimpleTypes( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_SIMPLE_TYPES, metaModelVersion ); + @Test + public void testAspectWithSimpleTypes() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_SIMPLE_TYPES ); final Class clazz = instance.getClass(); final XMLGregorianCalendar timestamp = getValue( clazz, instance, "dateTimeProperty", XMLGregorianCalendar.class ); @@ -99,10 +93,9 @@ public void testAspectWithSimpleTypes( final KnownVersion metaModelVersion ) thr assertThat( hexBinaryDecoded ).isEqualTo( "This is a test" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithCollection( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_COLLECTIONS, metaModelVersion ); + @Test + public void testAspectWithCollection() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_COLLECTIONS ); final Class clazz = instance.getClass(); final List listProperty = getValue( clazz, instance, "listProperty", @@ -116,10 +109,9 @@ public void testAspectWithCollection( final KnownVersion metaModelVersion ) thro assertThat( setProperty ).containsExactlyInAnyOrder( "foo", "bar" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEntity( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_SIMPLE_ENTITY, metaModelVersion ); + @Test + public void testAspectWithEntity() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_SIMPLE_ENTITY ); final Class clazz = instance.getClass(); final Field entityPropertyField = clazz.getDeclaredField( "entityProperty" ); @@ -131,10 +123,9 @@ public void testAspectWithEntity( final KnownVersion metaModelVersion ) throws E assertThat( foo ).isEqualTo( "some value" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithOptionalProperties( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_OPTIONAL_PROPERTIES, metaModelVersion ); + @Test + public void testAspectWithOptionalProperties() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_OPTIONAL_PROPERTIES ); final Class clazz = instance.getClass(); final XMLGregorianCalendar timestamp = getValue( clazz, instance, "timestampProperty", XMLGregorianCalendar.class ); @@ -146,10 +137,9 @@ public void testAspectWithOptionalProperties( final KnownVersion metaModelVersio assertThat( number ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithStructuredValue( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_NUMERIC_STRUCTURED_VALUE, metaModelVersion ); + @Test + public void testAspectWithStructuredValue() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_NUMERIC_STRUCTURED_VALUE ); final Class clazz = instance.getClass(); final XMLGregorianCalendar date = getValue( clazz, instance, "date", XMLGregorianCalendar.class ); @@ -167,16 +157,14 @@ public void testAspectWithStructuredValue( final KnownVersion metaModelVersion ) assertThat( day ).isEqualTo( 20 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEnumeration( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_STRING_ENUMERATION, metaModelVersion ); + @Test + public void testAspectWithEnumeration() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_STRING_ENUMERATION ); final Class clazz = instance.getClass(); final Field enumerationField = clazz.getDeclaredField( "enumerationProperty" ); enumerationField.setAccessible( true ); final Class enumerationType = enumerationField.getType(); - assertThat( enumerationType.getName() ).isEqualTo( PACKAGE + ".EnumerationPropertyEnumeration" ); assertThat( enumerationType.isEnum() ).isTrue(); final Object enumerationValue = enumerationField.get( instance ); @@ -184,18 +172,15 @@ public void testAspectWithEnumeration( final KnownVersion metaModelVersion ) thr assertThat( foo ).isEqualTo( "foo" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEntityEnumeration( final KnownVersion metaModelVersion ) throws Exception { + @Test + public void testAspectWithEntityEnumeration() throws Exception { final Object instance = generateInstance( - Tuple.of( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_NOT_EXISTING_ENUM, "AspectWithEntityEnumeration" ), - metaModelVersion ); + Tuple.of( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_NOT_EXISTING_ENUM, "AspectWithEntityEnumeration" ) ); final Class clazz = instance.getClass(); final Field enumerationField = clazz.getDeclaredField( "systemState" ); enumerationField.setAccessible( true ); final Class enumerationType = enumerationField.getType(); - assertThat( enumerationType.getName() ).isEqualTo( PACKAGE + ".SystemStateEnumeration" ); assertThat( enumerationType.isEnum() ).isTrue(); final Object enumerationValue = enumerationField.get( instance ); @@ -206,24 +191,21 @@ public void testAspectWithEntityEnumeration( final KnownVersion metaModelVersion assertThat( enumerationValue.toString() ).isEqualTo( "COOL_DOWN" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEntityEnumerationWithNotExistingEnum( final KnownVersion metaModelVersion ) { + @Test + public void testAspectWithEntityEnumerationWithNotExistingEnum() { assertThatExceptionOfType( EnumAttributeNotFoundException.class ).isThrownBy( () -> - generateInstance( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_NOT_EXISTING_ENUM, metaModelVersion ) ) + generateInstance( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_WITH_NOT_EXISTING_ENUM ) ) .withMessageContainingAll( "Tried to parse value", "but there is no enum field like that" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEntityEnumerationAndNotInPayloadProperties( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES, metaModelVersion ); + @Test + public void testAspectWithEntityEnumerationAndNotInPayloadProperties() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_NOT_IN_PAYLOAD_PROPERTIES ); final Class clazz = instance.getClass(); final Field enumerationField = clazz.getDeclaredField( "systemState" ); enumerationField.setAccessible( true ); final Class enumerationType = enumerationField.getType(); - assertThat( enumerationType.getName() ).isEqualTo( PACKAGE + ".SystemStateEnumeration" ); assertThat( enumerationType.isEnum() ).isTrue(); final Object enumerationValue = enumerationField.get( instance ); @@ -234,10 +216,9 @@ public void testAspectWithEntityEnumerationAndNotInPayloadProperties( final Know assertThat( enumerationValue.toString() ).isEqualTo( "COOL_DOWN" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectWithEitherWithComplexTypes( final KnownVersion metaModelVersion ) throws Exception { - final Object instance = generateInstance( TestAspect.ASPECT_WITH_EITHER_WITH_COMPLEX_TYPES, metaModelVersion ); + @Test + public void testAspectWithEitherWithComplexTypes() throws Exception { + final Object instance = generateInstance( TestAspect.ASPECT_WITH_EITHER_WITH_COMPLEX_TYPES ); final Class clazz = instance.getClass(); final Field testProperty = clazz.getDeclaredField( "testProperty" ); testProperty.setAccessible( true ); @@ -256,23 +237,21 @@ public void testAspectWithEitherWithComplexTypes( final KnownVersion metaModelVe assertThat( value ).isEqualTo( "eOMtThyhVNLWUZNRcBaQKxI" ); } - private Object generateInstance( final TestAspect model, final KnownVersion knownVersion ) throws IOException { - return generateInstance( Tuple.of( model, model.getName() ), knownVersion ); + private Object generateInstance( final TestAspect model ) throws IOException { + return generateInstance( Tuple.of( model, model.getName() ) ); } - private Object generateInstance( final Tuple2 modelNameAndPayloadName, final KnownVersion knownVersion ) - throws IOException { - final VersionedModel versionedModel = TestResources.getModel( modelNameAndPayloadName._1(), knownVersion ).get(); - final Class pojo = AspectModelLoader.getSingleAspect( versionedModel ).map( this::generatePojo ).get(); - final String jsonPayload = loadJsonPayload( modelNameAndPayloadName._1(), knownVersion, - modelNameAndPayloadName._2() ); + private Object generateInstance( final Tuple2 modelNameAndPayloadName ) throws IOException { + final Aspect aspect = TestResources.load( modelNameAndPayloadName._1() ).aspect(); + final Class pojo = generatePojo( aspect ); + final String jsonPayload = loadJsonPayload( modelNameAndPayloadName._1(), modelNameAndPayloadName._2() ); return parseJson( jsonPayload, pojo ); } - private String loadJsonPayload( final TestAspect model, final KnownVersion knownVersion, final String payloadName ) throws IOException { + private String loadJsonPayload( final TestAspect model, final String payloadName ) throws IOException { final AspectModelUrn modelUrn = model.getUrn(); final URL jsonUrl = getClass().getResource( - String.format( "/%s/%s/%s/%s.json", knownVersion.toString().toLowerCase(), + String.format( "/%s/%s/%s/%s.json", KnownVersion.getLatest().toString().toLowerCase(), modelUrn.getNamespace(), modelUrn.getVersion(), payloadName ) ); return Resources.toString( jsonUrl, StandardCharsets.UTF_8 ); } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaUtil.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaUtil.java index d24bd04e8..1f93680d0 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaUtil.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaUtil.java @@ -27,13 +27,7 @@ import java.util.stream.Stream; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.Trait; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.ComplexType; @@ -44,9 +38,14 @@ import org.eclipse.esmf.metamodel.StructureElement; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -218,8 +217,7 @@ public static String determineComplexTypeClassDefinition( final ComplexType elem } public static String generateAbstractEntityClassAnnotations( final ComplexType element, - final JavaCodeGenerationConfig codeGenerationConfig, - final Set extendingEntities ) { + final JavaCodeGenerationConfig codeGenerationConfig, final Set extendingEntities ) { final StringBuilder classAnnotationBuilder = new StringBuilder(); if ( element.isAbstractEntity() || !element.getExtendingElements().isEmpty() ) { codeGenerationConfig.importTracker().importExplicit( JsonTypeInfo.class ); @@ -313,7 +311,7 @@ public static String getDataType( final Optional dataType, final ImportTra importTracker.importExplicit( LangString.class ); return "LangString"; } - final Class result = DataType.getJavaTypeForMetaModelType( typeResource, actualDataType.getMetaModelVersion() ); + final Class result = SammXsdType.getJavaTypeForMetaModelType( typeResource ); importTracker.importExplicit( result ); return result.getTypeName(); } @@ -332,7 +330,7 @@ public static Class getDataTypeClass( final Type dataType ) { if ( typeResource.getURI().equals( RDF.langString.getURI() ) ) { return Map.class; } - final Class result = DataType.getJavaTypeForMetaModelType( typeResource, dataType.getMetaModelVersion() ); + final Class result = SammXsdType.getJavaTypeForMetaModelType( typeResource ); return result; } @@ -442,10 +440,9 @@ public static String generateInitializer( final Property property, final String final ValueInitializer valueInitializer ) { return property.getDataType().map( type -> { final Resource typeResource = ResourceFactory.createResource( type.getUrn() ); - final KnownVersion metaModelVersion = property.getMetaModelVersion(); - final Class result = DataType.getJavaTypeForMetaModelType( typeResource, metaModelVersion ); + final Class result = SammXsdType.getJavaTypeForMetaModelType( typeResource ); codeGenerationConfig.importTracker().importExplicit( result ); - return valueInitializer.apply( typeResource, value, metaModelVersion ); + return valueInitializer.apply( typeResource, value ); } ).orElseThrow( () -> new CodeGenerationException( "The Either Characteristic is not allowed for Properties used as elements in a StructuredValue" ) ); } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ConstraintAnnotationBuilder.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ConstraintAnnotationBuilder.java index aa4be96dc..ef6f26d2b 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ConstraintAnnotationBuilder.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ConstraintAnnotationBuilder.java @@ -19,13 +19,13 @@ import org.eclipse.esmf.aspectmodel.java.rangeconstraint.AnnotationExpression; import org.eclipse.esmf.aspectmodel.java.rangeconstraint.AnnotationFactory; import org.eclipse.esmf.aspectmodel.java.rangeconstraint.AnnotationTypeMapping; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; import jakarta.validation.constraints.Digits; import jakarta.validation.constraints.Pattern; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/DeconstructionSet.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/DeconstructionSet.java index 850ed40ff..b5d462fb7 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/DeconstructionSet.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/DeconstructionSet.java @@ -15,8 +15,8 @@ import java.util.List; -import org.eclipse.esmf.characteristic.StructuredValue; import org.eclipse.esmf.metamodel.Property; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; /** * Encapsulates a {@link Property} and, if it uses a {@link StructuredValue} characteristic, the corresponding diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/JavaArtifact.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/JavaArtifact.java index 05f702a08..15e450a2e 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/JavaArtifact.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/JavaArtifact.java @@ -13,6 +13,8 @@ package org.eclipse.esmf.aspectmodel.java; +import java.util.Objects; + import org.eclipse.esmf.aspectmodel.generator.Artifact; /** @@ -38,4 +40,22 @@ public String getContent() { public QualifiedName getId() { return new QualifiedName( filename, javaPackageName ); } + + @Override + public boolean equals( final Object o ) { + if ( this == o ) { + return true; + } + if ( o == null || getClass() != o.getClass() ) { + return false; + } + final JavaArtifact that = (JavaArtifact) o; + return Objects.equals( content, that.content ) && Objects.equals( filename, that.filename ) + && Objects.equals( javaPackageName, that.javaPackageName ); + } + + @Override + public int hashCode() { + return Objects.hash( content, filename, javaPackageName ); + } } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/StructuredValuePropertiesDeconstructor.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/StructuredValuePropertiesDeconstructor.java index ccf2ce1a1..65afb98fa 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/StructuredValuePropertiesDeconstructor.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/StructuredValuePropertiesDeconstructor.java @@ -17,12 +17,12 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.esmf.characteristic.StructuredValue; +import org.eclipse.esmf.aspectmodel.visitor.AspectStreamTraversalVisitor; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.HasProperties; import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.Property; -import org.eclipse.esmf.metamodel.visitor.AspectStreamTraversalVisitor; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; /** * When a {@link Property} uses the {@link StructuredValue} Characteristic, this class retrieves the diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueExpressionVisitor.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueExpressionVisitor.java index 15705fa33..f497775c0 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueExpressionVisitor.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueExpressionVisitor.java @@ -17,7 +17,7 @@ import java.util.stream.Collectors; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.EntityInstance; @@ -25,8 +25,8 @@ import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; @@ -78,10 +78,9 @@ private String generateValueExpression( final ScalarValue value, final Context c } final Resource typeResource = ResourceFactory.createResource( typeUri ); - final Class javaType = DataType.getJavaTypeForMetaModelType( typeResource, value.getMetaModelVersion() ); + final Class javaType = SammXsdType.getJavaTypeForMetaModelType( typeResource ); context.getCodeGenerationConfig().importTracker().importExplicit( javaType ); - return valueInitializer.apply( typeResource, javaType, AspectModelJavaUtil.createLiteral( value.getValue().toString() ), - value.getMetaModelVersion() ); + return valueInitializer.apply( typeResource, javaType, AspectModelJavaUtil.createLiteral( value.getValue().toString() ) ); } @Override diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueInitializer.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueInitializer.java index 52c6dda76..a1cc60ae0 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueInitializer.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueInitializer.java @@ -19,9 +19,8 @@ import java.util.function.BiFunction; import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; @@ -92,8 +91,7 @@ public class ValueInitializer { public boolean needInitializationToConstructor( final List deconstructionSets ) { return deconstructionSets.stream() .flatMap( deconstructionSet -> deconstructionSet.getElementProperties().stream().map( property -> property.getDataType() - .map( type -> DataType.getJavaTypeForMetaModelType( ResourceFactory.createResource( type.getUrn() ), - property.getMetaModelVersion() ) ) ) ) + .map( type -> SammXsdType.getJavaTypeForMetaModelType( ResourceFactory.createResource( type.getUrn() ) ) ) ) ) .anyMatch( dataType -> dataType.map( type -> type == XMLGregorianCalendar.class ).orElse( false ) ); } @@ -103,10 +101,9 @@ public boolean needInitializationToConstructor( final List de * * @param rdfType the type for which an instance should be created * @param valueExpression an expression that, when evaluated, will return the input value as a string. - * @param metaModelVersion the used meta model version */ - public String apply( final Resource rdfType, final String valueExpression, final KnownVersion metaModelVersion ) { - return apply( rdfType, DataType.getJavaTypeForMetaModelType( rdfType, metaModelVersion ), valueExpression, metaModelVersion ); + public String apply( final Resource rdfType, final String valueExpression ) { + return apply( rdfType, SammXsdType.getJavaTypeForMetaModelType( rdfType ), valueExpression ); } /** @@ -116,12 +113,9 @@ public String apply( final Resource rdfType, final String valueExpression, final * @param rdfType the type for which an instance should be created * @param javaType the corresponding Java type * @param valueExpression an expression that, when evaluated, will return the input value as a string. - * @param metaModelVersion the used meta model version */ - public String apply( final Resource rdfType, final Class javaType, final String valueExpression, - final KnownVersion metaModelVersion ) { - final SAMM samm = new SAMM( metaModelVersion ); - if ( rdfType.equals( samm.curie() ) ) { + public String apply( final Resource rdfType, final Class javaType, final String valueExpression ) { + if ( rdfType.equals( SammNs.SAMM.curie() ) ) { return String.format( "new Curie( %s )", valueExpression ); } return INITIALIZERS.get( rdfType ).apply( javaType, valueExpression ); diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueToEnumKeyVisitor.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueToEnumKeyVisitor.java index cdc6d62dc..8142aefef 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueToEnumKeyVisitor.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/ValueToEnumKeyVisitor.java @@ -15,12 +15,12 @@ import java.util.regex.Pattern; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; /** * Creates a valid Java enumeration key for a {@link Value} diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMax.java index afc5b67fa..c24e40df5 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMaxValidator.java index ddee5dcf3..db16773cb 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMaxValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMin.java index abdb1b517..d8f96a0ea 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMinValidator.java index 750b7410b..083619e66 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DoubleMinValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMax.java index b5cce1498..17ea98b3d 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMaxValidator.java index 1ac0c7406..2d24fdc6c 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMaxValidator.java @@ -17,7 +17,7 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMin.java index 62c04efe0..470eb3337 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMinValidator.java index 10b45f76c..f7ab3edf1 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/DurationMinValidator.java @@ -17,7 +17,7 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMax.java index c204b2953..fd8e45c9b 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMaxValidator.java index 1321a1db2..f65dfdc6b 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMaxValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMin.java index 280ffa022..ff0f66a40 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMinValidator.java index f76b98afd..5afc0e705 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/FloatMinValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMax.java index 57cd3143f..f2312d9b4 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMaxValidator.java index a2a9317ad..32d901adf 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMaxValidator.java @@ -17,7 +17,7 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMin.java index 5a5882ba1..be0f2b0dc 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMinValidator.java index 1e68d7032..77b93fb0e 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/GregorianCalendarMinValidator.java @@ -17,7 +17,7 @@ import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMax.java index 7cda91713..586c3bae4 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMaxValidator.java index 2a9646ba9..113f6e0ee 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMaxValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMin.java index 173b03a57..b0adb5ff8 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMinValidator.java index f1a051096..d2f41c551 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/IntegerMinValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMax.java index 16be87bba..4c0b39715 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMaxValidator.java index 0931c01bf..337b20170 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMaxValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMin.java index 408b79c8c..20cc1b8e1 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMinValidator.java index f8f932537..cc7d266ec 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/LongMinValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMax.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMax.java index d754b7a24..94f96ec4b 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMax.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMax.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMaxValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMaxValidator.java index 51bb6c094..fce9266a8 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMaxValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMaxValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMin.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMin.java index 66895e2bc..af0470a61 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMin.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMin.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.Constraint; import jakarta.validation.Payload; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMinValidator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMinValidator.java index 548e18df9..32ea8b401 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMinValidator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/customconstraint/ShortMinValidator.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaArtifactGenerator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaArtifactGenerator.java index 4db61ef39..86fae3533 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaArtifactGenerator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaArtifactGenerator.java @@ -35,62 +35,62 @@ import org.eclipse.esmf.aspectmodel.java.ValueInitializer; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; import org.eclipse.esmf.aspectmodel.java.pojo.JavaArtifactGenerator; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.List; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.characteristic.impl.DefaultCode; -import org.eclipse.esmf.characteristic.impl.DefaultCollection; -import org.eclipse.esmf.characteristic.impl.DefaultDuration; -import org.eclipse.esmf.characteristic.impl.DefaultEnumeration; -import org.eclipse.esmf.characteristic.impl.DefaultList; -import org.eclipse.esmf.characteristic.impl.DefaultMeasurement; -import org.eclipse.esmf.characteristic.impl.DefaultQuantifiable; -import org.eclipse.esmf.characteristic.impl.DefaultSet; -import org.eclipse.esmf.characteristic.impl.DefaultSingleEntity; -import org.eclipse.esmf.characteristic.impl.DefaultSortedSet; -import org.eclipse.esmf.characteristic.impl.DefaultState; -import org.eclipse.esmf.characteristic.impl.DefaultStructuredValue; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; -import org.eclipse.esmf.constraint.impl.DefaultEncodingConstraint; -import org.eclipse.esmf.constraint.impl.DefaultFixedPointConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLanguageConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLengthConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRangeConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRegularExpressionConstraint; import org.eclipse.esmf.metamodel.AbstractEntity; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.StructureElement; import org.eclipse.esmf.metamodel.Unit; import org.eclipse.esmf.metamodel.Units; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.List; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCode; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCollection; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultDuration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultEnumeration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultList; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultMeasurement; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultQuantifiable; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSingleEntity; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSortedSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultState; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultStructuredValue; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultEncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultFixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLengthConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRangeConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRegularExpressionConstraint; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.metamodel.impl.DefaultAbstractEntity; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultComplexType; import org.eclipse.esmf.metamodel.impl.DefaultEntity; import org.eclipse.esmf.metamodel.impl.DefaultScalar; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.staticmetamodel.PropertyContainer; import org.eclipse.esmf.staticmetamodel.StaticContainerProperty; @@ -133,10 +133,8 @@ public JavaArtifact apply( final E element, final JavaCodeGenerationConfig confi importTracker.importExplicit( Locale.class ); final CharMatcher matchHash = CharMatcher.is( '#' ); - final String modelUrnPrefix = element.getAspectModelUrn().map( AspectModelUrn::getUrnPrefix ).orElseThrow( () -> { - throw new CodeGenerationException( "Aspect or Entity may not be declared as an anonymous node" ); - } ); - final String characteristicBaseUrn = matchHash.trimTrailingFrom( new SAMMC( element.getMetaModelVersion() ).getNamespace() ); + final String modelUrnPrefix = element.urn().getUrnPrefix(); + final String characteristicBaseUrn = matchHash.trimTrailingFrom( SammNs.SAMMC.getNamespace() ); final Map context = ImmutableMap. builder() .put( "Arrays", java.util.Arrays.class ) @@ -197,7 +195,7 @@ public JavaArtifact apply( final E element, final JavaCodeGenerationConfig confi .put( "Measurement", Measurement.class ) .put( "modelUrnPrefix", modelUrnPrefix ) .put( "modelVisitor", new StaticMetaModelVisitor() ) - .put( "nonNegativeInteger", new DefaultScalar( XSD.nonNegativeInteger.getURI(), element.getMetaModelVersion() ) ) + .put( "nonNegativeInteger", new DefaultScalar( XSD.nonNegativeInteger.getURI() ) ) .put( "Quantifiable", Quantifiable.class ) .put( "RangeConstraint", RangeConstraint.class ) .put( "RegularExpressionConstraint", RegularExpressionConstraint.class ) diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaGenerator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaGenerator.java index 006f50a96..9cb6e70c9 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaGenerator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelJavaGenerator.java @@ -12,6 +12,7 @@ */ package org.eclipse.esmf.aspectmodel.java.metamodel; +import java.util.stream.Collectors; import java.util.stream.Stream; import org.eclipse.esmf.aspectmodel.generator.Artifact; @@ -32,6 +33,8 @@ public StaticMetaModelJavaGenerator( final Aspect aspect, final JavaCodeGenerati @Override protected Stream> generateArtifacts() { final StaticMetaModelJavaArtifactGenerator template = new StaticMetaModelJavaArtifactGenerator<>(); - return applyTemplate( StructureElement.class, template, config ); + return applyTemplate( StructureElement.class, template, config ) + .collect( Collectors.toSet() ) + .stream(); } } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelVisitor.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelVisitor.java index 3afa5e33c..567a81dbf 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelVisitor.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/metamodel/StaticMetaModelVisitor.java @@ -27,41 +27,9 @@ import org.eclipse.esmf.aspectmodel.java.ValueExpressionVisitor; import org.eclipse.esmf.aspectmodel.java.ValueInitializer; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.characteristic.impl.DefaultCode; -import org.eclipse.esmf.characteristic.impl.DefaultCollection; -import org.eclipse.esmf.characteristic.impl.DefaultEnumeration; -import org.eclipse.esmf.characteristic.impl.DefaultList; -import org.eclipse.esmf.characteristic.impl.DefaultSet; -import org.eclipse.esmf.characteristic.impl.DefaultSingleEntity; -import org.eclipse.esmf.characteristic.impl.DefaultSortedSet; -import org.eclipse.esmf.characteristic.impl.DefaultState; -import org.eclipse.esmf.characteristic.impl.DefaultStructuredValue; -import org.eclipse.esmf.characteristic.impl.DefaultTrait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.LocaleConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; -import org.eclipse.esmf.constraint.impl.DefaultEncodingConstraint; -import org.eclipse.esmf.constraint.impl.DefaultFixedPointConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLanguageConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLengthConstraint; -import org.eclipse.esmf.constraint.impl.DefaultLocaleConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRangeConstraint; -import org.eclipse.esmf.constraint.impl.DefaultRegularExpressionConstraint; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.AbstractEntity; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.ComplexType; @@ -69,7 +37,6 @@ import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.EntityInstance; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.QuantityKind; import org.eclipse.esmf.metamodel.QuantityKinds; @@ -79,7 +46,40 @@ import org.eclipse.esmf.metamodel.Unit; import org.eclipse.esmf.metamodel.Units; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCode; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultCollection; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultEnumeration; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultList; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSingleEntity; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultSortedSet; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultState; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultStructuredValue; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultTrait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.LocaleConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultEncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultFixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLengthConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultLocaleConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRangeConstraint; +import org.eclipse.esmf.metamodel.constraint.impl.DefaultRegularExpressionConstraint; import org.eclipse.esmf.metamodel.impl.DefaultAbstractEntity; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultCollectionValue; @@ -89,8 +89,6 @@ import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; import org.eclipse.esmf.metamodel.impl.DefaultUnit; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; import org.apache.commons.text.StringEscapeUtils; import org.apache.jena.rdf.model.Resource; @@ -376,16 +374,14 @@ public String visitCharacteristic( final Characteristic characteristic, final St @Override public String visitLengthConstraint( final LengthConstraint lengthConstraint, final StaticCodeGenerationContext context ) { context.getCodeGenerationConfig().importTracker().importExplicit( DefaultLengthConstraint.class ); - final Scalar nonNegativeInteger = new DefaultScalar( XSD.nonNegativeInteger.getURI(), lengthConstraint.getMetaModelVersion() ); + final Scalar nonNegativeInteger = new DefaultScalar( XSD.nonNegativeInteger.getURI() ); return "new DefaultLengthConstraint(" // MetaModelBaseAttributes + getMetaModelBaseAttributes( lengthConstraint, context ) + "," // Optional min - + getOptionalStaticDeclarationValue( nonNegativeInteger, lengthConstraint.getMinValue(), lengthConstraint.getMetaModelVersion(), - context ) + "," + + getOptionalStaticDeclarationValue( nonNegativeInteger, lengthConstraint.getMinValue(), context ) + "," // Optional max - + getOptionalStaticDeclarationValue( nonNegativeInteger, lengthConstraint.getMaxValue(), lengthConstraint.getMetaModelVersion(), - context ) + ")"; + + getOptionalStaticDeclarationValue( nonNegativeInteger, lengthConstraint.getMaxValue(), context ) + ")"; } @Override @@ -397,11 +393,9 @@ public String visitRangeConstraint( final RangeConstraint rangeConstraint, final // MetaModelBaseAttributes + getMetaModelBaseAttributes( rangeConstraint, context ) + "," // Optional minValue - + getOptionalStaticDeclarationValue( characteristicType, rangeConstraint.getMinValue(), rangeConstraint.getMetaModelVersion(), - context ) + "," + + getOptionalStaticDeclarationValue( characteristicType, rangeConstraint.getMinValue(), context ) + "," // Optional maxValue - + getOptionalStaticDeclarationValue( characteristicType, rangeConstraint.getMaxValue(), rangeConstraint.getMetaModelVersion(), - context ) + "," + + getOptionalStaticDeclarationValue( characteristicType, rangeConstraint.getMaxValue(), context ) + "," // BoundDefinition lowerBoundDefinition + "BoundDefinition." + rangeConstraint.getLowerBoundDefinition().name() + "," // BoundDefinition upperBoundDefinition @@ -500,7 +494,7 @@ public String visitAbstractEntity( final AbstractEntity abstractEntity, final St @Override public String visitScalar( final Scalar scalar, final StaticCodeGenerationContext context ) { context.getCodeGenerationConfig().importTracker().importExplicit( DefaultScalar.class ); - return "new DefaultScalar(\"" + scalar.getUrn() + "\", KnownVersion." + scalar.getMetaModelVersion() + ")"; + return "new DefaultScalar(\"" + scalar.getUrn() + "\" )"; } private String extendsComplexType( final ComplexType complexType, final StaticCodeGenerationContext context ) { @@ -513,8 +507,7 @@ private String extendsComplexType( final ComplexType complexType, final StaticCo final Entity entity = type.as( Entity.class ); context.getCodeGenerationConfig().importTracker().importExplicit( DefaultEntity.class ); return "Optional.of(DefaultEntity.createDefaultEntity(" + getMetaModelBaseAttributes( complexType, context ) + "," + "Meta" - + entity.getName() - + ".INSTANCE.getProperties()," + extendsComplexType( entity, context ) + "))"; + + entity.getName() + ".INSTANCE.getProperties()," + extendsComplexType( entity, context ) + "))"; } // AbstractEntity final AbstractEntity abstractEntity = type.as( AbstractEntity.class ); @@ -528,7 +521,6 @@ private String extendsComplexType( final ComplexType complexType, final StaticCo } private String getOptionalStaticDeclarationValue( final Type type, final Optional optionalValue, - final KnownVersion metaModelVersion, final StaticCodeGenerationContext context ) { if ( optionalValue.isEmpty() ) { return "Optional.empty()"; @@ -549,7 +541,7 @@ private String getOptionalStaticDeclarationValue( final Type type, final Opt } else { valueExpression = StringEscapeUtils.escapeJava( valueExpression ); } - return "Optional.of(" + valueInitializer.apply( xsdType, valueExpression, metaModelVersion ) + ")"; + return "Optional.of(" + valueInitializer.apply( xsdType, valueExpression ) + ")"; } /* @@ -559,18 +551,17 @@ public String metaModelBaseAttributes( final Property property, final StaticCode return getMetaModelBaseAttributes( property, context ); } - public String getMetaModelBaseAttributes( final T element, - final StaticCodeGenerationContext context ) { - if ( element.getPreferredNames().isEmpty() && element.getDescriptions().isEmpty() && element.getSee().isEmpty() ) { - return "MetaModelBaseAttributes.from(" + "KnownVersion." + element.getMetaModelVersion().toString() + ", " + elementUrn( element, - context ) + ", " - + "\"" + element.getName() + "\" )"; + public String getMetaModelBaseAttributes( final ModelElement element, final StaticCodeGenerationContext context ) { + final StringBuilder builder = new StringBuilder(); + builder.append( "MetaModelBaseAttributes.builder()" ); + if ( element.isAnonymous() ) { + builder.append( ".isAnonymous()" ); + } else { + builder.append( ".withUrn(" ); + builder.append( elementUrn( element, context ) ); + builder.append( ")" ); } - final StringBuilder builder = new StringBuilder(); - builder.append( "MetaModelBaseAttributes.builderFor( \"" ).append( element.getName() ).append( "\" )" ); - builder.append( ".withMetaModelVersion(KnownVersion." ).append( element.getMetaModelVersion().toString() ).append( ")" ); - builder.append( ".withUrn(" ).append( elementUrn( element, context ) ).append( ")" ); element.getPreferredNames().stream().sorted().forEach( preferredName -> { builder.append( ".withPreferredName(Locale.forLanguageTag(\"" ).append( preferredName.getLanguageTag().toLanguageTag() ) .append( "\")," ); @@ -587,16 +578,13 @@ public String getMetaModelBaseAttributes return builder.toString(); } - public String elementUrn( final NamedElement element, final StaticCodeGenerationContext context ) { - if ( element.getAspectModelUrn().isEmpty() ) { - return "null"; - } - if ( element.getAspectModelUrn().get().toString().startsWith( context.getModelUrnPrefix() ) ) { + public String elementUrn( final ModelElement element, final StaticCodeGenerationContext context ) { + if ( element.urn().toString().startsWith( context.getModelUrnPrefix() ) ) { return "AspectModelUrn.fromUrn( NAMESPACE + \"" + element.getName() + "\" )"; } - if ( element.getAspectModelUrn().get().toString().startsWith( context.getCharacteristicBaseUrn() ) ) { + if ( element.urn().toString().startsWith( context.getCharacteristicBaseUrn() ) ) { return "AspectModelUrn.fromUrn( CHARACTERISTIC_NAMESPACE + \"#" + element.getName() + "\" )"; } - return "AspectModelUrn.fromUrn( \"" + element.getAspectModelUrn().get() + "\" )"; + return "AspectModelUrn.fromUrn( \"" + element.urn() + "\" )"; } } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/AspectModelJavaGenerator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/AspectModelJavaGenerator.java index 543dac74b..bb73db00d 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/AspectModelJavaGenerator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/AspectModelJavaGenerator.java @@ -12,6 +12,7 @@ */ package org.eclipse.esmf.aspectmodel.java.pojo; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -20,10 +21,10 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig; import org.eclipse.esmf.aspectmodel.java.JavaGenerator; import org.eclipse.esmf.aspectmodel.java.QualifiedName; -import org.eclipse.esmf.characteristic.Enumeration; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Event; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; /** * Generates Java Domain classes for an Aspect model and all its contained elements. @@ -35,13 +36,15 @@ public AspectModelJavaGenerator( final Aspect aspect, final JavaCodeGenerationCo @Override protected Stream> generateArtifacts() { + final Set structureElements = elements( ComplexType.class ).filter( element -> + element.getExtends().isPresent() ).collect( Collectors.toSet() ); return Stream.of( applyTemplate( Aspect.class, new StructureElementJavaArtifactGenerator<>(), config ), - applyTemplate( ComplexType.class, new StructureElementJavaArtifactGenerator<>( - elements( ComplexType.class ).filter( element -> - element.getExtends().isPresent() ).collect( Collectors.toSet() ) ), config ), + applyTemplate( ComplexType.class, new StructureElementJavaArtifactGenerator<>( structureElements ), config ), applyTemplate( Event.class, new StructureElementJavaArtifactGenerator<>(), config ), applyTemplate( Enumeration.class, new EnumerationJavaArtifactGenerator<>(), config ) ) - .flatMap( Function.identity() ); + .flatMap( Function.identity() ) + .collect( Collectors.toSet() ) + .stream(); } } diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/EnumerationJavaArtifactGenerator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/EnumerationJavaArtifactGenerator.java index 62bb72bcf..faeb97be0 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/EnumerationJavaArtifactGenerator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/EnumerationJavaArtifactGenerator.java @@ -27,10 +27,10 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; import org.eclipse.esmf.aspectmodel.java.exception.EnumAttributeNotFoundException; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.State; import org.eclipse.esmf.metamodel.Entity; import org.eclipse.esmf.metamodel.Scalar; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.State; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/StructureElementJavaArtifactGenerator.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/StructureElementJavaArtifactGenerator.java index 9ce1aa042..17eee5705 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/StructureElementJavaArtifactGenerator.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/pojo/StructureElementJavaArtifactGenerator.java @@ -34,12 +34,12 @@ import org.eclipse.esmf.aspectmodel.java.StructuredValuePropertiesDeconstructor; import org.eclipse.esmf.aspectmodel.java.ValueInitializer; import org.eclipse.esmf.aspectmodel.java.exception.CodeGenerationException; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.characteristic.Trait; import org.eclipse.esmf.metamodel.ComplexType; import org.eclipse.esmf.metamodel.Constraint; import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.StructureElement; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; import org.eclipse.esmf.samm.KnownVersion; @@ -64,7 +64,6 @@ * @param the element type */ public class StructureElementJavaArtifactGenerator implements JavaArtifactGenerator { - private final Set extendingEntities; public StructureElementJavaArtifactGenerator() { @@ -93,7 +92,7 @@ public JavaArtifact apply( final E element, final JavaCodeGenerationConfig confi .put( "Constraint", Constraint.class ) .put( "ComplexType", ComplexType.class ) .put( "currentYear", Year.now() ) - .put( "DataType", DataType.class ) + .put( "SammType", SammXsdType.class ) .put( "DatatypeConfigurationException", DatatypeConfigurationException.class ) .put( "DatatypeConstants", DatatypeConstants.class ) .put( "DatatypeFactory", DatatypeFactory.class ) diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationExpression.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationExpression.java index 85cf98542..0b93f5256 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationExpression.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationExpression.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public interface AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationFieldBuilder.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationFieldBuilder.java index 705ca3112..9161426d9 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationFieldBuilder.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/AnnotationFieldBuilder.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; /** * Provides the functionality to build/concat the annotation fields. diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigDecimalAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigDecimalAnnotation.java index 0fe32ff37..38587d9ce 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigDecimalAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigDecimalAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class BigDecimalAnnotation extends ConstraintAnnotation implements AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigIntegerAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigIntegerAnnotation.java index f4752186d..971268b12 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigIntegerAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/BigIntegerAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class BigIntegerAnnotation extends ConstraintAnnotation implements AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ConstraintAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ConstraintAnnotation.java index b0d98a4c8..8f8ead57b 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ConstraintAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ConstraintAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public abstract class ConstraintAnnotation implements AnnotationExpression { protected Class targetAnnotation; diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/IntegerAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/IntegerAnnotation.java index b1cfba016..0f144da0e 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/IntegerAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/IntegerAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class IntegerAnnotation extends ConstraintAnnotation implements AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/LongAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/LongAnnotation.java index 63a8d0597..cc6e3ffac 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/LongAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/LongAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class LongAnnotation extends ConstraintAnnotation implements AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ShortAnnotation.java b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ShortAnnotation.java index 4d254a0cf..9ab2252be 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ShortAnnotation.java +++ b/core/esmf-aspect-model-java-generator/src/main/java/org/eclipse/esmf/aspectmodel/java/rangeconstraint/ShortAnnotation.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.rangeconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class ShortAnnotation extends ConstraintAnnotation implements AnnotationExpression { diff --git a/core/esmf-aspect-model-java-generator/src/main/java/velocity_implicit.vm b/core/esmf-aspect-model-java-generator/src/main/java/velocity_implicit.vm index c4f6a30e2..6e17aaf5e 100644 --- a/core/esmf-aspect-model-java-generator/src/main/java/velocity_implicit.vm +++ b/core/esmf-aspect-model-java-generator/src/main/java/velocity_implicit.vm @@ -3,14 +3,14 @@ #* @vtlvariable name="Arrays" type="java.lang.Class" *# #* @vtlvariable name="Base64BinaryDeserializer" type="java.lang.String" *# #* @vtlvariable name="Base64BinarySerializer" type="java.lang.String" *# -#* @vtlvariable name="BoundDefinition" type="java.lang.Class" *# +#* @vtlvariable name="BoundDefinition" type="java.lang.Class" *# #* @vtlvariable name="characteristicBaseUrn" type="java.lang.String" *# #* @vtlvariable name="Charset" type="java.lang.Class" *# #* @vtlvariable name="className" type="java.lang.String" *# -#* @vtlvariable name="Code" type="java.lang.Class" *# +#* @vtlvariable name="Code" type="java.lang.Class" *# #* @vtlvariable name="codeGenerationConfig" type="org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig" *# #* @vtlvariable name="Collections" type="java.lang.Class" *# -#* @vtlvariable name="Collection" type="java.lang.Class" *# +#* @vtlvariable name="Collection" type="java.lang.Class" *# #* @vtlvariable name="ComplexType" type="java.lang.Class" *# #* @vtlvariable name="Constraint" type="java.lang.Class" *# #* @vtlvariable name="context" type="org.eclipse.esmf.aspectmodel.java.metamodel.StaticCodeGenerationContext" *# @@ -18,41 +18,40 @@ #* @vtlvariable name="DatatypeConfigurationException" type="java.lang.Class" *# #* @vtlvariable name="DatatypeConstants" type="java.lang.Class" *# #* @vtlvariable name="DatatypeFactory" type="java.lang.Class" *# -#* @vtlvariable name="DataType" type="org.eclipse.esmf.aspectmodel.resolver.services.DataType" *# #* @vtlvariable name="dataType" type="java.lang.String" *# #* @vtlvariable name="deconstructor" type="org.eclipse.esmf.aspectmodel.java.StructuredValuePropertiesDeconstructor" *# #* @vtlvariable name="DefaultCharacteristic" type="java.lang.Class" *# -#* @vtlvariable name="DefaultCode" type="java.lang.Class" *# -#* @vtlvariable name="DefaultCollection" type="java.lang.Class" *# -#* @vtlvariable name="DefaultDuration" type="java.lang.Class" *# -#* @vtlvariable name="DefaultEncodingConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultCode" type="java.lang.Class" *# +#* @vtlvariable name="DefaultCollection" type="java.lang.Class" *# +#* @vtlvariable name="DefaultDuration" type="java.lang.Class" *# +#* @vtlvariable name="DefaultEncodingConstraint" type="java.lang.Class" *# #* @vtlvariable name="DefaultEntity" type="java.lang.Class" *# -#* @vtlvariable name="DefaultEnumeration" type="java.lang.Class" *# -#* @vtlvariable name="DefaultFixedPointConstraint" type="java.lang.Class" *# -#* @vtlvariable name="DefaultLanguageConstraint" type="java.lang.Class" *# -#* @vtlvariable name="DefaultLocaleConstraint" type="java.lang.Class" *# -#* @vtlvariable name="DefaultLengthConstraint" type="java.lang.Class" *# -#* @vtlvariable name="DefaultList" type="java.lang.Class" *# -#* @vtlvariable name="DefaultMeasurement" type="java.lang.Class" *# -#* @vtlvariable name="DefaultQuantifiable" type="java.lang.Class" *# -#* @vtlvariable name="DefaultRangeConstraint" type="java.lang.Class" *# -#* @vtlvariable name="DefaultRegularExpressionConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultEnumeration" type="java.lang.Class" *# +#* @vtlvariable name="DefaultFixedPointConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultLanguageConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultLocaleConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultLengthConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultList" type="java.lang.Class" *# +#* @vtlvariable name="DefaultMeasurement" type="java.lang.Class" *# +#* @vtlvariable name="DefaultQuantifiable" type="java.lang.Class" *# +#* @vtlvariable name="DefaultRangeConstraint" type="java.lang.Class" *# +#* @vtlvariable name="DefaultRegularExpressionConstraint" type="java.lang.Class" *# #* @vtlvariable name="DefaultScalar" type="java.lang.Class" *# #* @vtlvariable name="DefaultScalarValue" type="java.lang.Class" *# -#* @vtlvariable name="DefaultSet" type="java.lang.Class" *# -#* @vtlvariable name="DefaultSingleEntity" type="java.lang.Class" *# -#* @vtlvariable name="DefaultSortedSet" type="java.lang.Class" *# -#* @vtlvariable name="DefaultState" type="java.lang.Class" *# -#* @vtlvariable name="DefaultStructuredValue" type="java.lang.Class" *# -#* @vtlvariable name="DefaultTrait" type="java.lang.Class" *# -#* @vtlvariable name="Duration" type="java.lang.Class" *# +#* @vtlvariable name="DefaultSet" type="java.lang.Class" *# +#* @vtlvariable name="DefaultSingleEntity" type="java.lang.Class" *# +#* @vtlvariable name="DefaultSortedSet" type="java.lang.Class" *# +#* @vtlvariable name="DefaultState" type="java.lang.Class" *# +#* @vtlvariable name="DefaultStructuredValue" type="java.lang.Class" *# +#* @vtlvariable name="DefaultTrait" type="java.lang.Class" *# +#* @vtlvariable name="Duration" type="java.lang.Class" *# #* @vtlvariable name="Either" type="java.lang.Class" *# #* @vtlvariable name="element" type="org.eclipse.esmf.metamodel.StructureElement" *# -#* @vtlvariable name="EncodingConstraint" type="java.lang.Class" *# +#* @vtlvariable name="EncodingConstraint" type="java.lang.Class" *# #* @vtlvariable name="Entity" type="java.lang.Class" *# -#* @vtlvariable name="enumeration" type="org.eclipse.esmf.characteristic.Enumeration" *# -#* @vtlvariable name="Enumeration" type="java.lang.Class" *# -#* @vtlvariable name="FixedPointConstraint" type="java.lang.Class" *# +#* @vtlvariable name="enumeration" type="org.eclipse.esmf.metamodel.characteristic.Enumeration" *# +#* @vtlvariable name="Enumeration" type="java.lang.Class" *# +#* @vtlvariable name="FixedPointConstraint" type="java.lang.Class" *# #* @vtlvariable name="HashSet" type="java.lang.Class)" *# #* @vtlvariable name="HexBinaryDeserializer" type="java.lang.String" *# #* @vtlvariable name="HexBinarySerializer" type="java.lang.String" *# @@ -63,16 +62,16 @@ #* @vtlvariable name="JsonSerialize" type="java.lang.Class" *# #* @vtlvariable name="JsonValue" type="java.lang.Class" *# #* @vtlvariable name="KnownVersion" type="java.lang.Class" *# -#* @vtlvariable name="LangString" type="java.lang.Class)" *# -#* @vtlvariable name="LanguageConstraint" type="java.lang.Class" *# -#* @vtlvariable name="LocaleConstraint" type="java.lang.Class" *# -#* @vtlvariable name="LengthConstraint" type="java.lang.Class" *# -#* @vtlvariable name="List" type="java.lang.Class" *# +#* @vtlvariable name="LangString" type="java.lang.Class)" *# +#* @vtlvariable name="LanguageConstraint" type="java.lang.Class" *# +#* @vtlvariable name="LocaleConstraint" type="java.lang.Class" *# +#* @vtlvariable name="LengthConstraint" type="java.lang.Class" *# +#* @vtlvariable name="List" type="java.lang.Class" *# #* @vtlvariable name="localeEn" type="java.util.Locale" *# #* @vtlvariable name="Locale" type="java.lang.Class" *# #* @vtlvariable name="Map" type="java.lang.Class" *# #* @vtlvariable name="Matcher" type="java.lang.Class" *# -#* @vtlvariable name="Measurement" type="java.lang.Class" *# +#* @vtlvariable name="Measurement" type="java.lang.Class" *# #* @vtlvariable name="modelUrnPrefix" type="java.lang.String" *# #* @vtlvariable name="modelVisitor" type="org.eclipse.esmf.aspectmodel.java.metamodel.StaticMetaModelVisitor" *# #* @vtlvariable name="nonNegativeInteger" type="org.eclipse.esmf.metamodel.Scalar" *# @@ -81,15 +80,16 @@ #* @vtlvariable name="Optional" type="java.lang.Class" *# #* @vtlvariable name="Pattern" type="java.lang.Class" *# #* @vtlvariable name="property" type="org.eclipse.esmf.metamodel.Property" *# -#* @vtlvariable name="Quantifiable" type="java.lang.Class" *# -#* @vtlvariable name="RangeConstraint" type="java.lang.Class" *# -#* @vtlvariable name="RegularExpressionConstraint" type="java.lang.Class" *# +#* @vtlvariable name="Quantifiable" type="java.lang.Class" *# +#* @vtlvariable name="RangeConstraint" type="java.lang.Class" *# +#* @vtlvariable name="RegularExpressionConstraint" type="java.lang.Class" *# #* @vtlvariable name="ResourceFactory" type="org.apache.jena.rdf.model.ResourceFactory" *# +#* @vtlvariable name="SammType" type="org.eclipse.esmf.metamodel.datatype.SammXsdType" *# #* @vtlvariable name="Scalar" type="java.lang.Class" *# -#* @vtlvariable name="Set" type="java.lang.Class" *# -#* @vtlvariable name="SingleEntity" type="java.lang.Class" *# -#* @vtlvariable name="SortedSet" type="java.lang.Class" *# -#* @vtlvariable name="State" type="java.lang.Class" *# +#* @vtlvariable name="Set" type="java.lang.Class" *# +#* @vtlvariable name="SingleEntity" type="java.lang.Class" *# +#* @vtlvariable name="SortedSet" type="java.lang.Class" *# +#* @vtlvariable name="State" type="java.lang.Class" *# #* @vtlvariable name="StaticConstraintContainerProperty" type="java.lang.Class" *# #* @vtlvariable name="StaticConstraintProperty" type="java.lang.Class" *# #* @vtlvariable name="StaticConstraintUnitProperty" type="java.lang.Class" *# @@ -98,8 +98,8 @@ #* @vtlvariable name="String" type="java.lang.Class" *# #* @vtlvariable name="StringEscapeUtils" type="org.apache.commons.text.StringEscapeUtils" *# #* @vtlvariable name="StringUtils" type="org.apache.commons.lang3.StringUtils" *# -#* @vtlvariable name="StructuredValue" type="java.lang.Class" *# -#* @vtlvariable name="Trait" type="java.lang.class" *# +#* @vtlvariable name="StructuredValue" type="java.lang.Class" *# +#* @vtlvariable name="Trait" type="java.lang.class" *# #* @vtlvariable name="Unit" type="java.lang.Class" *# #* @vtlvariable name="Units" type="java.lang.Class" *# #* @vtlvariable name="util" type="org.eclipse.esmf.aspectmodel.java.AspectModelJavaUtil" *# diff --git a/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-body-lib.vm b/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-body-lib.vm index 05fc4f64d..dab2a6069 100644 --- a/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-body-lib.vm +++ b/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-body-lib.vm @@ -60,7 +60,7 @@ static { @Override public KnownVersion getMetaModelVersion() { - return KnownVersion.${element.getMetaModelVersion().toString()}; + return KnownVersion.getLatest(); } @Override diff --git a/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-property-lib.vm b/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-property-lib.vm index 363f04c61..fc64775b2 100644 --- a/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-property-lib.vm +++ b/core/esmf-aspect-model-java-generator/src/main/resources/java-static-class-property-lib.vm @@ -27,8 +27,7 @@ #if ( $Entity.isAssignableFrom( $extendedComplexType.class ) ) #set( $entityType = $util.castToEntity( $extendedComplexType ) ) $codeGenerationConfig.importTracker().importExplicit( $DefaultEntity ) - Optional.of(DefaultEntity.createDefaultEntity(MetaModelBaseAttributes.from(KnownVersion.$characteristic.getMetaModelVersion(), - $modelVisitor.elementUrn( $entityType, $context ), "$entityType.getName()" ), + Optional.of(DefaultEntity.createDefaultEntity(MetaModelBaseAttributes.builder().withUrn($modelVisitor.elementUrn( $entityType, $context )).build(), Meta${entityType.getName()}.INSTANCE.getProperties(), #extendsComplexType( $entityType ) ) @@ -36,8 +35,7 @@ #else #set( $abstractEntityType = $util.castToAbstractEntity( $extendedComplexType ) ) $codeGenerationConfig.importTracker().importExplicit( $DefaultAbstractEntity ) - Optional.of(DefaultAbstractEntity.createDefaultAbstractEntity(MetaModelBaseAttributes.from(KnownVersion.$characteristic.getMetaModelVersion(), - $modelVisitor.elementUrn( $abstractEntityType, $context ), "$abstractEntityType.getName()" ), + Optional.of(DefaultAbstractEntity.createDefaultAbstractEntity(MetaModelBaseAttributes.builder().withUrn($modelVisitor.elementUrn( $abstractType, $context )).build(), Meta${abstractEntityType.name}.INSTANCE.getProperties(), #extendsComplexType( $abstractEntityType ), List.of( diff --git a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/PropertyBasedTest.java b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/PropertyBasedTest.java index 2d49e5c59..48149d07b 100644 --- a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/PropertyBasedTest.java +++ b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/PropertyBasedTest.java @@ -15,29 +15,13 @@ import static org.junit.jupiter.api.Assertions.fail; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMME; -import org.eclipse.esmf.samm.KnownVersion; - public abstract class PropertyBasedTest implements SammArbitraries { private final DatatypeFactory datatypeFactory; - private final Map sammVersions; - private final Map sammcVersions; - private final Map sammeVersions; public PropertyBasedTest() { - sammVersions = KnownVersion.getVersions().stream().collect( Collectors.toMap( Function.identity(), SAMM::new ) ); - sammcVersions = KnownVersion.getVersions().stream() - .collect( Collectors.toMap( Function.identity(), SAMMC::new ) ); - sammeVersions = KnownVersion.getVersions().stream().collect( Collectors.toMap( Function.identity(), - version -> new SAMME( version, sammVersions.get( version ) ) ) ); try { datatypeFactory = DatatypeFactory.newInstance(); } catch ( final DatatypeConfigurationException exception ) { @@ -46,21 +30,6 @@ public PropertyBasedTest() { } } - @Override - public SAMM samm( final KnownVersion metaModelVersion ) { - return sammVersions.get( metaModelVersion ); - } - - @Override - public SAMMC sammc( final KnownVersion metaModelVersion ) { - return sammcVersions.get( metaModelVersion ); - } - - @Override - public SAMME samme( final KnownVersion metaModelVersion ) { - return sammeVersions.get( metaModelVersion ); - } - @Override public DatatypeFactory getDatatypeFactory() { return datatypeFactory; diff --git a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/SammArbitraries.java b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/SammArbitraries.java index fa8632493..c50bec322 100644 --- a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/SammArbitraries.java +++ b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/SammArbitraries.java @@ -20,12 +20,8 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; -import org.eclipse.esmf.aspectmodel.resolver.services.SammDataType; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMME; import org.eclipse.esmf.metamodel.Aspect; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Entity; @@ -36,7 +32,8 @@ import org.eclipse.esmf.metamodel.Scalar; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Value; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; import org.eclipse.esmf.metamodel.impl.DefaultAspect; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; import org.eclipse.esmf.metamodel.impl.DefaultEntity; @@ -46,7 +43,6 @@ import org.eclipse.esmf.metamodel.impl.DefaultProperty; import org.eclipse.esmf.metamodel.impl.DefaultScalar; import org.eclipse.esmf.metamodel.impl.DefaultScalarValue; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.samm.KnownVersion; import net.jqwik.api.Arbitraries; @@ -61,17 +57,10 @@ * Provides {@link Arbitrary}s for Aspect model elements. */ public interface SammArbitraries extends AspectModelUrnArbitraries, UriArbitraries, XsdArbitraries { - SAMM samm( KnownVersion metaModelVersion ); - - SAMMC sammc( KnownVersion metaModelVersion ); - - SAMME samme( KnownVersion metaModelVersion ); - @Provide default Arbitrary anyScalar() { - final Arbitrary uris = Arbitraries.of( - ExtendedXsdDataType.SUPPORTED_XSD_TYPES.stream().map( RDFDatatype::getURI ).collect( Collectors.toList() ) ); - return Combinators.combine( uris, anyMetaModelVersion() ).as( DefaultScalar::new ); + return Arbitraries.of( SammXsdType.ALL_TYPES.stream().map( RDFDatatype::getURI ).collect( Collectors.toList() ) ) + .map( DefaultScalar::new ); } @Provide @@ -170,8 +159,12 @@ default Arbitrary anyCharacteristic() { .combine( anyMetaModelVersion(), anyCharacteristicUrn(), anyPreferredNames(), anyDescriptions(), anySee(), anyScalar() ) .as( ( metaModelVersion, characteristicUrn, preferredNames, descriptions, see, dataType ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, characteristicUrn, characteristicUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( characteristicUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultCharacteristic( baseAttributes, Optional.of( dataType ) ); } ); } @@ -182,8 +175,13 @@ default Arbitrary anyAspect() { anySee(), anyProperty().list().ofMinSize( 1 ).ofMaxSize( 3 ), anyOperation().list().ofMaxSize( 3 ), anyEvent().list().ofMaxSize( 3 ) ) .as( ( metaModelVersion, aspectUrn, preferredNames, descriptions, see, properties, operations, events ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, aspectUrn, aspectUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( aspectUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); + return new DefaultAspect( baseAttributes, properties, operations, events, false ); } ); } @@ -193,8 +191,12 @@ default Arbitrary anyOperation() { return Combinators.combine( anyMetaModelVersion(), anyOperationUrn(), anyPreferredNames(), anyDescriptions(), anySee(), anyProperty().list().ofMinSize( 1 ).ofMaxSize( 3 ), anyProperty().optional() ) .as( ( metaModelVersion, operationUrn, preferredNames, descriptions, see, inputs, output ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, operationUrn, operationUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( operationUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultOperation( baseAttributes, inputs, output ); } ); } @@ -204,8 +206,12 @@ default Arbitrary anyEvent() { return Combinators.combine( anyMetaModelVersion(), anyEventUrn(), anyPreferredNames(), anyDescriptions(), anySee(), anyProperty().list().ofMinSize( 1 ).ofMaxSize( 3 ) ) .as( ( metaModelVersion, eventUrn, preferredNames, descriptions, see, properties ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, eventUrn, eventUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( eventUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultEvent( baseAttributes, properties ); } ); } @@ -215,8 +221,12 @@ default Arbitrary anyProperty() { return Combinators.combine( anyMetaModelVersion(), anyPropertyUrn(), anyPreferredNames(), anyDescriptions(), anySee(), anyCharacteristic(), anyPayloadName() ) .as( ( metaModelVersion, propertyUrn, preferredNames, descriptions, see, characteristic, payloadName ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, propertyUrn, propertyUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( propertyUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultProperty( baseAttributes, Optional.of( characteristic ), Optional.empty(), false, false, Optional.of( payloadName ), false, Optional.empty() ); @@ -228,8 +238,12 @@ default Arbitrary anyEntity() { return Combinators.combine( anyMetaModelVersion(), anyEntityUrn(), anyPreferredNames(), anyDescriptions(), anySee(), anyProperty().list().ofMinSize( 1 ).ofMaxSize( 3 ) ) .as( ( metaModelVersion, entityUrn, preferredNames, descriptions, see, properties ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, entityUrn, entityUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( entityUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultEntity( baseAttributes, properties ); } ); } @@ -247,73 +261,41 @@ private Value buildScalarValue( final Object value, final Scalar type ) { default Arbitrary anyValueForRdfType( final RDFDatatype rdfDatatype, final Scalar type ) { final Arbitrary anyString = Arbitraries.strings().ofMinLength( 1 ).ofMaxLength( 25 ); - switch ( rdfDatatype.getURI().split( "#" )[1] ) { - case "boolean": - return anyBoolean().map( x -> buildScalarValue( x, type ) ); - case "decimal": - case "integer": - return Arbitraries.bigIntegers().map( x -> buildScalarValue( x, type ) ); - case "double": - return Arbitraries.doubles().map( x -> buildScalarValue( x, type ) ); - case "float": - return Arbitraries.floats().map( x -> buildScalarValue( x, type ) ); - case "date": - return anyDate().map( x -> buildScalarValue( x, type ) ); - case "time": - return anyTime().map( x -> buildScalarValue( x, type ) ); - case "anyDateTime": - return anyDateTime().map( x -> buildScalarValue( x, type ) ); - case "anyDateTimeStamp": - return anyDateTimeStamp().map( x -> buildScalarValue( x, type ) ); - case "gYear": - return anyGyear().map( x -> buildScalarValue( x, type ) ); - case "gMonth": - return anyGmonth().map( x -> buildScalarValue( x, type ) ); - case "gDay": - return anyGday().map( x -> buildScalarValue( x, type ) ); - case "gYearMonth": - return anyGyearMonth().map( x -> buildScalarValue( x, type ) ); - case "gMonthDay": - return anyGmonthDay().map( x -> buildScalarValue( x, type ) ); - case "duration": - return anyDuration().map( x -> buildScalarValue( x, type ) ); - case "yearMonthDuation": - return anyYearMonthDuration().map( x -> buildScalarValue( x, type ) ); - case "dayTimeDuration": - return anyDayTimeDuration().map( x -> buildScalarValue( x, type ) ); - case "byte": - return Arbitraries.bytes().map( x -> buildScalarValue( x, type ) ); - case "short": - return Arbitraries.shorts().map( x -> buildScalarValue( x, type ) ); - case "unsignedByte": - return anyUnsignedByte().map( x -> buildScalarValue( x, type ) ); - case "int": - return Arbitraries.integers().map( x -> buildScalarValue( x, type ) ); - case "unsignedShort": - return anyUnsignedShort().map( x -> buildScalarValue( x, type ) ); - case "long": - return Arbitraries.longs().map( x -> buildScalarValue( x, type ) ); - case "unsignedLong": - return anyUnsignedLong().map( x -> buildScalarValue( x, type ) ); - case "positiveInteger": - return anyPositiveInteger().map( x -> buildScalarValue( x, type ) ); - case "nonNegativeInteger": - return anyNonNegativeInteger().map( x -> buildScalarValue( x, type ) ); - case "hexBinary": - return anyHexBinary().map( x -> buildScalarValue( x, type ) ); - case "base64Binary": - return anyBase64Binary().map( x -> buildScalarValue( x, type ) ); - case "anyURI": - return anyUri().map( x -> buildScalarValue( x, type ) ); - case "curie": - return anyMetaModelVersion().map( SammDataType::curie ).map( x -> buildScalarValue( x, type ) ); - case "langString": - return Combinators.combine( anyString, anyLocale() ) - .as( LangString::new ) - .map( x -> buildScalarValue( x, type ) ); - default: - return anyString.map( x -> buildScalarValue( x, type ) ); - } + return switch ( rdfDatatype.getURI().split( "#" )[1] ) { + case "boolean" -> anyBoolean().map( x -> buildScalarValue( x, type ) ); + case "decimal", "integer" -> Arbitraries.bigIntegers().map( x -> buildScalarValue( x, type ) ); + case "double" -> Arbitraries.doubles().map( x -> buildScalarValue( x, type ) ); + case "float" -> Arbitraries.floats().map( x -> buildScalarValue( x, type ) ); + case "date" -> anyDate().map( x -> buildScalarValue( x, type ) ); + case "time" -> anyTime().map( x -> buildScalarValue( x, type ) ); + case "anyDateTime" -> anyDateTime().map( x -> buildScalarValue( x, type ) ); + case "anyDateTimeStamp" -> anyDateTimeStamp().map( x -> buildScalarValue( x, type ) ); + case "gYear" -> anyGyear().map( x -> buildScalarValue( x, type ) ); + case "gMonth" -> anyGmonth().map( x -> buildScalarValue( x, type ) ); + case "gDay" -> anyGday().map( x -> buildScalarValue( x, type ) ); + case "gYearMonth" -> anyGyearMonth().map( x -> buildScalarValue( x, type ) ); + case "gMonthDay" -> anyGmonthDay().map( x -> buildScalarValue( x, type ) ); + case "duration" -> anyDuration().map( x -> buildScalarValue( x, type ) ); + case "yearMonthDuation" -> anyYearMonthDuration().map( x -> buildScalarValue( x, type ) ); + case "dayTimeDuration" -> anyDayTimeDuration().map( x -> buildScalarValue( x, type ) ); + case "byte" -> Arbitraries.bytes().map( x -> buildScalarValue( x, type ) ); + case "short" -> Arbitraries.shorts().map( x -> buildScalarValue( x, type ) ); + case "unsignedByte" -> anyUnsignedByte().map( x -> buildScalarValue( x, type ) ); + case "int" -> Arbitraries.integers().map( x -> buildScalarValue( x, type ) ); + case "unsignedShort" -> anyUnsignedShort().map( x -> buildScalarValue( x, type ) ); + case "long" -> Arbitraries.longs().map( x -> buildScalarValue( x, type ) ); + case "unsignedLong" -> anyUnsignedLong().map( x -> buildScalarValue( x, type ) ); + case "positiveInteger" -> anyPositiveInteger().map( x -> buildScalarValue( x, type ) ); + case "nonNegativeInteger" -> anyNonNegativeInteger().map( x -> buildScalarValue( x, type ) ); + case "hexBinary" -> anyHexBinary().map( x -> buildScalarValue( x, type ) ); + case "base64Binary" -> anyBase64Binary().map( x -> buildScalarValue( x, type ) ); + case "anyURI" -> anyUri().map( x -> buildScalarValue( x, type ) ); + case "curie" -> anyCurie().map( x -> buildScalarValue( x, type ) ); + case "langString" -> Combinators.combine( anyString, anyLocale() ) + .as( LangString::new ) + .map( x -> buildScalarValue( x, type ) ); + default -> anyString.map( x -> buildScalarValue( x, type ) ); + }; } @Provide @@ -326,8 +308,12 @@ default Arbitrary anyEntityInstance( final Entity entity ) { return Combinators.combine( anyMetaModelVersion(), anyAspectUrn(), anyPreferredNames(), anyDescriptions(), anySee(), entityAssertions ) .as( ( metaModelVersion, aspectUrn, preferredNames, descriptions, see, assertions ) -> { - final MetaModelBaseAttributes baseAttributes = new MetaModelBaseAttributes( - metaModelVersion, aspectUrn, aspectUrn.getName(), preferredNames, descriptions, see ); + final MetaModelBaseAttributes baseAttributes = MetaModelBaseAttributes.builder() + .withUrn( aspectUrn ) + .withPreferredNames( preferredNames ) + .withDescriptions( descriptions ) + .withSee( see ) + .build(); return new DefaultEntityInstance( baseAttributes, assertions, entity ); } ); } @@ -342,8 +328,8 @@ default Arbitrary anyValueForType( final Type type ) { @Provide default Arbitrary anyValueForScalarType( final Scalar type ) { - return ExtendedXsdDataType - .SUPPORTED_XSD_TYPES.stream() + return SammXsdType + .ALL_TYPES.stream() .filter( dataType -> dataType.getURI().equals( type.getUrn() ) ) .map( rdfDatatype -> anyValueForRdfType( rdfDatatype, type ) ) .findFirst() diff --git a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/UriArbitraries.java b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/UriArbitraries.java index a77fca696..66a46fb63 100644 --- a/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/UriArbitraries.java +++ b/core/esmf-aspect-model-java-generator/src/test-shared/java/org/eclipse/esmf/test/shared/arbitraries/UriArbitraries.java @@ -90,4 +90,12 @@ default Arbitrary anyUrn() { default Arbitrary anyUri() { return Arbitraries.oneOf( anyUrl(), anyUrn() ); } + + @Provide + default Arbitrary anyCurie() { + final Arbitrary frontPart = Arbitraries.strings().ofMinLength( 1 ).ofMaxLength( 3 ).alpha(); + final Arbitrary backPart = Arbitraries.strings().ofMinLength( 1 ).ofMaxLength( 5 ).alpha(); + return Combinators.combine( frontPart, backPart ) + .as( ( front, back ) -> front + ":" + back ); + } } diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaGeneratorTest.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaGeneratorTest.java index f76d53ab4..6d7f57d22 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaGeneratorTest.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/AspectModelJavaGeneratorTest.java @@ -32,16 +32,11 @@ import javax.xml.datatype.XMLGregorianCalendar; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; @@ -57,21 +52,19 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Streams; import com.google.common.reflect.TypeToken; +import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.Statement; import org.apache.jena.vocabulary.RDF; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; -public class AspectModelJavaGeneratorTest extends MetaModelVersions { - - private Collection getGenerators( final TestAspect testAspect, final KnownVersion metaModelVersion, - final String customJavaPackageName ) { - final VersionedModel model = TestResources.getModel( testAspect, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); +public class AspectModelJavaGeneratorTest { + private Collection getGenerators( final TestAspect testAspect, final String customJavaPackageName ) { + final Aspect aspect = TestResources.load( testAspect ).aspect(); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .packageName( customJavaPackageName ) .enableJacksonAnnotations( true ) @@ -80,32 +73,29 @@ private Collection getGenerators( final TestAspect testAspect, fi return List.of( new AspectModelJavaGenerator( aspect, config ) ); } - private Collection getGenerators( final TestAspect testAspect, final KnownVersion metaModelVersion, - final boolean enableJacksonAnnotations, + private Collection getGenerators( final TestAspect testAspect, final boolean enableJacksonAnnotations, final boolean executeLibraryMacros, final File templateLibPath ) { - final VersionedModel model = TestResources.getModel( testAspect, metaModelVersion ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); + final Aspect aspect = TestResources.load( testAspect ).aspect(); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( enableJacksonAnnotations ) .executeLibraryMacros( executeLibraryMacros ) .templateLibFile( templateLibPath ) - .packageName( aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).get() ) + .packageName( aspect.urn().getNamespace() ) .build(); return List.of( new AspectModelJavaGenerator( aspect, config ) ); } - private Collection getGenerators( final TestAspect testAspect, final KnownVersion metaModelVersion ) { - return getGenerators( TestResources.getModel( testAspect, metaModelVersion ).get() ); + private Collection getGenerators( final TestAspect testAspect ) { + return getGenerators( TestResources.load( testAspect ) ); } - private Collection getGenerators( final VersionedModel model ) { - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); + private Collection getGenerators( final AspectModel aspectModel ) { final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( true ) .executeLibraryMacros( false ) - .packageName( aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).get() ) + .packageName( aspectModel.aspect().urn().getNamespace() ) .build(); - return List.of( new AspectModelJavaGenerator( aspect, config ) ); + return List.of( new AspectModelJavaGenerator( aspectModel.aspect(), config ) ); } /** @@ -119,19 +109,19 @@ private Collection getGenerators( final VersionedModel model ) { "MODEL_WITH_BROKEN_CYCLES" // Contains elements that are not references from the Aspect } ) public void testCodeGeneration( final TestAspect testAspect ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final SAMM samm = new SAMM( metaModelVersion ); - final SAMMC sammc = new SAMMC( metaModelVersion ); assertThatCode( () -> { - final VersionedModel versionedModel = TestResources.getModel( testAspect, metaModelVersion ).get(); - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( versionedModel ) ); + final AspectModel aspectModel = TestResources.load( testAspect ); + final Model model = aspectModel.files().iterator().next().sourceModel(); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspectModel ) ); final int numberOfFiles = result.compilationUnits.size(); - final List structureElements = Streams.stream( - versionedModel.getRawModel().listStatements( null, RDF.type, (RDFNode) null ) ) + final List structureElements = Streams.stream( model.listStatements( null, RDF.type, (RDFNode) null ) ) .filter( statement -> { final Resource type = statement.getObject().asResource(); - return type.equals( samm.Aspect() ) || type.equals( samm.Entity() ) || type.equals( samm.Event() ) - || type.equals( samm.AbstractEntity() ) || type.equals( sammc.Enumeration() ); + return type.equals( SammNs.SAMM.Aspect() ) + || type.equals( SammNs.SAMM.Entity() ) + || type.equals( SammNs.SAMM.Event() ) + || type.equals( SammNs.SAMM.AbstractEntity() ) + || type.equals( SammNs.SAMMC.Enumeration() ); } ) .map( Statement::getSubject ) .toList(); @@ -146,9 +136,8 @@ public void testCodeGeneration( final TestAspect testAspect ) { * Generates Java classes for an aspect model that has multiple entity properties, also nested ones. * In total 4 classes should be written. */ - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelMultipleEntitiesOnMultipleLevels( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelMultipleEntitiesOnMultipleLevels() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testEntityOne", "TestEntity" ) .put( "testEntityTwo", "TestEntity" ) @@ -164,7 +153,7 @@ public void testGenerateAspectModelMultipleEntitiesOnMultipleLevels( final Known final TestAspect aspect = TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_ON_MULTIPLE_LEVELS; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 4 ); result.assertFields( "AspectWithMultipleEntitiesOnMultipleLevels", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithMultipleEntitiesOnMultipleLevels", expectedFieldsForAspectClass ); @@ -180,9 +169,8 @@ public void testGenerateAspectModelMultipleEntitiesOnMultipleLevels( final Known * Generates Java classes for an aspect model that has multiple enumeration properties as well as a entity property, * also nested ones. In total 5 classes should be written. */ - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelMultipleEnumerationsOnMultipleLevels( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelMultipleEnumerationsOnMultipleLevels() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testPropertyWithEnumOne", "TestEnumOneCharacteristic" ) .put( "testPropertyWithEnumTwo", "TestEnumTwoCharacteristic" ) @@ -190,8 +178,7 @@ public void testGenerateAspectModelMultipleEnumerationsOnMultipleLevels( final K .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_MULTIPLE_ENUMERATIONS_ON_MULTIPLE_LEVELS; - final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 5 ); result.assertFields( "AspectWithMultipleEnumerationsOnMultipleLevels", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithMultipleEnumerationsOnMultipleLevels", expectedFieldsForAspectClass ); @@ -201,53 +188,49 @@ public void testGenerateAspectModelMultipleEnumerationsOnMultipleLevels( final K Collections.emptyMap() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateRecursiveAspectModel( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateRecursiveAspectModel() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", "Optional" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "TestEntity", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "TestEntity", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithOptionalProperties( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithOptionalProperties() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "numberProperty", "Optional" ) .put( "timestampProperty", XMLGregorianCalendar.class ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_OPTIONAL_PROPERTIES; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithOptionalProperties", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithOptionalProperties", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithCurie( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithCurie() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testCurie", "Curie" ) .put( "testCurieWithoutExampleValue", "Curie" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_CURIE; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithCurie", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithCurie", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithExtendedEnums( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithExtendedEnums() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "result", "EvaluationResults" ) .put( "simpleResult", "YesNo" ) @@ -267,8 +250,7 @@ public void testGenerateAspectModelWithExtendedEnums( final KnownVersion metaMod .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENUMS; - final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 5 ); result.assertFields( "AspectWithExtendedEnums", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithExtendedEnums", expectedFieldsForAspectClass ); @@ -284,9 +266,8 @@ public void testGenerateAspectModelWithExtendedEnums( final KnownVersion metaMod assertConstructor( result, "NestedResult", expectedFieldsForNestedResult ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithExtendedEnumsWithNotInPayloadProperty( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithExtendedEnumsWithNotInPayloadProperty() throws IOException { final ImmutableMap expectedFieldsForEvaluationResults = ImmutableMap. builder() .put( "average", new TypeToken>() { } ) @@ -303,8 +284,7 @@ public void testGenerateAspectModelWithExtendedEnumsWithNotInPayloadProperty( fi .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENUMS_WITH_NOT_IN_PAYLOAD_PROPERTY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion, - true, false, null ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, true, false, null ) ); final List constructorDeclarations = result.compilationUnits.get( "EvaluationResult" ) .findAll( ConstructorDeclaration.class ); @@ -327,12 +307,11 @@ public void testGenerateAspectModelWithExtendedEnumsWithNotInPayloadProperty( fi @BeforeAll public static void setup() { - DataType.setupTypeMapping(); + SammXsdType.setupTypeMapping(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithConstraints() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testPropertyWithRegularExpression", String.class ) .put( "testPropertyWithDecimalMinDecimalMaxRangeConstraint", BigDecimal.class ) @@ -348,8 +327,7 @@ public void testGenerateAspectModelWithConstraints( final KnownVersion metaModel .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_CONSTRAINTS; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion, - true, false, null ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithConstraints", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -376,16 +354,14 @@ ImmutableMap. builder() assertConstructor( result, "AspectWithConstraints", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectModelWithOptionalAndConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithOptionalAndConstraints() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "stringProperty", "Optional<@Size(max = 3) String>" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_OPTIONAL_PROPERTY_AND_CONSTRAINT; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion, - true, false, null ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithOptionalPropertyAndConstraint", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -394,24 +370,22 @@ ImmutableMap. builder() assertConstructor( result, "AspectWithOptionalPropertyAndConstraint", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithConstrainedCollection( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithConstrainedCollection() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testCollection", new TypeToken>() { } ).build(); final TestAspect aspect = TestAspect.ASPECT_WITH_CONSTRAINED_COLLECTION; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithConstrainedCollection", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithConstrainedCollection", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithExclusiveRangeConstraint( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithExclusiveRangeConstraint() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "floatProp", Float.class ) .put( "doubleProp", Double.class ) @@ -422,7 +396,7 @@ public void testGenerateAspectWithExclusiveRangeConstraint( final KnownVersion m final TestAspect aspect = TestAspect.ASPECT_WITH_EXCLUSIVE_RANGE_CONSTRAINT; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithExclusiveRangeConstraint", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -446,45 +420,42 @@ ImmutableMap. builder() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithEither( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithEither() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", "Either" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_EITHER_WITH_COMPLEX_TYPES; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 3 ); result.assertFields( "AspectWithEitherWithComplexTypes", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithEitherWithComplexTypes", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithBoolean( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithBoolean() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testBoolean", Boolean.class.getSimpleName() ).build(); final TestAspect aspect = TestAspect.ASPECT_WITH_BOOLEAN; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithBoolean", expectedFieldsForAspectClass, ImmutableMap. builder().put( "testBoolean", "@NotNull" ).build() ); assertConstructor( result, "AspectWithBoolean", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithBinary( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithBinary() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testBinary", new ResolvedArrayType( ResolvedPrimitiveType.BYTE ) ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_BINARY; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithBinary", expectedFieldsForAspectClass, ImmutableMap. builder().put( "testBinary", @@ -493,31 +464,25 @@ ImmutableMap. builder().put( "testBinary", assertConstructor( result, "AspectWithBinary", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithCustomJavaPackageNameExpectCustomPackageDeclaration( final KnownVersion metaModelVersion ) - throws IOException { + @Test + public void testGenerateAspectWithCustomJavaPackageNameExpectCustomPackageDeclaration() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BINARY; final String customJavaPackageName = "test.test.test"; - final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, customJavaPackageName ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, customJavaPackageName ) ); result.assertNumberOfFiles( 1 ); result.assertNamespace( "AspectWithBinary", customJavaPackageName ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithEmptyJavaPackageNameExpectDefaultPackageDeclaration( final KnownVersion metaModelVersion ) - throws IOException { + @Test + public void testGenerateAspectWithEmptyJavaPackageNameExpectDefaultPackageDeclaration() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BINARY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertNamespace( "AspectWithBinary", "org.eclipse.esmf.test" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithComplexEnumeration( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithComplexEnumeration() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "result", "EvaluationResults" ) .put( "simpleResult", "YesNo" ) @@ -529,7 +494,7 @@ public void testGenerateAspectModelWithComplexEnumeration( final KnownVersion me .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 4 ); result.assertFields( "AspectWithComplexEnum", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithComplexEnum", expectedFieldsForAspectClass ); @@ -549,15 +514,14 @@ ImmutableMap. builder() result.assertEnumConstants( "YesNo", ImmutableSet.of( "YES", "NO" ), Collections.emptyMap() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithState( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithState() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "status", "TestState" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_STATE; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "AspectWithState", expectedFieldsForAspectClass, new HashMap<>() ); @@ -566,10 +530,8 @@ public void testGenerateAspectWithState( final KnownVersion metaModelVersion ) t result.assertEnumConstants( "TestState", ImmutableSet.of( "SUCCESS", "ERROR", "IN_PROGRESS" ), Collections.emptyMap() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelMultipleEntitiesOnMultipleLevelsWithoutJacksonAnnotations( - final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelMultipleEntitiesOnMultipleLevelsWithoutJacksonAnnotations() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testEntityOne", "TestEntity" ) .put( "testEntityTwo", "TestEntity" ) @@ -585,7 +547,7 @@ public void testGenerateAspectModelMultipleEntitiesOnMultipleLevelsWithoutJackso final TestAspect aspect = TestAspect.ASPECT_WITH_MULTIPLE_ENTITIES_ON_MULTIPLE_LEVELS; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, false, false, null ) ); + .apply( getGenerators( aspect, false, false, null ) ); result.assertNumberOfFiles( 4 ); result.assertFields( "AspectWithMultipleEntitiesOnMultipleLevels", expectedFieldsForAspectClass, new HashMap<>() ); result.assertConstructor( "AspectWithMultipleEntitiesOnMultipleLevels", expectedFieldsForAspectClass, new HashMap<>() ); @@ -593,9 +555,8 @@ public void testGenerateAspectModelMultipleEntitiesOnMultipleLevelsWithoutJackso result.assertConstructor( "TestEntity", expectedFieldsForEntityClass, new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithStructuredValue( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithStructuredValue() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "date", XMLGregorianCalendar.class ) .put( "year", Long.class ) @@ -608,17 +569,16 @@ public void testGenerateAspectWithStructuredValue( final KnownVersion metaModelV .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_NUMERIC_STRUCTURED_VALUE; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithNumericStructuredValue", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithNumericStructuredValue", expectedConstructorArguments ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithComplexEnumerationInclOptional( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithComplexEnumerationInclOptional() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM_INCL_OPTIONAL; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 4 ); result.assertEnumConstants( "EvaluationResults", ImmutableSet.of( "RESULT_NO_STATUS", "RESULT_GOOD", "RESULT_BAD" ), @@ -629,11 +589,10 @@ ImmutableMap. builder() .build() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithComplexEnumerations( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithComplexEnumerations() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_COLLECTION_ENUM; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 9 ); result.assertEnumConstants( "MyEnumerationOne", ImmutableSet.of( "ENTITY_INSTANCE_ONE" ), ImmutableMap. builder() @@ -653,11 +612,10 @@ ImmutableMap. builder() .build() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithComplexEntityCollectionEnumeration( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithComplexEntityCollectionEnumeration() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENTITY_COLLECTION_ENUM; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 4 ); result.assertEnumConstants( "MyEnumerationOne", ImmutableSet.of( "ENTITY_INSTANCE_ONE" ), ImmutableMap. builder() @@ -665,9 +623,8 @@ ImmutableMap. builder() .build() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithFixedPointConstraint( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithFixedPointConstraint() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", BigDecimal.class.getSimpleName() ) .build(); @@ -677,24 +634,22 @@ public void testGenerateAspectModelWithFixedPointConstraint( final KnownVersion .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_FIXED_POINT; - final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithFixedPoint", expectedFieldsForAspectClass, expectedAnnotations ); assertConstructor( result, "AspectWithFixedPoint", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithList( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithList() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", new TypeToken>() { } ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_LIST; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithList", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithList", expectedFieldsForAspectClass ); @@ -702,16 +657,15 @@ public void testGenerateAspectModelWithList( final KnownVersion metaModelVersion Collections.singletonList( "CollectionAspect,String>" ), Collections.emptyList() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithListAndElementCharacteristic( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithListAndElementCharacteristic() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", new TypeToken>() { } ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_LIST_AND_ELEMENT_CHARACTERISTIC; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithListAndElementCharacteristic", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithListAndElementCharacteristic", expectedFieldsForAspectClass ); @@ -719,9 +673,8 @@ public void testGenerateAspectModelWithListAndElementCharacteristic( final Known Collections.emptyList(), Collections.singletonList( "CollectionAspect,String>" ), Collections.emptyList() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithListAndElementConstraint( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithListAndElementConstraint() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", new TypeToken>() { } ) @@ -729,7 +682,7 @@ public void testGenerateAspectModelWithListAndElementConstraint( final KnownVers final TestAspect aspect = TestAspect.ASPECT_WITH_LIST_AND_ELEMENT_CONSTRAINT; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithListAndElementConstraint", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithListAndElementConstraint", expectedFieldsForAspectClass ); @@ -741,16 +694,15 @@ public void testGenerateAspectModelWithListAndElementConstraint( final KnownVers + "@FloatMax(value = \"10.5\", boundDefinition = BoundDefinition.AT_MOST) Float>testProperty;" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithSet( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithSet() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", new TypeToken>() { } ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_SET; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithSet", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithSet", expectedFieldsForAspectClass ); @@ -758,15 +710,14 @@ public void testGenerateAspectModelWithSet( final KnownVersion metaModelVersion Collections.singletonList( "CollectionAspect,String>" ), Collections.emptyList() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectWithRdfLangString( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithRdfLangString() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "prop", LangString.class ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_MULTI_LANGUAGE_TEXT; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithMultiLanguageText", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithMultiLanguageText", expectedFieldsForAspectClass ); @@ -782,15 +733,13 @@ private ImmutableMap buildExpectedAnnotations( final ImmutableMa final String expectedJsonAnnotation = "@JsonProperty(value = \"%s\")"; final ImmutableMap.Builder expectedAnnotationBuilder = ImmutableMap.builder(); - expectedFields.keySet().forEach( fieldName -> { - expectedAnnotationBuilder.put( fieldName, String.format( expectedJsonAnnotation, fieldName ) ); - } ); + expectedFields.keySet().forEach( fieldName -> + expectedAnnotationBuilder.put( fieldName, String.format( expectedJsonAnnotation, fieldName ) ) ); return expectedAnnotationBuilder.build(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithDurationTypeForRangeConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithDurationTypeForRangeConstraints() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testPropertyWithDayTimeDuration", Duration.class ) .put( "testPropertyWithDuration", Duration.class ) @@ -799,7 +748,7 @@ public void testGenerateAspectModelWithDurationTypeForRangeConstraints( final Kn final TestAspect aspect = TestAspect.ASPECT_WITH_DURATION_TYPE_FOR_RANGE_CONSTRAINTS; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithDurationTypeForRangeConstraints", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -817,9 +766,8 @@ ImmutableMap. builder() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithDateTimeTypeForRangeConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithDateTimeTypeForRangeConstraints() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testPropertyWithDateTime", XMLGregorianCalendar.class ) .put( "testPropertyWithDateTimeStamp", XMLGregorianCalendar.class ) @@ -827,7 +775,7 @@ public void testGenerateAspectModelWithDateTimeTypeForRangeConstraints( final Kn final TestAspect aspect = TestAspect.ASPECT_WITH_DATE_TIME_TYPE_FOR_RANGE_CONSTRAINTS; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithDateTimeTypeForRangeConstraints", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -842,9 +790,8 @@ ImmutableMap. builder() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithGtypeForRangeConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithGtypeForRangeConstraints() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testPropertyWithGYear", XMLGregorianCalendar.class ) .put( "testPropertyWithGMonth", XMLGregorianCalendar.class ) @@ -855,7 +802,7 @@ public void testGenerateAspectModelWithGtypeForRangeConstraints( final KnownVers final TestAspect aspect = TestAspect.ASPECT_WITH_G_TYPE_FOR_RANGE_CONSTRAINTS; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithGTypeForRangeConstraints", expectedFieldsForAspectClass, ImmutableMap. builder() @@ -879,39 +826,36 @@ ImmutableMap. builder() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithPropertyWithPayloadName( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithPropertyWithPayloadName() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "test", "String" ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithPropertyWithPayloadName", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithPropertyWithPayloadName", expectedFieldsForAspectClass ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateAspectModelWithBlankNode( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithBlankNode() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "list", new TypeToken>() { } ) .build(); final TestAspect aspect = TestAspect.ASPECT_WITH_BLANK_NODE; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 1 ); result.assertFields( "AspectWithBlankNode", expectedFieldsForAspectClass, new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateEqualsForAspectWithEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateEqualsForAspectWithEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ENTITY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); final Optional expectedReturnType = Optional.of( PrimitiveType.booleanType() ); final boolean expectOverride = true; @@ -940,11 +884,10 @@ public void testGenerateEqualsForAspectWithEntity( final KnownVersion metaModelV result.assertMethodBody( "TestEntity", "equals", expectOverride, expectedReturnType, expectedNumberOfParameters, expectedMethodBody ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGenerateHashCodeForAspectWithEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateHashCodeForAspectWithEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ENTITY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); final Optional expectedReturnType = Optional.of( PrimitiveType.intType() ); final boolean expectOverride = true; @@ -958,9 +901,8 @@ public void testGenerateHashCodeForAspectWithEntity( final KnownVersion metaMode expectedMethodBody ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectModelWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithAbstractEntity() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", "ExtendingTestEntity" ) .build(); @@ -980,7 +922,7 @@ public void testGenerateAspectModelWithAbstractEntity( final KnownVersion metaMo final TestAspect aspect = TestAspect.ASPECT_WITH_ABSTRACT_ENTITY; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 3 ); result.assertFields( "AspectWithAbstractEntity", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithAbstractEntity", expectedFieldsForAspectClass ); @@ -998,9 +940,8 @@ public void testGenerateAspectModelWithAbstractEntity( final KnownVersion metaMo Collections.singletonList( "AbstractTestEntity" ), Collections.emptyList(), Collections.emptyList() ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectModelWithCollectionWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithCollectionWithAbstractEntity() throws IOException { final ImmutableMap expectedFieldsForAspectClass = ImmutableMap. builder() .put( "testProperty", "Collection" ) .build(); @@ -1020,7 +961,7 @@ public void testGenerateAspectModelWithCollectionWithAbstractEntity( final Known final TestAspect aspect = TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY; final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, false, null ) ); + .apply( getGenerators( aspect, true, false, null ) ); result.assertNumberOfFiles( 3 ); result.assertFields( "AspectWithCollectionWithAbstractEntity", expectedFieldsForAspectClass, new HashMap<>() ); assertConstructor( result, "AspectWithCollectionWithAbstractEntity", expectedFieldsForAspectClass ); @@ -1041,11 +982,10 @@ public void testGenerateAspectModelWithCollectionWithAbstractEntity( final Known Collections.singletonList( "AbstractTestEntity" ), Collections.emptyList(), Collections.emptyList() ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectModelWithEntityEnumerationAndLangString( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectModelWithEntityEnumerationAndLangString() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ENTITY_ENUMERATION_AND_LANG_STRING; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 3 ); final ImmutableMap expectedConstantArguments = ImmutableMap. builder() @@ -1056,11 +996,10 @@ public void testGenerateAspectModelWithEntityEnumerationAndLangString( final Kno result.assertEnumConstants( "TestEnumeration", ImmutableSet.of( "ENTITY_INSTANCE" ), expectedConstantArguments ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateEqualsForAspectWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateEqualsForAspectWithAbstractEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ABSTRACT_ENTITY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); final Optional expectedReturnType = Optional.of( PrimitiveType.booleanType() ); final boolean expectOverride = true; @@ -1105,11 +1044,10 @@ public void testGenerateEqualsForAspectWithAbstractEntity( final KnownVersion me expectedMethodBody ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateHashCodeForAspectWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateHashCodeForAspectWithAbstractEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ABSTRACT_ENTITY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); final Optional expectedReturnType = Optional.of( PrimitiveType.intType() ); final boolean expectOverride = true; @@ -1127,11 +1065,10 @@ public void testGenerateHashCodeForAspectWithAbstractEntity( final KnownVersion expectedMethodBody ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectWithoutFileHeader( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithoutFileHeader() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); final CompilationUnit aspectClass = result.compilationUnits.get( TestAspect.ASPECT_WITH_COMPLEX_ENUM.getName() ); assertThat( aspectClass.getComment() ).isEmpty(); final CompilationUnit enumeration = result.compilationUnits.get( "EvaluationResults" ); @@ -1140,15 +1077,13 @@ public void testGenerateAspectWithoutFileHeader( final KnownVersion metaModelVer assertThat( entity.getComment() ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectWithFileHeader( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithFileHeader() throws IOException { final String currentWorkingDirectory = System.getProperty( "user.dir" ); final File templateLibFile = Path.of( currentWorkingDirectory, "/templates", "/test-macro-lib.vm" ).toFile(); final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM; - final GenerationResult result = TestContext.generateAspectCode() - .apply( getGenerators( aspect, metaModelVersion, false, true, templateLibFile ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, false, true, templateLibFile ) ); final int currentYear = LocalDate.now().getYear(); final String expectedCopyright = String.format( "Copyright (c) %s Test Inc. All rights reserved", currentYear ); @@ -1157,11 +1092,10 @@ public void testGenerateAspectWithFileHeader( final KnownVersion metaModelVersio result.assertCopyright( "EvaluationResult", expectedCopyright ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testGenerateAspectWithMultipleInheritance( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGenerateAspectWithMultipleInheritance() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENTITY; - final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final GenerationResult result = TestContext.generateAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 4 ); result.assertClassDeclaration( "ParentOfParentEntity", Collections.singletonList( Modifier.abstractModifier() ), Collections.emptyList(), Collections.emptyList(), List.of( "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)", diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/ExtendedStaticMetaModelFunctionalityTest.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/ExtendedStaticMetaModelFunctionalityTest.java index 42bcad14c..eb8a0e350 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/ExtendedStaticMetaModelFunctionalityTest.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/ExtendedStaticMetaModelFunctionalityTest.java @@ -20,7 +20,6 @@ import java.lang.reflect.Method; import java.util.List; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.staticmetamodel.ComputedProperty; import org.eclipse.esmf.staticmetamodel.StaticContainerProperty; import org.eclipse.esmf.staticmetamodel.StaticProperty; @@ -30,15 +29,13 @@ import org.eclipse.esmf.test.TestAspect; import org.apache.commons.lang3.reflect.ConstructorUtils; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; public class ExtendedStaticMetaModelFunctionalityTest extends StaticMetaModelGeneratorTest { - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testComputedProperties( final KnownVersion metaModelVersion ) throws IOException, ReflectiveOperationException { + @Test + void testComputedProperties() throws IOException, ReflectiveOperationException { final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENUMS; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithExtendedEnums" ); final Class metaAspectClass = findGeneratedClass( result, "MetaAspectWithExtendedEnums" ); @@ -57,9 +54,9 @@ void testComputedProperties( final KnownVersion metaModelVersion ) throws IOExce final ComputedProperty unwrapEnumValue = ComputedProperty.of( resultProperty, results -> { try { return getValueOfEvaluationResults.invoke( results ); - } catch ( IllegalAccessException e ) { + } catch ( final IllegalAccessException e ) { throw new RuntimeException( e ); - } catch ( InvocationTargetException e ) { + } catch ( final InvocationTargetException e ) { throw new RuntimeException( e ); } } ); @@ -67,11 +64,10 @@ void testComputedProperties( final KnownVersion metaModelVersion ) throws IOExce assertThat( unwrapEnumValue.getValue( aspectInstance ) ).isEqualTo( resultGoodValue ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testPropertyChain( final KnownVersion metaModelVersion ) throws IOException, ReflectiveOperationException { + @Test + void testPropertyChain() throws IOException, ReflectiveOperationException { final TestAspect aspect = TestAspect.ASPECT_WITH_NESTED_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithNestedEntity" ); final Class entityClass = findGeneratedClass( result, "Entity" ); @@ -115,11 +111,10 @@ void testPropertyChain( final KnownVersion metaModelVersion ) throws IOException assertThat( nestedEntityStringChain.getValue( aspectInstance ) ).isEqualTo( "nested-entity-string" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCollectionPropertyChain( final KnownVersion metaModelVersion ) throws IOException, ReflectiveOperationException { + @Test + void testCollectionPropertyChain() throws IOException, ReflectiveOperationException { final TestAspect aspect = TestAspect.ASPECT_WITH_ENTITY_WITH_NESTED_ENTITY_LIST_PROPERTY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithEntityWithNestedEntityListProperty" ); final Class entityClass = findGeneratedClass( result, "Entity" ); @@ -156,11 +151,10 @@ void testCollectionPropertyChain( final KnownVersion metaModelVersion ) throws I "nested-entity-string-2" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testSinglePropertyPredicates( final KnownVersion metaModelVersion ) throws IOException, ReflectiveOperationException { + @Test + void testSinglePropertyPredicates() throws IOException, ReflectiveOperationException { final TestAspect aspect = TestAspect.ASPECT_WITH_NESTED_ENTITY_LIST; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithNestedEntityList" ); final Class entityClass = findGeneratedClass( result, "TestFirstEntity" ); @@ -213,11 +207,10 @@ void testSinglePropertyPredicates( final KnownVersion metaModelVersion ) throws .containsExactlyInAnyOrder( e2, e3 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCollectionPropertyPredicates( final KnownVersion metaModelVersion ) throws IOException, ReflectiveOperationException { + @Test + void testCollectionPropertyPredicates() throws IOException, ReflectiveOperationException { final TestAspect aspect = TestAspect.ASPECT_WITH_NESTED_ENTITY_LIST; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithNestedEntityList" ); final Class entityClass = findGeneratedClass( result, "TestFirstEntity" ); diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticClassGenerationResult.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticClassGenerationResult.java index 1b8289c39..302e7080d 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticClassGenerationResult.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticClassGenerationResult.java @@ -22,7 +22,7 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.staticmetamodel.StaticMetaClass; import org.eclipse.esmf.staticmetamodel.StaticProperty; @@ -57,28 +57,23 @@ public void assertMetaModelBaseAttributesForProperties( final String className, assertThat( compilationUnits ).containsKey( className ); final List fields = compilationUnits.get( className ).findAll( FieldDeclaration.class ); - - fields.stream().filter( field -> expectedBaseAttributeArguments.containsKey( field.resolve().getName() ) ) - .forEach( field -> { - final String fieldName = field.resolve().getName(); - final Set expectedArguments = expectedBaseAttributeArguments.get( fieldName ); - final NodeList declarators = field.getVariables(); - assertThat( declarators ).hasSize( 1 ); - - final VariableDeclarator declarator = declarators.get( 0 ); - final Expression metaModelBaseAttributesDeclarationExpression = declarator.getInitializer().get() - .asObjectCreationExpr() - .getArguments().get( 0 ); - final NodeList metaModelBaseAttributesArguments = metaModelBaseAttributesDeclarationExpression - .asMethodCallExpr() - .getArguments(); - - assertThat( metaModelBaseAttributesArguments ).hasSize( expectedArguments.size() ); - - assertThat( metaModelBaseAttributesArguments ).allSatisfy( expression -> { - assertThat( expectedArguments ).containsOnlyOnce( expression.toString() ); - } ); - } ); + for ( final FieldDeclaration field : fields ) { + final String fieldName = field.resolve().getName(); + if ( !expectedBaseAttributeArguments.containsKey( fieldName ) ) { + continue; + } + final Set expectedArguments = expectedBaseAttributeArguments.get( fieldName ); + final NodeList declarators = field.getVariables(); + assertThat( declarators ).hasSize( 1 ); + + final VariableDeclarator declarator = declarators.get( 0 ); + final Expression metaModelBaseAttributesDeclarationExpression = declarator.getInitializer().get() + .asObjectCreationExpr() + .getArguments().get( 0 ); + for ( final String argument : expectedArguments ) { + assertThat( metaModelBaseAttributesDeclarationExpression.toString() ).contains( argument ); + } + } } /** diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelBaseAttributesTest.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelBaseAttributesTest.java index c6e8de7d3..24afcdb87 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelBaseAttributesTest.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelBaseAttributesTest.java @@ -16,45 +16,36 @@ import java.io.IOException; import java.util.Set; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.api.Test; public class StaticMetaModelBaseAttributesTest extends StaticMetaModelGeneratorTest { - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesOfGeneratedProperty( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testMetaModelBaseAttributesOfGeneratedProperty() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BOOLEAN; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final ImmutableSet expectedArguments = ImmutableSet. builder() - .add( "KnownVersion." + KnownVersion.getLatest().toString() ) .add( "AspectModelUrn.fromUrn(NAMESPACE + \"testBoolean\")" ) - .add( "\"testBoolean\"" ) .build(); final ImmutableMap> expectedMetaModelBaseAttributeArguments = ImmutableMap.> builder() .put( "TEST_BOOLEAN", expectedArguments ).build(); - result.assertMetaModelBaseAttributesForProperties( "MetaAspectWithBoolean", - expectedMetaModelBaseAttributeArguments ); + result.assertMetaModelBaseAttributesForProperties( "MetaAspectWithBoolean", expectedMetaModelBaseAttributeArguments ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesOfGeneratedPropertyWithAllAttributes( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testMetaModelBaseAttributesOfGeneratedPropertyWithAllAttributes() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_ALL_BASE_ATTRIBUTES; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); - final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builderFor(\"testBoolean\")" - + ".withMetaModelVersion(KnownVersion." + KnownVersion.getLatest() + ")" + final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builder()" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"testBoolean\"))" + ".withPreferredName(Locale.forLanguageTag(\"de\"), \"Test Boolean\")" + ".withPreferredName(Locale.forLanguageTag(\"en\"), \"Test Boolean\")" @@ -68,16 +59,13 @@ public void testMetaModelBaseAttributesOfGeneratedPropertyWithAllAttributes( fin ImmutableMap. builder().put( "TEST_BOOLEAN", expectedMetaModelBaseAttributeBuilderCall ).build(), 0 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesOfGeneratedPropertyWithPreferredNames( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testMetaModelBaseAttributesOfGeneratedPropertyWithPreferredNames() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_PREFERRED_NAMES; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); - final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builderFor(\"testBoolean\")" - + ".withMetaModelVersion(KnownVersion." + KnownVersion.getLatest() + ")" + final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builder()" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"testBoolean\"))" + ".withPreferredName(Locale.forLanguageTag(\"de\"), \"Test Boolean\")" + ".withPreferredName(Locale.forLanguageTag(\"en\"), \"Test Boolean\")" @@ -87,16 +75,14 @@ public void testMetaModelBaseAttributesOfGeneratedPropertyWithPreferredNames( fi ImmutableMap. builder().put( "TEST_BOOLEAN", expectedMetaModelBaseAttributeBuilderCall ).build(), 0 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesOfGeneratedPropertyWithDescriptions( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testMetaModelBaseAttributesOfGeneratedPropertyWithDescriptions() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_DESCRIPTIONS; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); - final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builderFor(\"testBoolean\")" - + ".withMetaModelVersion(KnownVersion." + KnownVersion.getLatest() + ")" + final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builder()" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"testBoolean\"))" + ".withDescription(Locale.forLanguageTag(\"de\"), \"Test Beschreibung\")" + ".withDescription(Locale.forLanguageTag(\"en\"), \"Test Description\")" @@ -106,16 +92,14 @@ public void testMetaModelBaseAttributesOfGeneratedPropertyWithDescriptions( fina ImmutableMap. builder().put( "TEST_BOOLEAN", expectedMetaModelBaseAttributeBuilderCall ).build(), 0 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMetaModelBaseAttributesOfGeneratedPropertyWithSee( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testMetaModelBaseAttributesOfGeneratedPropertyWithSee() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_SEE; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); - final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builderFor(\"testBoolean\")" - + ".withMetaModelVersion(KnownVersion." + KnownVersion.getLatest() + ")" + final String expectedMetaModelBaseAttributeBuilderCall = "MetaModelBaseAttributes.builder()" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"testBoolean\"))" + ".withSee(\"http://example.com/\")" + ".withSee(\"http://example.com/me\")" @@ -125,18 +109,17 @@ public void testMetaModelBaseAttributesOfGeneratedPropertyWithSee( final KnownVe ImmutableMap. builder().put( "TEST_BOOLEAN", expectedMetaModelBaseAttributeBuilderCall ).build(), 0 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGeneratedMetaModelContainsRequiredMethods( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGeneratedMetaModelContainsRequiredMethods() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BOOLEAN; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final ImmutableMap expectedMethodBodies = ImmutableMap. builder() .put( "getModelClass", "return AspectWithBoolean.class;" ) .put( "getAspectModelUrn", "return AspectModelUrn.fromUrn(MODEL_ELEMENT_URN);" ) - .put( "getMetaModelVersion", "return KnownVersion." + KnownVersion.getLatest().toString() + ";" ) + .put( "getMetaModelVersion", "return KnownVersion.getLatest();" ) .put( "getName", "return \"AspectWithBoolean\";" ) .put( "getProperties", "return Arrays.asList(TEST_BOOLEAN);" ) .put( "getAllProperties", "return getProperties();" ) @@ -148,12 +131,11 @@ public void testGeneratedMetaModelContainsRequiredMethods( final KnownVersion me result.assertMethods( "MetaAspectWithBoolean", expectedMethodBodies ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGeneratedMetaModelContainsOptionalMethods( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGeneratedMetaModelContainsOptionalMethods() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ALL_BASE_ATTRIBUTES; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String getPreferredNamesBody = "return new HashSet<>() {\n" @@ -175,7 +157,7 @@ public void testGeneratedMetaModelContainsOptionalMethods( final KnownVersion me final ImmutableMap expectedMethodBodies = ImmutableMap. builder() .put( "getModelClass", "return AspectWithAllBaseAttributes.class;" ) .put( "getAspectModelUrn", "return AspectModelUrn.fromUrn(MODEL_ELEMENT_URN);" ) - .put( "getMetaModelVersion", "return KnownVersion." + KnownVersion.getLatest().toString() + ";" ) + .put( "getMetaModelVersion", "return KnownVersion.getLatest();" ) .put( "getName", "return \"AspectWithAllBaseAttributes\";" ) .put( "getProperties", "return Arrays.asList(TEST_BOOLEAN);" ) .put( "getAllProperties", "return getProperties();" ) @@ -190,12 +172,11 @@ public void testGeneratedMetaModelContainsOptionalMethods( final KnownVersion me result.assertMethods( "MetaAspectWithAllBaseAttributes", expectedMethodBodies ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGeneratedMetaModelContainsGetPreferredNamesMethod( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGeneratedMetaModelContainsGetPreferredNamesMethod() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PREFERRED_NAMES; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String getPreferredNamesBody = "return new HashSet<>() {\n" @@ -209,7 +190,7 @@ public void testGeneratedMetaModelContainsGetPreferredNamesMethod( final KnownVe final ImmutableMap expectedMethodBodies = ImmutableMap. builder() .put( "getModelClass", "return AspectWithPreferredNames.class;" ) .put( "getAspectModelUrn", "return AspectModelUrn.fromUrn(MODEL_ELEMENT_URN);" ) - .put( "getMetaModelVersion", "return KnownVersion." + KnownVersion.getLatest().toString() + ";" ) + .put( "getMetaModelVersion", "return KnownVersion.getLatest();" ) .put( "getName", "return \"AspectWithPreferredNames\";" ) .put( "getProperties", "return Arrays.asList(TEST_BOOLEAN);" ) .put( "getAllProperties", "return getProperties();" ) @@ -222,12 +203,11 @@ public void testGeneratedMetaModelContainsGetPreferredNamesMethod( final KnownVe result.assertMethods( "MetaAspectWithPreferredNames", expectedMethodBodies ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGeneratedMetaModelContainsGetDescriptionsMethod( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGeneratedMetaModelContainsGetDescriptionsMethod() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_DESCRIPTIONS; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String getDescriptionsBody = "return new HashSet<>() {\n" @@ -241,7 +221,7 @@ public void testGeneratedMetaModelContainsGetDescriptionsMethod( final KnownVers final ImmutableMap expectedMethodBodies = ImmutableMap. builder() .put( "getModelClass", "return AspectWithDescriptions.class;" ) .put( "getAspectModelUrn", "return AspectModelUrn.fromUrn(MODEL_ELEMENT_URN);" ) - .put( "getMetaModelVersion", "return KnownVersion." + KnownVersion.getLatest().toString() + ";" ) + .put( "getMetaModelVersion", "return KnownVersion.getLatest();" ) .put( "getName", "return \"AspectWithDescriptions\";" ) .put( "getProperties", "return Arrays.asList(TEST_BOOLEAN);" ) .put( "getAllProperties", "return getProperties();" ) @@ -254,18 +234,17 @@ public void testGeneratedMetaModelContainsGetDescriptionsMethod( final KnownVers result.assertMethods( "MetaAspectWithDescriptions", expectedMethodBodies ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testGeneratedMetaModelContainsGetSeeMethod( final KnownVersion metaModelVersion ) throws IOException { + @Test + public void testGeneratedMetaModelContainsGetSeeMethod() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_SEE; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion ) ); + .apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final ImmutableMap expectedMethodBodies = ImmutableMap. builder() .put( "getModelClass", "return AspectWithPropertyWithSee.class;" ) .put( "getAspectModelUrn", "return AspectModelUrn.fromUrn(MODEL_ELEMENT_URN);" ) - .put( "getMetaModelVersion", "return KnownVersion." + KnownVersion.getLatest().toString() + ";" ) + .put( "getMetaModelVersion", "return KnownVersion.getLatest();" ) .put( "getName", "return \"AspectWithPropertyWithSee\";" ) .put( "getProperties", "return Arrays.asList(TEST_BOOLEAN);" ) .put( "getAllProperties", "return getProperties();" ) diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelGeneratorTest.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelGeneratorTest.java index edce3e141..cc51958ad 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelGeneratorTest.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelGeneratorTest.java @@ -22,18 +22,14 @@ import org.eclipse.esmf.aspectmodel.java.metamodel.StaticMetaModelJavaGenerator; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; import org.eclipse.esmf.aspectmodel.java.types.Either; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.esmf.metamodel.Characteristic; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.staticmetamodel.StaticContainerProperty; import org.eclipse.esmf.staticmetamodel.StaticProperty; import org.eclipse.esmf.staticmetamodel.StaticUnitProperty; import org.eclipse.esmf.staticmetamodel.constraint.StaticConstraintContainerProperty; import org.eclipse.esmf.staticmetamodel.constraint.StaticConstraintProperty; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; import org.eclipse.esmf.test.TestSharedAspect; @@ -42,42 +38,41 @@ import com.google.common.reflect.TypeParameter; import com.google.common.reflect.TypeToken; -abstract class StaticMetaModelGeneratorTest extends MetaModelVersions { - Collection getGenerators( final TestAspect testAspect, final KnownVersion version, final boolean executeLibraryMacros, - final File templateLibFile ) { - final VersionedModel model = TestResources.getModel( testAspect, version ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); +abstract class StaticMetaModelGeneratorTest { + Collection getGenerators( final TestAspect testAspect, final boolean executeLibraryMacros, final File templateLibFile ) { + final AspectModel aspectModel = TestResources.load( testAspect ); + final Aspect aspect = aspectModel.aspect(); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( false ) .executeLibraryMacros( executeLibraryMacros ) .templateLibFile( templateLibFile ) - .packageName( aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).get() ) + .packageName( aspect.urn().getNamespace() ) .build(); final JavaGenerator pojoGenerator = new AspectModelJavaGenerator( aspect, config ); final JavaGenerator staticGenerator = new StaticMetaModelJavaGenerator( aspect, config ); return List.of( pojoGenerator, staticGenerator ); } - Collection getGenerators( final TestAspect testAspect, final KnownVersion version ) { - final VersionedModel model = TestResources.getModel( testAspect, version ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); + Collection getGenerators( final TestAspect testAspect ) { + final AspectModel aspectModel = TestResources.load( testAspect ); + final Aspect aspect = aspectModel.aspect(); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( false ) .executeLibraryMacros( false ) - .packageName( aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).get() ) + .packageName( aspect.urn().getNamespace() ) .build(); final JavaGenerator pojoGenerator = new AspectModelJavaGenerator( aspect, config ); final JavaGenerator staticGenerator = new StaticMetaModelJavaGenerator( aspect, config ); return List.of( pojoGenerator, staticGenerator ); } - Collection getGenerators( final TestSharedAspect testAspect, final KnownVersion version ) { - final VersionedModel model = TestResources.getModel( testAspect, version ).get(); - final Aspect aspect = AspectModelLoader.getSingleAspectUnchecked( model ); + Collection getGenerators( final TestSharedAspect testAspect ) { + final AspectModel aspectModel = TestResources.load( testAspect ); + final Aspect aspect = aspectModel.aspect(); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( false ) .executeLibraryMacros( false ) - .packageName( aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).get() ) + .packageName( aspect.urn().getNamespace() ) .build(); final JavaGenerator pojoGenerator = new AspectModelJavaGenerator( aspect, config ); final JavaGenerator staticGenerator = new StaticMetaModelJavaGenerator( aspect, config ); diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelJavaGeneratorTest.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelJavaGeneratorTest.java index d5ee0e76e..e97090302 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelJavaGeneratorTest.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/StaticMetaModelJavaGeneratorTest.java @@ -25,22 +25,22 @@ import java.util.HashMap; import java.util.List; import java.util.Optional; +import java.util.regex.Pattern; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; -import org.eclipse.esmf.characteristic.impl.DefaultList; -import org.eclipse.esmf.characteristic.impl.DefaultMeasurement; -import org.eclipse.esmf.metamodel.datatypes.Curie; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultList; +import org.eclipse.esmf.metamodel.characteristic.impl.DefaultMeasurement; +import org.eclipse.esmf.metamodel.datatype.Curie; import org.eclipse.esmf.metamodel.impl.DefaultCharacteristic; -import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestSharedAspect; import com.github.javaparser.ast.CompilationUnit; import com.google.common.collect.ImmutableMap; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; class StaticMetaModelJavaGeneratorTest extends StaticMetaModelGeneratorTest { @@ -52,8 +52,15 @@ class StaticMetaModelJavaGeneratorTest extends StaticMetaModelGeneratorTest { @ParameterizedTest @EnumSource( value = TestAspect.class ) void testCodeGeneration( final TestAspect testAspect ) { - assertThatCode( () -> TestContext.generateStaticAspectCode() - .apply( getGenerators( testAspect, KnownVersion.getLatest() ) ) ).doesNotThrowAnyException(); + assertThatCode( () -> { + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( testAspect ) ); + final Pattern uninterpolatedTemplate = Pattern.compile( "\\$[a-zA-Z]" ); + result.compilationUnits.values().forEach( compilationUnit -> { + // Check that all template variables have been replaced. If Velocity fails to insert a value (because evaluation of the + // expression throws an exception), it leaves the template unchanged, i.e., leaving literal $ characters + assertThat( compilationUnit.toString() ).doesNotContainPattern( uninterpolatedTemplate ); + } ); + } ).doesNotThrowAnyException(); } /** @@ -65,14 +72,13 @@ void testCodeGeneration( final TestAspect testAspect ) { @EnumSource( value = TestSharedAspect.class ) void testCodeGenerationSharedAspect( final TestSharedAspect testAspect ) { assertThatCode( () -> TestContext.generateStaticAspectCode() - .apply( getGenerators( testAspect, KnownVersion.getLatest() ) ) ).doesNotThrowAnyException(); + .apply( getGenerators( testAspect ) ) ).doesNotThrowAnyException(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithOptionalProperties( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithOptionalProperties() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_OPTIONAL_PROPERTIES_WITH_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithOptionalPropertiesWithEntity" ); final Class entityClass = findGeneratedClass( result, "TestEntity" ); @@ -97,11 +103,10 @@ void testGenerateStaticMetaModelWithOptionalProperties( final KnownVersion metaM new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithExtendedEnums( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithExtendedEnums() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENUMS; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithExtendedEnums" ); final Class evaluationResultClass = findGeneratedClass( result, "EvaluationResult" ); @@ -129,11 +134,10 @@ void testGenerateStaticMetaModelWithExtendedEnums( final KnownVersion metaModelV .build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithEither( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithEither() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_EITHER_WITH_COMPLEX_TYPES; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class leftEntityClass = findGeneratedClass( result, "LeftEntity" ); final Class rightEntityClass = findGeneratedClass( result, "RightEntity" ); @@ -155,11 +159,10 @@ void testGenerateStaticMetaModelWithEither( final KnownVersion metaModelVersion new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithMeasurement( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithMeasurement() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_MEASUREMENT; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithMeasurement", fieldAssertions( "MetaAspectWithMeasurement" ) @@ -168,11 +171,10 @@ void testGenerateStaticMetaModelWithMeasurement( final KnownVersion metaModelVer new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testGenerateStaticMetaModelWithExtendedEntityAssertProperties( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithExtendedEntityAssertProperties() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_EXTENDED_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class testEntityClass = findGeneratedClass( result, "TestEntity" ); @@ -184,11 +186,10 @@ void testGenerateStaticMetaModelWithExtendedEntityAssertProperties( final KnownV new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithRecursiveAspectWithOptional( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithRecursiveAspectWithOptional() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_RECURSIVE_PROPERTY_WITH_OPTIONAL; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithRecursivePropertyWithOptional" ); final Class testEntityClass = findGeneratedClass( result, "TestEntity" ); @@ -204,11 +205,10 @@ void testGenerateStaticMetaModelWithRecursiveAspectWithOptional( final KnownVers .build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithDuration( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithDuration() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_DURATION; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithDuration", fieldAssertions( "MetaAspectWithDuration" ) @@ -217,11 +217,10 @@ void testGenerateStaticMetaModelWithDuration( final KnownVersion metaModelVersio new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithCurie( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithCurie() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_CURIE; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithCurie" ); @@ -233,11 +232,10 @@ void testGenerateStaticMetaModelWithCurie( final KnownVersion metaModelVersion ) new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithBinary( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithBinary() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BINARY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithBinary", fieldAssertions( "MetaAspectWithBinary" ) @@ -246,11 +244,10 @@ void testGenerateStaticMetaModelWithBinary( final KnownVersion metaModelVersion new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithState( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithState() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_STATE; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithState" ); final Class testStateClass = findGeneratedClass( result, "TestState" ); @@ -263,11 +260,10 @@ void testGenerateStaticMetaModelWithState( final KnownVersion metaModelVersion ) .build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "latestVersion" ) - void testGenerateStaticMetaModelWithExtendedEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithExtendedEntity() throws IOException { final TestSharedAspect aspect = TestSharedAspect.ASPECT_WITH_EXTENDED_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 8 ); final String methodName = "getAllProperties"; final boolean expectOverride = true; @@ -289,11 +285,10 @@ void testGenerateStaticMetaModelWithExtendedEntity( final KnownVersion metaModel getPropertiesMetaTestEntity ); } - @ParameterizedTest - @MethodSource( value = "latestVersion" ) - void testGenerateStaticMetaModelWithConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithConstraints() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_CONSTRAINTS; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithConstraints" ); @@ -324,11 +319,10 @@ void testGenerateStaticMetaModelWithConstraints( final KnownVersion metaModelVer DefaultList.class ) ).build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithStructuredValue( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithStructuredValue() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_NUMERIC_STRUCTURED_VALUE; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithNumericStructuredValue" ); @@ -343,11 +337,10 @@ void testGenerateStaticMetaModelWithStructuredValue( final KnownVersion metaMode .put( "DATE", TypeTokens.staticProperty( aspectClass, XMLGregorianCalendar.class ) ).build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithErrorCollection( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithErrorCollection() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ERROR_COLLECTION; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithErrorCollection" ); final Class errorEntityClass = findGeneratedClass( result, "Error" ); @@ -369,12 +362,10 @@ void testGenerateStaticMetaModelWithErrorCollection( final KnownVersion metaMode new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithCollectionAndSimpleElementCharacteristic( final KnownVersion metaModelVersion ) - throws IOException { + @Test + void testGenerateStaticMetaModelWithCollectionAndSimpleElementCharacteristic() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COLLECTION_AND_SIMPLE_ELEMENT_CHARACTERISTIC; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithCollectionAndSimpleElementCharacteristic", @@ -384,11 +375,10 @@ void testGenerateStaticMetaModelWithCollectionAndSimpleElementCharacteristic( fi TypeTokens.collection( String.class ) ) ).build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithCollectionAndElementCharacteristic( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithCollectionAndElementCharacteristic() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COLLECTION_AND_ELEMENT_CHARACTERISTIC; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithCollectionAndElementCharacteristic" ); final Class testEntityClass = findGeneratedClass( result, "TestEntity" ); @@ -402,11 +392,10 @@ void testGenerateStaticMetaModelWithCollectionAndElementCharacteristic( final Kn .build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithFixedPointConstraints( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithFixedPointConstraints() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_FIXED_POINT; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithFixedPoint", @@ -416,11 +405,10 @@ void testGenerateStaticMetaModelWithFixedPointConstraints( final KnownVersion me DefaultMeasurement.class ) ).build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithComplexEntityCollectionEnumeration( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithComplexEntityCollectionEnumeration() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENTITY_COLLECTION_ENUM; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final Class aspectClass = findGeneratedClass( result, "AspectWithComplexEntityCollectionEnum" ); final Class enumerationClass = findGeneratedClass( result, "MyEnumerationOne" ); @@ -445,42 +433,32 @@ void testGenerateStaticMetaModelWithComplexEntityCollectionEnumeration( final Kn .build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCharacteristicInstantiationForEnums( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testCharacteristicInstantiationForEnums() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ENUM_AND_OPTIONAL_ENUM_PROPERTIES; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 3 ); - final String latestMetaModelVersion = KnownVersion.getLatest().toString(); final String expectedTestPropertyCharacteristicConstructorCall = - "new DefaultEnumeration(MetaModelBaseAttributes.from(KnownVersion." + latestMetaModelVersion - + ", AspectModelUrn.fromUrn(NAMESPACE + " - + "\"TestEnumeration\"), " - + "\"TestEnumeration\"), new DefaultScalar(\"http://www.w3.org/2001/XMLSchema#integer\", KnownVersion." - + latestMetaModelVersion + "), new " - + "ArrayList() {\n" - + "\n" - + " {\n" - + " add(new DefaultScalarValue(new BigInteger(\"1\"), new DefaultScalar(\"http://www.w3" - + ".org/2001/XMLSchema#integer\", KnownVersion." + latestMetaModelVersion + ")));\n" - + " add(new DefaultScalarValue(new BigInteger(\"2\"), new DefaultScalar(\"http://www.w3" - + ".org/2001/XMLSchema#integer\", KnownVersion." + latestMetaModelVersion + ")));\n" - + " add(new DefaultScalarValue(new BigInteger(\"3\"), new DefaultScalar(\"http://www.w3" - + ".org/2001/XMLSchema#integer\", KnownVersion." + latestMetaModelVersion + ")));\n" - + " }\n" - + "})"; + """ + new DefaultEnumeration(MetaModelBaseAttributes.builder().withUrn(AspectModelUrn.fromUrn(NAMESPACE + "TestEnumeration")).build(), new DefaultScalar("http://www.w3.org/2001/XMLSchema#integer"), new ArrayList() { + + { + add(new DefaultScalarValue(new BigInteger("1"), new DefaultScalar("http://www.w3.org/2001/XMLSchema#integer"))); + add(new DefaultScalarValue(new BigInteger("2"), new DefaultScalar("http://www.w3.org/2001/XMLSchema#integer"))); + add(new DefaultScalarValue(new BigInteger("3"), new DefaultScalar("http://www.w3.org/2001/XMLSchema#integer"))); + } + })"""; result.assertConstructorArgumentForProperties( "MetaAspectWithEnumAndOptionalEnumProperties", ImmutableMap. builder().put( "TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ) .put( "OPTIONAL_TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ).build(), 1 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithPropertyWithPayloadName( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testAspectWithPropertyWithPayloadName() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_PROPERTY_WITH_PAYLOAD_NAME; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String expectedPayloadNameArgument = "Optional.of(\"test\")"; @@ -489,11 +467,10 @@ void testAspectWithPropertyWithPayloadName( final KnownVersion metaModelVersion ImmutableMap. builder().put( "TEST_PROPERTY", expectedPayloadNameArgument ).build(), 5 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithBlankNode( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testAspectWithBlankNode() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_BLANK_NODE; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); result.assertFields( "MetaAspectWithBlankNode", @@ -502,70 +479,62 @@ void testAspectWithBlankNode( final KnownVersion metaModelVersion ) throws IOExc TypeTokens.collection( String.class ) ) ).build(), new HashMap<>() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCharacteristicInstantiationForQuantifiableWithoutUnit( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testCharacteristicInstantiationForQuantifiableWithoutUnit() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_QUANTIFIABLE_WITHOUT_UNIT; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String expectedTestPropertyCharacteristicConstructorCall = - "new DefaultQuantifiable(MetaModelBaseAttributes" + ".builderFor(\"TestQuantifiable\")" + ".withMetaModelVersion(KnownVersion." - + KnownVersion.getLatest() + ")" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"TestQuantifiable\"))" + "new DefaultQuantifiable(MetaModelBaseAttributes" + ".builder()" + + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"TestQuantifiable\"))" + ".withPreferredName(Locale.forLanguageTag(\"en\"), \"Test Quantifiable\")" + ".withDescription(Locale.forLanguageTag(\"en\"), \"This is a test Quantifiable\")" + ".withSee(\"http://example.com/\").build()," - + " new DefaultScalar(\"http://www.w3.org/2001/XMLSchema#float\", KnownVersion." + KnownVersion.getLatest() + ")," + + " new DefaultScalar(\"http://www.w3.org/2001/XMLSchema#float\")," + " Optional.empty())"; result.assertConstructorArgumentForProperties( "MetaAspectWithQuantifiableWithoutUnit", ImmutableMap. builder().put( "TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ).build(), 1 ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCharacteristicInstantiationForQuantifiableWithUnit( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testCharacteristicInstantiationForQuantifiableWithUnit() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_QUANTIFIABLE_WITH_UNIT; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 2 ); final String expectedTestPropertyCharacteristicConstructorCall = - "new DefaultQuantifiable(MetaModelBaseAttributes.from(KnownVersion." + KnownVersion.getLatest() + "," - + " AspectModelUrn.fromUrn(NAMESPACE + \"TestQuantifiable\"), \"TestQuantifiable\")," - + " new DefaultScalar(\"http://www.w3.org/2001/XMLSchema#float\", KnownVersion." + KnownVersion.getLatest() - + "), Units.fromName(\"percent\"))"; + "new DefaultQuantifiable(MetaModelBaseAttributes.builder().withUrn(" + + "AspectModelUrn.fromUrn(NAMESPACE + \"TestQuantifiable\")).build()," + + " new DefaultScalar(\"http://www.w3.org/2001/XMLSchema#float\"), Units.fromName(\"percent\"))"; result.assertConstructorArgumentForProperties( "MetaAspectWithQuantifiableWithUnit", ImmutableMap. builder().put( "TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ).build(), 1 ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testGenerateStaticMetaModelForAspectModelWithAbstractEntity( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelForAspectModelWithAbstractEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_ABSTRACT_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 6 ); - final String latestMetaModelVersion = KnownVersion.getLatest().toString(); final String expectedTestPropertyCharacteristicConstructorCall = - "new DefaultSingleEntity(MetaModelBaseAttributes.builderFor(\"EntityCharacteristic\")" - + ".withMetaModelVersion(KnownVersion." + latestMetaModelVersion - + ").withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"EntityCharacteristic\"))" + "new DefaultSingleEntity(MetaModelBaseAttributes.builder()" + + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"EntityCharacteristic\"))" + ".withPreferredName(Locale" + ".forLanguageTag(\"en\"), \"Test Entity Characteristic\").withDescription(Locale.forLanguageTag(\"en\"), \"This is a " + "test Entity " - + "Characteristic\").withSee(\"http://example.com/\").build(), DefaultEntity.createDefaultEntity" - + "(MetaModelBaseAttributes.builderFor" - + "(\"ExtendingTestEntity\").withMetaModelVersion(KnownVersion." + latestMetaModelVersion - + ").withUrn(AspectModelUrn.fromUrn(NAMESPACE + " + + "Characteristic\").withSee(\"http://example.com/\").build(), DefaultEntity.createDefaultEntity(" + + "MetaModelBaseAttributes.builder()" + + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + " + "\"ExtendingTestEntity\"))" + ".withPreferredName(Locale.forLanguageTag(\"en\"), \"Test Entity\").withDescription(Locale.forLanguageTag(\"en\"), " + "\"This is a test entity\")" + ".build(), MetaExtendingTestEntity.INSTANCE.getProperties(), Optional.of(DefaultAbstractEntity" + ".createDefaultAbstractEntity" - + "(MetaModelBaseAttributes.builderFor(\"AbstractTestEntity\").withMetaModelVersion(KnownVersion." - + latestMetaModelVersion + ").withUrn" - + "(AspectModelUrn.fromUrn" + + "(MetaModelBaseAttributes.builder()" + + ".withUrn(AspectModelUrn.fromUrn" + "(NAMESPACE + \"AbstractTestEntity\")).withPreferredName(Locale.forLanguageTag(\"en\"), \"Abstract Test Entity\")" + ".withDescription(Locale" + ".forLanguageTag(\"en\"), \"This is a abstract test entity\").build(), MetaAbstractTestEntity.INSTANCE.getProperties" @@ -576,24 +545,20 @@ void testGenerateStaticMetaModelForAspectModelWithAbstractEntity( final KnownVer ImmutableMap. builder().put( "TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ).build(), 1 ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testGenerateStaticMetaModelForAspectModelWithCollectionWithAbstractEntity( final KnownVersion metaModelVersion ) - throws IOException { + @Test + void testGenerateStaticMetaModelForAspectModelWithCollectionWithAbstractEntity() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COLLECTION_WITH_ABSTRACT_ENTITY; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertNumberOfFiles( 6 ); - final String latestMetaModelVersion = KnownVersion.getLatest().toString(); final String expectedTestPropertyCharacteristicConstructorCall = - "new DefaultCollection(MetaModelBaseAttributes.builderFor(\"EntityCollectionCharacteristic\").withMetaModelVersion" - + "(KnownVersion." + latestMetaModelVersion + ")" + "new DefaultCollection(MetaModelBaseAttributes.builder()" + ".withUrn(AspectModelUrn.fromUrn(NAMESPACE + \"EntityCollectionCharacteristic\")).withDescription(Locale" + ".forLanguageTag(\"en\"), " + "\"This is an entity collection characteristic\").build(), Optional.of(DefaultAbstractEntity" + ".createDefaultAbstractEntity(" - + "MetaModelBaseAttributes.builderFor(\"AbstractTestEntity\").withMetaModelVersion(KnownVersion." + latestMetaModelVersion - + ").withUrn(" + + "MetaModelBaseAttributes.builder()" + + ".withUrn(" + "AspectModelUrn.fromUrn(NAMESPACE + \"AbstractTestEntity\")).withDescription(Locale.forLanguageTag(\"en\"), " + "\"This is an abstract test entity\").build(), MetaAbstractTestEntity.INSTANCE.getProperties(), Optional.empty(), " + "List.of(AspectModelUrn.fromUrn(\"urn:samm:org.eclipse.esmf.test:1.0.0#ExtendingTestEntity\")))), Optional.empty())"; @@ -602,11 +567,10 @@ void testGenerateStaticMetaModelForAspectModelWithCollectionWithAbstractEntity( ImmutableMap. builder().put( "TEST_PROPERTY", expectedTestPropertyCharacteristicConstructorCall ).build(), 1 ); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testGenerateStaticMetaModelWithoutFileHeader( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithoutFileHeader() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); final CompilationUnit aspectClass = result.compilationUnits.get( TestAspect.ASPECT_WITH_COMPLEX_ENUM.getName() ); assertThat( aspectClass.getComment() ).isEmpty(); final CompilationUnit enumeration = result.compilationUnits.get( "EvaluationResults" ); @@ -619,15 +583,14 @@ void testGenerateStaticMetaModelWithoutFileHeader( final KnownVersion metaModelV assertThat( staticEntity.getComment() ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testGenerateAspectWithFileHeader( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateAspectWithFileHeader() throws IOException { final String currentWorkingDirectory = System.getProperty( "user.dir" ); final File templateLibFile = Path.of( currentWorkingDirectory, "/templates", "/test-macro-lib.vm" ).toFile(); final TestAspect aspect = TestAspect.ASPECT_WITH_COMPLEX_ENUM; final StaticClassGenerationResult result = TestContext.generateStaticAspectCode() - .apply( getGenerators( aspect, metaModelVersion, true, templateLibFile ) ); + .apply( getGenerators( aspect, true, templateLibFile ) ); final int currentYear = LocalDate.now().getYear(); final String expectedCopyright = String.format( "Copyright (c) %s Test Inc. All rights reserved", currentYear ); @@ -638,11 +601,10 @@ void testGenerateAspectWithFileHeader( final KnownVersion metaModelVersion ) thr result.assertCopyright( "MetaEvaluationResult", expectedCopyright ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testGenerateStaticMetaModelWithUmlauts( final KnownVersion metaModelVersion ) throws IOException { + @Test + void testGenerateStaticMetaModelWithUmlauts() throws IOException { final TestAspect aspect = TestAspect.ASPECT_WITH_UMLAUT_DESCRIPTION; - final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect, metaModelVersion ) ); + final StaticClassGenerationResult result = TestContext.generateStaticAspectCode().apply( getGenerators( aspect ) ); result.assertMethodBody( "MetaAspectWithUmlautDescription", "getDescriptions", true, Optional.empty(), 0, List.of( diff --git a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/customconstraint/TestAspect.java b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/customconstraint/TestAspect.java index 3d671320b..a231105f4 100644 --- a/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/customconstraint/TestAspect.java +++ b/core/esmf-aspect-model-java-generator/src/test/java/org/eclipse/esmf/aspectmodel/java/customconstraint/TestAspect.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.java.customconstraint; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; +import org.eclipse.esmf.metamodel.BoundDefinition; public class TestAspect { diff --git a/core/esmf-aspect-model-resolver/README.md b/core/esmf-aspect-model-resolver/README.md deleted file mode 100644 index 95ad9c508..000000000 --- a/core/esmf-aspect-model-resolver/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# Aspect Model Resolver - -The Aspect Model Resolver provides functionality to resolve an Aspect Model URN. - -The following strategies are provides in order to resolve Aspect Models -* ```FileSystemStrategy``` resolves an Aspect Model for a given file path in the local file system -* ```EitherStrategy``` resolves an Aspect Model by trying two other strategies -* ```ClasspathStrategy``` resolves an Aspect Model for a given Aspect Model URN - from the class path - -## Aspect Model folder structure -The ```AspectModelResolver``` assumes the following directory structure when resolving Aspect Models residing in files in the local file system: -```/${directory-name}/${element-version}/${element-name}.ttl``` - -Where - -* ```${directory-name}``` is any directory. This directory must be given to the ```ClasspathStrategy``` and the ```FileSystemStrategy``` as the ```modelsRoot```. -* ```${element-version}``` the version of the Aspect Model element defined in the given Turtle file, e.g. ```1.0.0``` -* ```${element-name}``` the name of the Aspect Model element defined in the given Turtle file, e.g. ```Errors``` - -## Using the ```AspectModelResolver``` - -The following examples assumes an Aspect model in the given directory structure: -```/foo/1.0.0/Test.ttl```. - -To obtain the resolved raw RDF model: - -```java - - -AspectModelUrn aspectModelUrn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.samm:1.0.0#Test" ); - Path modelsRoot = Paths.get("/foo"); - AspectModelResolver resolver = new AspectModelResolver(); - - resolver.resolveAspectModel( new FileSystemStrategy( modelsRoot), aspectModelUrn ).forEach( versionedModel -> { - // Get the RDF model - Model model = versionedModel.getModel(); - - // Get the meta model version used in the Aspect - KnownVersion version = versionedModel.getVersion(); - - // ... - }); -``` - -To obtain an instance of the Java representation of an Aspect model -(a ```org.eclipse.esmf.metamodel.Aspect```): - -```java - - -import loader.org.eclipse.esmf.metamodel.AspectModelLoader; - -AspectModelUrn aspectModelUrn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.samm:1.0.0#Test" ); - Path modelsRoot = Paths.get("/foo"); - AspectModelResolver resolver = new AspectModelResolver(); - - resolver.resolveAspectModel( new FileSystemStrategy(modelsRoot), aspectModelUrn ) - .flatMap( AspectModelLoader::fromVersionedModel ) - .onFailure( throwable -> { /* something went wrong while loading the model */ } - .forEach(aspect -> { - // Get the meta model version used in the Aspect - KnownVersion version = aspect.getMetaModelVersion(); - - // ... e.g. aspect.getProperties().stream().forEach( ... ) - }); -``` diff --git a/core/esmf-aspect-model-resolver/pom.xml b/core/esmf-aspect-model-resolver/pom.xml deleted file mode 100644 index 7f649c1c4..000000000 --- a/core/esmf-aspect-model-resolver/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - org.eclipse.esmf - esmf-sdk-parent - DEV-SNAPSHOT - ../../pom.xml - - 4.0.0 - - esmf-aspect-model-resolver - ESMF Aspect Model Resolver - jar - - - - org.eclipse.esmf - esmf-semantic-aspect-meta-model - - - org.apache.jena - jena-core - - - org.eclipse.esmf - esmf-aspect-model-urn - - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - - - org.eclipse.esmf - esmf-aspect-meta-model-version-migrator - - - - - org.junit.jupiter - junit-jupiter - test - - - org.assertj - assertj-core - test - - - org.assertj - assertj-vavr - test - - - org.eclipse.esmf - esmf-test-aspect-models - test - - - diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AbstractResolutionStrategy.java b/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AbstractResolutionStrategy.java deleted file mode 100644 index f0d9bb222..000000000 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AbstractResolutionStrategy.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; - -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; - -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; - -/** - * Abstract base class for the implementation of {@link ResolutionStrategy}s. - */ -public abstract class AbstractResolutionStrategy implements ResolutionStrategy { - /** - * Loads an Aspect model from a resolveable URI - * - * @param uri The URI - * @return The model - */ - protected Try loadFromUri( final URI uri ) { - try { - return loadFromUrl( uri.toURL() ); - } catch ( final MalformedURLException exception ) { - return Try.failure( exception ); - } - } - - /** - * Loads an Aspect model from a resolveable URL - * - * @param url The URL - * @return The model - */ - protected Try loadFromUrl( final URL url ) { - return Try.ofSupplier( () -> TurtleLoader.openUrl( url ) ).flatMap( TurtleLoader::loadTurtle ); - } -} diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolver.java b/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolver.java deleted file mode 100644 index 30c16ef6e..000000000 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolver.java +++ /dev/null @@ -1,513 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver; - -import static io.vavr.API.$; -import static io.vavr.API.Case; -import static io.vavr.Predicates.instanceOf; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Stack; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.fs.FlatModelsRoot; -import org.eclipse.esmf.aspectmodel.resolver.fs.StructuredModelsRoot; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.urn.ElementType; -import org.eclipse.esmf.aspectmodel.urn.UrnSyntaxException; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorFactory; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorServiceLoader; -import org.eclipse.esmf.aspectmodel.versionupdate.migrator.BammUriRewriter; -import org.eclipse.esmf.samm.KnownVersion; - -import com.google.common.collect.Streams; -import io.vavr.CheckedFunction1; -import io.vavr.Value; -import io.vavr.control.Option; -import io.vavr.control.Try; -import org.apache.commons.io.FilenameUtils; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; -import org.apache.jena.vocabulary.XSD; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Provides facilities for loading an Aspect model and resolving referenced meta model elements and - * model elements from other Aspect models. - */ -public class AspectModelResolver { - private static final Logger LOG = LoggerFactory.getLogger( AspectModelResolver.class ); - - private final MigratorService migratorService = MigratorServiceLoader.getInstance().getMigratorService(); - private final BammUriRewriter bamm100UriRewriter = new BammUriRewriter( BammUriRewriter.BammVersion.BAMM_1_0_0 ); - private final BammUriRewriter bamm200UriRewriter = new BammUriRewriter( BammUriRewriter.BammVersion.BAMM_2_0_0 ); - - /** - * Returns all valid model URNs for Aspects and model elements in a model. - * - * @param model The RDF model - * @return The set of URNs - */ - public static Set getAllUrnsInModel( final Model model ) { - return Streams.stream( model.listStatements().mapWith( statement -> { - final Stream subjectUri = statement.getSubject().isURIResource() - ? Stream.of( statement.getSubject().getURI() ) - : Stream.empty(); - final Stream propertyUri = Stream.of( statement.getPredicate().getURI() ); - final Stream objectUri = statement.getObject().isURIResource() - ? Stream.of( statement.getObject().asResource().getURI() ) - : Stream.empty(); - - return Stream.of( subjectUri, propertyUri, objectUri ) - .flatMap( Function.identity() ) - .map( AspectModelResolver::resolveSammUrn ) - .flatMap( Value::toJavaStream ); - } ) ).flatMap( Function.identity() ).collect( Collectors.toSet() ); - } - - /** - * Tries to resolve the given SAMM URN {@link AspectModelUrn}. - * - * @param urn The Aspect (meta) model URN - * @return The {@link String} if it is resolvable, an {@link UrnSyntaxException} otherwise - */ - private static Try resolveSammUrn( final String urn ) { - try { - AspectModelUrn.fromUrn( urn ); - return Try.success( urn ); - } catch ( final UrnSyntaxException exception ) { - return Try.failure( exception ); - } - } - - /** - * Method to resolve a given {@link AspectModelUrn} using a suitable {@link ResolutionStrategy}. - * This creates the closure (merged model) of all referenced models and the corresponding meta model. - * - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param input the input to be resolved by the strategy - * @return the resolved model on success - */ - public Try resolveAspectModel( final ResolutionStrategy resolutionStrategy, final AspectModelUrn input ) { - return resolveAspectModel( resolutionStrategy, List.of( input ) ); - } - - /** - * Method to load an Aspect Model from an input stream, and resolve it using a suitable {@link ResolutionStrategy}. - * - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param inputStream the inputs stream to read the RDF/Turtle representation from - * @return the resolved model on success - */ - public Try resolveAspectModel( final ResolutionStrategy resolutionStrategy, final InputStream inputStream ) { - return TurtleLoader.loadTurtle( inputStream ).flatMap( model -> resolveAspectModel( resolutionStrategy, model ) ); - } - - /** - * Method to load an Aspect Model from a string, and resolve it using a suitable {@link ResolutionStrategy}. - * - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param modelContent a string containing the RDF/Turtle representation - * @return the resolved model on success - */ - public Try resolveAspectModel( final ResolutionStrategy resolutionStrategy, final String modelContent ) { - return resolveAspectModel( resolutionStrategy, new ByteArrayInputStream( modelContent.getBytes( StandardCharsets.UTF_8 ) ) ); - } - - /** - * Method to resolve a given aspect model. - * - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param model the initial aspect model - * @return the resolved model on success - */ - public Try resolveAspectModel( final ResolutionStrategy resolutionStrategy, final Model model ) { - return resolveAspectModel( model, resolutionStrategy, urnsToResolve( model, model ) ); - } - - /** - * Method to resolve multiple {@link AspectModelUrn}s using a suitable {@link ResolutionStrategy}. - * This creates the closure (merged model) of all referenced models and the corresponding meta model. - * - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param input the input to be resolved by the strategy - * @return the resolved model on success - */ - public Try resolveAspectModel( final ResolutionStrategy resolutionStrategy, final List input ) { - return resolveAspectModel( ModelFactory.createDefaultModel(), resolutionStrategy, input ); - } - - /** - * Method to resolve multiple {@link AspectModelUrn}s using a suitable {@link ResolutionStrategy} against an inital model. - * This creates the closure (merged model) of all referenced models and the corresponding meta model. - * - * @param initialModel the initial model - * @param resolutionStrategy the strategy to resolve input URNs to RDF models - * @param input the input to resolved by the strategy - * @return the resolved model on success - */ - public Try resolveAspectModel( final Model initialModel, final ResolutionStrategy resolutionStrategy, - final List input ) { - final Try mergedModel = resolve( initialModel, input, resolutionStrategy ) - .map( bamm100UriRewriter::migrate ) - .map( bamm200UriRewriter::migrate ); - - if ( mergedModel.isFailure() ) { - if ( mergedModel.getCause() instanceof final FileNotFoundException fileNotFoundException ) { - final String failedUrns = input.stream() - .filter( urn -> !urn.getElementType().equals( ElementType.META_MODEL ) ) - .filter( urn -> !urn.getElementType().equals( ElementType.CHARACTERISTIC ) ) - .filter( urn -> !urn.getElementType().equals( ElementType.ENTITY ) ) - .filter( urn -> !urn.getElementType().equals( ElementType.UNIT ) ) - .map( AspectModelUrn::toString ) - .collect( Collectors.joining( ", " ) ); - LOG.debug( "Could not resolve {}", failedUrns, fileNotFoundException ); - return Try.failure( new ModelResolutionException( "Could not resolve " + failedUrns, fileNotFoundException ) ); - } - return Try.failure( mergedModel.getCause() ); - } - - final AspectMetaModelResourceResolver resourceResolver = - migratorService.getSdsMigratorFactory().createAspectMetaModelResourceResolver(); - - final Set usedMetaModelVersions = - mergedModel.map( resourceResolver::getUsedMetaModelVersions ) - .getOrElse( Collections.emptySet() ); - - if ( usedMetaModelVersions.isEmpty() ) { - return Try.failure( new ModelResolutionException( "Could not determine used meta model version" ) ); - } - - if ( usedMetaModelVersions.size() == 1 - && usedMetaModelVersions.iterator().next().toString().equals( KnownVersion.getLatest().toVersionString() ) - && migratorService.getMigratorFactory().isEmpty() - ) { - return mergedModel.flatMap( model -> - migratorService.getSdsMigratorFactory().createAspectMetaModelResourceResolver() - .mergeMetaModelIntoRawModel( model, usedMetaModelVersions.iterator().next() ) ); - } - - final Try oldestVersion = - Option.ofOptional( usedMetaModelVersions.stream().sorted().findFirst() ).toTry(); - - return mergedModel.flatMap( model -> - oldestVersion.flatMap( oldest -> - migratorService.getSdsMigratorFactory() - .createAspectMetaModelResourceResolver() - .mergeMetaModelIntoRawModel( model, oldest ) - .orElse( () -> migratorService.getMigratorFactory() - .map( MigratorFactory::createAspectMetaModelResourceResolver ) - .map( Try::success ) - .orElseThrow() - .flatMap( metaResolver -> metaResolver.mergeMetaModelIntoRawModel( model, oldest ) ) ) - .flatMap( migratorService::updateMetaModelVersion ) ) ); - } - - /** - * Checks if a given model contains the definition of a model element. - * - * @param model the model - * @param urn the URN of the model element - * @return true if the model contains the definition of the model element - */ - public static boolean containsDefinition( final Model model, final AspectModelUrn urn ) { - if ( model.getNsPrefixMap().values().stream().anyMatch( prefixUri -> prefixUri.startsWith( "urn:bamm:" ) ) ) { - final boolean result = model.contains( model.createResource( urn.toString().replace( "urn:samm:", "urn:bamm:" ) ), RDF.type, - (RDFNode) null ); - LOG.debug( "Checking if model contains {}: {}", urn, result ); - return result; - } - final boolean result = model.contains( model.createResource( urn.toString() ), RDF.type, (RDFNode) null ); - LOG.debug( "Checking if model contains {}: {}", urn, result ); - return result; - } - - /** - * The main model resolution method that takes Aspect Model element URNs and a resolution strategy as input. - * The strategy is applied to the URNs to load a model, and then repeated for all URNs in the loaded model that - * have not yet been loaded. - * - * @param result the (possibly pre-filled) model for which elements need to be resolved - * @param urns the Aspect Model element URNs - * @param resolutionStrategy the resolution strategy that knowns how to turn a URN into a Model - * @return the fully resolved model, or a failure if one of the transitively referenced elements can't be found - */ - private Try resolve( final Model result, final List urns, final ResolutionStrategy resolutionStrategy ) { - final Stack unresolvedUrns = new Stack<>(); - final Set mergedModels = new HashSet<>(); - for ( final AspectModelUrn urn : urns ) { - unresolvedUrns.push( urn.toString() ); - } - - while ( !unresolvedUrns.isEmpty() ) { - final String urnToResolve = unresolvedUrns.pop(); - final Try resolvedModel = getModelForUrn( urnToResolve, resolutionStrategy ); - if ( resolvedModel.isFailure() ) { - LOG.debug( "Tried to resolve {} using {}, but it failed", urnToResolve, resolutionStrategy ); - return resolvedModel; - } - final Model model = resolvedModel.get(); - - // Merge the resolved model into the target if it was not already merged before. - // It could have been merged before when the model contains another model definition that was already resolved - if ( !modelAlreadyResolved( model, mergedModels ) ) { - mergeModels( result, model ); - mergedModels.add( model ); - - for ( final AspectModelUrn element : urnsToResolve( model, result ) ) { - if ( !unresolvedUrns.contains( element.toString() ) ) { - unresolvedUrns.push( element.toString() ); - } - } - } - } - - return Try.success( result ); - } - - /** - * Returns the list of model element URIs that were found in the source model which need to be resolved as they - * denote elements in the target model that are not yet defined there (i.e., no assertion "element a []" exists). - * - * @param source the source model - * @param target the target model - * @return the list of mode element URIs - */ - private List urnsToResolve( final Model source, final Model target ) { - final Property refines = source.createProperty( "urn:samm:org.eclipse.esmf.samm:meta-model:1.0.0#refines" ); - final List result = new ArrayList<>(); - for ( final String element : getAllUrnsInModel( source ) ) { - if ( !target.contains( source.createResource( element ), RDF.type, (RDFNode) null ) - // Backwards compatibility with SAMM 1.0.0 - && !target.contains( source.createResource( element ), refines, (RDFNode) null ) - ) { - result.add( AspectModelUrn.fromUrn( element ) ); - } - } - return result; - } - - private boolean modelAlreadyResolved( final Model model, final Set resolvedModels ) { - return resolvedModels.stream().anyMatch( model::isIsomorphicWith ); - } - - private final Model emptyModel = ModelFactory.createDefaultModel(); - - /** - * Applies a {@link ResolutionStrategy} to a URI to be resolved, but only if the URI is actually a valid {@link AspectModelUrn}. - * For meta model elements or other URIs, an empty model is returned. This method returns only a failure, when the used resolution - * strategy fails. - * - * @param urn the URN to resolve - * @param resolutionStrategy the resolution strategy to apply - * @return the model containing the defintion of the given model element - */ - private Try getModelForUrn( final String urn, final ResolutionStrategy resolutionStrategy ) { - if ( urn.startsWith( RDF.getURI() ) || urn.startsWith( XSD.getURI() ) ) { - return Try.success( emptyModel ); - } - - try { - final AspectModelUrn aspectModelUrn = AspectModelUrn.fromUrn( replaceLegacyBammUrn( urn ) ); - if ( aspectModelUrn.getElementType() != ElementType.NONE ) { - return Try.success( emptyModel ); - } - return resolutionStrategy.apply( aspectModelUrn ).flatMap( model -> { - if ( !containsType( model, urn ) ) { - return Try.failure( new ModelResolutionException( - "Resolution strategy returned a model which does not contain element definition for " + urn ) ); - } - return Try.success( model ); - } ); - } catch ( final UrnSyntaxException e ) { - // If it's no valid Aspect Model URN but some other URI (e.g., a samm:see value), there is nothing - // to resolve, so we return just an empty model - return Try.success( emptyModel ); - } - } - - private boolean containsType( final Model model, final String urn ) { - if ( model.contains( model.createResource( urn ), RDF.type, (RDFNode) null ) ) { - return true; - } else if ( urn.startsWith( "urn:samm:" ) ) { - // when deriving a URN from file (via "fileToUrn" method - mainly in samm-cli scenarios), - // we assume new "samm" format, but could actually have been the old "bamm" - return model.contains( model.createResource( toLegacyBammUrn( urn ) ), RDF.type, (RDFNode) null ); - } - return false; - } - - private String toLegacyBammUrn( final String urn ) { - if ( urn.startsWith( "urn:samm:" ) ) { - return urn.replace( "urn:samm:", "urn:bamm:" ); - } - return urn; - } - - /** - * Adapter that enables the resolver to handle URNs with the legacy "urn:bamm:" prefix. - * - * @param urn the URN to clean up - * @return the original URN (if using valid urn:samm: scheme) or the the cleaned up URN - */ - private String replaceLegacyBammUrn( final String urn ) { - if ( urn.startsWith( "urn:bamm:" ) ) { - return urn.replace( "urn:bamm:", "urn:samm:" ); - } - return urn; - } - - /** - * Merge a model into an existing target model. Prefixes are only added when they are not already present, i.e., - * a model won't overwrite the empty prefix of the target model. - * - * @param target the model to merge into - * @param other the model to be merged - */ - private void mergeModels( final Model target, final Model other ) { - for ( final Map.Entry prefixEntry : other.getNsPrefixMap().entrySet() ) { - if ( !target.getNsPrefixMap().containsKey( prefixEntry.getKey() ) ) { - target.setNsPrefix( prefixEntry.getKey(), prefixEntry.getValue() ); - } - } - - other.listStatements().forEach( target::add ); - } - - /** - * Convenience method for loading an resolving an Aspect Model from a file. - * - * @param input the input file - * @return the resolved model on success - */ - public static Try loadAndResolveModel( final File input ) { - final AspectModelResolver resolver = new AspectModelResolver(); - final File inputFile = input.getAbsoluteFile(); - final ResolutionStrategy fromSameDirectory = new FileSystemStrategy( new FlatModelsRoot( inputFile.getParentFile().toPath() ) ); - - // Construct the resolution strategy: Models should be searched in the structured folder (if it exists) and then in the - // same directory. If the structured folder can not be resolved, directly search in the same directory. - final ResolutionStrategy resolutionStrategy = getModelRoot( inputFile ).map( - modelsRoot -> new FileSystemStrategy( new StructuredModelsRoot( modelsRoot ) ) ) - . map( structured -> new EitherStrategy( structured, fromSameDirectory ) ).getOrElse( fromSameDirectory ); - return Try.withResources( () -> new FileInputStream( input ) ) - .of( stream -> resolver.resolveAspectModel( resolutionStrategy, stream ) ) - .flatMap( Function.identity() ); - } - - /** - * From an input Aspect Model file, determines the models root directory if it exists. - * - * @param inputFile the input model file - * @return the models root directory - */ - public static Try getModelRoot( final File inputFile ) { - return Option.of( Paths.get( inputFile.getParent(), "..", ".." ) ) - .map( Path::toFile ) - .flatMap( file -> CheckedFunction1.lift( File::getCanonicalFile ).apply( file ) ) - .map( File::toPath ) - .filter( path -> path.toFile().exists() && path.toFile().isDirectory() ) - .toTry( () -> new ModelResolutionException( "Could not locate models root directory" ) ); - } - - /** - * From an input Aspect Model file, which is assumed to contain a model element definition with the same local name as the file, - * determines the URN of this model element. The file is expected to reside in a valid location inside the models root - * (see {@link FileSystemStrategy}). Note that the file is not opened or loaded and the method does not check whether an element - * with the given URN actually exists in the file. - * - * @param inputFile the input model file - * @return the URN of the model element that corresponds to the file name and its location inside the models root - */ - public static Try fileToUrn( final File inputFile ) { - final File versionDirectory = inputFile.getParentFile(); - if ( versionDirectory == null ) { - throw new ModelResolutionException( "Could not determine parent directory of " + inputFile ); - } - - final String version = versionDirectory.getName(); - final File namespaceDirectory = versionDirectory.getParentFile(); - if ( namespaceDirectory == null ) { - throw new ModelResolutionException( "Could not determine parent directory of " + versionDirectory ); - } - - final String namespace = namespaceDirectory.getName(); - final String aspectName = FilenameUtils.removeExtension( inputFile.getName() ); - final String urn = String.format( "urn:samm:%s:%s#%s", namespace, version, aspectName ); - return AspectModelUrn.from( urn ).mapFailure( Case( - $( instanceOf( UrnSyntaxException.class ) ), - e -> new ModelResolutionException( "The URN constructed from the input file path is invalid: " + urn, e ) ) - ); - } - - /** - * Finds URN matched to file in the loaded model. - * - * @param model the loaded version model - * @param file the input model file - * @return the URN of the model element that corresponds to the file name and its location inside the models root - */ - public static AspectModelUrn urnFromModel( final VersionedModel model, final File file ) { - final String aspectName = FilenameUtils.removeExtension( file.getName() ); - return Streams.stream( model.getRawModel().listSubjects() ).filter( s -> aspectName.equals( s.getLocalName() ) ) - .findFirst() - .map( Resource::getURI ) - .map( AspectModelUrn::fromUrn ) - .orElseThrow(); - } - - /** - * Similar to {@link #loadAndResolveModel(File)} except no additional files are loaded. If the input model file contains references - * to elements from namespaces not defined in the same file, those references will not be resolved. - * - * @param inputFile the input model file - * @return the loaded model file on success, including meta model definitions but not definitions of externally referenced elements - */ - public static Try loadButNotResolveModel( final File inputFile ) { - try ( final InputStream inputStream = new FileInputStream( inputFile ) ) { - final SammAspectMetaModelResourceResolver metaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - return TurtleLoader.loadTurtle( inputStream ).flatMap( model -> - metaModelResourceResolver.getMetaModelVersion( model ).flatMap( metaModelVersion -> - metaModelResourceResolver.mergeMetaModelIntoRawModel( model, metaModelVersion ) ) ); - } catch ( final IOException exception ) { - return Try.failure( exception ); - } - } -} diff --git a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java b/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java deleted file mode 100644 index 23bee0ae0..000000000 --- a/core/esmf-aspect-model-resolver/src/main/java/org/eclipse/esmf/aspectmodel/resolver/EitherStrategy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver; - -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; - -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; - -/** - * A Resolution strategy that supports two types of inputs and wraps two dedicated sub-resolution strategies - * for each of the inputs - */ -public class EitherStrategy implements ResolutionStrategy { - private final ResolutionStrategy strategy1; - private final ResolutionStrategy strategy2; - - public EitherStrategy( final ResolutionStrategy strategy1, final ResolutionStrategy strategy2 ) { - this.strategy1 = strategy1; - this.strategy2 = strategy2; - } - - @Override - public Try apply( final AspectModelUrn input ) { - final Try result = strategy1.apply( input ); - if ( result.isSuccess() ) { - return result; - } - return strategy2.apply( input ); - } - - @Override - public String toString() { - return "EitherStrategy(strategy1=" + strategy1 + ", strategy2=" + strategy2 + ")"; - } -} diff --git a/core/esmf-aspect-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java b/core/esmf-aspect-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java deleted file mode 100644 index 68f5387e6..000000000 --- a/core/esmf-aspect-model-resolver/src/test/java/org/eclipse/esmf/aspectmodel/resolver/AspectModelResolverTest.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel.resolver; - -import static org.apache.jena.rdf.model.ResourceFactory.createResource; -import static org.assertj.core.api.Assertions.assertThat; - -import java.io.File; -import java.net.URISyntaxException; -import java.nio.file.Paths; -import java.util.List; - -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; - -import com.google.common.collect.Streams; -import io.vavr.control.Try; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; - -public class AspectModelResolverTest extends MetaModelVersions { - private final AspectModelResolver resolver = new AspectModelResolver(); - private static final String TEST_NAMESPACE = "urn:samm:org.eclipse.esmf.test:1.0.0#"; - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testLoadDataModelExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TEST_NAMESPACE + "Test" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Resource aspect = createResource( TEST_NAMESPACE + "Test" ); - final Resource sammAspect = new SAMM( KnownVersion.getLatest() ).Aspect(); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, sammAspect ).nextOptional() ).isNotEmpty(); - } - - @Test - public void testLoadLegacyBammModelWithoutPrefixesExpectSuccess() throws URISyntaxException { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TEST_NAMESPACE + "BammAspectWithoutPrefixes" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( null, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "versionsUpToIncluding2_0_0" ) - public void testLoadLegacyBammModelExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( "urn:bamm:org.eclipse.esmf.test:2.0.0#BammTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( null, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "versionsUpToIncluding2_0_0" ) - public void testLoadLegacyBammModelFromFileExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelResolver.fileToUrn( - Paths.get( aspectModelsRootDirectory.toString(), "org.eclipse.esmf.test", "2.0.0", "BammTest.ttl" ).toFile() ).get(); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( null, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testLoadModelWithVersionEqualToUnsupportedMetaModelVersionExpectSuccess( - final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.test:1.1.0#Test" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Resource aspect = createResource( "urn:samm:org.eclipse.esmf.test:1.1.0#Test" ); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolveReferencedModelFromMemoryExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final AspectModelUrn inputUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "AnotherTest" ); - final Model model = TurtleLoader.loadTurtle( - AspectModelResolverTest.class.getResourceAsStream( - "/" + metaModelVersion.toString().toLowerCase() - + "/org.eclipse.esmf.test/1.0.0/Test.ttl" ) ).get(); - final ResolutionStrategy inMemoryStrategy = anyUrn -> Try.success( model ); - final EitherStrategy inMemoryResolutionStrategy = new EitherStrategy( urnStrategy, inMemoryStrategy ); - - final Try result = resolver.resolveAspectModel( inMemoryResolutionStrategy, inputUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - final Resource aspect = createResource( TEST_NAMESPACE + "AnotherTest" ); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - - final Resource propertyFromReferencedAspect = createResource( TEST_NAMESPACE + "foo" ); - assertThat( - result.get().getModel().listStatements( propertyFromReferencedAspect, RDF.type, samm.Property() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolveReferencedModelExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "AnotherTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - final Resource aspect = createResource( TEST_NAMESPACE + "AnotherTest" ); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - - final Resource propertyFromReferencedAspect = createResource( TEST_NAMESPACE + "foo" ); - assertThat( - result.get().getModel().listStatements( propertyFromReferencedAspect, RDF.type, samm.Property() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolutionMissingAspectExpectFailure( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "AnotherFailingTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isFailure() ).isTrue(); - assertThat( result.getCause() ).isInstanceOf( ModelResolutionException.class ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolutionMissingModelElementExpectFailure( final KnownVersion metaModelVersion ) throws Throwable { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "FailingTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isFailure() ).isTrue(); - assertThat( result.getCause() ).isInstanceOf( ModelResolutionException.class ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolutionReferencedCharacteristicExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "ReferenceCharacteristicTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( - aspectModelsRootDirectory.toPath() ); - - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Resource aspect = createResource( - TEST_NAMESPACE + "ReferenceCharacteristicTest" ); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - - final Resource referencedCharacteristic = createResource( TEST_NAMESPACE + "TestCharacteristic" ); - assertThat( result.get().getModel().listStatements( referencedCharacteristic, RDF.type, samm.Characteristic() ) - .nextOptional() ).isNotEmpty(); - } - - /** - * This test checks that if the same shared resource (in this case: the shared TestCharacteristic) is - * transitively imported on multiple paths through the dependency graph, it is still only added once to the - * final merged model, so for example the Statement x:testCharacteristic samm:name "testCharacteristic" is - * only present once in the model. Here, TransitiveReferenceTest references both the Test Characteristic - * and a second Aspect model, ReferenceCharacteristicTest, which in turn also references the Test Characteristic. - * - * @throws Throwable if one of the resources is not found - */ - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testTransitiveReferenceExpectSuccess( final KnownVersion metaModelVersion ) throws Throwable { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "TransitiveReferenceTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Model model = result.get().getModel(); - final Resource testCharacteristic = createResource( TEST_NAMESPACE + "TestCharacteristic" ); - assertThat( Streams.stream( model.listStatements( testCharacteristic, RDF.type, (RDFNode) null ) ).count() ).isEqualTo( 1 ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolutionReferencedEntity( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn - .fromUrn( TEST_NAMESPACE + "ReferenceEntityTest" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( - aspectModelsRootDirectory.toPath() ); - - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Resource aspect = createResource( TEST_NAMESPACE + "ReferenceEntityTest" ); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( result.get().getModel().listStatements( aspect, RDF.type, samm.Aspect() ).nextOptional() ).isNotEmpty(); - - final Resource referencedEntity = createResource( TEST_NAMESPACE + "TestEntity" ); - assertThat( result.get().getModel().listStatements( referencedEntity, RDF.type, samm.Entity() ).nextOptional() ).isNotEmpty(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testAspectReferencingAnotherAspectExpectSuccess( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader().getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final String aspectUrn = "urn:samm:org.eclipse.esmf.test:2.0.0#Test"; - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( aspectUrn ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - final Model model = result.get().getModel(); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - assertThat( Streams.stream( model.listStatements( null, RDF.type, samm.Aspect() ) ).count() ).isEqualTo( 2 ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testClassPathResolution( final KnownVersion metaModelVersion ) { - final String aspectUrn = TEST_NAMESPACE + "Test"; - final AspectModelResolver resolver = new AspectModelResolver(); - final ClasspathStrategy strategy = new ClasspathStrategy( metaModelVersion.toString().toLowerCase() ); - final Try result = resolver - .resolveAspectModel( strategy, AspectModelUrn.fromUrn( aspectUrn ) ); - assertThat( result.isSuccess() ).isTrue(); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testResolveAspectContainingRefinedProperty2( final KnownVersion metaModelVersion ) { - final String aspectUrn = TEST_NAMESPACE + "ReferenceCharacteristicTest"; - final AspectModelResolver resolver = new AspectModelResolver(); - final ClasspathStrategy strategy = new ClasspathStrategy( metaModelVersion.toString().toLowerCase() ); - final Try result = resolver - .resolveAspectModel( strategy, AspectModelUrn.fromUrn( aspectUrn ) ); - assertThat( result.isSuccess() ).describedAs( "Resolution of refined Property failed." ).isTrue(); - } - - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - public void testMergingModelsWithBlankNodeValues( final KnownVersion metaModelVersion ) { - final String aspectUrn = TEST_NAMESPACE + "SecondaryAspect"; - final AspectModelResolver resolver = new AspectModelResolver(); - final ClasspathStrategy strategy = new ClasspathStrategy( metaModelVersion.toString().toLowerCase() ); - final Try result = resolver - .resolveAspectModel( strategy, AspectModelUrn.fromUrn( aspectUrn ) ); - assertThat( result.isSuccess() ).isTrue(); - - final Model model = result.get().getModel(); - final Resource primaryAspect = model.createResource( TEST_NAMESPACE + "PrimaryAspect" ); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - final List propertiesAssertions = model.listStatements( primaryAspect, samm.properties(), (RDFNode) null ).toList(); - assertThat( propertiesAssertions.size() ).isEqualTo( 1 ); - } - - @ParameterizedTest - @MethodSource( value = "allVersions" ) - public void testMultiReferenceSameSource( final KnownVersion metaModelVersion ) throws URISyntaxException { - final File aspectModelsRootDirectory = new File( - AspectModelResolverTest.class.getClassLoader() - .getResource( metaModelVersion.toString().toLowerCase() ) - .toURI().getPath() ); - - final AspectModelUrn testUrn = AspectModelUrn.fromUrn( TEST_NAMESPACE + "VehicleInstance" ); - - final ResolutionStrategy urnStrategy = new FileSystemStrategy( aspectModelsRootDirectory.toPath() ); - final Try result = resolver.resolveAspectModel( urnStrategy, testUrn ); - assertThat( result.isSuccess() ).isTrue(); - - // make sure the source file for the definitions of ModelYear and ModelCode (ModelDef.ttl) is only loaded once - final Model model = result.get().getModel(); - final Resource entity = model.createResource( TEST_NAMESPACE + "SomeOtherNonRelatedEntity" ); - final SAMM samm = new SAMM( KnownVersion.getLatest() ); - final List properties = model.listStatements( entity, samm.properties(), (RDFNode) null ).toList(); - assertThat( properties.size() ).isEqualTo( 1 ); - } -} diff --git a/core/esmf-aspect-model-resolver/src/test/resources/logback.xml b/core/esmf-aspect-model-resolver/src/test/resources/logback.xml deleted file mode 100644 index 3d4dffa73..000000000 --- a/core/esmf-aspect-model-resolver/src/test/resources/logback.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/AspectSerializer.java b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/AspectSerializer.java index ed35031ee..a5da06ce0 100644 --- a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/AspectSerializer.java +++ b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/AspectSerializer.java @@ -17,11 +17,8 @@ import java.io.StringWriter; import java.util.function.Function; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; import org.apache.jena.rdf.model.Model; @@ -33,15 +30,22 @@ public class AspectSerializer implements Function { @Override public String apply( final Aspect aspect ) { - final Namespace aspectNamespace = () -> aspect.getAspectModelUrn().get().getUrnPrefix(); - final RdfModelCreatorVisitor rdfModelCreatorVisitor = new RdfModelCreatorVisitor( KnownVersion.getLatest(), aspectNamespace ); + final RdfNamespace aspectNamespace = new RdfNamespace() { + @Override + public String getShortForm() { + return ""; + } + + @Override + public String getUri() { + return aspect.urn().getUrnPrefix(); + } + }; + final RdfModelCreatorVisitor rdfModelCreatorVisitor = new RdfModelCreatorVisitor( aspectNamespace ); final StringWriter stringWriter = new StringWriter(); try ( final PrintWriter printWriter = new PrintWriter( stringWriter ) ) { - final Model model = aspect.accept( rdfModelCreatorVisitor, null ).getModel(); - final VersionedModel versionedModel = new SammAspectMetaModelResourceResolver() - .mergeMetaModelIntoRawModel( model, aspect.getMetaModelVersion() ).get(); - final PrettyPrinter prettyPrinter = new PrettyPrinter( - versionedModel, aspect.getAspectModelUrn().get(), printWriter ); + final Model model = aspect.accept( rdfModelCreatorVisitor, null ).model(); + final PrettyPrinter prettyPrinter = new PrettyPrinter( model, aspect.urn(), printWriter ); prettyPrinter.print(); } return stringWriter.toString(); diff --git a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinter.java b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinter.java index f5db13476..a8cec3e9e 100644 --- a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinter.java +++ b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinter.java @@ -29,13 +29,10 @@ import java.util.Set; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.UnsupportedVersionException; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.AspectModelFile; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import com.google.common.collect.ImmutableList; import org.apache.commons.text.StringEscapeUtils; @@ -66,8 +63,8 @@ import org.apache.jena.vocabulary.XSD; /** - * Allows to serialize a {@link Model} that contains an Aspect model to RDF/Turtle while following - * the formatting rules for Aspect models. + * Serializes an {@link AspectModelFile} to RDF/Turtle while following the formatting rules for Aspect models. + * The model is expected to contain exactly one Aspect. */ public class PrettyPrinter { private static final String INDENT = " "; @@ -82,86 +79,78 @@ public class PrettyPrinter { private final AspectModelUrn rootElementUrn; private final PrintWriter writer; private final Map prefixMap; - private final SAMM samm; + private final List headerComment; private final PrintVisitor printVisitor; - /** - * Constructor that takes a raw RDF {@link Model} - * - * @param model the Aspect Model to write - * @param metaModelVersion the meta model version - * @param rootElementUrn the URN of the root model element - * @param writer the writer to write to - */ - public PrettyPrinter( final Model model, final KnownVersion metaModelVersion, final AspectModelUrn rootElementUrn, - final PrintWriter writer ) { - this( new VersionedModel( ModelFactory.createDefaultModel(), metaModelVersion, model ), rootElementUrn, writer ); - } - - /** - * Constructor that takes a {@link VersionedModel} - * - * @param versionedModel the Aspect Model to write - * @param rootElementUrn the URN of the root model element - * @param writer the writer to write to - */ - public PrettyPrinter( final VersionedModel versionedModel, final AspectModelUrn rootElementUrn, final PrintWriter writer ) { - model = versionedModel.getRawModel(); - final KnownVersion metaModelVersion = KnownVersion.fromVersionString( versionedModel.getMetaModelVersion().toString() ) - .orElseThrow( () -> new UnsupportedVersionException( versionedModel.getMetaModelVersion() ) ); + private PrettyPrinter( final Model model, final AspectModelUrn rootElementUrn, final PrintWriter writer, + final List headerComment ) { this.writer = writer; this.rootElementUrn = rootElementUrn; - printVisitor = new PrintVisitor( model ); - - samm = new SAMM( metaModelVersion ); - final SAMMC sammc = new SAMMC( metaModelVersion ); + this.model = ModelFactory.createDefaultModel(); + this.model.add( model ); + this.headerComment = List.of(); - prefixMap = new HashMap<>( Namespace.createPrefixMap( metaModelVersion ) ); - prefixMap.putAll( versionedModel.getModel().getNsPrefixMap() ); + prefixMap = new HashMap<>( RdfNamespace.createPrefixMap() ); + prefixMap.putAll( model.getNsPrefixMap() ); prefixMap.put( "", rootElementUrn.getUrnPrefix() ); - model.setNsPrefixes( prefixMap ); + this.model.setNsPrefixes( prefixMap ); - propertyOrder = createPredefinedPropertyOrder( sammc ); + propertyOrder = createPredefinedPropertyOrder(); prefixOrder = createPredefinedPrefixOrder(); + printVisitor = new PrintVisitor( this.model ); } - private Comparator createPredefinedPropertyOrder( final SAMMC sammc ) { + public PrettyPrinter( final Model model, final AspectModelUrn rootElementUrn, final PrintWriter writer ) { + this( model, rootElementUrn, writer, List.of() ); + } + + /** + * Creates a new Pretty Printer for a given Aspect Model File. + * + * @param modelFile the model file to pretty print + * @param writer the writer to write to + */ + public PrettyPrinter( final AspectModelFile modelFile, final PrintWriter writer ) { + this( modelFile.sourceModel(), modelFile.aspect().urn(), writer, modelFile.headerComment() ); + } + + private Comparator createPredefinedPropertyOrder() { final List predefinedPropertyOrder = new ArrayList<>(); - predefinedPropertyOrder.add( samm._extends() ); - predefinedPropertyOrder.add( samm.preferredName() ); - predefinedPropertyOrder.add( samm.description() ); - predefinedPropertyOrder.add( samm.see() ); - predefinedPropertyOrder.add( samm.characteristic() ); - predefinedPropertyOrder.add( samm.properties() ); - predefinedPropertyOrder.add( samm.operations() ); - predefinedPropertyOrder.add( samm.events() ); - predefinedPropertyOrder.add( samm.input() ); - predefinedPropertyOrder.add( samm.output() ); - predefinedPropertyOrder.add( samm.baseCharacteristic() ); - predefinedPropertyOrder.add( samm.dataType() ); - predefinedPropertyOrder.add( samm.exampleValue() ); - predefinedPropertyOrder.add( samm.value() ); - predefinedPropertyOrder.add( samm.property() ); - predefinedPropertyOrder.add( samm.optional() ); - - predefinedPropertyOrder.add( sammc.languageCode() ); - predefinedPropertyOrder.add( sammc.localeCode() ); - predefinedPropertyOrder.add( sammc.left() ); - predefinedPropertyOrder.add( sammc.right() ); - predefinedPropertyOrder.add( sammc.minValue() ); - predefinedPropertyOrder.add( sammc.maxValue() ); - predefinedPropertyOrder.add( sammc.lowerBoundDefinition() ); - predefinedPropertyOrder.add( sammc.upperBoundDefinition() ); - predefinedPropertyOrder.add( sammc.defaultValue() ); - predefinedPropertyOrder.add( sammc.unit() ); - predefinedPropertyOrder.add( sammc.left() ); - predefinedPropertyOrder.add( sammc.right() ); - predefinedPropertyOrder.add( sammc.deconstructionRule() ); - predefinedPropertyOrder.add( sammc.elements() ); - predefinedPropertyOrder.add( sammc.values() ); - predefinedPropertyOrder.add( sammc.integer() ); - predefinedPropertyOrder.add( sammc.scale() ); + predefinedPropertyOrder.add( SammNs.SAMM._extends() ); + predefinedPropertyOrder.add( SammNs.SAMM.preferredName() ); + predefinedPropertyOrder.add( SammNs.SAMM.description() ); + predefinedPropertyOrder.add( SammNs.SAMM.see() ); + predefinedPropertyOrder.add( SammNs.SAMM.characteristic() ); + predefinedPropertyOrder.add( SammNs.SAMM.properties() ); + predefinedPropertyOrder.add( SammNs.SAMM.operations() ); + predefinedPropertyOrder.add( SammNs.SAMM.events() ); + predefinedPropertyOrder.add( SammNs.SAMM.input() ); + predefinedPropertyOrder.add( SammNs.SAMM.output() ); + predefinedPropertyOrder.add( SammNs.SAMM.dataType() ); + predefinedPropertyOrder.add( SammNs.SAMM.exampleValue() ); + predefinedPropertyOrder.add( SammNs.SAMM.value() ); + predefinedPropertyOrder.add( SammNs.SAMM.property() ); + predefinedPropertyOrder.add( SammNs.SAMM.optional() ); + + predefinedPropertyOrder.add( SammNs.SAMMC.baseCharacteristic() ); + predefinedPropertyOrder.add( SammNs.SAMMC.languageCode() ); + predefinedPropertyOrder.add( SammNs.SAMMC.localeCode() ); + predefinedPropertyOrder.add( SammNs.SAMMC.left() ); + predefinedPropertyOrder.add( SammNs.SAMMC.right() ); + predefinedPropertyOrder.add( SammNs.SAMMC.minValue() ); + predefinedPropertyOrder.add( SammNs.SAMMC.maxValue() ); + predefinedPropertyOrder.add( SammNs.SAMMC.lowerBoundDefinition() ); + predefinedPropertyOrder.add( SammNs.SAMMC.upperBoundDefinition() ); + predefinedPropertyOrder.add( SammNs.SAMMC.defaultValue() ); + predefinedPropertyOrder.add( SammNs.SAMMC.unit() ); + predefinedPropertyOrder.add( SammNs.SAMMC.left() ); + predefinedPropertyOrder.add( SammNs.SAMMC.right() ); + predefinedPropertyOrder.add( SammNs.SAMMC.deconstructionRule() ); + predefinedPropertyOrder.add( SammNs.SAMMC.elements() ); + predefinedPropertyOrder.add( SammNs.SAMMC.values() ); + predefinedPropertyOrder.add( SammNs.SAMMC.integer() ); + predefinedPropertyOrder.add( SammNs.SAMMC.scale() ); return Comparator. comparingInt( property -> predefinedPropertyOrder.contains( property ) @@ -213,6 +202,13 @@ private void showMilestoneBanner() { * Print to the PrintWriter given in the constructor. This method does not close the PrintWriter. */ public void print() { + for ( final String line : headerComment ) { + writer.println( line ); + } + if ( headerComment.size() > 1 ) { + writer.println(); + } + showMilestoneBanner(); prefixMap.entrySet().stream().sorted( prefixOrder ) diff --git a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitor.java b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitor.java index 1e15d2e8c..d61b6c9a6 100644 --- a/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitor.java +++ b/core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitor.java @@ -25,37 +25,11 @@ import java.util.Optional; import java.util.function.Function; -import org.eclipse.esmf.aspectmodel.resolver.services.DataType; -import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMME; -import org.eclipse.esmf.aspectmodel.vocabulary.UNIT; -import org.eclipse.esmf.characteristic.Code; -import org.eclipse.esmf.characteristic.Collection; -import org.eclipse.esmf.characteristic.Duration; -import org.eclipse.esmf.characteristic.Either; -import org.eclipse.esmf.characteristic.Enumeration; -import org.eclipse.esmf.characteristic.Measurement; -import org.eclipse.esmf.characteristic.Quantifiable; -import org.eclipse.esmf.characteristic.Set; -import org.eclipse.esmf.characteristic.SingleEntity; -import org.eclipse.esmf.characteristic.SortedSet; -import org.eclipse.esmf.characteristic.State; -import org.eclipse.esmf.characteristic.StructuredValue; -import org.eclipse.esmf.characteristic.TimeSeries; -import org.eclipse.esmf.characteristic.Trait; -import org.eclipse.esmf.constraint.EncodingConstraint; -import org.eclipse.esmf.constraint.FixedPointConstraint; -import org.eclipse.esmf.constraint.LanguageConstraint; -import org.eclipse.esmf.constraint.LengthConstraint; -import org.eclipse.esmf.constraint.LocaleConstraint; -import org.eclipse.esmf.constraint.RangeConstraint; -import org.eclipse.esmf.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.aspectmodel.visitor.AspectVisitor; import org.eclipse.esmf.metamodel.AbstractEntity; import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.BoundDefinition; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.CollectionValue; import org.eclipse.esmf.metamodel.ComplexType; @@ -64,7 +38,6 @@ import org.eclipse.esmf.metamodel.Event; import org.eclipse.esmf.metamodel.HasProperties; import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.NamedElement; import org.eclipse.esmf.metamodel.Operation; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.QuantityKind; @@ -72,10 +45,31 @@ import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.datatypes.LangString; -import org.eclipse.esmf.metamodel.impl.BoundDefinition; -import org.eclipse.esmf.metamodel.visitor.AspectVisitor; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.characteristic.Code; +import org.eclipse.esmf.metamodel.characteristic.Collection; +import org.eclipse.esmf.metamodel.characteristic.Duration; +import org.eclipse.esmf.metamodel.characteristic.Either; +import org.eclipse.esmf.metamodel.characteristic.Enumeration; +import org.eclipse.esmf.metamodel.characteristic.Measurement; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; +import org.eclipse.esmf.metamodel.characteristic.Set; +import org.eclipse.esmf.metamodel.characteristic.SingleEntity; +import org.eclipse.esmf.metamodel.characteristic.SortedSet; +import org.eclipse.esmf.metamodel.characteristic.State; +import org.eclipse.esmf.metamodel.characteristic.StructuredValue; +import org.eclipse.esmf.metamodel.characteristic.TimeSeries; +import org.eclipse.esmf.metamodel.characteristic.Trait; +import org.eclipse.esmf.metamodel.constraint.EncodingConstraint; +import org.eclipse.esmf.metamodel.constraint.FixedPointConstraint; +import org.eclipse.esmf.metamodel.constraint.LanguageConstraint; +import org.eclipse.esmf.metamodel.constraint.LengthConstraint; +import org.eclipse.esmf.metamodel.constraint.LocaleConstraint; +import org.eclipse.esmf.metamodel.constraint.RangeConstraint; +import org.eclipse.esmf.metamodel.constraint.RegularExpressionConstraint; +import org.eclipse.esmf.metamodel.datatype.LangString; +import org.eclipse.esmf.metamodel.datatype.SammXsdType; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.apache.jena.datatypes.RDFDatatype; import org.apache.jena.rdf.model.Literal; @@ -97,12 +91,8 @@ */ @SuppressWarnings( "squid:S3655" ) // Optional is checked with isEmpty() public class RdfModelCreatorVisitor implements AspectVisitor, Function { - private final SAMM samm; - private final SAMMC sammc; - private final SAMME samme; - private final UNIT unitNamespace; - private final Namespace namespace; - private final Map anonymousResources = new HashMap<>(); + private final RdfNamespace namespace; + private final Map anonymousResources = new HashMap<>(); private final List resourceList = new LinkedList<>(); private final List hasVisited = new LinkedList<>(); @@ -111,23 +101,15 @@ public class RdfModelCreatorVisitor implements AspectVisitor focusElement; + public record ElementModel( Model model, Optional focusElement ) { } /** * Constructor. * - * @param metaModelVersion The meta model version to use in the serialized RDF model * @param namespace The namespace the model root element itself uses for its child elements */ - public RdfModelCreatorVisitor( final KnownVersion metaModelVersion, final Namespace namespace ) { - samm = new SAMM( metaModelVersion ); - sammc = new SAMMC( metaModelVersion ); - samme = new SAMME( metaModelVersion, samm ); - unitNamespace = new UNIT( metaModelVersion, samm ); + public RdfModelCreatorVisitor( final RdfNamespace namespace ) { this.namespace = namespace; } @@ -149,25 +131,24 @@ private Literal serializeBoolean( final Boolean value ) { return ResourceFactory.createTypedLiteral( value ); } - private boolean isLocalElement( final NamedElement element ) { - return element.getAspectModelUrn().isEmpty() - || element.getAspectModelUrn().get().getUrnPrefix().equals( namespace.getNamespace() ); + private boolean isLocalElement( final ModelElement element ) { + return element.isAnonymous() || element.urn().getUrnPrefix().equals( namespace.getNamespace() ); } - private Resource getElementResource( final NamedElement element ) { - if ( element.getAspectModelUrn().isEmpty() ) { + private Resource getElementResource( final ModelElement element ) { + if ( element.isAnonymous() ) { return anonymousResources.computeIfAbsent( element, key -> createResource() ); } - return createResource( element.getAspectModelUrn().get().toString() ); + return createResource( element.urn().toString() ); } - private Model serializeDescriptions( final Resource elementResource, final NamedElement element ) { + private Model serializeDescriptions( final Resource elementResource, final ModelElement element ) { final Model model = ModelFactory.createDefaultModel(); - element.getSee().forEach( seeValue -> model.add( elementResource, samm.see(), ResourceFactory.createResource( seeValue ) ) ); + element.getSee().forEach( seeValue -> model.add( elementResource, SammNs.SAMM.see(), ResourceFactory.createResource( seeValue ) ) ); element.getPreferredNames().stream().map( this::serializeLocalizedString ).forEach( preferredName -> - model.add( elementResource, samm.preferredName(), preferredName ) ); + model.add( elementResource, SammNs.SAMM.preferredName(), preferredName ) ); element.getDescriptions().stream().map( this::serializeLocalizedString ).forEach( description -> - model.add( elementResource, samm.description(), description ) ); + model.add( elementResource, SammNs.SAMM.description(), description ) ); return model; } @@ -187,8 +168,8 @@ private Model serializePropertiesOrParameters( final Resource elementResource, f .map( property -> { final Model propertyModel = ModelFactory.createDefaultModel(); final ElementModel propertyResult = property.accept( this, element ); - propertyModel.add( propertyResult.getModel() ); - final Resource propertyResource = propertyResult.getFocusElement() + propertyModel.add( propertyResult.model() ); + final Resource propertyResource = propertyResult.focusElement() .map( RDFNode::asResource ) .orElseGet( () -> getElementResource( property ) ); @@ -207,24 +188,24 @@ private Model serializePropertiesOrParameters( final Resource elementResource, f } private Model serializeParameters( final Resource elementResource, final HasProperties element ) { - return serializePropertiesOrParameters( elementResource, element, samm.parameters() ); + return serializePropertiesOrParameters( elementResource, element, SammNs.SAMM.parameters() ); } private Model serializeProperties( final Resource elementResource, final HasProperties element ) { - return serializePropertiesOrParameters( elementResource, element, samm.properties() ); + return serializePropertiesOrParameters( elementResource, element, SammNs.SAMM.properties() ); } private Resource serializeAnonymousPropertyNodes( final Property property, final Model propertyModel, final Resource propertyResource ) { final Resource anonymousPropertyNode = createResource(); - propertyModel.add( anonymousPropertyNode, samm.property(), propertyResource ); + propertyModel.add( anonymousPropertyNode, SammNs.SAMM.property(), propertyResource ); if ( property.isOptional() ) { - propertyModel.add( anonymousPropertyNode, samm.optional(), serializeBoolean( true ) ); + propertyModel.add( anonymousPropertyNode, SammNs.SAMM.optional(), serializeBoolean( true ) ); } if ( property.isNotInPayload() ) { - propertyModel.add( anonymousPropertyNode, samm.notInPayload(), serializeBoolean( true ) ); + propertyModel.add( anonymousPropertyNode, SammNs.SAMM.notInPayload(), serializeBoolean( true ) ); } if ( !property.getName().equals( property.getPayloadName() ) ) { - propertyModel.add( anonymousPropertyNode, samm.payloadName(), serializePlainString( property.getPayloadName() ) ); + propertyModel.add( anonymousPropertyNode, SammNs.SAMM.payloadName(), serializePlainString( property.getPayloadName() ) ); } return anonymousPropertyNode; } @@ -243,9 +224,9 @@ private Model createCharacteristicsModel( final Characteristic characteristic, f final Resource resource = getElementResource( characteristic ); if ( !skipDataType && characteristic.getDataType().isPresent() ) { final Type type = characteristic.getDataType().get(); - model.add( resource, samm.dataType(), createResource( type.getUrn() ) ); + model.add( resource, SammNs.SAMM.dataType(), createResource( type.getUrn() ) ); if ( type.is( ComplexType.class ) ) { - model.add( type.accept( this, characteristic ).getModel() ); + model.add( type.accept( this, characteristic ).model() ); } } @@ -268,13 +249,13 @@ private Model createCollectionModel( final Collection collection ) { final Resource resource = getElementResource( collection ); if ( collection.getElementCharacteristic().isPresent() ) { final Characteristic elementCharacteristic = collection.getElementCharacteristic().get(); - model.add( resource, sammc.elementCharacteristic(), getElementResource( elementCharacteristic ) ); - model.add( elementCharacteristic.accept( this, collection ).getModel() ); + model.add( resource, SammNs.SAMMC.elementCharacteristic(), getElementResource( elementCharacteristic ) ); + model.add( elementCharacteristic.accept( this, collection ).model() ); } else if ( collection.getDataType().isPresent() ) { final Type type = collection.getDataType().get(); - model.add( resource, samm.dataType(), createResource( type.getUrn() ) ); + model.add( resource, SammNs.SAMM.dataType(), createResource( type.getUrn() ) ); if ( !type.is( Scalar.class ) ) { - model.add( type.accept( this, collection ).getModel() ); + model.add( type.accept( this, collection ).model() ); } } @@ -286,15 +267,15 @@ private Model createCollectionModel( final Collection collection ) { public ElementModel visitCollection( final Collection collection, final ModelElement context ) { final Model model = createCollectionModel( collection ); final Resource resource = getElementResource( collection ); - model.add( resource, RDF.type, sammc.Collection() ); + model.add( resource, RDF.type, SammNs.SAMMC.Collection() ); return new ElementModel( model, Optional.of( resource ) ); } @Override - public ElementModel visitList( final org.eclipse.esmf.characteristic.List list, final ModelElement context ) { + public ElementModel visitList( final org.eclipse.esmf.metamodel.characteristic.List list, final ModelElement context ) { final Model model = createCollectionModel( list ); final Resource resource = getElementResource( list ); - model.add( resource, RDF.type, sammc.List() ); + model.add( resource, RDF.type, SammNs.SAMMC.List() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -302,7 +283,7 @@ public ElementModel visitList( final org.eclipse.esmf.characteristic.List list, public ElementModel visitSet( final Set set, final ModelElement context ) { final Model model = createCollectionModel( set ); final Resource resource = getElementResource( set ); - model.add( resource, RDF.type, sammc.Set() ); + model.add( resource, RDF.type, SammNs.SAMMC.Set() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -310,7 +291,7 @@ public ElementModel visitSet( final Set set, final ModelElement context ) { public ElementModel visitSortedSet( final SortedSet sortedSet, final ModelElement context ) { final Model model = createCollectionModel( sortedSet ); final Resource resource = getElementResource( sortedSet ); - model.add( resource, RDF.type, sammc.SortedSet() ); + model.add( resource, RDF.type, SammNs.SAMMC.SortedSet() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -318,7 +299,7 @@ public ElementModel visitSortedSet( final SortedSet sortedSet, final ModelElemen public ElementModel visitTimeSeries( final TimeSeries timeSeries, final ModelElement context ) { final Model model = createCollectionModel( timeSeries ); final Resource resource = getElementResource( timeSeries ); - model.add( resource, RDF.type, sammc.TimeSeries() ); + model.add( resource, RDF.type, SammNs.SAMMC.TimeSeries() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -335,68 +316,68 @@ public ElementModel visitConstraint( final Constraint constraint, final ModelEle @Override public ElementModel visitEncodingConstraint( final EncodingConstraint encodingConstraint, final ModelElement context ) { - final Model model = visitConstraint( encodingConstraint, null ).getModel(); + final Model model = visitConstraint( encodingConstraint, null ).model(); final Resource resource = getElementResource( encodingConstraint ); - model.add( resource, RDF.type, sammc.EncodingConstraint() ); - final Resource encoding = samm.resource( encodingConstraint.getValue().name() ); - model.add( resource, samm.value(), encoding ); + model.add( resource, RDF.type, SammNs.SAMMC.EncodingConstraint() ); + final Resource encoding = SammNs.SAMM.resource( encodingConstraint.getValue().name() ); + model.add( resource, SammNs.SAMM.value(), encoding ); return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitLanguageConstraint( final LanguageConstraint languageConstraint, final ModelElement context ) { - final Model model = visitConstraint( languageConstraint, null ).getModel(); + final Model model = visitConstraint( languageConstraint, null ).model(); final Resource resource = getElementResource( languageConstraint ); - model.add( resource, RDF.type, sammc.LanguageConstraint() ); - model.add( resource, sammc.languageCode(), serializePlainString( languageConstraint.getLanguageCode().toLanguageTag() ) ); + model.add( resource, RDF.type, SammNs.SAMMC.LanguageConstraint() ); + model.add( resource, SammNs.SAMMC.languageCode(), serializePlainString( languageConstraint.getLanguageCode().toLanguageTag() ) ); return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitLocaleConstraint( final LocaleConstraint localeConstraint, final ModelElement context ) { - final Model model = visitConstraint( localeConstraint, null ).getModel(); + final Model model = visitConstraint( localeConstraint, null ).model(); final Resource resource = getElementResource( localeConstraint ); - model.add( resource, RDF.type, sammc.LocaleConstraint() ); - model.add( resource, sammc.localeCode(), serializePlainString( localeConstraint.getLocaleCode().toLanguageTag() ) ); + model.add( resource, RDF.type, SammNs.SAMMC.LocaleConstraint() ); + model.add( resource, SammNs.SAMMC.localeCode(), serializePlainString( localeConstraint.getLocaleCode().toLanguageTag() ) ); return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitLengthConstraint( final LengthConstraint lengthConstraint, final ModelElement context ) { - final Model model = visitConstraint( lengthConstraint, null ).getModel(); + final Model model = visitConstraint( lengthConstraint, null ).model(); final Resource resource = getElementResource( lengthConstraint ); lengthConstraint.getMinValue().stream().map( minValue -> - createStatement( resource, sammc.minValue(), - serializeTypedValue( minValue.toString(), ExtendedXsdDataType.NON_NEGATIVE_INTEGER ) ) ) + createStatement( resource, SammNs.SAMMC.minValue(), + serializeTypedValue( minValue.toString(), SammXsdType.NON_NEGATIVE_INTEGER ) ) ) .forEach( model::add ); lengthConstraint.getMaxValue().stream().map( maxValue -> - createStatement( resource, sammc.maxValue(), - serializeTypedValue( maxValue.toString(), ExtendedXsdDataType.NON_NEGATIVE_INTEGER ) ) ) + createStatement( resource, SammNs.SAMMC.maxValue(), + serializeTypedValue( maxValue.toString(), SammXsdType.NON_NEGATIVE_INTEGER ) ) ) .forEach( model::add ); - model.add( resource, RDF.type, sammc.LengthConstraint() ); + model.add( resource, RDF.type, SammNs.SAMMC.LengthConstraint() ); return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitRangeConstraint( final RangeConstraint rangeConstraint, final ModelElement context ) { - final Model model = visitConstraint( rangeConstraint, null ).getModel(); + final Model model = visitConstraint( rangeConstraint, null ).model(); final Resource resource = getElementResource( rangeConstraint ); - model.add( resource, RDF.type, sammc.RangeConstraint() ); + model.add( resource, RDF.type, SammNs.SAMMC.RangeConstraint() ); rangeConstraint.getMinValue().stream() - .flatMap( minValue -> minValue.accept( this, rangeConstraint ).getFocusElement().stream() ) - .map( literal -> createStatement( resource, sammc.minValue(), literal ) ) + .flatMap( minValue -> minValue.accept( this, rangeConstraint ).focusElement().stream() ) + .map( literal -> createStatement( resource, SammNs.SAMMC.minValue(), literal ) ) .forEach( model::add ); rangeConstraint.getMaxValue().stream() - .flatMap( maxValue -> maxValue.accept( this, rangeConstraint ).getFocusElement().stream() ) - .map( literal -> createStatement( resource, sammc.maxValue(), literal ) ) + .flatMap( maxValue -> maxValue.accept( this, rangeConstraint ).focusElement().stream() ) + .map( literal -> createStatement( resource, SammNs.SAMMC.maxValue(), literal ) ) .forEach( model::add ); if ( rangeConstraint.getLowerBoundDefinition() != BoundDefinition.OPEN ) { - model.add( resource, sammc.lowerBoundDefinition(), - sammc.resource( rangeConstraint.getLowerBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) ); + model.add( resource, SammNs.SAMMC.lowerBoundDefinition(), + SammNs.SAMMC.resource( rangeConstraint.getLowerBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) ); } if ( rangeConstraint.getUpperBoundDefinition() != BoundDefinition.OPEN ) { - model.add( resource, sammc.upperBoundDefinition(), - sammc.resource( rangeConstraint.getUpperBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) ); + model.add( resource, SammNs.SAMMC.upperBoundDefinition(), + SammNs.SAMMC.resource( rangeConstraint.getUpperBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) ); } return new ElementModel( model, Optional.of( resource ) ); } @@ -404,22 +385,22 @@ public ElementModel visitRangeConstraint( final RangeConstraint rangeConstraint, @Override public ElementModel visitRegularExpressionConstraint( final RegularExpressionConstraint regularExpressionConstraint, final ModelElement context ) { - final Model model = visitConstraint( regularExpressionConstraint, null ).getModel(); + final Model model = visitConstraint( regularExpressionConstraint, null ).model(); final Resource resource = getElementResource( regularExpressionConstraint ); - model.add( resource, RDF.type, sammc.RegularExpressionConstraint() ); - model.add( resource, samm.value(), serializePlainString( regularExpressionConstraint.getValue() ) ); + model.add( resource, RDF.type, SammNs.SAMMC.RegularExpressionConstraint() ); + model.add( resource, SammNs.SAMM.value(), serializePlainString( regularExpressionConstraint.getValue() ) ); return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitFixedPointConstraint( final FixedPointConstraint fixedPointConstraint, final ModelElement context ) { - final Model model = visitConstraint( fixedPointConstraint, null ).getModel(); + final Model model = visitConstraint( fixedPointConstraint, null ).model(); final Resource resource = getElementResource( fixedPointConstraint ); - model.add( resource, RDF.type, sammc.FixedPointConstraint() ); - model.add( resource, sammc.integer(), - serializeTypedValue( fixedPointConstraint.getInteger().toString(), ExtendedXsdDataType.POSITIVE_INTEGER ) ); - model.add( resource, sammc.scale(), - serializeTypedValue( fixedPointConstraint.getScale().toString(), ExtendedXsdDataType.POSITIVE_INTEGER ) ); + model.add( resource, RDF.type, SammNs.SAMMC.FixedPointConstraint() ); + model.add( resource, SammNs.SAMMC.integer(), + serializeTypedValue( fixedPointConstraint.getInteger().toString(), SammXsdType.POSITIVE_INTEGER ) ); + model.add( resource, SammNs.SAMMC.scale(), + serializeTypedValue( fixedPointConstraint.getScale().toString(), SammXsdType.POSITIVE_INTEGER ) ); return new ElementModel( model, Optional.of( resource ) ); } @@ -427,7 +408,7 @@ public ElementModel visitFixedPointConstraint( final FixedPointConstraint fixedP public ElementModel visitCode( final Code code, final ModelElement context ) { final Model model = createCharacteristicsModel( code ); final Resource resource = getElementResource( code ); - model.add( resource, RDF.type, sammc.Code() ); + model.add( resource, RDF.type, SammNs.SAMMC.Code() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -435,10 +416,10 @@ public ElementModel visitCode( final Code code, final ModelElement context ) { public ElementModel visitDuration( final Duration duration, final ModelElement context ) { final Model model = createCharacteristicsModel( duration ); final Resource resource = getElementResource( duration ); - model.add( resource, RDF.type, sammc.Duration() ); + model.add( resource, RDF.type, SammNs.SAMMC.Duration() ); getUnitStatement( duration, resource ).ifPresent( model::add ); - duration.getUnit().map( unit -> unit.accept( this, duration ) ).ifPresent( elementModel -> model.add( elementModel.getModel() ) ); + duration.getUnit().map( unit -> unit.accept( this, duration ) ).ifPresent( elementModel -> model.add( elementModel.model() ) ); return new ElementModel( model, Optional.of( resource ) ); } @@ -446,13 +427,13 @@ public ElementModel visitDuration( final Duration duration, final ModelElement c public ElementModel visitEither( final Either either, final ModelElement context ) { final Model model = createCharacteristicsModel( either ); final Resource resource = getElementResource( either ); - model.add( resource, RDF.type, sammc.Either() ); + model.add( resource, RDF.type, SammNs.SAMMC.Either() ); final ElementModel left = either.getLeft().accept( this, either ); - left.getFocusElement().ifPresent( leftCharacteristic -> model.add( resource, sammc.left(), leftCharacteristic ) ); - model.add( left.getModel() ); + left.focusElement().ifPresent( leftCharacteristic -> model.add( resource, SammNs.SAMMC.left(), leftCharacteristic ) ); + model.add( left.model() ); final ElementModel right = either.getRight().accept( this, either ); - right.getFocusElement().ifPresent( rightCharacteristic -> model.add( resource, sammc.right(), rightCharacteristic ) ); - model.add( right.getModel() ); + right.focusElement().ifPresent( rightCharacteristic -> model.add( resource, SammNs.SAMMC.right(), rightCharacteristic ) ); + model.add( right.model() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -461,15 +442,15 @@ public ElementModel visitEnumeration( final Enumeration enumeration, final Model final Model model = createCharacteristicsModel( enumeration ); final Resource resource = getElementResource( enumeration ); if ( !(enumeration.is( State.class )) ) { - model.add( resource, RDF.type, sammc.Enumeration() ); + model.add( resource, RDF.type, SammNs.SAMMC.Enumeration() ); } final List elements = enumeration.getValues().stream().flatMap( value -> { final ElementModel valueElementModel = value.accept( this, enumeration ); - model.add( valueElementModel.getModel() ); - return valueElementModel.getFocusElement().stream(); + model.add( valueElementModel.model() ); + return valueElementModel.focusElement().stream(); } ).toList(); - model.add( resource, sammc.values(), model.createList( elements.iterator() ) ); + model.add( resource, SammNs.SAMMC.values(), model.createList( elements.iterator() ) ); return new ElementModel( model, Optional.of( resource ) ); } @@ -479,11 +460,10 @@ public ElementModel visitEntityInstance( final EntityInstance instance, final Mo final Resource resource = getElementResource( instance ); model.add( resource, RDF.type, getElementResource( instance.getEntityType() ) ); instance.getAssertions().forEach( ( key, value ) -> { - final org.apache.jena.rdf.model.Property property = ResourceFactory.createProperty( - key.getAspectModelUrn().orElseThrow().toString() ); + final org.apache.jena.rdf.model.Property property = ResourceFactory.createProperty( key.urn().toString() ); final ElementModel valueElementModel = value.accept( this, instance ); - model.add( valueElementModel.getModel() ); - valueElementModel.getFocusElement().ifPresent( elementValue -> model.add( resource, property, elementValue ) ); + model.add( valueElementModel.model() ); + valueElementModel.focusElement().ifPresent( elementValue -> model.add( resource, property, elementValue ) ); } ); return new ElementModel( model, Optional.of( resource ) ); } @@ -498,7 +478,7 @@ public ElementModel visitScalarValue( final ScalarValue value, final ModelElemen return new ElementModel( model, Optional.of( literal ) ); } - final Optional targetType = DataType.getAllSupportedTypesForMetaModelVersion( value.getMetaModelVersion() ).stream() + final Optional targetType = SammXsdType.ALL_TYPES.stream() .filter( dataType -> dataType.getURI().equals( type.getUrn() ) ).findAny(); if ( targetType.isEmpty() || type.getUrn().equals( XSD.xstring.getURI() ) ) { return new ElementModel( model, Optional.of( ResourceFactory.createStringLiteral( value.getValue().toString() ) ) ); @@ -512,8 +492,8 @@ public ElementModel visitCollectionValue( final CollectionValue collection, fina final Model model = ModelFactory.createDefaultModel(); final List elements = collection.getValues().stream().flatMap( value -> { final ElementModel valueElementModel = value.accept( this, collection ); - model.add( valueElementModel.getModel() ); - return valueElementModel.getFocusElement().stream(); + model.add( valueElementModel.model() ); + return valueElementModel.focusElement().stream(); } ).toList(); final RDFNode rdfList = model.createList( elements.iterator() ); return new ElementModel( model, Optional.of( rdfList ) ); @@ -521,20 +501,21 @@ public ElementModel visitCollectionValue( final CollectionValue collection, fina @Override public ElementModel visitState( final State state, final ModelElement context ) { - final Model model = visitEnumeration( state, null ).getModel(); + final Model model = visitEnumeration( state, null ).model(); final Resource resource = getElementResource( state ); - model.add( resource, RDF.type, sammc.State() ); + model.add( resource, RDF.type, SammNs.SAMMC.State() ); final ElementModel defaultValueElementModel = state.getDefaultValue().accept( this, state ); - model.add( defaultValueElementModel.getModel() ); - defaultValueElementModel.getFocusElement().ifPresent( defaultValue -> model.add( resource, sammc.defaultValue(), defaultValue ) ); + model.add( defaultValueElementModel.model() ); + defaultValueElementModel.focusElement() + .ifPresent( defaultValue -> model.add( resource, SammNs.SAMMC.defaultValue(), defaultValue ) ); return new ElementModel( model, Optional.of( resource ) ); } private Optional getUnitStatement( final Quantifiable elementWithUnit, final Resource targetResource ) { return elementWithUnit.getUnit() - .flatMap( NamedElement::getAspectModelUrn ) + .map( ModelElement::urn ) .map( AspectModelUrn::toString ) - .map( unitUrn -> createStatement( targetResource, sammc.unit(), + .map( unitUrn -> createStatement( targetResource, SammNs.SAMMC.unit(), createResource( unitUrn ) ) ); } @@ -542,12 +523,12 @@ private Optional getUnitStatement( final Quantifiable elementWithUnit public ElementModel visitMeasurement( final Measurement measurement, final ModelElement context ) { final Model model = createCharacteristicsModel( measurement ); final Resource resource = getElementResource( measurement ); - model.add( resource, RDF.type, sammc.Measurement() ); + model.add( resource, RDF.type, SammNs.SAMMC.Measurement() ); measurement.getUnit().ifPresent( unit -> { final ElementModel unitModel = unit.accept( this, measurement ); - model.add( unitModel.getModel() ); - unitModel.getFocusElement().ifPresent( unitResource -> model.add( resource, sammc.unit(), unitResource ) ); + model.add( unitModel.model() ); + unitModel.focusElement().ifPresent( unitResource -> model.add( resource, SammNs.SAMMC.unit(), unitResource ) ); } ); return new ElementModel( model, Optional.of( resource ) ); } @@ -556,12 +537,12 @@ public ElementModel visitMeasurement( final Measurement measurement, final Model public ElementModel visitQuantifiable( final Quantifiable quantifiable, final ModelElement context ) { final Model model = createCharacteristicsModel( quantifiable ); final Resource resource = getElementResource( quantifiable ); - model.add( resource, RDF.type, sammc.Quantifiable() ); + model.add( resource, RDF.type, SammNs.SAMMC.Quantifiable() ); quantifiable.getUnit().ifPresent( unit -> { final ElementModel unitModel = unit.accept( this, quantifiable ); - model.add( unitModel.getModel() ); - unitModel.getFocusElement().ifPresent( unitResource -> model.add( resource, sammc.unit(), unitResource ) ); + model.add( unitModel.model() ); + unitModel.focusElement().ifPresent( unitResource -> model.add( resource, SammNs.SAMMC.unit(), unitResource ) ); } ); return new ElementModel( model, Optional.of( resource ) ); } @@ -570,7 +551,7 @@ public ElementModel visitQuantifiable( final Quantifiable quantifiable, final Mo public ElementModel visitSingleEntity( final SingleEntity singleEntity, final ModelElement context ) { final Model model = createCharacteristicsModel( singleEntity ); final Resource resource = getElementResource( singleEntity ); - model.add( resource, RDF.type, sammc.SingleEntity() ); + model.add( resource, RDF.type, SammNs.SAMMC.SingleEntity() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -578,20 +559,20 @@ public ElementModel visitSingleEntity( final SingleEntity singleEntity, final Mo public ElementModel visitStructuredValue( final StructuredValue structuredValue, final ModelElement context ) { final Model model = createCharacteristicsModel( structuredValue ); final Resource resource = getElementResource( structuredValue ); - model.add( resource, RDF.type, sammc.StructuredValue() ); + model.add( resource, RDF.type, SammNs.SAMMC.StructuredValue() ); - model.add( resource, sammc.deconstructionRule(), serializePlainString( structuredValue.getDeconstructionRule() ) ); + model.add( resource, SammNs.SAMMC.deconstructionRule(), serializePlainString( structuredValue.getDeconstructionRule() ) ); final RDFList elementsList = model.createList( structuredValue.getElements().stream().map( element -> element instanceof String ? serializePlainString( (String) element ) : getElementResource( (Property) element ) ).iterator() ); - model.add( resource, sammc.elements(), elementsList ); + model.add( resource, SammNs.SAMMC.elements(), elementsList ); structuredValue.getElements().stream() .filter( Property.class::isInstance ) .map( Property.class::cast ) .map( property -> property.accept( this, structuredValue ) ) - .forEach( elementModel -> model.add( elementModel.getModel() ) ); + .forEach( elementModel -> model.add( elementModel.model() ) ); return new ElementModel( model, Optional.of( resource ) ); } @@ -599,16 +580,16 @@ public ElementModel visitStructuredValue( final StructuredValue structuredValue, public ElementModel visitTrait( final Trait trait, final ModelElement context ) { final Model model = createCharacteristicsModel( trait, true ); final Resource resource = getElementResource( trait ); - model.add( resource, RDF.type, sammc.Trait() ); + model.add( resource, RDF.type, SammNs.SAMMC.Trait() ); final Resource baseCharacteristicResource = getElementResource( trait.getBaseCharacteristic() ); - model.add( resource, sammc.baseCharacteristic(), baseCharacteristicResource ); - model.add( trait.getBaseCharacteristic().accept( this, trait ).getModel() ); + model.add( resource, SammNs.SAMMC.baseCharacteristic(), baseCharacteristicResource ); + model.add( trait.getBaseCharacteristic().accept( this, trait ).model() ); trait.getConstraints().forEach( constraint -> { final Resource constraintResource = getElementResource( constraint ); - model.add( resource, sammc.constraint(), constraintResource ); - model.add( constraint.accept( this, trait ).getModel() ); + model.add( resource, SammNs.SAMMC.constraint(), constraintResource ); + model.add( constraint.accept( this, trait ).model() ); } ); return new ElementModel( model, Optional.of( resource ) ); } @@ -617,18 +598,18 @@ public ElementModel visitTrait( final Trait trait, final ModelElement context ) public ElementModel visitAspect( final Aspect aspect, final ModelElement context ) { final Model model = ModelFactory.createDefaultModel(); final Resource resource = getElementResource( aspect ); - model.add( resource, RDF.type, samm.Aspect() ); + model.add( resource, RDF.type, SammNs.SAMM.Aspect() ); model.add( serializeDescriptions( resource, aspect ) ); model.add( serializeProperties( resource, aspect ) ); - model.add( resource, samm.operations(), model.createList( + model.add( resource, SammNs.SAMM.operations(), model.createList( aspect.getOperations().stream().map( this::getElementResource ).iterator() ) ); aspect.getOperations().stream().map( operation -> operation.accept( this, aspect ) ) - .forEach( elementModel -> model.add( elementModel.getModel() ) ); + .forEach( elementModel -> model.add( elementModel.model() ) ); if ( !aspect.getEvents().isEmpty() ) { - model.add( resource, samm.events(), model.createList( + model.add( resource, SammNs.SAMM.events(), model.createList( aspect.getEvents().stream().map( this::getElementResource ).iterator() ) ); aspect.getEvents().stream().map( event -> event.accept( this, aspect ) ) - .forEach( elementModel -> model.add( elementModel.getModel() ) ); + .forEach( elementModel -> model.add( elementModel.model() ) ); } return new ElementModel( model, Optional.of( resource ) ); } @@ -640,17 +621,17 @@ public ElementModel visitProperty( final Property property, final ModelElement c if ( property.getExtends().isPresent() ) { final Property superProperty = property.getExtends().get(); // The Property is an instantiation of an abstract Property: - // [ samm:extends :superProperty ; samm:characteristic ... ] + // [ SammNs.SAMM.extends :superProperty ; SammNs.SAMM.characteristic ... ] if ( !superProperty.getCharacteristic().equals( property.getCharacteristic() ) ) { final Resource propertyResource = createResource(); final Resource superPropertyResource = getElementResource( superProperty ); final ElementModel superPropertyElementModel = superProperty.accept( this, context ); - model.add( superPropertyElementModel.getModel() ); + model.add( superPropertyElementModel.model() ); property.getCharacteristic().ifPresent( characteristic -> { final Resource characteristicResource = getElementResource( characteristic ); - model.add( characteristic.accept( this, property ).getModel() ); - model.add( propertyResource, samm.characteristic(), characteristicResource ); - model.add( propertyResource, samm._extends(), superPropertyResource ); + model.add( characteristic.accept( this, property ).model() ); + model.add( propertyResource, SammNs.SAMM.characteristic(), characteristicResource ); + model.add( propertyResource, SammNs.SAMM._extends(), superPropertyResource ); } ); return new ElementModel( model, Optional.of( propertyResource ) ); } @@ -661,20 +642,20 @@ public ElementModel visitProperty( final Property property, final ModelElement c } final Resource resource = getElementResource( property ); - model.add( resource, RDF.type, samm.Property() ); + model.add( resource, RDF.type, SammNs.SAMM.Property() ); model.add( serializeDescriptions( resource, property ) ); property.getExampleValue().ifPresent( exampleValue -> { final ElementModel exampleValueElementModel = exampleValue.accept( this, property ); - model.add( exampleValueElementModel.getModel() ); - exampleValueElementModel.getFocusElement().ifPresent( exampleValueNode -> - model.add( resource, samm.exampleValue(), exampleValueNode ) ); + model.add( exampleValueElementModel.model() ); + exampleValueElementModel.focusElement().ifPresent( exampleValueNode -> + model.add( resource, SammNs.SAMM.exampleValue(), exampleValueNode ) ); } ); property.getCharacteristic().ifPresent( characteristic -> { final Resource characteristicResource = getElementResource( characteristic ); - model.add( characteristic.accept( this, property ).getModel() ); - model.add( resource, samm.characteristic(), characteristicResource ); + model.add( characteristic.accept( this, property ).model() ); + model.add( resource, SammNs.SAMM.characteristic(), characteristicResource ); } ); return new ElementModel( model, Optional.of( resource ) ); @@ -684,15 +665,16 @@ public ElementModel visitProperty( final Property property, final ModelElement c public ElementModel visitOperation( final Operation operation, final ModelElement context ) { final Model model = ModelFactory.createDefaultModel(); final Resource resource = getElementResource( operation ); - model.add( resource, RDF.type, samm.Operation() ); + model.add( resource, RDF.type, SammNs.SAMM.Operation() ); model.add( serializeDescriptions( resource, operation ) ); final List inputProperties = operation.getInput().stream().map( this::getElementResource ).toList(); - model.add( resource, samm.input(), model.createList( inputProperties.iterator() ) ); + model.add( resource, SammNs.SAMM.input(), model.createList( inputProperties.iterator() ) ); operation.getInput().stream().map( property -> property.accept( this, operation ) ) - .forEach( elementModel -> model.add( elementModel.getModel() ) ); - operation.getOutput().ifPresent( outputProperty -> model.add( resource, samm.output(), getElementResource( outputProperty ) ) ); + .forEach( elementModel -> model.add( elementModel.model() ) ); + operation.getOutput() + .ifPresent( outputProperty -> model.add( resource, SammNs.SAMM.output(), getElementResource( outputProperty ) ) ); operation.getOutput().map( outputProperty -> outputProperty.accept( this, operation ) ) - .ifPresent( elementModel -> model.add( elementModel.getModel() ) ); + .ifPresent( elementModel -> model.add( elementModel.model() ) ); return new ElementModel( model, Optional.of( resource ) ); } @@ -700,7 +682,7 @@ public ElementModel visitOperation( final Operation operation, final ModelElemen public ElementModel visitEvent( final Event event, final ModelElement context ) { final Model model = ModelFactory.createDefaultModel(); final Resource resource = getElementResource( event ); - model.add( resource, RDF.type, samm.Event() ); + model.add( resource, RDF.type, SammNs.SAMM.Event() ); model.add( serializeDescriptions( resource, event ) ); model.add( serializeParameters( resource, event ) ); return new ElementModel( model, Optional.of( resource ) ); @@ -710,11 +692,11 @@ public ElementModel visitEvent( final Event event, final ModelElement context ) public ElementModel visitCharacteristic( final Characteristic characteristic, final ModelElement context ) { if ( !isLocalElement( characteristic ) ) { return new ElementModel( ModelFactory.createDefaultModel(), - characteristic.getAspectModelUrn().map( urn -> createResource( urn.toString() ) ) ); + characteristic.isAnonymous() ? Optional.empty() : Optional.of( createResource( characteristic.urn().toString() ) ) ); } final Model model = createCharacteristicsModel( characteristic ); final Resource resource = getElementResource( characteristic ); - model.add( resource, RDF.type, samm.Characteristic() ); + model.add( resource, RDF.type, SammNs.SAMM.Characteristic() ); return new ElementModel( model, Optional.of( resource ) ); } @@ -729,30 +711,30 @@ public ElementModel visitComplexType( final ComplexType complexType, final Model final Resource resource = getElementResource( complexType ); if ( complexType.getExtends().isPresent() ) { final ComplexType extendedComplexType = complexType.getExtends().get(); - model.add( extendedComplexType.accept( this, extendedComplexType ).getModel() ); + model.add( extendedComplexType.accept( this, extendedComplexType ).model() ); final Resource extendedTypeResource = createResource( extendedComplexType.getUrn() ); - model.add( createStatement( resource, samm._extends(), extendedTypeResource ) ); + model.add( createStatement( resource, SammNs.SAMM._extends(), extendedTypeResource ) ); } model.add( serializeProperties( resource, complexType ) ); model.add( serializeDescriptions( resource, complexType ) ); if ( complexType.isAbstractEntity() ) { - model.add( createStatement( resource, RDF.type, samm.AbstractEntity() ) ); + model.add( createStatement( resource, RDF.type, SammNs.SAMM.AbstractEntity() ) ); } else { - model.add( createStatement( resource, RDF.type, samm.Entity() ) ); + model.add( createStatement( resource, RDF.type, SammNs.SAMM.Entity() ) ); } return new ElementModel( model, Optional.of( resource ) ); } @Override public ElementModel visitAbstractEntity( final AbstractEntity abstractEntity, final ModelElement context ) { - if ( abstractEntity.getUrn().startsWith( samme.getNamespace() ) ) { + if ( abstractEntity.getUrn().startsWith( SammNs.SAMM.getNamespace() ) ) { return new ElementModel( ModelFactory.createDefaultModel(), - abstractEntity.getAspectModelUrn().map( urn -> createResource( urn.toString() ) ) ); + abstractEntity.isAnonymous() ? Optional.empty() : Optional.of( createResource( abstractEntity.getUrn() ) ) ); } - final Model model = visitComplexType( abstractEntity, context ).getModel(); - abstractEntity.getExtendingElements().forEach( complexType -> model.add( complexType.accept( this, complexType ).getModel() ) ); + final Model model = visitComplexType( abstractEntity, context ).model(); + abstractEntity.getExtendingElements().forEach( complexType -> model.add( complexType.accept( this, complexType ).model() ) ); return new ElementModel( model, Optional.empty() ); } @@ -760,17 +742,18 @@ public ElementModel visitAbstractEntity( final AbstractEntity abstractEntity, fi public ElementModel visitUnit( final Unit unit, final ModelElement context ) { final Model model = ModelFactory.createDefaultModel(); final Resource unitResource = getElementResource( unit ); - if ( !unitResource.getNameSpace().equals( unitNamespace.getNamespace() ) ) { + if ( !unitResource.getNameSpace().equals( SammNs.UNIT.getNamespace() ) ) { // This is a unit defined in the scope of the Aspect model - model.add( unitResource, RDF.type, samm.Unit() ); + model.add( unitResource, RDF.type, SammNs.SAMM.Unit() ); unit.getQuantityKinds().forEach( quantityKind -> { final ElementModel quantityKindModel = quantityKind.accept( this, context ); - model.add( quantityKindModel.getModel() ); - quantityKindModel.getFocusElement().ifPresent( quantityKindResource -> - model.add( unitResource, samm.quantityKind(), quantityKindResource ) ); + model.add( quantityKindModel.model() ); + final RDFNode quantityKindResource = quantityKindModel.focusElement() + .orElseGet( () -> model.createResource( quantityKind.urn().toString() ) ); + model.add( unitResource, SammNs.SAMM.quantityKind(), quantityKindResource ); } ); model.add( serializeDescriptions( unitResource, unit ) ); - unit.getSymbol().ifPresent( symbol -> model.add( unitResource, samm.symbol(), serializePlainString( symbol ) ) ); + unit.getSymbol().ifPresent( symbol -> model.add( unitResource, SammNs.SAMM.symbol(), serializePlainString( symbol ) ) ); return new ElementModel( model, Optional.of( unitResource ) ); } return new ElementModel( model, Optional.of( unitResource ) ); @@ -780,19 +763,18 @@ public ElementModel visitUnit( final Unit unit, final ModelElement context ) { public ElementModel visitQuantityKind( final QuantityKind quantityKind, final ModelElement context ) { final Model model = ModelFactory.createDefaultModel(); final Resource quantityKindResource = getElementResource( quantityKind ); - if ( !quantityKindResource.getNameSpace().equals( unitNamespace.getNamespace() ) ) { - if ( quantityKind.getAspectModelUrn().map( quantityKindUrn -> - quantityKindUrn.getUrnPrefix().equals( unitNamespace.getNamespace() ) ).orElse( true ) ) { + if ( !SammNs.UNIT.getNamespace().equals( quantityKindResource.getNameSpace() ) ) { + if ( SammNs.UNIT.getNamespace().equals( quantityKind.urn().getUrnPrefix() ) ) { return new ElementModel( model, Optional.empty() ); } - model.add( quantityKindResource, RDF.type, samm.QuantityKind() ); - model.add( quantityKindResource, samm.preferredName(), ResourceFactory.createLangLiteral( quantityKind.getLabel(), "en" ) ); + model.add( quantityKindResource, RDF.type, SammNs.SAMM.QuantityKind() ); + model.add( quantityKindResource, SammNs.SAMM.preferredName(), ResourceFactory.createLangLiteral( quantityKind.getLabel(), "en" ) ); } return new ElementModel( model, Optional.of( quantityKindResource ) ); } @Override public Model apply( final Aspect aspect ) { - return visitAspect( aspect, null ).getModel(); + return visitAspect( aspect, null ).model(); } } diff --git a/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinterTest.java b/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinterTest.java index 6e57dd8f5..60ea03e03 100644 --- a/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinterTest.java +++ b/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/PrettyPrinterTest.java @@ -14,7 +14,6 @@ package org.eclipse.esmf.aspectmodel.serializer; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -22,46 +21,32 @@ import java.io.PrintWriter; import java.nio.charset.StandardCharsets; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; +import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestResources; import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.riot.RDFLanguages; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -public class PrettyPrinterTest extends MetaModelVersions { - +public class PrettyPrinterTest { @ParameterizedTest @EnumSource( value = TestAspect.class, mode = EnumSource.Mode.EXCLUDE, names = { - "MODEL_WITH_BLANK_AND_ADDITIONAL_NODES" // contains blank nodes which are not referenced from an aspect and therefore not pretty-printed + "MODEL_WITH_BLANK_AND_ADDITIONAL_NODES" } ) public void testPrettyPrinter( final TestAspect testAspect ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final Model originalModel = TestResources - .getModelWithoutResolution( testAspect, metaModelVersion ).getRawModel(); + final AspectModel aspectModel = TestResources.load( testAspect ); + final Model originalModel = aspectModel.files().iterator().next().sourceModel(); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); final PrintWriter writer = new PrintWriter( buffer, false, StandardCharsets.UTF_8 ); - new PrettyPrinter( new VersionedModel( ModelFactory.createDefaultModel(), metaModelVersion, originalModel ), - testAspect.getUrn(), writer ).print(); + new PrettyPrinter( originalModel, testAspect.getUrn(), writer ).print(); writer.flush(); final InputStream bufferInput = new ByteArrayInputStream( buffer.toByteArray() ); - final Model prettyPrintedModel = ModelFactory.createDefaultModel(); - try { - prettyPrintedModel.read( bufferInput, "", RDFLanguages.TURTLE.getName() ); - } catch ( final Exception e ) { - System.out.println( e.getMessage() ); - System.out.println(); - System.out.println( buffer ); - fail( "Syntax error" ); - } + final Model prettyPrintedModel = TurtleLoader.loadTurtle( buffer.toString( StandardCharsets.UTF_8 ) ).get(); assertThat( RdfComparison.hash( originalModel ).equals( RdfComparison.hash( prettyPrintedModel ) ) ).isTrue(); } diff --git a/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitorTest.java b/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitorTest.java index fab565868..01667f490 100644 --- a/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitorTest.java +++ b/core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitorTest.java @@ -20,24 +20,19 @@ import java.util.Map; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; import org.eclipse.esmf.test.TestResources; -import io.vavr.control.Try; import org.apache.jena.rdf.model.Model; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -public class RdfModelCreatorVisitorTest extends MetaModelVersions { - - @ParameterizedTest +public class RdfModelCreatorVisitorTest { /* * Exclude the test models that contain unused elements; the resulting serialized models can * never be identical to the original because the unused elements are ignored when loading the @@ -47,6 +42,7 @@ public class RdfModelCreatorVisitorTest extends MetaModelVersions { * an empty list as value) for now, so here the serialization will differ from the source model * as well. */ + @ParameterizedTest @EnumSource( value = TestAspect.class, mode = EnumSource.Mode.EXCLUDE, names = { "ASPECT_WITH_USED_AND_UNUSED_CHARACTERISTIC", "ASPECT_WITH_USED_AND_UNUSED_COLLECTION", @@ -61,24 +57,33 @@ public class RdfModelCreatorVisitorTest extends MetaModelVersions { "ASPECT_WITH_MULTIPLE_ENTITIES_SAME_EXTEND", "ASPECT_WITH_UMLAUT_DESCRIPTION", "MODEL_WITH_BROKEN_CYCLES", - "MODEL_WITH_BLANK_AND_ADDITIONAL_NODES" + "MODEL_WITH_BLANK_AND_ADDITIONAL_NODES", + "ASPECT_WITH_TIME_SERIES" } ) public void testRdfModelCreatorVisitor( final TestAspect testAspect ) { final KnownVersion knownVersion = KnownVersion.getLatest(); - final VersionedModel versionedModel = TestResources.getModel( testAspect, knownVersion ).get(); + final AspectModel aspectModel = TestResources.load( testAspect ); + final Aspect aspect = aspectModel.aspect(); - final Try tryAspect = AspectModelLoader.getSingleAspect( versionedModel ); - final Aspect aspect = tryAspect.getOrElseThrow( () -> new RuntimeException( tryAspect.getCause() ) ); + final RdfNamespace namespace = new RdfNamespace() { + @Override + public String getShortForm() { + return ""; + } - final Namespace namespace = () -> aspect.getAspectModelUrn().get().getUrnPrefix(); - final RdfModelCreatorVisitor visitor = new RdfModelCreatorVisitor( aspect.getMetaModelVersion(), namespace ); - final Model serializedModel = visitor.visitAspect( aspect, null ).getModel(); + @Override + public String getUri() { + return aspect.urn().getUrnPrefix(); + } + }; + final RdfModelCreatorVisitor visitor = new RdfModelCreatorVisitor( namespace ); + final Model serializedModel = visitor.visitAspect( aspect, null ).model(); - final Map prefixMap = new HashMap<>( Namespace.createPrefixMap( knownVersion ) ); + final Map prefixMap = new HashMap<>( RdfNamespace.createPrefixMap() ); prefixMap.put( "", namespace.getNamespace() ); serializedModel.setNsPrefixes( prefixMap ); - final Model originalModel = TestResources.getModelWithoutResolution( testAspect, knownVersion ).getRawModel(); + final Model originalModel = aspectModel.files().iterator().next().sourceModel(); serializedModel.clearNsPrefixMap(); originalModel.getNsPrefixMap().forEach( serializedModel::setNsPrefix ); @@ -95,24 +100,28 @@ public void testRdfModelCreatorVisitor( final TestAspect testAspect ) { } private String modelToString( final Model model ) { - return Arrays.stream( TestModel.modelToString( model ).split( "\\n" ) ) + return Arrays.stream( TestModel.modelToString( model ) + .replaceAll( ";", "" ) + .replaceAll( "\\.", "" ) + .replaceAll( " +", "" ) + .split( "\\n" ) ) .filter( line -> !line.contains( "samm-c:values" ) ) .filter( line -> !line.contains( "samm:see" ) ) .map( this::sortLineWithRdfListOrLangString ) .sorted() .collect( Collectors.joining() ) - .replaceAll( " *", " " ); + .replaceAll( " +", " " ); } /** * In some test models, lines with RDF lists appear, e.g.: - * :property ( "foo" "bar" ) + * :property ( "foo" "bar" ) * However, for some serialized models, the order of elements is non-deterministic since the underlying collection is a Set. * In order to check that the line is present in the two models, we simply tokenize and sort both lines, so we can compare them. */ private String sortLineWithRdfListOrLangString( final String line ) { if ( line.contains( " ( " ) || line.contains( "@" ) ) { - return Arrays.stream( line.split( " " ) ).sorted().collect( Collectors.joining() ); + return Arrays.stream( line.split( "[ ,\"]" ) ).sorted().collect( Collectors.joining() ); } return line; } diff --git a/core/esmf-aspect-model-starter/pom.xml b/core/esmf-aspect-model-starter/pom.xml index 5777abce4..3571f0499 100644 --- a/core/esmf-aspect-model-starter/pom.xml +++ b/core/esmf-aspect-model-starter/pom.xml @@ -32,14 +32,6 @@ org.eclipse.esmf esmf-aspect-model-urn - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - - - org.eclipse.esmf - esmf-aspect-model-resolver - org.eclipse.esmf esmf-aspect-meta-model-java diff --git a/core/esmf-aspect-model-urn/src/main/java/org/eclipse/esmf/aspectmodel/urn/AspectModelUrn.java b/core/esmf-aspect-model-urn/src/main/java/org/eclipse/esmf/aspectmodel/urn/AspectModelUrn.java index 376dfb142..6c108bd0e 100644 --- a/core/esmf-aspect-model-urn/src/main/java/org/eclipse/esmf/aspectmodel/urn/AspectModelUrn.java +++ b/core/esmf-aspect-model-urn/src/main/java/org/eclipse/esmf/aspectmodel/urn/AspectModelUrn.java @@ -100,7 +100,7 @@ public static AspectModelUrn fromUrn( final String urn ) { try { return fromUrn( new URI( urn ) ); } catch ( final URISyntaxException e ) { - throw new UrnSyntaxException( UrnSyntaxException.URN_IS_NO_URI ); + throw new UrnSyntaxException( UrnSyntaxException.URN_IS_NO_URI + ": " + urn ); } } diff --git a/core/esmf-aspect-model-validator/pom.xml b/core/esmf-aspect-model-validator/pom.xml index 9206d1600..3914209ab 100644 --- a/core/esmf-aspect-model-validator/pom.xml +++ b/core/esmf-aspect-model-validator/pom.xml @@ -40,14 +40,6 @@ org.eclipse.esmf esmf-aspect-model-urn - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - - - org.eclipse.esmf - esmf-aspect-model-resolver - org.graalvm.js js diff --git a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/SHACL.java b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/SHACL.java index ea5994b62..07cfc94d8 100644 --- a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/SHACL.java +++ b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/SHACL.java @@ -13,7 +13,7 @@ package org.eclipse.esmf.aspectmodel.shacl; -import org.eclipse.esmf.aspectmodel.vocabulary.Namespace; +import org.eclipse.esmf.metamodel.vocabulary.RdfNamespace; import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.Resource; @@ -24,7 +24,7 @@ // Since the class is an RDF vocabulary, naming rules for the class and for several methods (which should be named identically // to the corresponding model elements) are suppressed. @SuppressWarnings( { "checkstyle:AbbreviationAsWordInName", "NewMethodNamingConvention", "unused" } ) -public class SHACL implements Namespace { +public class SHACL implements RdfNamespace { public static final String NS = "http://www.w3.org/ns/shacl#"; @Override @@ -37,6 +37,11 @@ public String getNamespace() { return NS; } + @Override + public String getShortForm() { + return "sh"; + } + /** * The (single) value of this property must be a list of path elements, representing * the elements of alternative paths. diff --git a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/ShaclValidator.java b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/ShaclValidator.java index f35b92de7..f2852f742 100644 --- a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/ShaclValidator.java +++ b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/shacl/ShaclValidator.java @@ -22,7 +22,6 @@ import java.util.function.Function; import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.shacl.constraint.Constraint; import org.eclipse.esmf.aspectmodel.shacl.constraint.MinCountConstraint; import org.eclipse.esmf.aspectmodel.shacl.constraint.SparqlConstraint; @@ -118,13 +117,12 @@ private List validateElement( final Resource element, final Map validateModel( final VersionedModel model ) { - final Map> sparqlTargetsWithShapes = findSparqlTargets( model.getRawModel() ); - return Streams.stream( model.getRawModel().listStatements( null, RDF.type, (RDFNode) null ) ) + public List validateModel( final Model model ) { + final Map> sparqlTargetsWithShapes = findSparqlTargets( model ); + return Streams.stream( model.listStatements( null, RDF.type, (RDFNode) null ) ) .map( Statement::getSubject ) .filter( Resource::isURIResource ) - .flatMap( element -> validateElement( element, sparqlTargetsWithShapes, model.getModel() ).stream() ) + .flatMap( element -> validateElement( element, sparqlTargetsWithShapes, model ).stream() ) .toList(); } diff --git a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidator.java b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidator.java index eec80bdb1..20c72151a 100644 --- a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidator.java +++ b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidator.java @@ -13,24 +13,25 @@ package org.eclipse.esmf.aspectmodel.validation.services; +import java.io.File; import java.util.List; +import java.util.function.Supplier; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidRootElementCountException; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.exceptions.ParserException; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; import org.eclipse.esmf.aspectmodel.shacl.ShaclValidator; import org.eclipse.esmf.aspectmodel.shacl.violation.InvalidSyntaxViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.ProcessingViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; -import org.eclipse.esmf.metamodel.ModelElement; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.AspectModel; -import io.vavr.control.Try; +import io.vavr.control.Either; import org.apache.jena.query.ARQ; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; /** @@ -43,81 +44,91 @@ public class AspectModelValidator { * Default constructor that will use the latest meta model version */ public AspectModelValidator() { - this( KnownVersion.getLatest() ); + ARQ.init(); + shaclValidator = new ShaclValidator( MetaModelFile.metaModelShapes() ); } /** - * Constructor to choose the meta model version to use for validation + * Validates an Aspect Model provided by a Supplier. This can be used to make the validator also catch and handle + * loading and resolution errors, such as RDF/Turtle syntax errors or missing references. In those cases, corresponding + * violations such as {@link InvalidSyntaxViolation} and {@link ProcessingViolation} are created. * - * @param metaModelVersion the meta model version + * @param aspectModelSupplier the Aspect Model supplier + * @return a list of {@link Violation}s. An empty list indicates that the model is valid. */ - public AspectModelValidator( final KnownVersion metaModelVersion ) { - ARQ.init(); - shaclValidator = new ShaclValidator( new SammAspectMetaModelResourceResolver().loadShapesModel( metaModelVersion ) - .getOrElseThrow( () -> new RuntimeException( "Could not load meta model shapes" ) ) ); + public List validateModel( final Supplier aspectModelSupplier ) { + final Either, AspectModel> result = loadModel( aspectModelSupplier ); + if ( result.isLeft() ) { + return result.getLeft(); + } + return validateModel( result.get() ); } /** - * Validates an Aspect Model that is provided as a {@link VersionedModel}. + * Loads an Aspect Model provided by a Supplier and returns either the sucessfully loaded model or the list of + * violations representing resolution failures, syntax errors etc.. This method does not perform semantic validation. + * This method is an alternative to {@link AspectModelLoader#load(File)} and its siblings with the difference that on errors + * (syntax errors, resolution errors), no exception is thrown and a {@link Violation} is created instead. * - * @param versionedModel the Aspect Model - * @return a list of {@link Violation}s. An empty list indicates that the model is valid. + * @param aspectModelSupplier the Aspect Model supplier + * @return An {@link Either.Right} with the model if there are now violations, or an {@link Either.Left} with a list of + * {@link Violation}s. */ - public List validateModel( final VersionedModel versionedModel ) { - return validateModel( Try.success( versionedModel ) ); + public Either, AspectModel> loadModel( final Supplier aspectModelSupplier ) { + final AspectModel model; + try { + model = aspectModelSupplier.get(); + return Either.right( model ); + } catch ( final ParserException exception ) { // Syntax error + // RiotException's message looks like this: + // [line: 17, col: 2 ] Triples not terminated by DOT + final Pattern pattern = Pattern.compile( "\\[ *line: *(\\d+), *col: *(\\d+) *] *(.*)" ); + final Matcher matcher = pattern.matcher( exception.getMessage() ); + if ( matcher.find() ) { + final long line = Long.parseLong( matcher.group( 1 ) ); + final long column = Long.parseLong( matcher.group( 2 ) ); + final String message = matcher.group( 3 ); + return Either.left( List.of( new InvalidSyntaxViolation( message, exception.getSourceDocument(), line, column ) ) ); + } + return Either.left( + List.of( new InvalidSyntaxViolation( "Syntax error: " + exception.getMessage(), exception.getSourceDocument(), -1, -1 ) ) ); + } catch ( final Exception exception ) { // Any other exception, e.g., resolution exception + return Either.left( List.of( new ProcessingViolation( exception.getMessage(), exception ) ) ); + } } /** - * Validates an Aspect Model that is provided as a {@link Try} of a {@link VersionedModel} that can - * contain either a syntactically valid (but semantically invalid) Aspect model, or a Throwable - * if an error during parsing or resolution occurred. + * Validates an Aspect Model. * - * @param versionedModel the Aspect Model or the corresponding error + * @param aspectModel the Aspect Model * @return a list of {@link Violation}s. An empty list indicates that the model is valid. */ - public List validateModel( final Try versionedModel ) { - if ( versionedModel.isFailure() ) { - final Throwable cause = versionedModel.getCause(); - if ( cause instanceof final ParserException exception ) { - // RiotException's message looks like this: - // [line: 17, col: 2 ] Triples not terminated by DOT - final Pattern pattern = Pattern.compile( "\\[ *line: *(\\d+), *col: *(\\d+) *] *(.*)" ); - final Matcher matcher = pattern.matcher( cause.getMessage() ); - if ( matcher.find() ) { - final long line = Long.parseLong( matcher.group( 1 ) ); - final long column = Long.parseLong( matcher.group( 2 ) ); - final String message = matcher.group( 3 ); - return List.of( new InvalidSyntaxViolation( message, exception.getSourceDocument(), line, column ) ); - } - } - - return List.of( new ProcessingViolation( versionedModel.getCause().getMessage(), versionedModel.getCause() ) ); - } - // Determine violations for all model elements - final VersionedModel model = versionedModel.get(); - final List result = shaclValidator.validateModel( model ); + public List validateModel( final AspectModel aspectModel ) { + final Model model = ModelFactory.createDefaultModel(); + model.add( aspectModel.mergedModel() ); + model.add( MetaModelFile.metaModelDefinitions() ); + final List result = validateModel( model ); if ( result.isEmpty() ) { // The SHACL validation succeeded, check for cycles in the model. - final List cycleDetectionReport = new ModelCycleDetector().validateModel( model ); + final List cycleDetectionReport = new ModelCycleDetector().validateModel( aspectModel.mergedModel() ); if ( !cycleDetectionReport.isEmpty() ) { return cycleDetectionReport; } - - // To catch false positives, also try to load the model - final Try> modelElements = AspectModelLoader.getElements( model ); - if ( modelElements.isFailure() && !( modelElements.getCause() instanceof InvalidRootElementCountException ) ) { - return List.of( new ProcessingViolation( - "Validation succeeded, but an error was found while processing the model. " - + "This indicates an error in the model validation; please consider reporting this issue including the model " - + "at https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/issues -- " - + buildCauseMessage( modelElements.getCause() ), modelElements.getCause() ) ); - } } - return result; } + /** + * Validates an Aspect Model. Note that the model needs to include the SAMM meta model definitions to yield correct validation results. + * + * @param model the Aspect Model + * @return a list of {@link Violation}s. An empty list indicates that the model is valid. + */ + public List validateModel( final Model model ) { + return shaclValidator.validateModel( model ); + } + /** * Validates a single model element. * @@ -128,17 +139,4 @@ public List validateModel( final Try versionedModel ) public List validateElement( final Resource element ) { return shaclValidator.validateElement( element ); } - - private static String buildCauseMessage( final Throwable throwable ) { - final StringBuilder builder = new StringBuilder(); - Throwable t = throwable; - while ( t != null ) { - builder.append( t.getMessage() ); - t = t.getCause(); - if ( t != null ) { - builder.append( ": " ); - } - } - return builder.toString(); - } } diff --git a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/ModelCycleDetector.java b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/ModelCycleDetector.java index 7aaa1b678..52187a1b9 100644 --- a/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/ModelCycleDetector.java +++ b/core/esmf-aspect-model-validator/src/main/java/org/eclipse/esmf/aspectmodel/validation/services/ModelCycleDetector.java @@ -18,15 +18,14 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; -import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; import java.util.function.Consumer; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.shacl.violation.ProcessingViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SAMM; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.samm.KnownVersion; import org.apache.jena.query.Query; @@ -60,8 +59,8 @@ public class ModelCycleDetector { + "json payload."; private static final String PREFIXES = """ - prefix samm: - prefix samm-c: + prefix samm: + prefix samm-c: prefix rdf: """; @@ -71,21 +70,19 @@ public class ModelCycleDetector { private Query query; - private SAMM samm; + private final SAMM samm = SammNs.SAMM; private Model model; final List cycleDetectionReport = new ArrayList<>(); - public List validateModel( final VersionedModel versionedModel ) { + public List validateModel( final Model rawModel ) { discovered.clear(); discoveredOptionals.clear(); finished.clear(); cycleDetectionReport.clear(); - model = versionedModel.getModel(); - final Optional metaModelVersion = KnownVersion.fromVersionString( versionedModel.getMetaModelVersion().toString() ); - samm = new SAMM( metaModelVersion.get() ); - initializeQuery( metaModelVersion.get() ); + model = rawModel; + initializeQuery(); // we only want to investigate properties that are directly reachable from an Aspect final StmtIterator aspects = model.listStatements( null, RDF.type, samm.Aspect() ); @@ -225,9 +222,8 @@ private void reportCycle( final String cyclePath ) { } @SuppressWarnings( "checkstyle:LineLength" ) - private void initializeQuery( final KnownVersion metaModelVersion ) { - final String currentVersionPrefixes = String.format( PREFIXES, metaModelVersion.toVersionString(), - metaModelVersion.toVersionString() ); + private void initializeQuery() { + final String currentVersionPrefixes = PREFIXES.formatted( KnownVersion.getLatest().toVersionString() ); //noinspection LongLine final String queryString = String.format( """ %s select ?reachableProperty ?viaEither diff --git a/core/esmf-aspect-model-validator/src/test/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidatorTest.java b/core/esmf-aspect-model-validator/src/test/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidatorTest.java index 56a4d4340..389df44d1 100644 --- a/core/esmf-aspect-model-validator/src/test/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidatorTest.java +++ b/core/esmf-aspect-model-validator/src/test/java/org/eclipse/esmf/aspectmodel/validation/services/AspectModelValidatorTest.java @@ -14,87 +14,71 @@ package org.eclipse.esmf.aspectmodel.validation.services; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatCode; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; import org.eclipse.esmf.aspectmodel.shacl.fix.Fix; import org.eclipse.esmf.aspectmodel.shacl.violation.DatatypeViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.InvalidSyntaxViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.ProcessingViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.SparqlConstraintViolation; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import org.eclipse.esmf.samm.KnownVersion; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.test.InvalidTestAspect; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; -import org.eclipse.esmf.test.TestModel; import org.eclipse.esmf.test.TestProperty; import org.eclipse.esmf.test.TestResources; -import io.vavr.control.Try; +import com.github.jsonldjava.shaded.com.google.common.base.Supplier; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; import org.apache.jena.vocabulary.XSD; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; -class AspectModelValidatorTest extends MetaModelVersions { +class AspectModelValidatorTest { // One specific validator instance for each meta model version - private final Map service = Arrays.stream( KnownVersion.values() ) - .collect( Collectors.toMap( Function.identity(), AspectModelValidator::new ) ); - - @Test - void testValidAspect() { - final Try validAspectModel = TestResources.getModel( TestAspect.ASPECT, KnownVersion.getLatest() ); - final List violations = service.get( KnownVersion.getLatest() ).validateModel( validAspectModel ); - assertThat( violations ).isEmpty(); - } + AspectModelValidator service = new AspectModelValidator(); @ParameterizedTest @EnumSource( value = TestAspect.class ) void testValidateTestAspectModel( final TestAspect testAspect ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final Try tryModel = TestResources.getModel( testAspect, metaModelVersion ); - final List violations = service.get( metaModelVersion ).validateModel( tryModel ); + final AspectModel aspectModel = TestResources.load( testAspect ); + final List violations = service.validateModel( aspectModel ); assertThat( violations ).isEmpty(); } @ParameterizedTest @EnumSource( value = TestProperty.class ) void testValidateProperty( final TestProperty testProperty ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final Try tryModel = TestResources.getModel( testProperty, metaModelVersion ); - final List violations = service.get( metaModelVersion ).validateModel( tryModel ); + final AspectModel aspectModel = TestResources.load( testProperty ); + final List violations = service.validateModel( aspectModel ); assertThat( violations ).isEmpty(); } @ParameterizedTest - @MethodSource( "invalidTestModels" ) + @EnumSource( value = InvalidTestAspect.class, mode = EnumSource.Mode.EXCLUDE, + names = { + "ASPECT_MISSING_NAME_AND_PROPERTIES", + "ASPECT_MISSING_PROPERTIES", + "MISSING_ASPECT_DECLARATION" + } ) void testValidateInvalidTestAspectModel( final InvalidTestAspect testModel ) { - assertThatCode( () -> { - final Try invalidAspectModel = TestResources.getModel( testModel, KnownVersion.SAMM_2_1_0 ); - final List violations = service.get( KnownVersion.SAMM_2_1_0 ).validateModel( invalidAspectModel ); - assertThat( violations ).isNotEmpty(); - } ).doesNotThrowAnyException(); + final Supplier invalidAspectModel = () -> TestResources.load( testModel ); + final List violations = service.validateModel( invalidAspectModel ); + assertThat( violations ).isNotEmpty(); } - @ParameterizedTest - @MethodSource( "latestVersion" ) - void testGetFixForInvalidTestAspectModel( final KnownVersion metaModelVersion ) { - final TestModel testModel = InvalidTestAspect.INVALID_PREFERRED_NAME_DATATYPE; - final Try invalidAspectModel = TestResources.getModel( testModel, metaModelVersion ); - final List violations = service.get( metaModelVersion ).validateModel( invalidAspectModel ); + @Test + void testGetFixForInvalidTestAspectModel() { + final Supplier invalidAspectModel = () -> TestResources.load( InvalidTestAspect.INVALID_PREFERRED_NAME_DATATYPE ); + final List violations = service.validateModel( invalidAspectModel ); assertThat( violations ).isNotEmpty(); final DatatypeViolation violation = (DatatypeViolation) violations.get( 0 ); assertThat( violation.fixes() ).isNotEmpty(); @@ -102,43 +86,30 @@ void testGetFixForInvalidTestAspectModel( final KnownVersion metaModelVersion ) assertThat( fix.description() ).isEqualTo( "Add default @en language tag to value" ); } - private static Stream invalidTestModels() { - return Arrays.stream( InvalidTestAspect.values() ) - .filter( invalidTestAspect -> - (!invalidTestAspect.equals( InvalidTestAspect.ASPECT_MISSING_NAME_AND_PROPERTIES ) - && !invalidTestAspect.equals( InvalidTestAspect.ASPECT_MISSING_PROPERTIES )) ) - .map( Arguments::of ); - } - - @ParameterizedTest - @MethodSource( value = "versionsStartingWith2_0_0" ) - void testValidateValidModelElement( final KnownVersion metaModelVersion ) { - final VersionedModel testModel = TestResources.getModel( TestAspect.ASPECT_WITH_BOOLEAN, metaModelVersion ).get(); - final Resource element = testModel.getModel().createResource( TestAspect.TEST_NAMESPACE + "BooleanTestCharacteristic" ); - final List violations = service.get( metaModelVersion ).validateElement( element ); + @Test + void testValidateValidModelElement() { + final AspectModel testModel = TestResources.load( TestAspect.ASPECT_WITH_BOOLEAN ); + final Resource element = testModel.mergedModel().createResource( TestAspect.TEST_NAMESPACE + "BooleanTestCharacteristic" ); + final List violations = service.validateElement( element ); assertThat( violations ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "latestVersion" ) - void testValidateInvalidModelElement( final KnownVersion metaModelVersion ) { - final VersionedModel testModel = TestResources.getModel( InvalidTestAspect.INVALID_EXAMPLE_VALUE_DATATYPE, metaModelVersion ).get(); - final Resource element = testModel.getModel().createResource( TestAspect.TEST_NAMESPACE + "stringProperty" ); - final List violations = service.get( metaModelVersion ).validateElement( element ); + @Test + void testValidateInvalidModelElement() { + final AspectModel testModel = TestResources.load( InvalidTestAspect.INVALID_EXAMPLE_VALUE_DATATYPE ); + final Resource element = testModel.mergedModel().createResource( TestAspect.TEST_NAMESPACE + "stringProperty" ); + final List violations = service.validateElement( element ); assertThat( violations ).hasSize( 1 ); final SparqlConstraintViolation violation = (SparqlConstraintViolation) violations.get( 0 ); - final SAMM samm = new SAMM( metaModelVersion ); assertThat( violation.context().element() ).isEqualTo( element ); - assertThat( violation.context().property() ).contains( samm.exampleValue() ); + assertThat( violation.context().property() ).contains( SammNs.SAMM.exampleValue() ); assertThat( violation.bindings().get( "value" ).asResource().getURI() ).isEqualTo( XSD.xint.getURI() ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testInvalidTurtleSyntax( final KnownVersion metaModelVersion ) { - final Try invalidTurtleSyntax = TestResources.getModel( InvalidTestAspect.INVALID_SYNTAX, metaModelVersion ); - assertThat( invalidTurtleSyntax.isFailure() ).isTrue(); - final List violations = service.get( metaModelVersion ).validateModel( invalidTurtleSyntax ); + @Test + void testInvalidTurtleSyntax() { + final Supplier invalidTurtleSyntax = () -> TestResources.load( InvalidTestAspect.INVALID_SYNTAX ); + final List violations = service.validateModel( invalidTurtleSyntax ); assertThat( violations ).hasSize( 1 ); final InvalidSyntaxViolation violation = (InvalidSyntaxViolation) violations.get( 0 ); assertThat( violation.line() ).isEqualTo( 17 ); @@ -146,12 +117,10 @@ void testInvalidTurtleSyntax( final KnownVersion metaModelVersion ) { assertThat( violation.message() ).contains( "Triples not terminated by DOT" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testNonTurtleFile( final KnownVersion metaModelVersion ) { - final Try invalidTurtleSyntax = TestResources.getModel( InvalidTestAspect.ACTUALLY_JSON, metaModelVersion ); - assertThat( invalidTurtleSyntax.isFailure() ).isTrue(); - final List violations = service.get( metaModelVersion ).validateModel( invalidTurtleSyntax ); + @Test + void testNonTurtleFile() { + final Supplier invalidTurtleSyntax = () -> TestResources.load( InvalidTestAspect.ACTUALLY_JSON ); + final List violations = service.validateModel( invalidTurtleSyntax ); assertThat( violations ).hasSize( 1 ); final InvalidSyntaxViolation violation = (InvalidSyntaxViolation) violations.get( 0 ); assertThat( violation.line() ).isEqualTo( 12 ); @@ -163,60 +132,50 @@ void testNonTurtleFile( final KnownVersion metaModelVersion ) { * Verify that validation of the given aspect model containing a unit not specified in the unit catalog * and referred with samm namespace fails. */ - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithSammNamespaceForCustomUnit( final KnownVersion metaModelVersion ) { - final Try invalidAspectModel = TestResources - .getModel( InvalidTestAspect.ASPECT_WITH_SAMM_NAMESPACE_FOR_CUSTOM_UNIT, metaModelVersion ); + @Test + void testAspectWithSammNamespaceForCustomUnit() { + final Supplier invalidAspectModel = () -> TestResources + .load( InvalidTestAspect.ASPECT_WITH_SAMM_NAMESPACE_FOR_CUSTOM_UNIT ); - final List errors = service.get( metaModelVersion ).validateModel( invalidAspectModel ); + final List errors = service.validateModel( invalidAspectModel ); assertThat( errors ).hasSize( 1 ); assertThat( errors.get( 0 ) ).isOfAnyClassIn( ProcessingViolation.class ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testAspectWithInvalidMetaModelVersion( final KnownVersion metaModelVersion ) { - final Try invalidTurtleSyntax = TestResources.getModel( InvalidTestAspect.ASPECT_WITH_INVALID_VERSION, - metaModelVersion ); - assertThat( invalidTurtleSyntax.isFailure() ).isTrue(); - final List violations = service.get( metaModelVersion ).validateModel( invalidTurtleSyntax ); + @Test + void testAspectWithInvalidMetaModelVersion() { + final Supplier invalidTurtleSyntax = () -> TestResources.load( InvalidTestAspect.ASPECT_WITH_INVALID_VERSION ); + final List violations = service.validateModel( invalidTurtleSyntax ); assertThat( violations ).hasSize( 1 ); final ProcessingViolation violation = (ProcessingViolation) violations.get( 0 ); - assertThat( violation.message() ).contains( "does not contain element definition" ); + assertThat( violation.message() ).contains( "can not be updated to version" ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testMissingAspectDeclaration( final KnownVersion metaModelVersion ) { - final Try missingAspect = TestResources - .getModel( InvalidTestAspect.MISSING_ASPECT_DECLARATION, metaModelVersion ); - assertThat( missingAspect.isFailure() ).isTrue(); - final List violations = service.get( metaModelVersion ).validateModel( missingAspect ); - assertThat( violations ).hasSize( 1 ); - final ProcessingViolation violation = (ProcessingViolation) violations.get( 0 ); - assertThat( violation.message() ).contains( "does not contain element definition" ); + @Test + void testEmptyModel() { + final Supplier missingAspect = () -> TestResources.load( InvalidTestAspect.MISSING_ASPECT_DECLARATION ); + final List violations = service.validateModel( missingAspect ); + assertThat( violations ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testValidationWithMultipleAspects( final KnownVersion metaModelVersion ) { - final Try model = TestResources.getModel( TestAspect.ASPECT, metaModelVersion ); - model.forEach( versionedModel -> { - final VersionedModel model2 = TestResources.getModel( TestAspect.ASPECT_WITH_SIMPLE_TYPES, metaModelVersion ).get(); - versionedModel.getModel().add( model2.getRawModel() ); - versionedModel.getRawModel().add( model2.getRawModel() ); - } ); - - final List violations = service.get( metaModelVersion ).validateModel( model ); + @Test + void testValidationWithMultipleAspects() { + final AspectModel model = TestResources.load( TestAspect.ASPECT ); + final AspectModel model2 = TestResources.load( TestAspect.ASPECT_WITH_SIMPLE_TYPES ); + + final Model merged = ModelFactory.createDefaultModel(); + merged.add( model.mergedModel() ); + merged.add( model2.mergedModel() ); + merged.add( MetaModelFile.metaModelDefinitions() ); + + final List violations = service.validateModel( merged ); assertThat( violations ).isEmpty(); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCycleDetection( final KnownVersion metaModelVersion ) { - final Try versionedModel = TestResources.getModel( InvalidTestAspect.MODEL_WITH_CYCLES, metaModelVersion ); - final List report = service.get( metaModelVersion ).validateModel( versionedModel ); + @Test + void testCycleDetection() { + final Supplier versionedModel = () -> TestResources.load( InvalidTestAspect.MODEL_WITH_CYCLES ); + final List report = service.validateModel( versionedModel ); assertThat( report ).hasSize( 7 ); assertThat( report ).containsAll( cycles( ":a -> :b -> :a", @@ -224,18 +183,14 @@ void testCycleDetection( final KnownVersion metaModelVersion ) { ":h -> :h", ":h -> :i -> :h", ":l -> :l", - // TimeSeries are handled differently between v1 and v2 meta models. - metaModelVersion.isOlderThan( KnownVersion.SAMM_2_0_0 ) - ? ":n -> :refinedValue -> :n" - : ":n -> :NTimeSeriesEntity|samm-e:value -> :n", + ":n -> :NTimeSeriesEntity|samm-e:value -> :n", ":p -> :q -> :r -> :q" ) ); } - @ParameterizedTest - @MethodSource( value = "allVersions" ) - void testCycleDetectionWithCycleBreakers( final KnownVersion metaModelVersion ) { - final Try versionedModel = TestResources.getModel( TestAspect.MODEL_WITH_BROKEN_CYCLES, metaModelVersion ); - final List report = service.get( metaModelVersion ).validateModel( versionedModel ); + @Test + void testCycleDetectionWithCycleBreakers() { + final AspectModel aspectModel = TestResources.load( TestAspect.MODEL_WITH_BROKEN_CYCLES ); + final List report = service.validateModel( aspectModel ); assertThat( report ).isEmpty(); } diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/ComputedProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/ComputedProperty.java index d92eb16c1..8c002af8c 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/ComputedProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/ComputedProperty.java @@ -16,8 +16,8 @@ import java.util.Optional; import java.util.function.Function; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.impl.DefaultProperty; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; /** * Allows ad-hoc definitions of static properties that wrap another property and compute their value using a given function, taking the diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticContainerProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticContainerProperty.java index f2301cad1..225f09e4a 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticContainerProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticContainerProperty.java @@ -15,10 +15,10 @@ import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; /** * Extends {@link StaticProperty} to represent container or wrapper types like {@code Collection} or {code @Optional} diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticMetaClass.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticMetaClass.java index b2ffc18b9..bafae7e79 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticMetaClass.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticMetaClass.java @@ -19,7 +19,7 @@ import java.util.Set; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.metamodel.datatypes.LangString; +import org.eclipse.esmf.metamodel.datatype.LangString; import org.eclipse.esmf.samm.KnownVersion; /** diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticProperty.java index 88dc402d4..8203ca192 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticProperty.java @@ -15,12 +15,12 @@ import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Type; import org.eclipse.esmf.metamodel.impl.DefaultProperty; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; /** * Extends the SAMM {@link DefaultProperty} definition with a concrete type. diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticUnitProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticUnitProperty.java index 3ae456261..c2092cb91 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticUnitProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/StaticUnitProperty.java @@ -15,11 +15,11 @@ import java.util.Optional; -import org.eclipse.esmf.characteristic.Quantifiable; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; /** * Extends the {@link StaticProperty} definition with a {@link Unit}. Only {@link Quantifiable} properties that actually carry a diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintContainerProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintContainerProperty.java index c84304d24..479325eba 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintContainerProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintContainerProperty.java @@ -15,10 +15,10 @@ import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.staticmetamodel.ContainerProperty; /** diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintProperty.java index b978a2416..785e13362 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintProperty.java @@ -15,11 +15,11 @@ import java.util.Optional; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.impl.DefaultProperty; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.staticmetamodel.StaticProperty; /** diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintUnitProperty.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintUnitProperty.java index 034754464..1ad9435f7 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintUnitProperty.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/constraint/StaticConstraintUnitProperty.java @@ -15,12 +15,12 @@ import java.util.Optional; -import org.eclipse.esmf.characteristic.Quantifiable; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.metamodel.Characteristic; import org.eclipse.esmf.metamodel.Property; import org.eclipse.esmf.metamodel.ScalarValue; import org.eclipse.esmf.metamodel.Unit; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.metamodel.characteristic.Quantifiable; import org.eclipse.esmf.staticmetamodel.UnitProperty; /** diff --git a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/propertychain/PropertyChain.java b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/propertychain/PropertyChain.java index 2974e76b2..38a6b7685 100644 --- a/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/propertychain/PropertyChain.java +++ b/core/esmf-aspect-static-meta-model-java/src/main/java/org/eclipse/esmf/staticmetamodel/propertychain/PropertyChain.java @@ -22,9 +22,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.esmf.metamodel.NamedElement; +import org.eclipse.esmf.aspectmodel.loader.MetaModelBaseAttributes; +import org.eclipse.esmf.metamodel.ModelElement; import org.eclipse.esmf.metamodel.impl.DefaultProperty; -import org.eclipse.esmf.metamodel.loader.MetaModelBaseAttributes; import org.eclipse.esmf.staticmetamodel.PropertyAccessor; import org.eclipse.esmf.staticmetamodel.PropertyTypeInformation; import org.eclipse.esmf.staticmetamodel.StaticContainerProperty; @@ -208,7 +208,7 @@ public int hashCode() { public String toString() { return new StringJoiner( ", ", getClass().getSimpleName() + "[", "]" ) .add( getContainingType().getSimpleName() ) - .add( properties.stream().map( NamedElement::getName ).collect( Collectors.joining( "." ) ) ) + .add( properties.stream().map( ModelElement::getName ).collect( Collectors.joining( "." ) ) ) .toString(); } } diff --git a/core/esmf-test-aspect-models/pom.xml b/core/esmf-test-aspect-models/pom.xml index 4cbf8d1c0..2eb9e00e2 100644 --- a/core/esmf-test-aspect-models/pom.xml +++ b/core/esmf-test-aspect-models/pom.xml @@ -32,6 +32,10 @@ org.eclipse.esmf esmf-aspect-model-urn + + org.eclipse.esmf + esmf-semantic-aspect-meta-model + org.apache.commons commons-text @@ -40,9 +44,5 @@ org.apache.jena jena-core - - org.eclipse.esmf - esmf-semantic-aspect-meta-model - diff --git a/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/MetaModelVersions.java b/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/MetaModelVersions.java deleted file mode 100644 index 9894fb3ec..000000000 --- a/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/MetaModelVersions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.test; - -import java.util.Arrays; -import java.util.stream.Stream; - -import org.eclipse.esmf.samm.KnownVersion; - -public abstract class MetaModelVersions { - - protected MetaModelVersions() { - } - - protected static Stream allVersions() { - return Arrays.stream( KnownVersion.values() ).dropWhile( KnownVersion.SAMM_1_0_0::isNewerThan ); - } - - protected static Stream versionsStartingWith( final KnownVersion version ) { - return allVersions().dropWhile( version::isNewerThan ); - } - - protected static Stream versionsUpToIncluding( final KnownVersion version ) { - return allVersions().takeWhile( v -> version.isNewerThan( v ) || v.equals( version ) ); - } - - protected static Stream versionsBetween( final KnownVersion start, final KnownVersion end ) { - return versionsStartingWith( start ).takeWhile( v -> !v.isNewerThan( end ) ); - } - - protected static Stream latestVersion() { - return Stream.of( KnownVersion.getLatest() ); - } - - @SuppressWarnings( "squid:S00100" ) // Underscores are required to make version unambiguous - protected static Stream versionsStartingWith2_0_0() { - return versionsStartingWith( KnownVersion.SAMM_2_0_0 ); - } - - protected static Stream versionsUpToIncluding1_0_0() { - return versionsUpToIncluding( KnownVersion.SAMM_1_0_0 ); - } - - protected static Stream versionsUpToIncluding2_0_0() { - return versionsUpToIncluding( KnownVersion.SAMM_2_0_0 ); - } -} diff --git a/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/TestSharedModel.java b/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/TestSharedModel.java index 42ddcb5bb..5d469b7d8 100644 --- a/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/TestSharedModel.java +++ b/core/esmf-test-aspect-models/src/main/java/org/eclipse/esmf/test/TestSharedModel.java @@ -13,13 +13,9 @@ package org.eclipse.esmf.test; -import java.io.StringWriter; - import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.apache.jena.rdf.model.Model; - -public interface TestSharedModel { +public interface TestSharedModel extends TestModel { String TEST_NAMESPACE = "urn:samm:org.eclipse.esmf.test.shared:1.0.0#"; String getName(); @@ -27,10 +23,4 @@ public interface TestSharedModel { default AspectModelUrn getUrn() { return AspectModelUrn.fromUrn( TEST_NAMESPACE + getName() ); } - - static String modelToString( final Model model ) { - final StringWriter stringWriter = new StringWriter(); - model.write( stringWriter, "TURTLE" ); - return stringWriter.toString(); - } } diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl rename to core/esmf-test-aspect-models/src/main/resources/invalid/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl deleted file mode 100644 index 3900b5257..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -{ - "key": "value" -} diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl deleted file mode 100644 index ebf83876e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectMissingNameAndProperties a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl deleted file mode 100644 index c1563f193..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectMissingProperties a samm:Aspect ; - samm:name "InvalidAspectMissingProperties" ; - samm:preferredName "Test Aspect"@en ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl deleted file mode 100644 index 424c6901a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectWithInvalidVersion a samm:Aspect ; - samm:name "AspectWithInvalidVersion" ; - samm:preferredName "Test Aspect"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl deleted file mode 100644 index f70528437..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix xsd: . -@prefix samm: . -@prefix unit: . -@prefix samm-c: . -@prefix samm-e: . -@prefix : . - -:AspectWithRecursiveProperty a samm:Aspect; - samm:name "AspectWithRecursiveProperty"; - samm:properties ( :testProperty); - samm:operations (). -:testProperty a samm:Property; - samm:name "testProperty"; - samm:characteristic :testItemCharacteristic. -:testItemCharacteristic a samm-c:SingleEntity; - samm:name "testItemCharacteristic"; - samm:dataType :testEntity. -:testEntity a samm:Entity; - samm:name "testEntity"; - samm:properties (:testProperty). diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSammNamespaceForCustomUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSammNamespaceForCustomUnit.ttl deleted file mode 100644 index 79b52e921..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSammNamespaceForCustomUnit.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSammNamespaceForCustomUnit a samm:Aspect ; - samm:name "AspectWithSammNamespaceForCustomUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm:dataType xsd:int ; - samm-c:unit samm:normLitrePerMinute . - -samm:normLitrePerMinute a unit:Unit ; - samm:name "normLitrePerMinute" ; - samm:preferredName "norm litre per minute"@en ; - unit:quantityKind unit:volumeFlowRate ; - unit:symbol "nl/min" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl deleted file mode 100644 index 04f253d27..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:InvalidExampleValueDatatype a samm:Aspect ; - samm:name "InvalidExampleValueDatatype" ; - samm:properties ( :stringProperty ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:name "stringProperty" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl deleted file mode 100644 index cac04fc70..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:InvalidSyntax a samm:Aspect; - samm:name "TestAspect" - samm:preferredName "Test Aspect"@en; - samm:properties () ; - samm:operations () . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl deleted file mode 100644 index 01951d81b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl deleted file mode 100644 index ed7d8f22b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl +++ /dev/null @@ -1,222 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . - -:ModelWithCycles a samm:Aspect ; - samm:name "ModelWithCycles" ; - samm:properties ( :a :e :h :l :n [ samm:property :p ; samm:optional true ; ] ) ; - samm:operations ( ) . - -##################################### -# direct cycle between two properties -##################################### -:a a samm:Property; - samm:name "a" ; - samm:characteristic :aCharacteristic. - -:aCharacteristic a samm:Characteristic; - samm:name "aCharacteristic" ; - samm:dataType :AEntity. - -:AEntity a samm:Entity; - samm:name "AEntity" ; - samm:properties ( :b ) . - -:b a samm:Property; - samm:name "b" ; - samm:characteristic :bCharacteristic. - -:bCharacteristic a samm:Characteristic; - samm:name "bCharacteristic" ; - samm:dataType :BEntity. - -:BEntity a samm:Entity; - samm:name "BEntity" ; - samm:properties ( :a ) . - -############################################# -# indirect cycle via an intermediate property -############################################# -:e a samm:Property; - samm:name "e" ; - samm:characteristic :eCharacteristic. - -:eCharacteristic a samm:Characteristic; - samm:name "eCharacteristic" ; - samm:dataType :EEntity. - -:EEntity a samm:Entity; - samm:name "EEntity" ; - samm:properties ( :f ) . - -:f a samm:Property; - samm:name "f" ; - samm:characteristic :fCharacteristic. - -:fCharacteristic a samm:Characteristic; - samm:name "fCharacteristic" ; - samm:dataType :FEntity. - -:FEntity a samm:Entity; - samm:name "FEntity" ; - samm:properties ( :g ) . - -:g a samm:Property; - samm:name "g" ; - samm:characteristic :gCharacteristic. - -:gCharacteristic a samm:Characteristic; - samm:name "gCharacteristic" ; - samm:dataType :GEntity. - -:GEntity a samm:Entity; - samm:name "GEntity" ; - samm:properties ( :e ) . - -############################################## -# cycle via both branches of samm-c:Either -############################################## -:h a samm:Property; - samm:name "h" ; - samm:characteristic :hCharacteristic. - -:hCharacteristic a samm-c:Either; - samm:name "hCharacteristic" ; - samm-c:left :leftCharacteristic ; - samm-c:right :rightCharacteristic. - -:leftCharacteristic a samm:Characteristic; - samm:name "leftCharacteristic" ; - samm:dataType :LeftEntity. - -:rightCharacteristic a samm:Characteristic; - samm:name "rightCharacteristic" ; - samm:dataType :RightEntity. - -:LeftEntity a samm:Entity; - samm:name "LeftEntity" ; - samm:properties ( :h ) . # direct cycle - -:RightEntity a samm:Entity; - samm:name "RightEntity" ; - samm:properties ( :i ) . # cycle via an intermediary property - -:i a samm:Property; - samm:name "i" ; - samm:characteristic :iCharacteristic. - -:iCharacteristic a samm:Characteristic; - samm:name "iCharacteristic" ; - samm:dataType :IEntity. - -:IEntity a samm:Entity; - samm:name "IEntity" ; - samm:properties ( :h ) . - -############################################# -# cycle via samm-c:baseCharacteristic -############################################# -:l a samm:Property; - samm:name "l" ; - samm:characteristic :lCharacteristic . - -:lCharacteristic a samm-c:Trait; - samm:name "lCharacteristic" ; - samm-c:baseCharacteristic :MEntityList ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] . - -:MEntityList a samm-c:List ; - samm:name "MEntityList" ; - samm:dataType :MEntity . - -:MEntity a samm:Entity; - samm:name "MEntity" ; - samm:properties ( :l ) . - -#################################################### -# cycle via samm-e:TimeSeriesEntity and samm:extends -#################################################### -:n a samm:Property ; - samm:name "n" ; - samm:characteristic :NTimeSeries . - -:NTimeSeries a samm-c:TimeSeries ; - samm:name "NTimeSeries" ; - samm:dataType :NTimeSeriesEntity . - -:NTimeSeriesEntity samm:refines samm-e:TimeSeriesEntity ; - samm:name "NTimeSeriesEntity" ; - samm:properties ( :refinedValue ) . - -:refinedValue samm:refines samm-e:value ; - samm:name "refinedValue" ; - samm:characteristic :oCharacteristic . - -:oCharacteristic a samm:Characteristic; - samm:name "mCharacteristic" ; - samm:dataType :OEntity. - -:OEntity a samm:Entity; - samm:name "OEntity" ; - samm:properties ( :n ) . - -###################################################### -# optional property *before* a cycle does not break it -###################################################### -:p a samm:Property ; - samm:name "p" ; - samm:characteristic :pCharacteristic . - -:pCharacteristic a samm:Characteristic; - samm:name "pCharacteristic" ; - samm:dataType :PEntity. - -:PEntity a samm:Entity; - samm:name "PEntity" ; - samm:properties ( :q ) . - -:q a samm:Property ; - samm:name "q" ; - samm:characteristic :qCharacteristic . - -:qCharacteristic a samm:Characteristic; - samm:name "qCharacteristic" ; - samm:dataType :QEntity. - -:QEntity a samm:Entity; - samm:name "QEntity" ; - samm:properties ( :r ) . - -:r a samm:Property ; - samm:name "rEntity" ; - samm:characteristic :rCharacteristic . - -:rCharacteristic a samm:Characteristic; - samm:name "rCharacteristic" ; - samm:dataType :REntity. - -:REntity a samm:Entity; - samm:name "REntity" ; - samm:properties ( :q ) . - - - - - - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl deleted file mode 100644 index a2bdd9ce1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:ValidAspect a samm:Aspect ; - samm:name "ValidAspect" ; - samm:preferredName "Test Aspect"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl deleted file mode 100644 index 658b46f3c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ActuallyJson.ttl +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -{ - "key": "value" -} \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl deleted file mode 100644 index c38bf963f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingNameAndProperties.ttl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectMissingNameAndProperties a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl deleted file mode 100644 index 2b2cba60a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectMissingProperties.ttl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectMissingProperties a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl deleted file mode 100644 index a1a6a476d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithInvalidVersion.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:AspectWithInvalidVersion a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl deleted file mode 100644 index de141d7f5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursiveProperty.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix xsd: . -@prefix samm: . -@prefix unit: . -@prefix samm-c: . -@prefix samm-e: . -@prefix : . - -:AspectWithRecursiveProperty a samm:Aspect; - samm:properties ( :testProperty); - samm:operations (). -:testProperty a samm:Property; - samm:characteristic :testItemCharacteristic. -:testItemCharacteristic a samm-c:SingleEntity; - samm:dataType :testEntity. -:testEntity a samm:Entity; - samm:properties (:testProperty). diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl deleted file mode 100644 index ba46b2dfd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidExampleValueDatatype.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:InvalidExampleValueDatatype a samm:Aspect ; - samm:properties ( :stringProperty ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl deleted file mode 100644 index cdf56f8a1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidPreferredNameDatatype.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:InvalidPreferredNameDatatype a samm:Aspect ; - samm:preferredName "Invalid PreferredName Datatype" ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl deleted file mode 100644 index 3d0bd92bd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/InvalidSyntax.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:InvalidSyntax a samm:Aspect; - samm:preferredName "Test Aspect"@en - samm:properties () ; - samm:operations () . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl deleted file mode 100644 index a1880dac8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/MissingAspectDeclaration.ttl +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl deleted file mode 100644 index 75650120a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithCycles.ttl +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . - -:ModelWithCycles a samm:Aspect ; - samm:properties ( :a :e :h :l :n [ samm:property :p ; samm:optional true ; ] ) . - -##################################### -# direct cycle between two properties -##################################### -:a a samm:Property; - samm:characteristic :aCharacteristic. - -:aCharacteristic a samm:Characteristic; - samm:dataType :AEntity. - -:AEntity a samm:Entity; - samm:properties ( :b ) . - -:b a samm:Property; - samm:characteristic :bCharacteristic. - -:bCharacteristic a samm:Characteristic; - samm:dataType :BEntity. - -:BEntity a samm:Entity; - samm:properties ( :a ) . - -############################################# -# indirect cycle via an intermediate property -############################################# -:e a samm:Property; - samm:characteristic :eCharacteristic. - -:eCharacteristic a samm:Characteristic; - samm:dataType :EEntity. - -:EEntity a samm:Entity; - samm:properties ( :f ) . - -:f a samm:Property; - samm:characteristic :fCharacteristic. - -:fCharacteristic a samm:Characteristic; - samm:dataType :FEntity. - -:FEntity a samm:Entity; - samm:properties ( :g ) . - -:g a samm:Property; - samm:characteristic :gCharacteristic. - -:gCharacteristic a samm:Characteristic; - samm:dataType :GEntity. - -:GEntity a samm:Entity; - samm:properties ( :e ) . - -############################################## -# cycle via both branches of samm-c:Either -############################################## -:h a samm:Property; - samm:characteristic :hCharacteristic. - -:hCharacteristic a samm-c:Either; - samm-c:left :leftCharacteristic ; - samm-c:right :rightCharacteristic. - -:leftCharacteristic a samm:Characteristic; - samm:dataType :LeftEntity. - -:rightCharacteristic a samm:Characteristic; - samm:dataType :RightEntity. - -:LeftEntity a samm:Entity; - samm:properties ( :h ) . # direct cycle - -:RightEntity a samm:Entity; - samm:properties ( :i ) . # cycle via an intermediary property - -:i a samm:Property; - samm:characteristic :iCharacteristic. - -:iCharacteristic a samm:Characteristic; - samm:dataType :IEntity. - -:IEntity a samm:Entity; - samm:properties ( :h ) . - -############################################# -# cycle via samm-c:baseCharacteristic -############################################# -:l a samm:Property; - samm:characteristic :lCharacteristic . - -:lCharacteristic a samm-c:Trait; - samm-c:baseCharacteristic :MEntityList ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] . - -:MEntityList a samm-c:List ; - samm:dataType :MEntity . - -:MEntity a samm:Entity; - samm:properties ( :l ) . - -#################################################### -# cycle via samm-e:TimeSeriesEntity and samm:extends -#################################################### -:n a samm:Property ; - samm:characteristic :NTimeSeries . - -:NTimeSeries a samm-c:TimeSeries ; - samm:dataType :NTimeSeriesEntity . - -:NTimeSeriesEntity a samm:Entity ; - samm:extends samm-e:TimeSeriesEntity ; - samm:properties ( [ samm:extends samm-e:value ; samm:characteristic :oCharacteristic ] ) . - -:oCharacteristic a samm:Characteristic; - samm:dataType :OEntity. - -:OEntity a samm:Entity; - samm:properties ( :n ) . - -###################################################### -# optional property *before* a cycle does not break it -###################################################### -:p a samm:Property ; - samm:characteristic :pCharacteristic . - -:pCharacteristic a samm:Characteristic; - samm:dataType :PEntity. - -:PEntity a samm:Entity; - samm:properties ( :q ) . - -:q a samm:Property ; - samm:characteristic :qCharacteristic . - -:qCharacteristic a samm:Characteristic; - samm:dataType :QEntity. - -:QEntity a samm:Entity; - samm:properties ( :r ) . - -:r a samm:Property ; - samm:characteristic :rCharacteristic . - -:rCharacteristic a samm:Characteristic; - samm:dataType :REntity. - -:REntity a samm:Entity; - samm:properties ( :q ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl deleted file mode 100644 index 20c816e3d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/RangeConstraintWithWrongType.ttl +++ /dev/null @@ -1,16 +0,0 @@ -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . -@prefix : . - -:NumberTrait a samm-c:Trait ; - samm-c:baseCharacteristic :NumberList; - samm-c:constraint :RangeConstraintWithWrongType . - -:RangeConstraintWithWrongType a samm-c:RangeConstraint; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger . - -:NumberList a samm-c:List ; - samm:dataType xsd:float . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl b/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl deleted file mode 100644 index 9ed335a7a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ValidAspect.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . - -:ValidAspect a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithCollectionOfSimpleType.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithCollectionOfSimpleType.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithCollectionOfSimpleType.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithCollectionOfSimpleType.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithComplexEntityCollectionEnum.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithComplexEntityCollectionEnum.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithComplexEntityCollectionEnum.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithComplexEntityCollectionEnum.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEither.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEither.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEither.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEither.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEitherWithComplexTypes.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEitherWithComplexTypes.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEitherWithComplexTypes.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEitherWithComplexTypes.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEntity.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEntity.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEntity.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEntity.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEntityList.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEntityList.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithEntityList.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithEntityList.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithMultiLanguageText.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithMultiLanguageText.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithMultiLanguageText.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithMultiLanguageText.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithNestedEntity.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithNestedEntity.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithNestedEntity.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithNestedEntity.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithNestedEntityList.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithNestedEntityList.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithNestedEntityList.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithNestedEntityList.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithProperty.json b/core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithProperty.json similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_0_0/AspectWithProperty.json rename to core/esmf-test-aspect-models/src/main/resources/payloads/AspectWithProperty.json diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithCollectionOfSimpleType.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithCollectionOfSimpleType.json deleted file mode 100644 index c8e2a5545..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithCollectionOfSimpleType.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "testList": [ - 1, - 2, - 3, - 4, - 5, - 6 - ] -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithComplexEntityCollectionEnum.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithComplexEntityCollectionEnum.json deleted file mode 100644 index 7b7d0c37d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithComplexEntityCollectionEnum.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "myPropertyOne": { - "entityPropertyOne": [ - { - "entityPropertyTwo": "foo" - } - ] - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEither.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEither.json deleted file mode 100644 index af5a8a845..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEither.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "testProperty": { - "left": "left-value" - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEitherWithComplexTypes.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEitherWithComplexTypes.json deleted file mode 100644 index 79b9ae5cd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEitherWithComplexTypes.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "testProperty": { - "left": { - "result": "The result" - } - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntity.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntity.json deleted file mode 100644 index 22f51f49d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntity.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "testProperty": { - "entityProperty": "This is an entity property" - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntityList.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntityList.json deleted file mode 100644 index a00d056ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithEntityList.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "testList": [ - { - "testString": "Example Value Test", - "randomValue": "eOMtThyhVNLWUZNRcBaQKxI", - "testInt": 3, - "testFloat": 2.25, - "testLocalDateTime": "2018-02-28T14:23:32.918Z" - }, - { - "testString": "Second Example Value Test", - "randomValue": "abaGZhgiuwehgiwujowik", - "testInt": 4, - "testFloat": 3.75, - "testLocalDateTime": "2022-02-28T14:23:32.918Z" - } - ] -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithMultiLanguageText.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithMultiLanguageText.json deleted file mode 100644 index 1ecb248b4..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithMultiLanguageText.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "prop": { - "en": "This is English", - "de": "Das ist Deutsch" - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntity.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntity.json deleted file mode 100644 index 859139aca..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntity.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "entity": { - "testString": "This is the test string", - "nestedEntity": { - "testString": "This is the nested test string" - } - } -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntityList.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntityList.json deleted file mode 100644 index 05a15a7a5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithNestedEntityList.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "testList": [ - { - "testString": "Example Value Test", - "testInt": 3, - "testFloat": 2.25, - "testSecondList": [ - { - "randomValue": "eOMtThyhVNLWUZNRcBaQKxI", - "testLocalDateTime": "2018-02-28T14:23:32.918Z" - } - ] - }, - { - "testString": "Second Example Value Test", - "testInt": 4, - "testFloat": 3.75, - "testSecondList": [ - { - "randomValue": "abaGZhgiuwehgiwujowik", - "testLocalDateTime": "2022-02-28T14:23:32.918Z" - }, - { - "randomValue": "kklgeriogjeriogjerio", - "testLocalDateTime": "2023-02-28T14:23:32.918Z" - } - ] - } - ] -} diff --git a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithProperty.json b/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithProperty.json deleted file mode 100644 index be389dd17..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/payloads/valid/samm_2_1_0/AspectWithProperty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "testProperty": "This is a test" -} diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/Aspect.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/Aspect.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl similarity index 100% rename from core/esmf-test-aspect-models/src/main/resources/valid/samm_2_1_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl rename to core/esmf-test-aspect-models/src/main/resources/valid/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl deleted file mode 100644 index d08bfef3e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:Aspect a samm:Aspect ; - samm:name "Aspect" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl deleted file mode 100644 index 9b632489f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithAllBaseAttributes a samm:Aspect ; - samm:name "AspectWithAllBaseAttributes" ; - samm:preferredName "Aspect With Boolean"@en ; - samm:preferredName "Aspekt Mit Boolean"@de ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:see ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl deleted file mode 100644 index 96cc515af..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBinary a samm:Aspect ; - samm:name "AspectWithBinary" ; - samm:properties ( :testBinary ) ; - samm:operations ( ) . - -:testBinary a samm:Property ; - samm:name "testBinary" ; - samm:characteristic :BinaryTestCharacteristic . - -:BinaryTestCharacteristic a samm:Characteristic ; - samm:name "BinaryTestCharacteristic" ; - samm:dataType xsd:hexBinary . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl deleted file mode 100644 index 39a9f0296..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBlankNode a samm:Aspect ; - samm:name "AspectWithBlankNode" ; - samm:preferredName "Aspect With Blank Node"@en ; - samm:preferredName "Aspekt mit anonymen Knoten"@de ; - samm:properties ( :list ) ; - samm:operations ( ) . - -:list a samm:Property ; - samm:name "list" ; - samm:characteristic [ - a samm-c:Collection ; - samm:name "BlankNodeCollection" ; - samm:preferredName "Blank Node Collection"@en ; - samm:preferredName "Blank Node Liste"@de ; - samm:dataType xsd:string ; - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl deleted file mode 100644 index 5c909a317..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBoolean a samm:Aspect ; - samm:name "AspectWithBoolean" ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl deleted file mode 100644 index bea76d1b2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithCharacteristicWithMultipleSeeAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm:Characteristic ; - samm:name "TestCharacteristic" ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl deleted file mode 100644 index 1e74615bd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithCharacteristicWithSeeAttribute" ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :TestCharacteristicTwo . - -:TestCharacteristic a samm:Characteristic ; - samm:name "TestCharacteristic" ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:see ; - samm:dataType xsd:string . - -:TestCharacteristicTwo a samm:Characteristic ; - samm:name "TestCharacteristicTwo" ; - samm:preferredName "Test Characteristic Two"@en ; - samm:description "Test Characteristic Two"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl deleted file mode 100644 index e9b79f910..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithCharacteristicWithoutSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm:Characteristic ; - samm:name "TestCharacteristic" ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCissAcceleration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCissAcceleration.ttl deleted file mode 100644 index d844affbe..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCissAcceleration.ttl +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCissAcceleration a samm:Aspect ; - samm:name "AspectWithCissAcceleration" ; - samm:preferredName "CISS Acceleration Aspect"@en ; - samm:preferredName "CISS Beschleunigungsaspekt"@de ; - samm:properties ( :acceleration_x :acceleration_y :acceleration_z ) ; - samm:operations ( :SetConfig :FFT ) . - -:acceleration_x a samm:Property ; - samm:name "acceleration_x" ; - samm:characteristic :AccelerationTimeSeries . - -:acceleration_y a samm:Property ; - samm:name "acceleration_y" ; - samm:characteristic :AccelerationTimeSeries . - -:acceleration_z a samm:Property ; - samm:name "acceleration_z" ; - samm:characteristic :AccelerationTimeSeries . - -:AccelerationTimeSeries a samm-c:TimeSeries ; - samm:name "AccelerationTimeSeries" ; - samm:preferredName "Acceleration Time Series"@en ; - samm:description "Represents the acceleration over time as key/value pair with the timestamp being the key and the recorded value being the value."@en ; - samm:dataType :AccelerationTimeSeriesEntity . - -:AccelerationTimeSeriesEntity samm:refines samm-e:TimeSeriesEntity ; - samm:name "AccelerationTimeSeriesEntity" ; - samm:preferredName "Acceleration Time Series Entity"@en ; - samm:preferredName "Acceleration Time Series Entität"@de ; - samm:description "Defines the Acceleration as a Time Series value."@en ; - samm:properties ( :acceleration_value ) . - -:acceleration_value samm:refines samm-e:value ; - samm:name "acceleration_value" ; - samm:preferredName "Acceleration Value"@en ; - samm:preferredName "Beschleunigungswert"@de ; - samm:description "The acceleration at a certain point in time."@en ; - samm:description "Die Beschleunigung zu einem bestimmten Zeitpunkt."@de ; - samm:characteristic :AccelerationRange . - -:AccelerationRange a samm-c:Trait ; - samm:name "AccelerationRange" ; - samm:description "The acceleration range"@en ; - samm-c:baseCharacteristic :AccelerationMeasurement ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-2000"^^xsd:float ; - samm-c:maxValue "2000"^^xsd:float ; - ] . - -:AccelerationMeasurement a samm-c:Measurement ; - samm:name "AccelerationMeasurement" ; - samm:description "The acceleration"@en ; - samm:dataType xsd:float ; - samm-c:unit unit:gal . - -:SetConfig a samm:Operation ; - samm:name "SetConfig" ; - samm:preferredName "Set Configuration"@en ; - samm:description "Operation which updates the device configuration."@en ; - samm:input ( :minValue :maxValue :sampleRate :enabled ) ; - samm:output :operationStatus . - -:minValue a samm:Property ; - samm:name "minValue" ; - samm:preferredName "Minimum Value"@en ; - samm:preferredName "Minimalwert"@de ; - samm:characteristic :ValueRange . - -:maxValue a samm:Property ; - samm:name "maxValue" ; - samm:preferredName "Maximum Value"@en ; - samm:preferredName "Maximalwert"@de ; - samm:characteristic :ValueRange . - -:sampleRate a samm:Property ; - samm:name "sampleRate" ; - samm:preferredName "Sample Rate"@en ; - samm:preferredName "Messrate"@de ; - samm:characteristic :FrequencyRange . - -:enabled a samm:Property ; - samm:name "enabled" ; - samm:preferredName "Enabled/Disabled"@en ; - samm:preferredName "Aktiviert/Deaktiviert"@de ; - samm:characteristic samm-c:Boolean . - -:operationStatus a samm:Property ; - samm:name "operationStatus" ; - samm:preferredName "Status of Set Config Operation"@en ; - samm:preferredName "Status der Konfigurations-Operation"@de ; - samm:characteristic :OperationState . - -:FrequencyRange a samm-c:Trait ; - samm:name "FrequencyRange" ; - samm:description "The range of the Sample Rate Frequency"@en ; - samm-c:baseCharacteristic :Frequency ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "0"^^xsd:float ; - samm-c:maxValue "100"^^xsd:float ; - ] . - -:Frequency a samm-c:Measurement ; - samm:name "Frequency" ; - samm:description "Rate at which measurements are taken by the sensor"@en ; - samm:dataType xsd:float ; - samm-c:unit unit:hertz . - -:ValueRange a samm-c:Trait ; - samm:name "ValueRange" ; - samm:description "The range of the input parameters for the SetConfig Operation"@en ; - samm-c:baseCharacteristic :Numeric ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-2000"^^xsd:float ; - samm-c:maxValue "2000"^^xsd:float ; - ] . - -:Numeric a samm:Characteristic ; - samm:name "Numeric" ; - samm:description "Positive Integers"@en ; - samm:dataType xsd:float . - -:OperationState a samm-c:State ; - samm:name "OperationState" ; - samm:description "Return status for the Set Configuration Operation"@en ; - samm:dataType xsd:string ; - samm-c:defaultValue "OK" ; - samm-c:values ( "OK" "ERR" ) . - -:FFT a samm:Operation ; - samm:name "FFT" ; - samm:preferredName "Fourier Transformation"@en ; - samm:description "Operation which performs a Fourier Transformation for a specific axis."@en ; - samm:input ( :axis :nfft :nmean ) ; - samm:output :fftResult . - -:axis a samm:Property ; - samm:name "axis" ; - samm:preferredName "Axis"@en ; - samm:preferredName "Achse"@de ; - samm:characteristic :AccelerationProperties . - -:nfft a samm:Property ; - samm:name "nfft" ; - samm:preferredName "Nfft"@en ; - samm:preferredName "Nfft"@de ; - samm:characteristic :PositiveNumeric . - -:nmean a samm:Property ; - samm:name "nmean" ; - samm:preferredName "Nmean"@en ; - samm:preferredName "Nmean"@de ; - samm:characteristic :PositiveNumeric . - -:AccelerationProperties a samm-c:Enumeration ; - samm:name "AccelerationProperties" ; - samm:description "The properties from the Acceleration Aspect which may be used in the FFT Operation."@en ; - samm:dataType samm:Property ; - samm-c:values ( :acceleration_x :acceleration_y :acceleration_z ) . - -:PositiveNumeric a samm:Characteristic ; - samm:name "PositiveNumeric" ; - samm:description "Positive Integers"@en ; - samm:dataType xsd:positiveInteger . - -:fftResult a samm:Property ; - samm:name "fftResult" ; - samm:preferredName "FFT Result"@en ; - samm:preferredName "FFT Ergebnis"@de ; - samm:characteristic [ - a samm-c:Set ; - samm:name "FFTResultSet" ; - samm:dataType :FFTResult - ] . - -:FFTResult a samm:Entity ; - samm:name "FFTResult" ; - samm:preferredName "FFT Result Domain Entity"@en ; - samm:properties ( :frequency :acceleration_value ) . - -:frequency a samm:Property ; - samm:name "frequency" ; - samm:preferredName "Frequency"@en ; - samm:preferredName "Frequenz"@de ; - samm:description "Amount of occurrences of value"@en ; - samm:characteristic :PositiveNumeric . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl deleted file mode 100644 index 327add806..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCode a samm:Aspect ; - samm:name "AspectWithCode" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCode . - -:TestCode a samm-c:Code ; - samm:name "TestCode" ; - samm:preferredName "Test Code"@en ; - samm:description "This is a test code."@en ; - samm:see ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl deleted file mode 100644 index 6ef99d7e6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollection a samm:Aspect ; - samm:name "AspectWithCollection" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl deleted file mode 100644 index 5960a31dd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionAndElementCharacteristic a samm:Aspect ; - samm:name "AspectWithCollectionAndElementCharacteristic" ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:name "items" ; - samm:characteristic [ - a samm-c:Collection ; - samm:name "TestCollection" ; - samm-c:elementCharacteristic :TestEntityCharacteristic - ] . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testProperty ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl deleted file mode 100644 index a53421760..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionAndSimpleElementCharacteristic a samm:Aspect ; - samm:name "AspectWithCollectionAndSimpleElementCharacteristic" ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:name "items" ; - samm:characteristic [ - a samm-c:Collection ; - samm:name "TestCollection" ; - samm-c:elementCharacteristic samm-c:Text - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl deleted file mode 100644 index 5cf46463e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionOfSimpleType a samm:Aspect ; - samm:name "AspectWithCollectionOfSimpleType" ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:name "testList" ; - samm:exampleValue "35"^^xsd:int ; - samm:characteristic :IntegerList . - -:IntegerList a samm-c:List ; - samm:name "IntegerList" ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl deleted file mode 100644 index 5b63830ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionWithElementCharacteristic a samm:Aspect ; - samm:name "AspectWithCollectionWithElementCharacteristic" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm-c:elementCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl deleted file mode 100644 index b71d61ce8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionWithElementConstraint a samm:Aspect ; - samm:name "AspectWithCollectionWithElementConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.0"^^xsd:float ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm-c:elementCharacteristic [ - a samm-c:Trait ; - samm:name "ElementRangeConstraint" ; - samm-c:baseCharacteristic :Measurement ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:maxValue "10.5"^^xsd:float ; - ] - ] . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl deleted file mode 100644 index ddac978ec..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithCollectionWithMultipleSeeAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl deleted file mode 100644 index 0da955cdf..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithCollectionWithSeeAttribute" ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCollection . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :TestCollectionTwo . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:see ; - samm:dataType xsd:string . - -:TestCollectionTwo a samm-c:Collection ; - samm:name "TestCollectionTwo" ; - samm:preferredName "Test Collection Two"@en ; - samm:description "Test Collection Two"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl deleted file mode 100644 index 409a9e293..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithCollectionWithoutSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl deleted file mode 100644 index 92706d223..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithCollections a samm:Aspect ; - samm:name "AspectWithCollections" ; - samm:properties ( :setProperty :listProperty ) ; - samm:operations ( ) . - -:listProperty a samm:Property ; - samm:name "listProperty" ; - samm:characteristic [ - a samm-c:List ; - samm:name "NumberList" ; - samm:dataType xsd:int - ] . - -:setProperty a samm:Property ; - samm:name "setProperty" ; - samm:characteristic [ - a samm-c:Set ; - samm:name "StringSet" ; - samm:dataType xsd:string - ] . - - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl deleted file mode 100644 index eb0748a18..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionsWithElementCharacteristicAndSimpleDataType a samm:Aspect ; - samm:name "AspectWithCollectionsWithElementCharacteristicAndSimpleDataType" ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCollection . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :TestCollectionTwo . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:dataType xsd:string . - -:TestCollectionTwo a samm-c:Collection ; - samm:name "TestCollectionTwo" ; - samm-c:elementCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl deleted file mode 100644 index a18064c68..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithComplexCollectionEnum a samm:Aspect ; - samm:name "AspectWithComplexCollectionEnum" ; - samm:properties ( :myPropertyOne :myPropertyTwo :myPropertyThree :myPropertyFour ) ; - samm:operations ( ) . - -:myPropertyOne a samm:Property ; - samm:name "myPropertyOne" ; - samm:characteristic :MyEnumerationOne . - -:MyEnumerationOne a samm-c:Enumeration ; - samm:name "MyEnumerationOne" ; - samm:dataType :MyEntityOne ; - samm-c:values ( :entityInstanceOne ) . - -:MyEntityOne a samm:Entity ; - samm:name "MyEntityOne" ; - samm:properties ( :entityPropertyOne ) . - -:entityPropertyOne a samm:Property ; - samm:name "entityPropertyOne" ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:name "ListCharacteristic" ; - samm:dataType xsd:string . - -:entityInstanceOne a :MyEntityOne ; - :entityPropertyOne ( "fooOne" "barOne" "bazOne" ) . - -:myPropertyTwo a samm:Property ; - samm:name "myPropertyTwo" ; - samm:characteristic :MyEnumerationTwo . - -:MyEnumerationTwo a samm-c:Enumeration ; - samm:name "MyEnumerationTwo" ; - samm:dataType :MyEntityTwo ; - samm-c:values ( :entityInstanceTwo ) . - -:MyEntityTwo a samm:Entity ; - samm:name "MyEntityTwo" ; - samm:properties ( :entityPropertyTwo ) . - -:entityPropertyTwo a samm:Property ; - samm:name "entityPropertyTwo" ; - samm:characteristic :setCharacteristic . - -:setCharacteristic a samm-c:Set ; - samm:name "setCharacteristic" ; - samm:dataType xsd:string . - -:entityInstanceTwo a :MyEntityTwo ; - :entityPropertyTwo ( "fooTwo" "barTwo" "bazTwo" ) . - -:myPropertyThree a samm:Property ; - samm:name "myPropertyThree" ; - samm:characteristic :MyEnumerationThree . - -:MyEnumerationThree a samm-c:Enumeration ; - samm:name "MyEnumerationThree" ; - samm:dataType :MyEntityThree ; - samm-c:values ( :entityInstanceThree ) . - -:MyEntityThree a samm:Entity ; - samm:name "MyEntityThree" ; - samm:properties ( :entityPropertyThree ) . - -:entityPropertyThree a samm:Property ; - samm:name "entityPropertyThree" ; - samm:characteristic :sortedSetCharacteristic . - -:sortedSetCharacteristic a samm-c:SortedSet ; - samm:name "sortedSetCharacteristic" ; - samm:dataType xsd:string . - -:entityInstanceThree a :MyEntityThree ; - :entityPropertyThree ( "fooThree" "barThree" "bazThree" ) . - -:myPropertyFour a samm:Property ; - samm:name "myPropertyFour" ; - samm:characteristic :MyEnumerationFour . - -:MyEnumerationFour a samm-c:Enumeration ; - samm:name "MyEnumerationFour" ; - samm:dataType :MyEntityFour ; - samm-c:values ( :entityInstanceFour ) . - -:MyEntityFour a samm:Entity ; - samm:name "MyEntityFour" ; - samm:properties ( :entityPropertyFour ) . - -:entityPropertyFour a samm:Property ; - samm:name "entityPropertyFour" ; - samm:characteristic :collectionCharacteristic . - -:collectionCharacteristic a samm-c:Collection ; - samm:name "collectionCharacteristic" ; - samm:dataType xsd:string . - -:entityInstanceFour a :MyEntityFour ; - :entityPropertyFour ( "fooFour" "barFour" "bazFour" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl deleted file mode 100644 index e68c58518..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithComplexEntityCollectionEnum a samm:Aspect ; - samm:name "AspectWithComplexEntityCollectionEnum" ; - samm:properties ( :myPropertyOne ) ; - samm:operations ( ) . - -:myPropertyOne a samm:Property ; - samm:name "myPropertyOne" ; - samm:characteristic :MyEnumerationOne . - -:MyEnumerationOne a samm-c:Enumeration ; - samm:name "MyEnumerationOne" ; - samm:description "This is my enumeration one"@en ; - samm:dataType :MyEntityOne ; - samm-c:values ( :entityInstanceOne ) . - -:MyEntityOne a samm:Entity ; - samm:name "MyEntityOne" ; - samm:properties ( :entityPropertyOne ) . - -:entityPropertyOne a samm:Property ; - samm:name "entityPropertyOne" ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:name "ListCharacteristic" ; - samm:dataType :MyEntityTwo . - -:MyEntityTwo a samm:Entity ; - samm:name "MyEntityTwo" ; - samm:properties ( :entityPropertyTwo ) . - -:entityPropertyTwo a samm:Property ; - samm:name "entityPropertyTwo" ; - samm:characteristic samm-c:Text . - -:entityInstanceOne a :MyEntityOne ; - :entityPropertyOne ( :entityInstanceTwo ) . - -:entityInstanceTwo a :MyEntityTwo ; - :entityPropertyTwo "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl deleted file mode 100644 index 4a7f613c2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithComplexEnum a samm:Aspect ; - samm:name "AspectWithComplexEnum" ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( :numericCode :description ) . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:numericCode a samm:Property ; - samm:name "numericCode" ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:ResultNoStatus a :EvaluationResult ; - :numericCode "-1"^^xsd:short ; - :description "No status" . - -:ResultGood a :EvaluationResult ; - :numericCode "1"^^xsd:short ; - :description "Good" . - -:ResultBad a :EvaluationResult ; - :numericCode "2"^^xsd:short ; - :description "Bad" . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus :ResultGood :ResultBad ) . - -:result a samm:Property ; - samm:name "result" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:YesNo a samm-c:Enumeration ; - samm:name "YesNo" ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:simpleResult a samm:Property ; - samm:name "simpleResult" ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl deleted file mode 100644 index 5c0493862..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithComplexEnumInclOptional a samm:Aspect ; - samm:name "AspectWithComplexEnumInclOptional" ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ - samm:property :numericCode ; - samm:optional "true"^^xsd:boolean - ] - [ - samm:property :description ; - samm:optional "true"^^xsd:boolean - ] ) . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:numericCode a samm:Property ; - samm:name "numericCode" ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:ResultNoStatus a :EvaluationResult ; - :numericCode "-1"^^xsd:short ; - :description "No status" . - -:ResultGood a :EvaluationResult ; - :numericCode "1"^^xsd:short ; - :description "Good" . - -:ResultBad a :EvaluationResult ; - :numericCode "2"^^xsd:short ; - :description "Bad" . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus :ResultGood :ResultBad ) . - -:result a samm:Property ; - samm:name "result" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:YesNo a samm-c:Enumeration ; - samm:name "YesNo" ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:simpleResult a samm:Property ; - samm:name "simpleResult" ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl deleted file mode 100644 index 0e655dc2d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithComplexSet a samm:Aspect ; - samm:name "AspectWithComplexSet" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm:name "TestTrait" ; - samm-c:baseCharacteristic :TestSet; - samm-c:constraint :TestSetConstraint. - -:TestSet a samm-c:Set ; - samm:name "TestSet" ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType :Id . - -:TestSetConstraint a samm-c:LengthConstraint; - samm:name "TestSetConstraint" ; - samm:preferredName "TestSet Constraint"@en; - samm:description "Constraint for defining a non-empty set of identifiers."@en; - samm:see ; - samm-c:minValue "2"^^xsd:nonNegativeInteger. - -:Id a samm:Entity; - samm:name "Id" ; - samm:preferredName "Unique Identifier"@en; - samm:properties ( :productId ). - -:productId a samm:Property; - samm:name "productId" ; - samm:preferredName "Unique Identifier"@en; - samm:characteristic :ProductIdCharacteristic ; - samm:exampleValue "urn:uuid:51131FB5-42A2-4267-A402-0ECFEFAD1619"^^xsd:anyURI. - -:ProductIdCharacteristic a samm:Characteristic; - samm:name "ProductIdCharacteristic" ; - samm:preferredName "Unique Identifier Characteristic"@en; - samm:dataType xsd:anyURI. - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl deleted file mode 100644 index c310b4526..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstrainedCollection a samm:Aspect ; - samm:name "AspectWithConstrainedCollection" ; - samm:properties ( :testCollection ) ; - samm:operations ( ) . - -:testCollection a samm:Property ; - samm:name "testCollection" ; - samm:characteristic :IntegerRange . - -:IntegerRange a samm-c:Trait ; - samm:name "IntegerRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2"^^xsd:integer ; - samm-c:maxValue "10"^^xsd:integer ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:name "IntList" ; - samm:dataType xsd:integer ; - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl deleted file mode 100644 index b9c908b46..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithConstrainedSet a samm:Aspect ; - samm:name "AspectWithConstrainedSet" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm:name "TestTrait" ; - samm-c:baseCharacteristic :TestSet; - samm-c:constraint :TestSetConstraint. - -:TestSet a samm-c:Set ; - samm:name "TestSet" ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType xsd:string . - -:TestSetConstraint a samm-c:LengthConstraint; - samm:name "TestSetConstraint" ; - samm:preferredName "TestSet Constraint"@en; - samm:description "Constraint for defining a non-empty set of identifiers."@en; - samm:see ; - samm-c:minValue "1"^^xsd:nonNegativeInteger. diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl deleted file mode 100644 index 3bda853c6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraint a samm:Aspect ; - samm:name "AspectWithConstraint" ; - samm:properties ( :stringLcProperty :doubleRcProperty :intRcProperty :bigIntRcProperty :floatRcProperty :stringRegexcProperty ) ; - samm:operations ( ) . - -:stringLcProperty a samm:Property ; - samm:name "stringLcProperty" ; - samm:characteristic :StringLengthConstraint . - -:stringRegexcProperty a samm:Property ; - samm:name "stringRegexcProperty" ; - samm:characteristic :RegularExpressionConstraint . - -:doubleRcProperty a samm:Property ; - samm:name "doubleRcProperty" ; - samm:characteristic :DoubleRangeConstraint . - -:intRcProperty a samm:Property ; - samm:name "intRcProperty" ; - samm:characteristic :IntegerRangeConstraint . - -:bigIntRcProperty a samm:Property ; - samm:name "bigIntRcProperty" ; - samm:characteristic :BigIntegerRangeConstraint . - -:floatRcProperty a samm:Property ; - samm:name "floatRcProperty" ; - samm:characteristic :FloatRangeConstraint . - -:StringLengthConstraint a samm-c:Trait ; - samm:name "StringLengthConstraint" ; - samm:preferredName "Used Test Constraint"@en ; - samm:description "Used Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "20"^^xsd:nonNegativeInteger ; - samm-c:maxValue "22"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleRangeConstraint a samm-c:Trait ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-0.1"^^xsd:double ; - samm-c:maxValue "0.2"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :DoubleMeasurement . - -:IntegerRangeConstraint a samm-c:Trait ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-1"^^xsd:int ; - samm-c:maxValue "-1"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :IntegerMeasurement . - -:BigIntegerRangeConstraint a samm-c:Trait ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "10"^^xsd:int ; - samm-c:maxValue "15"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :BigIntegerMeasurement . - -:FloatRangeConstraint a samm-c:Trait ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "100"^^xsd:int ; - samm-c:maxValue "112"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :FloatMeasurement . - -:RegularExpressionConstraint a samm-c:Trait ; - samm:name "TestRegularExpressionConstraint" ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "Test Regular Expression Constraint"@en ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "[a-zA-Z]" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleMeasurement a samm-c:Measurement ; - samm:name "AccelerationMeasurement" ; - samm:description "The acceleration"@en ; - samm:dataType xsd:double . - -:IntegerMeasurement a samm-c:Measurement ; - samm:name "AccelerationMeasurement" ; - samm:description "The acceleration"@en ; - samm:dataType xsd:int . - -:BigIntegerMeasurement a samm-c:Measurement ; - samm:name "AccelerationMeasurement" ; - samm:description "The acceleration"@en ; - samm:dataType xsd:integer . - -:FloatMeasurement a samm-c:Measurement ; - samm:name "AccelerationMeasurement" ; - samm:description "The acceleration"@en ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl deleted file mode 100644 index f0093f9ec..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithConstraintWithMultipleSeeAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl deleted file mode 100644 index 03746a891..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithConstraintWithSeeAttribute" ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :TestTraitTwo . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:TestTraitTwo a samm-c:Trait ; - samm:name "TestTraitTwo" ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:preferredName "Test Constraint Two"@en ; - samm:description "Test Constraint Two"@en ; - samm:see ; - samm:value "^[A-Z][A-Z][A-Z]$" ; - ] ; - samm-c:baseCharacteristic :TestCharacteristicTwo . -:TestCharacteristicTwo a samm:Characteristic; - samm:preferredName "Test Characteristic Two"@en; - samm:description "Test Characteristic Two"@en; - samm:dataType xsd:string; - samm:see . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl deleted file mode 100644 index f00a86be1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithConstraintWithoutSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl deleted file mode 100644 index 147038d74..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl +++ /dev/null @@ -1,211 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithConstraints a samm:Aspect ; - samm:name "AspectWithConstraints" ; - samm:properties ( :testPropertyWithRegularExpression :testPropertyWithDecimalMinDecimalMaxRangeConstraint - :testPropertyWithDecimalMaxRangeConstraint :testPropertyWithMinMaxRangeConstraint - :testPropertyWithMinRangeConstraint :testPropertyRangeConstraintWithFloatType - :testPropertyRangeConstraintWithDoubleType :testPropertyWithMinMaxLengthConstraint - :testPropertyWithMinLengthConstraint :testPropertyCollectionLengthConstraint ) ; - samm:operations ( ) . - -:testPropertyWithRegularExpression a samm:Property ; - samm:name "testPropertyWithRegularExpression" ; - samm:characteristic :TestRegularExpressionConstraint . - -:TestRegularExpressionConstraint a samm-c:Trait ; - samm:name "TestRegularExpressionConstraint" ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "Test Regular Expression Constraint"@en ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "^[a-zA-Z]\\.[0-9]" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:testPropertyWithDecimalMinDecimalMaxRangeConstraint a samm:Property ; - samm:name "testPropertyWithDecimalMinDecimalMaxRangeConstraint" ; - samm:characteristic :TestWithDecimalMinDecimalMaxRangeConstraint . - -:TestWithDecimalMinDecimalMaxRangeConstraint a samm-c:Trait ; - samm:name "TestWithDecimalMinDecimalMaxRangeConstraint" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:decimal ; - samm-c:maxValue "10.5"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDecimal . - -:testPropertyWithDecimalMaxRangeConstraint a samm:Property ; - samm:name "testPropertyWithDecimalMaxRangeConstraint" ; - samm:characteristic :TestWithDecimalMaxRangeConstraint . - -:TestWithDecimalMaxRangeConstraint a samm-c:Trait ; - samm:name "testWithDecimalMaxRangeConstraint" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:maxValue "10.5"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDecimal . - -:MeasurementDecimal a samm-c:Measurement ; - samm:name "MeasurementDecimal" ; - samm:dataType xsd:decimal ; - samm-c:unit unit:metrePerSecond . - -:testPropertyWithMinMaxRangeConstraint a samm:Property ; - samm:name "testPropertyWithMinMaxRangeConstraint" ; - samm:characteristic :TestWithMinMaxRangeConstraint . - -:TestWithMinMaxRangeConstraint a samm-c:Trait ; - samm:name "TestWithMinMaxRangeConstraint" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:int ; - samm-c:maxValue "10"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:testPropertyWithMinRangeConstraint a samm:Property ; - samm:name "testPropertyWithMinRangeConstraint" ; - samm:characteristic :TestWithMinRangeConstraint . - -:TestWithMinRangeConstraint a samm-c:Trait ; - samm:name "TestWithMinRangeConstraint" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:int ; - samm-c:unit unit:metrePerSecond . - -:testPropertyRangeConstraintWithFloatType a samm:Property ; - samm:name "testPropertyRangeConstraintWithFloatType" ; - samm:characteristic :TestRangeConstraintWithFloatType . - -:TestRangeConstraintWithFloatType a samm-c:Trait ; - samm:name "TestRangeConstraintWithFloatType" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:float ; - samm-c:maxValue "10"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementWithFloatType . - -:MeasurementWithFloatType a samm-c:Measurement ; - samm:name "MeasurementWithFloatType" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . - -:testPropertyRangeConstraintWithDoubleType a samm:Property ; - samm:name "testPropertyRangeConstraintWithDoubleType" ; - samm:characteristic :TestRangeConstraintWithDoubleType . - -:TestRangeConstraintWithDoubleType a samm-c:Trait ; - samm:name "TestRangeConstraintWithDoubleType" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:double ; - samm-c:maxValue "10"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementWithDoubleType . - -:MeasurementWithDoubleType a samm-c:Measurement ; - samm:name "MeasurementWithDoubleType" ; - samm:dataType xsd:double ; - samm-c:unit unit:metrePerSecond . - -:testPropertyWithMinMaxLengthConstraint a samm:Property ; - samm:name "testPropertyWithMinMaxLengthConstraint" ; - samm:characteristic :TestLengthConstraint . - -:TestLengthConstraint a samm-c:Trait ; - samm:name "TestLengthConstraint" ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "Test Length Constraint"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:testPropertyWithMinLengthConstraint a samm:Property ; - samm:name "testPropertyWithMinLengthConstraint" ; - samm:characteristic :TestLengthConstraintOnlyMin . - -:TestLengthConstraintOnlyMin a samm-c:Trait ; - samm:name "TestLengthConstraintOnlyMin" ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "Test Length Constraint"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "NonNegativeInteger" ; - samm:dataType xsd:nonNegativeInteger - ] . - -:testPropertyCollectionLengthConstraint a samm:Property ; - samm:name "testPropertyCollectionLengthConstraint" ; - samm:characteristic :TestLengthConstraintWithCollection . - -:TestLengthConstraintWithCollection a samm-c:Trait ; - samm:name "TestLengthConstraintWithCollection" ; - samm:preferredName "Test Length Constraint with collection"@en ; - samm:description "Test Length Constraint with collection"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:name "IntList" ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl deleted file mode 100644 index 7c7d1e085..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCurie a samm:Aspect ; - samm:name "AspectWithCurie" ; - samm:properties ( :testCurie :testCurieWithoutExampleValue ) ; - samm:operations ( ) . - -:testCurie a samm:Property ; - samm:name "testCurie" ; - samm:exampleValue "unit:hectopascal"^^samm:curie ; - samm:characteristic samm-c:UnitReference . - -:testCurieWithoutExampleValue a samm:Property ; - samm:name "testCurieWithoutExampleValue" ; - samm:characteristic samm-c:UnitReference . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl deleted file mode 100644 index 22e0935db..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix custom: . - -:AspectWithCustomNamespace a samm:Aspect ; - samm:name "AspectWithCustomNamespace" ; - samm:preferredName "Test Aspect"@en; - samm:description "This is a test description"@en ; - samm:properties ( ) ; - samm:operations () . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl deleted file mode 100644 index 4f7cb9b4c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCustomUnit a samm:Aspect ; - samm:name "AspectWithCustomUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm:dataType xsd:int ; - samm-c:unit :normLitrePerMinute . - -:normLitrePerMinute a unit:Unit ; - samm:name "normLitrePerMinute" ; - samm:preferredName "norm litre per minute"@en ; - unit:quantityKind unit:volumeFlowRate ; - unit:symbol "nl/min" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl deleted file mode 100644 index 0138b97a9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDateTimeTypeForRangeConstraints - a samm:Aspect ; - samm:name "AspectWithDateTimeTypeForRangeConstraints" ; - samm:properties ( :testPropertyWithDateTime :testPropertyWithDateTimeStamp ) ; - samm:operations ( ) . - -:testPropertyWithDateTime - a samm:Property ; - samm:name "testPropertyWithDateTime" ; - samm:characteristic :testWithGregorianCalenderMinGregorianCalenderMaxDateTime . - -:testWithGregorianCalenderMinGregorianCalenderMaxDateTime - a samm-c:Trait ; - samm:name "testWithGregorianCalenderMinGregorianCalenderMaxDateTime" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01-01T14:23:00"^^xsd:dateTime ; - samm-c:maxValue "2000-01-02T15:23:00"^^xsd:dateTime ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDateTime . - -:MeasurementDateTime - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:dateTime ; - samm-c:unit unit:secondUnitOfTime . - -:testPropertyWithDateTimeStamp - a samm:Property ; - samm:name "testPropertyWithDateTimeStamp" ; - samm:characteristic :testWithGregorianCalenderMinGregorianCalenderMaxDateTimeStamp . - -:testWithGregorianCalenderMinGregorianCalenderMaxDateTimeStamp - a samm-c:Trait; - samm:name "testWithGregorianCalenderMinGregorianCalenderMaxDateTimeStamp" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01-01T14:23:00.66372+14:00"^^xsd:dateTimeStamp ; - samm-c:maxValue "2000-01-01T15:23:00.66372+14:00"^^xsd:dateTimeStamp ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDateTimeStamp . - -:MeasurementDateTimeStamp - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:dateTimeStamp ; - samm-c:unit unit:secondUnitOfTime . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl deleted file mode 100644 index e474ed7c4..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithDescriptionInProperty a samm:Aspect ; - samm:name "AspectWithDescriptionInProperty" ; - samm:properties ( :enabled ) ; - samm:operations ( ) . - -:enabled a samm:Property ; - samm:name "enabled" ; - samm:preferredName "Enabled/Disabled"@en ; - samm:preferredName "Aktiviert/Deaktiviert"@de ; - samm:characteristic samm-c:Boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl deleted file mode 100644 index 635b0e576..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithDescriptions a samm:Aspect ; - samm:name "AspectWithDescriptions" ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl deleted file mode 100644 index 95305108d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDuration a samm:Aspect ; - samm:name "AspectWithDuration" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestDuration . - -:TestDuration a samm-c:Duration ; - samm:name "TestDuration" ; - samm:preferredName "Test Duration"@en ; - samm:description "This is a test Duration"@en ; - samm:see ; - samm:dataType xsd:int ; - samm-c:unit unit:kilosecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl deleted file mode 100644 index ec8286709..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDurationTypeForRangeConstraints - a samm:Aspect ; - samm:name "AspectWithDurationTypeForRangeConstraints" ; - samm:properties ( :testPropertyWithDayTimeDuration :testPropertyWithDuration - :testPropertyWithYearMonthDuration ) ; - samm:operations ( ) . - -:testPropertyWithDayTimeDuration - a samm:Property ; - samm:name "testPropertyWithDayTimeDuration" ; - samm:characteristic :testWithDurationMinDurationMaxDayTimeDuration . - -:testWithDurationMinDurationMaxDayTimeDuration - a samm-c:Trait ; - samm:name "testWithDurationMinDurationMaxDayTimeDuration" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "P1DT5H"^^xsd:dayTimeDuration ; - samm-c:maxValue "P1DT8H"^^xsd:dayTimeDuration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDayTimeDuration . - -:MeasurementDayTimeDuration - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:dayTimeDuration ; - samm-c:unit unit:hour . - -:testPropertyWithDuration - a samm:Property ; - samm:name "testPropertyWithDuration" ; - samm:characteristic :testWithDurationMinDurationMaxDuration . - -:testWithDurationMinDurationMaxDuration - a samm-c:Trait ; - samm:name "testWithDurationMinDurationMaxDuration" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "PT1H5M0S"^^xsd:duration ; - samm-c:maxValue "PT1H5M3S"^^xsd:duration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDuration . - -:MeasurementDuration - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:duration ; - samm-c:unit unit:hour . - -:testPropertyWithYearMonthDuration - a samm:Property ; - samm:name "testPropertyWithYearMonthDuration" ; - samm:characteristic :testWithDurationMinDurationMaxYearMonthDuration . - -:testWithDurationMinDurationMaxYearMonthDuration - a samm-c:Trait ; - samm:name "testWithDurationMinDurationMaxYearMonthDuration" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "P5Y2M"^^xsd:yearMonthDuration ; - samm-c:maxValue "P5Y3M"^^xsd:yearMonthDuration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementYearMonthDuration . - -:MeasurementYearMonthDuration - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:yearMonthDuration ; - samm-c:unit unit:hour . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl deleted file mode 100644 index a227a3ad3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEither a samm:Aspect ; - samm:name "AspectWithEither" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "This is a test Either."@en ; - samm:see ; - samm-c:left samm-c:Text ; - samm-c:right samm-c:Boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl deleted file mode 100644 index 856bf0aa3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEitherWithComplexTypes a samm:Aspect ; - samm:name "AspectWithEitherWithComplexTypes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:name "LeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:dataType :LeftEntity . - -:RightType a samm:Characteristic ; - samm:name "RightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:dataType :RightEntity . - -:LeftEntity a samm:Entity ; - samm:name "LeftEntity" ; - samm:properties ( :result ) . - -:result a samm:Property ; - samm:name "result" ; - samm:characteristic :ResultCharacteristic . - -:ResultCharacteristic a samm:Characteristic ; - samm:name "ResultCharacteristic" ; - samm:dataType xsd:string . - -:RightEntity a samm:Entity ; - samm:name "RightEntity" ; - samm:properties ( :error ) . - -:error a samm:Property ; - samm:name "error" ; - samm:characteristic :ErrorCharacteristic . - -:ErrorCharacteristic a samm:Characteristic ; - samm:name "ErrorCharacteristic" ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl deleted file mode 100644 index a5bb12336..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithEitherWithMultipleSeeAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:name "LeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:name "RightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl deleted file mode 100644 index eb4de88d7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithEitherWithSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:name "LeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:name "RightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl deleted file mode 100644 index 9867d1ba6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithEitherWithoutSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:name "LeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:name "RightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl deleted file mode 100644 index 8a90c09b6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEncodedStrings a samm:Aspect ; - samm:name "AspectWithEncodedStrings" ; - samm:preferredName "VGhpcyBpcyBhbiBBc3BlY3Qgd2l0aCBlbmNvZGVkIHRleHQu"@en ; - samm:description "Aspect With encoded text"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl deleted file mode 100644 index 67bf48143..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEncodingConstraint a samm:Aspect ; - samm:name "AspectWithEncodingConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestEncodingConstraint . - -:TestEncodingConstraint a samm-c:Trait ; - samm:name "TestEncodingConstraint" ; - samm-c:constraint [ - a samm-c:EncodingConstraint ; - samm:preferredName "Test Encoding Constraint"@en ; - samm:description "This is a test encoding constraint."@en ; - samm:see ; - samm:value samm:UTF-8 ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl deleted file mode 100644 index 16c7c6f96..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnglishAndGermanDescription a samm:Aspect ; - samm:name "AspectWithEnglishAndGermanDescription" ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Testaspekt"@de ; - samm:description "Aspect With Multilingual Descriptions"@en ; - samm:description "Aspekt mit mehrsprachigen Beschreibungen"@de ; - samm:properties ( :testString ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:preferredName "testString"@en ; - samm:preferredName "testString"@de ; - samm:description "This is a test string"@en ; - samm:description "Es ist ein Test-String"@de ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl deleted file mode 100644 index 9743dd706..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnglishDescription a samm:Aspect ; - samm:name "AspectWithEnglishDescription" ; - samm:preferredName "Test Aspect"@en ; - samm:description "Test Aspect"@en ; - samm:properties ( :testString ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:preferredName "testString"@en ; - samm:description "testString"@en ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl deleted file mode 100644 index 09bc0197f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntity a samm:Aspect ; - samm:name "AspectWithEntity" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:name "EntityCharacteristic" ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl deleted file mode 100644 index 918eccb21..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityCollection a samm:Aspect ; - samm:name "AspectWithEntityCollection" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:name "TestCollection" ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl deleted file mode 100644 index e1f8a73f7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumeration a samm:Aspect ; - samm:name "AspectWithEntityEnumeration" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl deleted file mode 100644 index fc6d5f829..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumerationAndLangString a samm:Aspect ; - samm:name "AspectWithEntityEnumerationAndLangString" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:MultiLanguageText . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test."@en . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl deleted file mode 100644 index 0dc49c326..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityEnumerationAndNotInPayloadProperties a samm:Aspect ; - samm:name "AspectWithEntityEnumerationAndNotInPayloadProperties" ; - samm:preferredName "Aspect with entity enumeration and not in payload properties"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :systemState ) ; - samm:operations ( ) . - -:systemState a samm:Property ; - samm:name "systemState" ; - samm:preferredName "System State"@en ; - samm:description "The state the system is currently in, e.g. heat-up."@en ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:name "SystemStates" ; - samm:preferredName "System States"@en ; - samm:description "Defines which states the system may have."@en ; - samm:dataType :SystemState ; - samm-c:values ( :On :CoolDown :Off :HeatUp ) - ] . - -:SystemState a samm:Entity ; - samm:name "SystemState" ; - samm:preferredName "System State"@en ; - samm:description "Represents a specific state the system may have."@en ; - samm:properties ( :state - [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:Off a :SystemState ; - :state "0"^^xsd:short ; - :description "Off" . - -:On a :SystemState ; - :state "1"^^xsd:short ; - :description "On" . - -:CoolDown a :SystemState ; - :state "3"^^xsd:short ; - :description "CoolDown" . - -:HeatUp a :SystemState ; - :state "4"^^xsd:short ; - :description "HeatUp" . - -:state a samm:Property ; - samm:name "state" ; - samm:characteristic :Measurement . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl deleted file mode 100644 index ad48ee7c8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityEnumerationWithNotExistingEnum a samm:Aspect ; - samm:name "AspectWithEntityEnumeration" ; - samm:preferredName "Aspect with entity enumeration"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :systemState ) ; - samm:operations ( ) . - -:systemState a samm:Property ; - samm:name "systemState" ; - samm:preferredName "System State"@en ; - samm:description "The state the system is currently in, e.g. heat-up."@en ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:name "SystemStates" ; - samm:preferredName "System States"@en ; - samm:description "Defines which states the system may have."@en ; - samm:dataType :SystemState ; - samm-c:values ( :Off :CoolDown :HeatUp :On ) - ] . - -:SystemState a samm:Entity ; - samm:name "SystemState" ; - samm:preferredName "System State"@en ; - samm:description "Represents a specific state the system may have."@en ; - samm:properties ( :state :description ) . - -:Off a :SystemState ; - :state "0"^^xsd:short ; - :description "Off" . - -:On a :SystemState ; - :state "1"^^xsd:short ; - :description "On" . - -:CoolDown a :SystemState ; - :state "3"^^xsd:short ; - :description "CoolDown" . - -:HeatUp a :SystemState ; - :state "4"^^xsd:short ; - :description "HeatUp" . - -:state a samm:Property ; - samm:name "state" ; - samm:characteristic :Measurement . - -:description a samm:Property ; - samm:name "description" ; - samm:characteristic samm-c:Text . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl deleted file mode 100644 index 0cd135377..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties a samm:Aspect ; - samm:name "AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty - [ samm:property :optionalEntityProperty ; samm:optional "true"^^xsd:boolean ] - [ samm:property :notInPayloadEntityProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:name "optionalEntityProperty" ; - samm:characteristic samm-c:Text . - -:notInPayloadEntityProperty a samm:Property ; - samm:name "notInPayloadEntityProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :notInPayloadEntityProperty "This is not part of the payload." . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl deleted file mode 100644 index 19adbcc64..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithNestedEntityListProperty a samm:Aspect ; - samm:name "AspectWithEntityInstanceWithNestedEntityListProperty" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:name "TestCharacteristic" ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :testList ( :NestedEntityInstance :NestedEntityInstanceTwo ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :code - [ samm:property :testList ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:name "code" ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:name "testList" ; - samm:characteristic [ - a samm-c:List ; - samm:name "IntegerList" ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:name "NestedEntity" ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:name "nestedEntityProperty" ; - samm:characteristic samm-c:Text . - -:NestedEntityInstance a :NestedEntity ; - :nestedEntityProperty "bar" . - -:NestedEntityInstanceTwo a :NestedEntity ; - :nestedEntityProperty "baz" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl deleted file mode 100644 index c854463ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithNestedEntityProperty a samm:Aspect ; - samm:name "AspectWithEntityInstanceWithNestedEntityProperty" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:name "TestCharacteristic" ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :nestedEntity :NestedEntityInstance . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :code - [ samm:property :nestedEntity ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:name "code" ; - samm:characteristic :ShortCode . - -:nestedEntity a samm:Property ; - samm:name "nestedEntity" ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:name "NestedEntityCharacteristic" ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:name "NestedEntity" ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:name "nestedEntityProperty" ; - samm:characteristic samm-c:Text . - -:NestedEntityInstance a :NestedEntity ; - :nestedEntityProperty "bar" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl deleted file mode 100644 index 9c055e8e4..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithScalarListProperty a samm:Aspect ; - samm:name "AspectWithEntityInstanceWithScalarListProperty" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:name "TestCharacteristic" ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :testList ( 1 2 3 ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :code - :testList ) . - -:code a samm:Property ; - samm:name "code" ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:name "testList" ; - samm:characteristic [ - a samm-c:List ; - samm:name "IntegerList" ; - samm:dataType xsd:int - ] . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl deleted file mode 100644 index 339896cc2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithScalarProperties a samm:Aspect ; - samm:name "AspectWithEntityInstanceWithScalarProperties" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:name "TestCharacteristic" ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :description "foo" . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :code [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:name "code" ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:name "description" ; - samm:characteristic samm-c:Text . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl deleted file mode 100644 index a07dfe20c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityList a samm:Aspect ; - samm:name "AspectWithEntityList" ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:name "testList" ; - samm:characteristic [ - a samm-c:List ; - samm:name "EntityList" ; - samm:dataType :TestEntity - ] . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl deleted file mode 100644 index e7473d1ac..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityWithMultipleProperties a samm:Aspect ; - samm:name "AspectWithEntityWithMultipleProperties" ; - samm:properties ( :testEntity ) ; - samm:operations ( ) . - -:testEntity a samm:Property ; - samm:name "testEntity" ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl deleted file mode 100644 index 3e1a2dc9c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityWithNestedEntityListProperty a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :Entity . - -:Entity a samm:Entity ; - samm:properties ( :code :testList ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl deleted file mode 100644 index c6743f72a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEnumAndOptionalEnumProperties a samm:Aspect ; - samm:name "AspectWithEnumAndOptionalEnumProperties" ; - samm:properties ( :testProperty [ samm:property :optionalTestProperty ; samm:optional "true"^^xsd:boolean ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:optionalTestProperty a samm:Property ; - samm:name "optionalTestProperty" ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl deleted file mode 100644 index a9eadfb7d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumHavingNestedEntities a samm:Aspect ; - samm:name "AspectWithEnumHavingNestedEntities" ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:result a samm:Property ; - samm:name "result" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:simpleResult a samm:Property ; - samm:name "simpleResult" ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultGood :ResultBad ) . - -:YesNo a samm-c:Enumeration ; - samm:name "YesNo" ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( :details ) . - -:details a samm:Property ; - samm:name "details" ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:name "DetailEntityCharacteristic" ; - samm:dataType :DetailEntity ; - ] . - -:DetailEntity a samm:Entity ; - samm:name "DetailEntity" ; - samm:properties ( :description :message :numericCode ) . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:message a samm:Property ; - samm:name "message" ; - samm:characteristic samm-c:Text . - -:numericCode a samm:Property ; - samm:name "numericCode" ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:ResultBad a :EvaluationResult ; - :details :NoStatusDetails . - -:ResultGood a :EvaluationResult ; - :details :SucceededStatusDetails . - -:NoStatusDetails a :DetailEntity ; - :description "No status" ; - :message "No status available" ; - :numericCode "-10"^^xsd:short . - -:SucceededStatusDetails a :DetailEntity ; - :description "Result succeeded" ; - :message "Evaluation succeeded." ; - :numericCode "10"^^xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl deleted file mode 100644 index 16de817bb..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix : . - -:AspectWithEnumOnlyOneSee a samm:Aspect; - samm:name "Test"; - samm:properties (:prop1 :prop2); - samm:operations (). - -:prop1 a samm:Property; - samm:name "prop1"; - samm:characteristic :Enum1. -:prop2 a samm:Property; - samm:name "prop2"; - samm:characteristic :Enum2. - -:Enum1 a samm-c:Enumeration; - samm:name "Enum1"; - samm:dataType xsd:string; - samm-c:values ("a" "b"). -:Enum2 a samm-c:Enumeration; - samm:name "Enum2"; - samm:dataType xsd:string; - samm-c:values ("1" "2"); - samm:see . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl deleted file mode 100644 index 12df8727e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEnumeration a samm:Aspect ; - samm:name "AspectWithEnumeration" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl deleted file mode 100644 index ac4dd9e61..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithEnumerationWithMultipleSeeAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl deleted file mode 100644 index 4df1cd7b8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithScalarVariable a samm:Aspect ; - samm:name "AspectWithEnumerationWithScalarVariable" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "testProperty"@en ; - samm:characteristic :TestScalarEnumeration . - -:TestScalarEnumeration a samm-c:Enumeration ; - samm:name "TestScalarEnumeration" ; - samm:preferredName "TestScalarEnumeration Result"@en ; - samm:see ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl deleted file mode 100644 index 3c63c862f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithEnumerationWithSeeAttribute" ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :TestEnumerationTwo . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . - -:TestEnumerationTwo a samm-c:Enumeration ; - samm:name "TestEnumerationTwo" ; - samm:preferredName "Test Enumeration Two"@en ; - samm:description "Test Enumeration Two"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl deleted file mode 100644 index 2d2a718fd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithoutScalarVariable a samm:Aspect ; - samm:name "AspectWithEnumerationWithoutScalarVariable" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultGood ) . - -:ResultGood a :EvaluationResult . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl deleted file mode 100644 index 35a9e8816..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithEnumerationWithoutSeeAttribute" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl deleted file mode 100644 index f1e382e8f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithErrorCollection a samm:Aspect ; - samm:name "AspectWithErrorCollection" ; - samm:preferredName "Errors Aspect"@en ; - samm:description "The Errors Aspect delivers a list of the currently active errors for a specific machine."@en ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:name "items" ; - samm:preferredName "Items"@en ; - samm:description "A list of current active errors."@en ; - samm:characteristic [ - a samm-c:Collection ; - samm:name "Errors" ; - samm:preferredName "Errors"@en ; - samm:description "A collection of Error Entities."@en ; - samm:dataType :Error - ] . - -:Error a samm:Entity ; - samm:name "Error" ; - samm:preferredName "Error Entity"@en ; - samm:description "The Entity describing an Error."@en ; - samm:properties ( :errorNo :errorText :startTimestamp ) . - -:errorNo a samm:Property ; - samm:name "errorNo" ; - samm:preferredName "Error Number"@en ; - samm:description "The number that represents the type of error which has occurred."@en ; - samm:exampleValue "123"^^xsd:int ; - samm:characteristic :ErrorNumber . - -:errorText a samm:Property ; - samm:name "errorText" ; - samm:preferredName "Error Text"@en ; - samm:description "The error text provided by the machine."@en ; - samm:exampleValue "120.6 °C" ; - samm:characteristic samm-c:Text . - -:startTimestamp a samm:Property ; - samm:name "startTimestamp" ; - samm:preferredName "Start Timestamp"@en ; - samm:description "The timestamp denoting when the error occurred."@en ; - samm:exampleValue "2018-08-08T12:00:00.0000"^^xsd:dateTime ; - samm:characteristic samm-c:Timestamp . - -:ErrorNumber a samm-c:Code ; - samm:name "ErrorNumber" ; - samm:preferredName "Error Number"@en ; - samm:description "The numeric representation of an Error."@en ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl deleted file mode 100644 index 7fb5c486c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithExclusiveRangeConstraint a samm:Aspect ; - samm:name "AspectWithExclusiveRangeConstraint" ; - samm:properties ( :floatProp :doubleProp :decimalProp :integerProp :intProp ) ; - samm:operations ( ) . - -:floatProp a samm:Property ; - samm:name "floatProp" ; - samm:characteristic :FloatRange . - -:doubleProp a samm:Property ; - samm:name "doubleProp" ; - samm:characteristic :DoubleRange . - -:decimalProp a samm:Property ; - samm:name "decimalProp" ; - samm:characteristic :DecimalRange . - -:integerProp a samm:Property ; - samm:name "integerProp" ; - samm:characteristic :IntegerRange . - -:intProp a samm:Property ; - samm:name "intProp" ; - samm:characteristic :IntRange . - -:FloatRange a samm-c:Trait; - samm:name "FloatRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a floating range constraint"@en ; - samm-c:minValue "12.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float - ] . - -:DoubleRange a samm-c:Trait ; - samm:name "DoubleRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a double range constraint"@en ; - samm-c:minValue "12.3"^^xsd:double ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "Double" ; - samm:dataType xsd:double - ] . - -:DecimalRange a samm-c:Trait ; - samm:name "DecimalRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a decimal range constraint"@en ; - samm-c:minValue "12.3"^^xsd:decimal ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "Decimal" ; - samm:dataType xsd:decimal - ] . - -:IntegerRange a samm-c:Trait ; - samm:name "IntegerRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a integer range constraint"@en ; - samm-c:minValue "12"^^xsd:integer ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23"^^xsd:integer ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "Integer" ; - samm:dataType xsd:integer - ] . - -:IntRange a samm-c:Trait ; - samm:name "IntRange" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "12"^^xsd:int ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl deleted file mode 100644 index 770c2d299..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithExtendedEnums a samm:Aspect ; - samm:name "AspectWithExtendedEnums" ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ samm:property :average ; samm:optional "true"^^xsd:boolean ] - :numericCode - :description - :nestedResult ) . - -:NestedResult a samm:Entity ; - samm:name "NestedResult" ; - samm:preferredName "Nested Result"@en ; - samm:description "A nested result for testing"@en ; - samm:properties ( :average :description ) . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:BigIntegerValue a samm:Characteristic ; - samm:name "BigIntegerValue" ; - samm:preferredName "BigInteger Value"@en ; - samm:description "Some big integer value"@en ; - samm:dataType xsd:integer . - -:numericCode a samm:Property ; - samm:name "numericCode" ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:average a samm:Property ; - samm:name "average" ; - samm:preferredName "Average"@en ; - samm:description "Some artifical average value"@en ; - samm:characteristic :BigIntegerValue . - -:ResultNoStatus a :EvaluationResult ; - :average "3"^^xsd:integer ; - :numericCode "-1"^^xsd:short ; - :description "No status" ; - :nestedResult :NestedResultGood . - -:ResultGood a :EvaluationResult ; - :average "4"^^xsd:integer ; - :numericCode "1"^^xsd:short ; - :description "Good" ; - :nestedResult :NestedResultGood . - -:ResultBad a :EvaluationResult ; - :average "13"^^xsd:integer ; - :numericCode "2"^^xsd:short ; - :description "Bad" ; - :nestedResult :NestedResultGood . - -:NestedResultGood a :NestedResult ; - :average "1"^^xsd:integer ; - :description "GOOD" . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus - :ResultGood - :ResultBad ) . - -:result a samm:Property ; - samm:name "result" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:nestedResult a samm:Property ; - samm:name "nestedResult" ; - samm:preferredName "nested result"@en ; - samm:characteristic :NestedResultCharacteristic . - -:NestedResultCharacteristic a samm:Characteristic ; - samm:name "NestedResultCharacteristic" ; - samm:dataType :NestedResult . - -:YesNo a samm-c:Enumeration ; - samm:name "YesNo" ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . - -:simpleResult a samm:Property ; - samm:name "simpleResult" ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl deleted file mode 100644 index 16f7c8f98..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithExtendedEnumsWithNotInPayloadProperty a samm:Aspect ; - samm:name "AspectWithExtendedEnumsWithNotInPayloadProperty" ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:name "EvaluationResult" ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ samm:property :average ; samm:optional "true"^^xsd:boolean ] - :numericCode - [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] - :nestedResult ) . - -:NestedResult a samm:Entity ; - samm:name "NestedResult" ; - samm:preferredName "Nested Result"@en ; - samm:description "A nested result for testing"@en ; - samm:properties ( :average :description ) . - -:ShortCode a samm:Characteristic ; - samm:name "ShortCode" ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:BigIntegerValue a samm:Characteristic ; - samm:name "BigIntegerValue" ; - samm:preferredName "BigInteger Value"@en ; - samm:description "Some big integer value"@en ; - samm:dataType xsd:integer . - -:numericCode a samm:Property ; - samm:name "numericCode" ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:name "description" ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:average a samm:Property ; - samm:name "average" ; - samm:preferredName "Average"@en ; - samm:description "Some artifical average value"@en ; - samm:characteristic :BigIntegerValue . - -:ResultNoStatus a :EvaluationResult ; - :average "3"^^xsd:integer ; - :numericCode "-1"^^xsd:short ; - :description "No status" ; - :nestedResult :NestedResultGood . - -:ResultGood a :EvaluationResult ; - :average "4"^^xsd:integer ; - :numericCode "1"^^xsd:short ; - :description "Good" ; - :nestedResult :NestedResultGood . - -:ResultBad a :EvaluationResult ; - :average "13"^^xsd:integer ; - :numericCode "2"^^xsd:short ; - :description "Bad" ; - :nestedResult :NestedResultGood . - -:NestedResultGood a :NestedResult ; - :average "1"^^xsd:integer ; - :description "GOOD" . - -:EvaluationResults a samm-c:Enumeration ; - samm:name "EvaluationResults" ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus - :ResultGood - :ResultBad ) . - -:result a samm:Property ; - samm:name "result" ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:nestedResult a samm:Property ; - samm:name "nestedResult" ; - samm:preferredName "nested result"@en ; - samm:characteristic :NestedResultCharacteristic . - -:NestedResultCharacteristic a samm:Characteristic ; - samm:name "NestedResultCharacteristic" ; - samm:dataType :NestedResult . - -:YesNo a samm-c:Enumeration ; - samm:name "YesNo" ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . - -:simpleResult a samm:Property ; - samm:name "simpleResult" ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl deleted file mode 100644 index 21a2d2d99..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithFixedPoint a samm:Aspect ; - samm:name "AspectWithFixedPoint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestFixedPoint . - -:TestFixedPoint a samm-c:Trait ; - samm:name "TestFixedPoint" ; - samm-c:constraint [ - a samm-c:FixedPointConstraint ; - samm:preferredName "Test Fixed Point"@en ; - samm:description "This is a test fixed point constraint."@en ; - samm:see ; - samm-c:scale "5"^^xsd:nonNegativeInteger ; - samm-c:integer "3"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:decimal ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl deleted file mode 100644 index e4a921288..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithFixedPointConstraint a samm:Aspect ; - samm:name "AspectWithFixedPointConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:FixedPointConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Fixed Point"@en ; - samm:description "This is a test fixed point constraint."@en ; - samm:see ; - samm-c:scale "5"^^xsd:nonNegativeInteger ; - samm-c:integer "3"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl deleted file mode 100644 index 509feca0a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - - -:AspectWithGTypeForRangeConstraints - a samm:Aspect ; - samm:name "AspectWithGTypeForRangeConstraints" ; - samm:properties ( :testPropertyWithGYear :testPropertyWithGMonth - :testPropertyWithGDay :testPropertyWithGYearMonth - :testPropertyWithGMonthYear ) ; - samm:operations ( ) . - -:testPropertyWithGYear - a samm:Property ; - samm:name "testPropertyWithGYear" ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGYear . - -:testWithGregorianCalendarMinGregorianCalendarMaxGYear - a samm-c:Trait; - samm:name "testWithGregorianCalendarMinGregorianCalendarMaxGYear" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000"^^xsd:gYear ; - samm-c:maxValue "2001"^^xsd:gYear ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGYear . - -:MeasurementGYear - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:gYear ; - samm-c:unit unit:year . - -:testPropertyWithGMonth - a samm:Property ; - samm:name "testPropertyWithGMonth" ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGMonth . - -:testWithGregorianCalendarMinGregorianCalendarMaxGMonth - a samm-c:Trait ; - samm:name "testWithGregorianCalendarMinGregorianCalendarMaxGMonth" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "--04"^^xsd:gMonth ; - samm-c:maxValue "--05"^^xsd:gMonth ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGMonth . - -:MeasurementGMonth - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:gMonth ; - samm-c:unit unit:month . - -:testPropertyWithGDay - a samm:Property ; - samm:name "testPropertyWithGDay" ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGDay . - -:testWithGregorianCalendarMinGregorianCalendarMaxGDay - a samm-c:Trait ; - samm:name "testWithGregorianCalendarMinGregorianCalendarMaxGDay" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "---04"^^xsd:gDay ; - samm-c:maxValue "---05"^^xsd:gDay ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGDay . - -:MeasurementGDay - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:gDay ; - samm-c:unit unit:day . - -:testPropertyWithGYearMonth - a samm:Property ; - samm:name "testPropertyWithGYearMonth" ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGYearMonth . - -:testWithGregorianCalendarMinGregorianCalendarMaxGYearMonth - a samm-c:Trait ; - samm:name "testWithGregorianCalendarMinGregorianCalendarMaxGYearMonth" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01"^^xsd:gYearMonth ; - samm-c:maxValue "2000-02"^^xsd:gYearMonth ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGYearMonth . - -:MeasurementGYearMonth - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:gYearMonth ; - samm-c:unit unit:one . - -:testPropertyWithGMonthYear - a samm:Property ; - samm:name "testPropertyWithGMonthYear" ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGMonthYear . - -:testWithGregorianCalendarMinGregorianCalendarMaxGMonthYear - a samm-c:Trait ; - samm:name "testWithGregorianCalendarMinGregorianCalendarMaxGMonthYear" ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "--01-01"^^xsd:gMonthDay ; - samm-c:maxValue "--01-02"^^xsd:gMonthDay ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGMonthYear . - -:MeasurementGMonthYear - a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:gMonthDay ; - samm-c:unit unit:one . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl deleted file mode 100644 index ec6fd052c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithHtmlTags a samm:Aspect ; - samm:name "AspectWithHtmlTags" ; - samm:preferredName "Aspect With Entity"@en ; - samm:description "Aspect With

    inside html tag

    Entity"@en ; - samm:properties ( :testEntity ) ; - samm:operations ( ) . - -:testEntity a samm:Property ; - samm:name "testEntity" ; - samm:preferredName "Preferred Name '/>"@en ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl deleted file mode 100644 index 4dcc64eca..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithLanguageConstraint a samm:Aspect ; - samm:name "AspectWithLanguageConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestLanguageConstraint . - -:TestLanguageConstraint a samm-c:Trait ; - samm:name "TestLanguageConstraint" ; - samm-c:constraint [ - a samm-c:LanguageConstraint ; - samm:preferredName "Test Language Constraint"@en ; - samm:description "This is a test language constraint."@en ; - samm:see ; - samm-c:languageCode "de" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl deleted file mode 100644 index 565213cd6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithLengthConstraint a samm:Aspect ; - samm:name "AspectWithLengthConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Test123" ; - samm:characteristic :TestLengthConstraint . - -:TestLengthConstraint a samm-c:Trait ; - samm:name "TestLengthConstraint" ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "This is a test length constraint."@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl deleted file mode 100644 index 89e32526e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithList a samm:Aspect ; - samm:name "AspectWithList" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:name "TestList" ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl deleted file mode 100644 index 4576d2b9f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndAdditionalProperty a samm:Aspect ; - samm:name "AspectWithListAndAdditionalProperty" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:preferredName "Test Property Two"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic samm-c:Text . - -:TestList a samm-c:List ; - samm:name "TestList" ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl deleted file mode 100644 index 75adc7884..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndElementCharacteristic a samm:Aspect ; - samm:name "AspectWithListAndElementCharacteristic" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:name "TestList" ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm-c:elementCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl deleted file mode 100644 index f19c85714..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndElementConstraint a samm:Aspect ; - samm:name "AspectWithListAndElementConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.0"^^xsd:float ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:name "TestList" ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm-c:elementCharacteristic [ - a samm-c:Trait ; - samm:name "ElementRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement - ] . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl deleted file mode 100644 index c14da7933..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListEntityEnumeration a samm:Aspect ; - samm:name "AspectWithListEntityEnumeration" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:name "ListCharacteristic" ; - samm:dataType xsd:string . - -:entityInstance a :TestEntity ; - :entityProperty ( "foo" "bar" "baz" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl deleted file mode 100644 index 754cd6b60..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListWithLengthConstraint a samm:Aspect ; - samm:name "AspectWithListWithLengthConstraint" ; - samm:properties ( :testPropertyCollectionLengthConstraint ) ; - samm:operations ( ) . - -:testPropertyCollectionLengthConstraint a samm:Property ; - samm:name "testPropertyCollectionLengthConstraint" ; - samm:characteristic :TestLengthConstraintWithCollection . - -:TestLengthConstraintWithCollection a samm-c:Trait ; - samm:name "TestLengthConstraintWithCollection" ; - samm:preferredName "Test Length Constraint with collection"@en ; - samm:description "Test Length Constraint with collection"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:name "IntList" ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl deleted file mode 100644 index 4776604f1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithMeasurement a samm:Aspect ; - samm:name "AspectWithMeasurement" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestMeasurement . - -:TestMeasurement a samm-c:Measurement ; - samm:name "TestMeasurement" ; - samm:preferredName "Test Measurement"@en ; - samm:description "This is a test Measurement"@en ; - samm:see ; - samm:dataType xsd:float ; - samm-c:unit unit:kelvin . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl deleted file mode 100644 index 5108cd13a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithMeasurementWithUnit a samm:Aspect ; - samm:name "AspectWithMeasurementWithUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestMeasurement . - -:TestMeasurement a samm-c:Measurement ; - samm:name "TestMeasurement" ; - samm-c:unit unit:percent ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl deleted file mode 100644 index 2846301bf..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithMultiLanguageText a samm:Aspect ; - samm:name "AspectWithMultiLanguageText" ; - samm:properties ( :prop ) ; - samm:operations ( ) . - -:prop a samm:Property ; - samm:name "prop" ; - samm:characteristic samm-c:MultiLanguageText . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl deleted file mode 100644 index ac5419177..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithMultilanguageExampleValue a samm:Aspect ; - samm:name "AspectWithMultiLanguageText" ; - samm:properties ( :prop ) ; - samm:operations ( ) . - -:prop a samm:Property ; - samm:name "prop" ; - samm:characteristic samm-c:MultiLanguageText ; - samm:exampleValue "Multilanguage example value."@de . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl deleted file mode 100644 index 8ff38df41..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleCollectionsOfSimpleType a samm:Aspect ; - samm:name "AspectWithMultipleCollectionsOfSimpleType" ; - samm:properties ( :testListInt :testListString ) ; - samm:operations ( ) . - -:testListInt a samm:Property ; - samm:name "testListInt" ; - samm:exampleValue "35"^^xsd:int ; - samm:characteristic :IntegerList . - -:testListString a samm:Property ; - samm:name "testListString" ; - samm:exampleValue "test string" ; - samm:characteristic :StringList . - -:IntegerList a samm-c:List ; - samm:name "IntegerList" ; - samm:dataType xsd:int . - -:StringList a samm-c:List ; - samm:name "StringList" ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl deleted file mode 100644 index 1e037b8e2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntities a samm:Aspect ; - samm:name "AspectWithMultipleEntities" ; - samm:properties ( :testEntityOne :testEntityTwo ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:name "testEntityOne" ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:name "testEntityTwo" ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl deleted file mode 100644 index 78ddb4ebf..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesAndEither a samm:Aspect ; - samm:name "AspectWithMultipleEntitiesAndEither" ; - samm:properties ( :testEntityOne :testEntityTwo :testEitherProperty ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:name "testEntityOne" ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:name "testEntityTwo" ; - samm:characteristic :TestEntityCharacteristic . - -:testEitherProperty a samm:Property ; - samm:name "testEitherProperty" ; - samm:characteristic :TestEither . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . - -:TestEither a samm-c:Either ; - samm:name "TestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "This is a test Either."@en ; - samm:see ; - samm-c:right :RightEitherType ; - samm-c:left :LeftEitherType . - -:RightEitherType a samm:Characteristic ; - samm:name "Right either type" ; - samm:preferredName "Right either type"@en ; - samm:description "Right type Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:LeftEitherType a samm:Characteristic ; - samm:name "Left either type" ; - samm:preferredName "Left either type"@en ; - samm:description "Left type Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl deleted file mode 100644 index 07de7ecb0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesOnMultipleLevels a samm:Aspect ; - samm:name "AspectWithMultipleEntitiesOnMultipleLevels" ; - samm:properties ( :testEntityOne :testEntityTwo :testString :testSecondEntity ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:name "testEntityOne" ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:name "testEntityTwo" ; - samm:characteristic :TestEntityCharacteristic . - -:testSecondEntity a samm:Property ; - samm:name "testSecondEntity" ; - samm:characteristic :SecondTestEntityCharacteristic . - -:testThirdEntity a samm:Property ; - samm:name "testThirdEntity" ; - samm:characteristic :ThirdTestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testLocalDateTime :randomValue :testThirdEntity ) . - -:SecondTestEntity a samm:Entity ; - samm:name "SecondTestEntity" ; - samm:properties ( :testInt :testFloat ) . - -:ThirdTestEntity a samm:Entity ; - samm:name "ThirdTestEntity" ; - samm:properties ( :testString :testFloat ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTime . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . - -:SecondTestEntityCharacteristic a samm:Characteristic ; - samm:name "SecondTestEntityCharacteristic" ; - samm:dataType :SecondTestEntity . - -:ThirdTestEntityCharacteristic a samm:Characteristic ; - samm:name "ThirdTestEntityCharacteristic" ; - samm:dataType :ThirdTestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl deleted file mode 100644 index b9776869c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 -# -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesSameExtend a samm:Aspect ; - samm:name "AspectWithMultipleEntitiesSameExtend" ; - samm:properties ( :testPropertyOne :testPropertyTwo ) ; - samm:operations ( ) . - -:testPropertyOne a samm:Property ; - samm:name "testPropertyOne" ; - samm:characteristic :testCharacteristicOne . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic :testCharacteristicTwo . - -:testCharacteristicOne a samm:Characteristic ; - samm:name "testCharacteristicOne" ; - samm:dataType :testEntityOne . - -:testCharacteristicTwo a samm:Characteristic ; - samm:name "testCharacteristicTwo" ; - samm:dataType :testEntityTwo . - -:testEntityOne a samm:Entity ; - samm:name "testEntityOne" ; - samm:extends :AbstractTestEntity ; - samm:properties ( ) . - -:testEntityTwo a samm:Entity ; - samm:name "testEntityTwo" ; - samm:extends :AbstractTestEntity ; - samm:properties ( ) . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:name "AbstractTestEntity" ; - samm:properties ( ). diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl deleted file mode 100644 index 6413aa7ed..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntityCollections a samm:Aspect ; - samm:name "AspectWithMultipleEntityCollections" ; - samm:properties ( :testListOne :testListTwo ) ; - samm:operations ( ) . - -:testListOne a samm:Property ; - samm:name "testListOne" ; - samm:characteristic :EntityList . - -:testListTwo a samm:Property ; - samm:name "testListTwo" ; - samm:characteristic :EntityList . - -:EntityList a samm-c:List ; - samm:name "EntityList" ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl deleted file mode 100644 index 79a1aa311..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEnumerationsOnMultipleLevels a samm:Aspect ; - samm:name "AspectWithMultipleEnumerationsOnMultipleLevels" ; - samm:properties ( :testPropertyWithEnumOne :testPropertyWithEnumTwo :testEntityWithEnumOne ) ; - samm:operations ( ) . - -:testPropertyWithEnumOne a samm:Property ; - samm:name "testPropertyWithEnumOne" ; - samm:characteristic :TestEnumOneCharacteristic . - -:testPropertyWithEnumTwo a samm:Property ; - samm:name "testPropertyWithEnumTwo" ; - samm:characteristic :TestEnumTwoCharacteristic . - -:testEntityWithEnumOne a samm:Property ; - samm:name "testEntityWithEnumOne" ; - samm:characteristic :TestEntityCharacteristic . - -:TestEnumOneCharacteristic a samm-c:Enumeration ; - samm:name "TestEnumOneCharacteristic" ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . - -:TestEnumTwoCharacteristic a samm-c:Enumeration ; - samm:name "TestEnumTwoCharacteristic" ; - samm:dataType xsd:string ; - samm-c:values ( "One" "Two" "Three" ) . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntityWithEnumOne . - -:TestEntityWithEnumOne a samm:Entity ; - samm:name "TestEntityWithEnumOne" ; - samm:properties ( :testString :testPropertyWithEnumOne :testPropertyWithEnumThree ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:characteristic samm-c:Text . - -:testPropertyWithEnumThree a samm:Property ; - samm:name "testPropertyWithEnumThree" ; - samm:characteristic :TestEnumThreeCharacteristic . - -:TestEnumThreeCharacteristic a samm-c:Enumeration ; - samm:name "TestEnumThreeCharacteristic" ; - samm:dataType xsd:string ; - samm-c:values ( "Active" "Error" "Inactive" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl deleted file mode 100644 index a10d23635..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithMultipleSeeAttributes" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:see ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl deleted file mode 100644 index 9d68a651f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntity a samm:Aspect ; - samm:name "AspectWithNestedEntity" ; - samm:properties ( :entity ) ; - samm:operations ( ) . - -:entity a samm:Property ; - samm:name "entity" ; - samm:characteristic :EntityCharacteristic . - -:Entity a samm:Entity ; - samm:name "Entity" ; - samm:properties ( :nestedEntity :testString ) . - -:nestedEntity a samm:Property ; - samm:name "nestedEntity" ; - samm:characteristic :NestedEntityCharacteristic . - -:NestedTestEntity a samm:Entity ; - samm:name "NestedTestEntity" ; - samm:properties ( :testString ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:EntityCharacteristic a samm:Characteristic ; - samm:name "EntityCharacteristic" ; - samm:dataType :Entity . - -:NestedEntityCharacteristic a samm:Characteristic ; - samm:name "NestedEntityCharacteristic" ; - samm:dataType :NestedTestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl deleted file mode 100644 index fe6db4f7c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityEnumerationWithNotInPayload a samm:Aspect ; - samm:name "AspectWithNestedEntityEnumerationWithNotInPayload" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :entityProperty - [ samm:property :nestedEntityProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:nestedEntityProperty a samm:Property ; - samm:name "nestedEntityProperty" ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:name "NestedEntityCharacteristic" ; - samm:dataType :NestedEntity - ] . - -:NestedEntity a samm:Entity ; - samm:name "NestedEntity" ; - samm:properties ( :notInPayloadProperty ) . - -:notInPayloadProperty a samm:Property ; - samm:name "notInPayloadProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :nestedEntityProperty :NestedEntityInstance . - -:NestedEntityInstance a :NestedEntity ; - :notInPayloadProperty "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl deleted file mode 100644 index a58a22a0d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityList a samm:Aspect ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :TestFirstEntity - ] . - -:TestFirstEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testSecondList ) . - -:testSecondList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :TestSecondEntity - ] . - -:TestSecondEntity a samm:Entity ; - samm:properties ( :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl deleted file mode 100644 index be0af8b2f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityListEnumerationWithNotInPayload a samm:Aspect ; - samm:name "AspectWithNestedEntityListEnumerationWithNotInPayload" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:name "TestEnumeration" ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :entityProperty - [ samm:property :nestedEntityListProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:nestedEntityListProperty a samm:Property ; - samm:name "nestedEntityListProperty" ; - samm:characteristic [ - a samm-c:Set ; - samm:name "NestedEntityList" ; - samm:dataType :NestedEntity - ] . - -:NestedEntity a samm:Entity ; - samm:name "NestedEntity" ; - samm:properties ( :notInPayloadProperty ) . - -:notInPayloadProperty a samm:Property ; - samm:name "notInPayloadProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :nestedEntityListProperty ( :NestedEntityInstance ) . - -:NestedEntityInstance a :NestedEntity ; - :notInPayloadProperty "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl deleted file mode 100644 index d7310e9a9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNumericRegularExpressionConstraint a samm:Aspect ; - samm:name "AspectWithNumericRegularExpressionConstraint" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:name "TestConstraint" ; - samm:value "\\d*|x" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl deleted file mode 100644 index 643af9180..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithNumericStructuredValue a samm:Aspect ; - samm:name "AspectWithNumericStructuredValue" ; - samm:properties ( :date ) ; - samm:operations ( ) . - -:date a samm:Property ; - samm:name "date" ; - samm:exampleValue "2019-09-27"^^xsd:date ; - samm:characteristic :StructuredDate . - -:StructuredDate a samm-c:StructuredValue ; - samm:name "StructuredDate" ; - samm:dataType xsd:date ; - samm-c:deconstructionRule "(\\d{4})-(\\d{2})-(\\d{2})" ; - samm-c:elements ( :year "-" :month "-" :day ) . - -:year a samm:Property ; - samm:name "year" ; - samm:characteristic :Year . - -:month a samm:Property ; - samm:name "month" ; - samm:characteristic :Month . - -:day a samm:Property ; - samm:name "day" ; - samm:characteristic :Day . - -:Year a samm:Characteristic ; - samm:name "Year" ; - samm:dataType xsd:unsignedInt . - -:Month a samm:Characteristic ; - samm:name "Month" ; - samm:dataType xsd:unsignedInt . - -:Day a samm:Characteristic ; - samm:name "Day" ; - samm:dataType xsd:unsignedInt . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl deleted file mode 100644 index 03dfe96ea..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOperation a samm:Aspect ; - samm:name "AspectWithOperation" ; - samm:properties ( ) ; - samm:operations ( :testOperation :testOperationTwo ) . - -:testOperation a samm:Operation ; - samm:name "testOperation" ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( :input ) ; - samm:output :output . - -:output a samm:Property ; - samm:name "output" ; - samm:characteristic samm-c:Text . - -:input a samm:Property ; - samm:name "input" ; - samm:characteristic samm-c:Text . - -:testOperationTwo a samm:Operation ; - samm:name "testOperationTwo" ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( :input ) ; - samm:output :output . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl deleted file mode 100644 index eb8d8863c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithMultipleSeeAttributes a samm:Aspect ; - samm:name "AspectWithOperationWithMultipleSeeAttributes" ; - samm:properties ( ) ; - samm:operations ( :testOperation ) . - -:testOperation a samm:Operation ; - samm:name "testOperation" ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:name "output" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl deleted file mode 100644 index 2fc525080..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithOperationWithSeeAttribute" ; - samm:properties ( ) ; - samm:operations ( :testOperation :testOperationTwo ) . - -:testOperation a samm:Operation ; - samm:name "testOperation" ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:testOperationTwo a samm:Operation ; - samm:name "testOperationTwo" ; - samm:preferredName "Test Operation Two"@en ; - samm:description "Test Operation Two"@en ; - samm:see ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:name "output" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl deleted file mode 100644 index ffc1e1bdc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithOperationWithoutSeeAttribute" ; - samm:properties ( ) ; - samm:operations ( :testOperation ) . - -:testOperation a samm:Operation ; - samm:name "testOperation" ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:name "output" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl deleted file mode 100644 index db245bbf7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithOptionalProperties a samm:Aspect ; - samm:name "AspectWithOptionalProperties" ; - samm:properties ( [ samm:property :numberProperty; samm:optional true ] :timestampProperty ) ; - samm:operations ( ) . - -:timestampProperty a samm:Property ; - samm:name "timestampProperty" ; - samm:characteristic samm-c:Timestamp . - -:numberProperty a samm:Property ; - samm:name "numberProperty" ; - samm:characteristic [ - a samm-c:Quantifiable ; - samm:name "SomeLength" ; - samm:dataType xsd:unsignedLong ; - samm-c:unit unit:metre - ] . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl deleted file mode 100644 index ee72b15ed..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithOptionalPropertiesWithEntity a samm:Aspect ; - samm:name "AspectWithOptionalPropertiesWithEntity" ; - samm:properties ( :testString [ - samm:property :testOptionalString ; - samm:optional "true"^^xsd:boolean - ] [ - samm:property :testOptionalEntity ; - samm:optional "true"^^xsd:boolean - ] ) ; - samm:operations ( ) . - -:testOptionalEntity a samm:Property ; - samm:name "testOptionalEntity" ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( :codeProperty :testSecondString :testIntList ) . - -:codeProperty a samm:Property ; - samm:name "codeProperty" ; - samm:characteristic :TestCode . - -:TestCode a samm-c:Code ; - samm:name "TestCode" ; - samm:preferredName "Test Code"@en ; - samm:description "This is a test code."@en ; - samm:dataType xsd:int . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testOptionalString a samm:Property ; - samm:name "testOptionalString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testSecondString a samm:Property ; - samm:name "testSecondString" ; - samm:exampleValue "Another Example Value Test" ; - samm:characteristic samm-c:Text . - -:testIntList a samm:Property ; - samm:name "testIntList" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :IntegerList . - -:IntegerList a samm-c:List ; - samm:name "IntegerList" ; - samm:dataType xsd:int . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl deleted file mode 100644 index 33e32d2dc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOptionalProperty a samm:Aspect ; - samm:name "AspectWithOptionalProperty" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl deleted file mode 100644 index 9eed1b69b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOptionalPropertyWithPayloadName a samm:Aspect ; - samm:name "AspectWithOptionalPropertyWithPayloadName" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - samm:payloadName "test" - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl deleted file mode 100644 index 3878e6874..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPreferredNames a samm:Aspect ; - samm:name "AspectWithPreferredNames" ; - samm:preferredName "Aspect With Boolean"@en ; - samm:preferredName "Aspekt Mit Boolean"@de ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl deleted file mode 100644 index ed3de6416..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithProperty a samm:Aspect ; - samm:name "AspectWithProperty" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl deleted file mode 100644 index 9eec0934b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithAllBaseAttributes a samm:Aspect ; - samm:name "AspectWithPropertyWithAllBaseAttributes" ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:preferredName "Test Boolean"@en ; - samm:preferredName "Test Boolean"@de ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:characteristic :BooleanTestCharacteristic ; - samm:see ; - samm:see . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl deleted file mode 100644 index a4801bc28..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithDescriptions a samm:Aspect ; - samm:name "AspectWithPropertyWithDescriptions" ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl deleted file mode 100644 index 12138554f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithPropertyWithPayloadName a samm:Aspect ; - samm:name "AspectWithPropertyWithPayloadName" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:payloadName "test" ; - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl deleted file mode 100644 index d0a18e486..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithPreferredNames a samm:Aspect ; - samm:name "AspectWithPropertyWithPreferredNames" ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:preferredName "Test Boolean"@en ; - samm:preferredName "Test Boolean"@de ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl deleted file mode 100644 index 4b84ecd1d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithSee a samm:Aspect ; - samm:name "AspectWithPropertyWithSee" ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:name "testBoolean" ; - samm:characteristic :BooleanTestCharacteristic ; - samm:see ; - samm:see . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:name "BooleanTestCharacteristic" ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl deleted file mode 100644 index ff9839ee3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableAndUnit a samm:Aspect ; - samm:name "AspectWithQuantifiableAndUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm:preferredName "Test Quantifiable"@en ; - samm:description "This is a test Quantifiable"@en ; - samm:see ; - samm:dataType xsd:float ; - samm-c:unit unit:hertz . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl deleted file mode 100644 index 9ba291ea7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableWithUnit a samm:Aspect ; - samm:name "AspectWithQuantifiableWithUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm-c:unit unit:percent ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl deleted file mode 100644 index a4566853d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableWithoutUnit a samm:Aspect ; - samm:name "AspectWithQuantifiableWithoutUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm:preferredName "Test Quantifiable"@en ; - samm:description "This is a test Quantifiable"@en ; - samm:see ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl deleted file mode 100644 index ec1a4de49..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraint a samm:Aspect ; - samm:name "AspectWithRangeConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl deleted file mode 100644 index 8383b37dd..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintInclBoundDefinitionProperties a samm:Aspect ; - samm:name "AspectWithRangeConstraintInclBoundDefinitionProperties" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl deleted file mode 100644 index 6cca3a6ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintOnConstrainedNumericType a samm:Aspect ; - samm:name "AspectWithRangeConstraintOnConstrainedNumericType" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "5"^^xsd:short ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl deleted file mode 100644 index d731b6bf7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithBoundDefinitionAttributes a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithBoundDefinitionAttributes" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "NumberCharacteristic" ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl deleted file mode 100644 index 52eb5a535..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyLowerBound a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyLowerBound" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl deleted file mode 100644 index d2f3c1c15..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "NumberCharacteristic" ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl deleted file mode 100644 index 0e718a915..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl deleted file mode 100644 index 41aa74ec0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithOnlyMinValue a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyMinValue" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm:name "TestTrait" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:name "TestConstraint" ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:name "NumberCharacteristic" ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl deleted file mode 100644 index 536262419..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyUpperBound a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyUpperBound" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "2.0"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:maxValue "2.3"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl deleted file mode 100644 index 520850c67..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "2.0"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:maxValue "2.3"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:name "Measurement" ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl deleted file mode 100644 index 5d4b30600..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithoutMinMaxDoubleValue a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithoutMinMaxDoubleValue" ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Test Aspekt"@de ; - samm:properties ( :doubleProperty ) ; - samm:operations ( ) . - -:doubleProperty a samm:Property ; - samm:name "doubleProperty" ; - samm:preferredName "Test Double Property"@en ; - samm:preferredName "Numerischer Wert"@de ; - samm:description "A property with a numeric value."@en ; - samm:description "Eine Property mit einem numerischen Wert."@de ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm:preferredName "Test Range Constraint"@en ; - samm:preferredName "Test Range Constraint"@de ; - samm:description "Restricts a numeric value to values between 0 and 100."@en ; - samm:description "Beschränkt einen numerischen Wert auf Werte zwischen 0 und 100."@de ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - ] ; - samm-c:baseCharacteristic :DoubleCharacteristic . - -:DoubleCharacteristic a samm:Characteristic ; - samm:name "DoubleCharacteristic" ; - samm:preferredName "Double Characteristic"@en ; - samm:preferredName "Numerische Charakteristik"@de ; - samm:description "Positive Numbers"@en ; - samm:description "Positive Zahlen"@de ; - samm:dataType xsd:double . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl deleted file mode 100644 index c91999612..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithoutMinMaxIntegerValue a samm:Aspect ; - samm:name "AspectWithRangeConstraintWithoutMinMaxIntegerValue" ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Test Aspekt"@de ; - samm:properties ( :testInt ) ; - samm:operations ( ) . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:preferredName "Test Integer Property"@en ; - samm:preferredName "Numerischer Wert"@de ; - samm:description "A property with a numeric value."@en ; - samm:description "Eine Property mit einem numerischen Wert."@de ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:name "TestRangeConstraint" ; - samm:preferredName "Test Range Constraint"@en ; - samm:preferredName "Test Range Constraint"@de ; - samm:description "Restricts a numeric value to values between 0 and 100."@en ; - samm:description "Beschränkt einen numerischen Wert auf Werte zwischen 0 und 100."@de ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - ] ; - samm-c:baseCharacteristic :IntegerCharacteristic . - -:IntegerCharacteristic a samm:Characteristic ; - samm:name "IntegerCharacteristic" ; - samm:preferredName "Integer Characteristic"@en ; - samm:preferredName "Numerische Charakteristik"@de ; - samm:description "Positive Numbers"@en ; - samm:description "Positive Zahlen"@de ; - samm:dataType xsd:integer . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl deleted file mode 100644 index 836c8caa7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix xsd: . -@prefix samm: . -@prefix unit: . -@prefix samm-c: . -@prefix samm-e: . -@prefix : . - -:AspectWithRecursivePropertyWithOptional a samm:Aspect; - samm:name "AspectWithRecursivePropertyWithOptional"; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestItemCharacteristic . - -:TestItemCharacteristic a samm-c:SingleEntity ; - samm:name "testItemCharacteristic" ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - ] ). - - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl deleted file mode 100644 index b01e1f996..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRegularExpressionConstraint a samm:Aspect ; - samm:name "AspectWithRegularExpressionConstraint" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "3" ; - samm:characteristic :TestRegularExpressionConstraint . - -:TestRegularExpressionConstraint a samm-c:Trait ; - samm:name "TestRegularExpressionConstraint" ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "This is a test regular expression constraint."@en ; - samm:see ; - samm:value "^[0-9]*$" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl deleted file mode 100644 index 8f5d1129b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRubyGemUpdateCommand a samm:Aspect ; - samm:name "AspectWithRubyGemUpdateCommand" ; - samm:preferredName "gem update --system"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl deleted file mode 100644 index aee9c4141..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithScriptTags a samm:Aspect ; - samm:name "AspectWithScriptTags" ; - samm:preferredName "Aspect With Entity"@en ; - samm:properties ( :testEntity ) ; - samm:operations ( :TestOperation ) . - -:testEntity a samm:Property ; - samm:name "testEntity" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:name "TestEntity" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example Value Test " ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:name "TestEntityCharacteristic" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType :TestEntity . - -:TestOperation a samm:Operation ; - samm:name "TestOperation" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:input ( :operationInput ) ; - samm:output :operationOutput . - -:operationInput a samm:Property ; - samm:name "operationInput" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example operation input " ; - samm:characteristic samm-c:Text . - -:operationOutput a samm:Property ; - samm:name "operationOutput" ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example operation output " ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl deleted file mode 100644 index 85ba0f215..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSee a samm:Aspect ; - samm:name "AspectWithSee" ; - samm:preferredName "Test Aspect With See"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl deleted file mode 100644 index 5f712814f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithSeeAttribute a samm:Aspect ; - samm:name "AspectWithSeeAttribute" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl deleted file mode 100644 index 364de5838..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSet a samm:Aspect ; - samm:name "AspectWithSet" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestSet . - -:TestSet a samm-c:Set ; - samm:name "TestSet" ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl deleted file mode 100644 index fd18410c0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithSimpleEntity a samm:Aspect ; - samm:name "AspectWithSimpleEntity" ; - samm:properties ( :entityProperty ) ; - samm:operations ( ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:name "FooEntity" ; - samm:dataType :Foo - ] . - -:Foo a samm:Entity ; - samm:name "Foo" ; - samm:properties ( :foo ) . - -:foo a samm:Property ; - samm:name "foo" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl deleted file mode 100644 index e8eee7b07..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithSimpleProperties a samm:Aspect ; - samm:name "AspectWithSimpleProperties" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :testLocalDateTimeWithoutExample :testDurationWithoutExample :randomValue ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:testLocalDateTimeWithoutExample a samm:Property ; - samm:name "testLocalDateTimeWithoutExample" ; - samm:characteristic :LocalDateTime . - -:testDurationWithoutExample a samm:Property ; - samm:name "testDurationWithoutExample" ; - samm:characteristic :Duration . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Duration a samm:Characteristic ; - samm:name "Duration" ; - samm:dataType xsd:duration . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTime . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl deleted file mode 100644 index e7938eae1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithSimplePropertiesAndState a samm:Aspect ; - samm:name "AspectWithSimplePropertiesAndState" ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue :automationProperty ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:name "testString" ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:name "testInt" ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:name "testFloat" ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:name "testLocalDateTime" ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:name "randomValue" ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:name "Int" ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:name "Float" ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:name "LocalDateTime" ; - samm:dataType xsd:dateTime . - -:automationProperty a samm:Property ; - samm:name "automationProperty" ; - samm:preferredName "Enabled/Disabled"@en ; - samm:preferredName "Aktiviert/Deaktiviert"@de ; - samm:characteristic :Automation . - -:Automation a samm-c:State ; - samm:name "AutomationState" ; - samm:description "Return status for the Set Configuration Operation"@en ; - samm:dataType xsd:string ; - samm-c:defaultValue "Automation Default Prop" ; - samm-c:values ( "Automation Default Prop" "Automation2" "Automation3" ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl deleted file mode 100644 index fa45c1f60..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl +++ /dev/null @@ -1,287 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithSimpleTypes a samm:Aspect ; - samm:name "AspectWithSimpleTypes" ; - samm:properties ( :anyUriProperty :base64BinaryProperty :booleanProperty :byteProperty :curieProperty :dateProperty :dateTimeProperty :dateTimeStampProperty :dayTimeDuration :decimalProperty :doubleProperty :durationProperty :floatProperty :gDayProperty :gMonthDayProperty :gMonthProperty :gYearMonthProperty :gYearProperty :hexBinaryProperty :intProperty :integerProperty :langStringProperty :longProperty :negativeIntegerProperty :nonNegativeIntegerProperty :nonPositiveInteger :positiveIntegerProperty :shortProperty :stringProperty :timeProperty :unsignedByteProperty :unsignedIntProperty :unsignedLongProperty :unsignedShortProperty :yearMonthDurationProperty ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:name "stringProperty" ; - samm:characteristic samm-c:Text . - -:booleanProperty a samm:Property ; - samm:name "booleanProperty" ; - samm:characteristic samm-c:Boolean . - -:decimalProperty a samm:Property ; - samm:name "decimalProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeDecimal" ; - samm:dataType xsd:decimal - ] . - -:integerProperty a samm:Property ; - samm:name "integerProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeInteger" ; - samm:dataType xsd:integer - ] . - -:doubleProperty a samm:Property ; - samm:name "doubleProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeDouble" ; - samm:dataType xsd:double - ] . - -:floatProperty a samm:Property ; - samm:name "floatProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeFloat" ; - samm:dataType xsd:float - ] . - -:dateProperty a samm:Property ; - samm:name "dateProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "DateValue" ; - samm:dataType xsd:date -] . - -:timeProperty a samm:Property ; - samm:name "timeProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeTime" ; - samm:dataType xsd:time - ] . - -:dateTimeProperty a samm:Property ; - samm:name "dateTimeProperty" ; - samm:characteristic samm-c:Timestamp . - -:dateTimeStampProperty a samm:Property ; - samm:name "dateTimeStampProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeDateTimeStamp" ; - samm:dataType xsd:dateTimeStamp - ] . - -:gYearProperty a samm:Property ; - samm:name "gYearProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeGYear" ; - samm:dataType xsd:gYear - ] . - -:gMonthProperty a samm:Property ; - samm:name "gMonthProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeGMonth" ; - samm:dataType xsd:gMonth - ] . - -:gDayProperty a samm:Property ; - samm:name "gDayProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeGDay" ; - samm:dataType xsd:gDay - ] . - -:gYearMonthProperty a samm:Property ; - samm:name "gYearMonthProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeGYearMonth" ; - samm:dataType xsd:gYearMonth - ] . - -:gMonthDayProperty a samm:Property ; - samm:name "gMonthDayProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeGMonthDay" ; - samm:dataType xsd:gMonthDay - ] . - -:durationProperty a samm:Property ; - samm:name "durationProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeDuration" ; - samm:dataType xsd:duration - ] . - -:yearMonthDurationProperty a samm:Property ; - samm:name "yearMonthDurationProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeYearMonthDuration" ; - samm:dataType xsd:yearMonthDuration - ] . - -:dayTimeDuration a samm:Property ; - samm:name "dayTimeDuration" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeDayTimeDuration" ; - samm:dataType xsd:dayTimeDuration - ] . - -:byteProperty a samm:Property ; - samm:name "byteProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeByte" ; - samm:description "This is a byteProperty characteristic."@en ; - samm:dataType xsd:byte - ] . - -:shortProperty a samm:Property ; - samm:name "shortProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeShort" ; - samm:dataType xsd:short - ] . - -:intProperty a samm:Property ; - samm:name "intProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeInt" ; - samm:dataType xsd:int - ] . - -:longProperty a samm:Property ; - samm:name "longProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeLong" ; - samm:dataType xsd:long - ] . - -:unsignedByteProperty a samm:Property ; - samm:name "unsignedByteProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeUnsignedByte" ; - samm:dataType xsd:unsignedByte - ] . - -:unsignedShortProperty a samm:Property ; - samm:name "unsignedShortProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeUnsignedShort" ; - samm:dataType xsd:unsignedShort - ] . - -:unsignedIntProperty a samm:Property ; - samm:name "unsignedIntProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeUnsignedInt" ; - samm:dataType xsd:unsignedInt - ] . - -:unsignedLongProperty a samm:Property ; - samm:name "unsignedLongProperty" ; - samm:characteristic [ - a samm-c:Quantifiable ; - samm:name "SomeLength" ; - samm:dataType xsd:unsignedLong ; - samm-c:unit unit:metre - ] . - -:positiveIntegerProperty a samm:Property ; - samm:name "positiveIntegerProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomePositiveInteger" ; - samm:dataType xsd:positiveInteger - ] . - -:nonNegativeIntegerProperty a samm:Property ; - samm:name "nonNegativeIntegerProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeNonNegativeInteger" ; - samm:dataType xsd:nonNegativeInteger - ] . - -:negativeIntegerProperty a samm:Property ; - samm:name "negativeIntegerProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeNegativeInteger" ; - samm:dataType xsd:negativeInteger - ] . - -:nonPositiveInteger a samm:Property ; - samm:name "nonPositiveInteger" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeNonPositiveInteger" ; - samm:dataType xsd:nonPositiveInteger - ] . - -:hexBinaryProperty a samm:Property ; - samm:name "hexBinaryProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "HexBinaryValue" ; - samm:dataType xsd:hexBinary - ] . - -:base64BinaryProperty a samm:Property ; - samm:name "base64BinaryProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "Base64BinaryValue" ; - samm:description "This is a base64Binary characteristic."@en ; - samm:dataType xsd:base64Binary - ] . - -:anyUriProperty a samm:Property ; - samm:name "anyUriProperty" ; - samm:characteristic [ - a samm:Characteristic ; - samm:name "SomeAnyUri" ; - samm:description "This is an anyURI characteristic."@en ; - samm:dataType xsd:anyURI - ] . - -:curieProperty a samm:Property ; - samm:name "curieProperty" ; - samm:characteristic samm-c:UnitReference . - -:langStringProperty a samm:Property ; - samm:name "langStringProperty" ; - samm:characteristic samm-c:MultiLanguageText . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl deleted file mode 100644 index 98131519c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSortedSet a samm:Aspect ; - samm:name "AspectWithSortedSet" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestSortedSet . - -:TestSortedSet a samm-c:SortedSet ; - samm:name "TestSortedSet" ; - samm:preferredName "Test Sorted Set"@en ; - samm:description "This is a test sorted set."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl deleted file mode 100644 index c5c94bb07..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithState a samm:Aspect ; - samm:name "AspectWithState" ; - samm:properties ( :status ) ; - samm:operations () . - -:status a samm:Property ; - samm:name "status" ; - samm:characteristic :TestState . - -:TestState a samm-c:State ; - samm:name "TestState" ; - samm:dataType xsd:string ; - samm-c:values ( "Success" "Error" "In Progress" ) ; - samm-c:defaultValue "In Progress" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl deleted file mode 100644 index 88ffe6759..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithStringEnumeration a samm:Aspect ; - samm:name "AspectWithStringEnumeration" ; - samm:properties ( :enumerationProperty ) ; - samm:operations ( ) . - -:enumerationProperty a samm:Property ; - samm:name "enumerationProperty" ; - samm:preferredName ""@en ; - samm:description ""@en ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:name "Foo" ; - samm:dataType xsd:string ; - samm-c:values ( "foo" "bar" ) - ] . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl deleted file mode 100644 index 8303f119d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithStructuredValue a samm:Aspect ; - samm:name "AspectWithStructuredValue" ; - samm:properties ( :date ) ; - samm:operations ( ) . - -:date a samm:Property ; - samm:name "date" ; - samm:exampleValue "2019-09-27"^^xsd:date ; - samm:characteristic :StructuredDate . - -:StructuredDate a samm-c:StructuredValue ; - samm:name "StructuredDate" ; - samm:dataType xsd:date ; - samm-c:deconstructionRule "(\\d{4})-(\\d{2})-(\\d{2})" ; - samm-c:elements ( :year "-" :month "-" :day ) . - -:year a samm:Property ; - samm:name "year" ; - samm:characteristic :Year . - -:month a samm:Property ; - samm:name "month" ; - samm:characteristic :Month . - -:day a samm:Property ; - samm:name "day" ; - samm:characteristic :Day . - -:Year a samm:Characteristic ; - samm:name "Year" ; - samm:dataType xsd:gYear . - -:Month a samm:Characteristic ; - samm:name "Month" ; - samm:dataType xsd:gMonth . - -:Day a samm:Characteristic ; - samm:name "Day" ; - samm:dataType xsd:gMonthDay . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl deleted file mode 100644 index e65be283b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . -@prefix unit: . - -:AspectWithTimeSeries a samm:Aspect ; - samm:name "AspectWithTimeSeries" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestTimeSeries . - -:TestTimeSeries a samm-c:TimeSeries ; - samm:name "TestTimeSeries" ; - samm:preferredName "Test Time Series"@en ; - samm:description "This is a test time series."@en ; - samm:see ; - samm:dataType :TestTimeSeriesEntity . - -:TestTimeSeriesEntity samm:refines samm-e:TimeSeriesEntity ; - samm:name "TestTimeSeriesEntity" ; - samm:preferredName "Test Time Series Entity"@en ; - samm:description "This is a test time series entity."@en ; - samm:see ; - samm:properties ( :testValue ) . - -:testValue samm:refines samm-e:value ; - samm:name "testValue" ; - samm:preferredName "Test Value"@en ; - samm:description "This is a test value."@en ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl deleted file mode 100644 index 758fae502..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithTwoLists a samm:Aspect ; - samm:name "AspectWithTwoLists" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:preferredName "Test Property Two"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:name "TestList" ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl deleted file mode 100644 index 3afdaa6cb..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithUmlautDescription a samm:Aspect ; - samm:name "AspectWithUmlautDescription" ; - samm:preferredName "Test Aspect with Umlauts within description"@en ; - samm:preferredName "Test Aspect mit Umlauten in der Beschreibung"@de ; - samm:description "This is a test description"@en ; - samm:description "Im Wort Entität ist ein Umlaut"@de ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl deleted file mode 100644 index f9948ffd1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithUnit a samm:Aspect ; - samm:name "AspectWithUnit" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:name "TestQuantifiable" ; - samm:dataType xsd:int ; - samm-c:unit unit:bitPerSecond . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl deleted file mode 100644 index c2c09edc2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedCharacteristic a samm:Aspect ; - samm:name "AspectWithUsedAndUnusedCharacteristic" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :UsedTestCharacteristic . - -:UsedTestCharacteristic a samm:Characteristic ; - samm:name "UsedTestCharacteristic" ; - samm:preferredName "Used Test Characteristic"@en ; - samm:description "Used Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:UnusedTestCharacteristic a samm:Characteristic ; - samm:name "UnusedTestCharacteristic" ; - samm:preferredName "Unused Test Characteristic"@en ; - samm:description "Unused Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl deleted file mode 100644 index c8af81c59..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedCollection a samm:Aspect ; - samm:name "AspectWithUsedAndUnusedCollection" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :UsedTestCollection . - -:UsedTestCollection a samm-c:Collection ; - samm:name "UsedTestCollection" ; - samm:preferredName "Used Test Collection"@en ; - samm:description "Used Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:UnusedTestCollection a samm-c:Collection ; - samm:name "UnusedTestCollection" ; - samm:preferredName "Unused Test Collection"@en ; - samm:description "Unused Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl deleted file mode 100644 index 52d16d8b8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedConstraint a samm:Aspect ; - samm:name "AspectWithUsedAndUnusedConstraint" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :UsedTestTrait . - -:UsedTestTrait a samm-c:Trait ; - samm:name "UsedTestTrait" ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:name "UsedTestConstraint" ; - samm:preferredName "Used Test Constraint"@en ; - samm:description "Used Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:UnusedTestConstraint a samm-c:LengthConstraint ; - samm:name "UnusedTestConstraint" ; - samm:preferredName "Unused Test Constraint"@en ; - samm:description "Unused Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl deleted file mode 100644 index 6f8e4ad9c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedEither a samm:Aspect ; - samm:name "AspectWithUsedAndUnusedEither" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :UsedTestEither . - -:UsedTestEither a samm-c:Either ; - samm:name "UsedTestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :UsedLeftType ; - samm-c:right :UsedRightType . - -:UsedLeftType a samm:Characteristic ; - samm:name "UsedLeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:UsedRightType a samm:Characteristic ; - samm:name "UsedRightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:NonUsedTestEither a samm-c:Either ; - samm:name "NonUsedTestEither" ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :NonUsedLeftType ; - samm-c:right :NonUsedRightType . - -:NonUsedLeftType a samm:Characteristic ; - samm:name "NonUsedLeftType" ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:NonUsedRightType a samm:Characteristic ; - samm:name "UnusedRightType" ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl deleted file mode 100644 index 653762cf2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedEnumeration a samm:Aspect ; - samm:name "AspectWithUsedAndUnusedEnumeration" ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic :UsedTestEnumeration . - -:UsedTestEnumeration a samm-c:Enumeration ; - samm:name "UsedTestEnumeration" ; - samm:preferredName "Used Test Enumeration"@en ; - samm:description "Used Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . - -:UnusedTestEnumeration a samm-c:Enumeration ; - samm:name "UnusedTestEnumeration" ; - samm:preferredName "Unused Test Enumeration"@en ; - samm:description "Unused Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl deleted file mode 100644 index cda25a908..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithoutLanguageTags a samm:Aspect ; - samm:name "AspectWithoutLanguageTags" ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl deleted file mode 100644 index 13a2958a2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithoutSeeAttribute a samm:Aspect ; - samm:name "AspectWithoutSeeAttribute" ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl deleted file mode 100644 index f30fd572f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property - -:EntityInstanceTest1 a samm:Aspect ; - samm:name "EntityInstanceTest1" ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:name "aspectProperty" ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:name "TheEnum" ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:name "TheEntity" ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl deleted file mode 100644 index e948e3e14..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property and one optional Property, -# with the Property being present in the instance - -:EntityInstanceTest2 a samm:Aspect ; - samm:name "EntityInstanceTest2" ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:name "aspectProperty" ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:name "TheEnum" ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:name "TheEntity" ; - samm:properties ( :entityProperty [ samm:property :optionalEntityProperty; samm:optional true ] ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:name "optionalEntityProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" ; - :optionalEntityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl deleted file mode 100644 index c0757d3ef..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property and one optional Property, -# with the Property being not present in the instance - -:EntityInstanceTest3 a samm:Aspect ; - samm:name "EntityInstanceTest3" ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:name "aspectProperty" ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:name "TheEnum" ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:name "TheEntity" ; - samm:properties ( :entityProperty [ samm:property :optionalEntityProperty; samm:optional true ] ) . - -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:name "optionalEntityProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl deleted file mode 100644 index 65b2583e0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with two optional Properties, # with no Property being present in the instance - -:EntityInstanceTest4 a samm:Aspect ; - samm:name "EntityInstanceTest4" ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:name "aspectProperty" ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:name "TheEnum" ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:name "TheEntity" ; - samm:properties ( [ samm:property :entityProperty; samm:optional true ] [ samm:property :optionalEntityProperty; samm:optional true ] ) . -:entityProperty a samm:Property ; - samm:name "entityProperty" ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:name "optionalEntityProperty" ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl deleted file mode 100644 index b06ed57d2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithMultipleSeeAttributes a samm:Entity ; - samm:name "EntityWithMultipleSeeAttributes" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:see ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl deleted file mode 100644 index d5c36636d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalAndNotInPayloadProperty a samm:Entity ; - samm:name "EntityWithOptionalAndNotInPayloadProperty" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( :testPropertyOne - [ samm:property :testPropertyTwo ; samm:optional "true"^^xsd:boolean ] - [ samm:property :testPropertyThree ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:testPropertyOne a samm:Property ; - samm:name "testPropertyOne" ; - samm:characteristic samm-c:Text . - -:testPropertyTwo a samm:Property ; - samm:name "testPropertyTwo" ; - samm:characteristic samm-c:Text . - -:testPropertyThree a samm:Property ; - samm:name "testPropertyThree" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl deleted file mode 100644 index d33ab90f6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalProperty a samm:Entity ; - samm:name "EntityWithOptionalProperty" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:optional "true"^^xsd:boolean ] ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl deleted file mode 100644 index b6d1654be..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalPropertyWithPayloadName a samm:Entity ; - samm:name "EntityWithOptionalPropertyWithPayloadName" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:optional "true"^^xsd:boolean ; samm:payloadName "test" ] ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl deleted file mode 100644 index 38a003f8c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithPropertyWithPayloadName a samm:Entity ; - samm:name "EntityWithPropertyWithPayloadName" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:payloadName "test" ] ) . - -:testProperty a samm:Property ; - samm:name "testProperty" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl deleted file mode 100644 index f258ee6bc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithSeeAttribute a samm:Entity ; - samm:name "EntityWithSeeAttribute" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl deleted file mode 100644 index d1cabd193..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithoutSeeAttribute a samm:Entity ; - samm:name "EntityWithoutSeeAttribute" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl deleted file mode 100644 index 4396d3203..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix aux: . -@prefix xsd: . - -[ - aux:contains :ModelWithBlankAndAdditionalNodes, :testProperty, :NumberList, :Number, _:blankNode ; -] . - -:ModelWithBlankAndAdditionalNodes a samm:Aspect ; - samm:name "ModelWithBlankAndAdditionalNodes" ; - samm:preferredName "Test Aspect"@en ; - samm:properties ( :testProperty ) . - -:testProperty a samm:Property ; - samm:name "TestProperty" ; - samm:characteristic :NumberList . - -:NumberList a samm-c:List ; - samm:name "NumberList" ; - samm-c:elementCharacteristic _:blankNode . - -_:blankNode a samm-c:Trait ; - samm:name "AnonymousNode" ; - samm-c:baseCharacteristic :Number ; - samm-c:constraint [ a samm-c:RangeConstraint ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; ] . - -:Number a samm:Characteristic ; - samm:name "Number" ; - samm:dataType xsd:nonNegativeInteger . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl deleted file mode 100644 index 856ab2da1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:ModelWithBrokenCycles a samm:Aspect ; - samm:name "ModelWithBrokenCycles" ; - samm:properties ( :a :e :h ) ; - samm:operations ( ) . - -############################################################# -# direct cycle between two properties broken by samm:optional -############################################################# - -:a a samm:Property; - samm:name "a" ; - samm:characteristic :aCharacteristic. - -:aCharacteristic a samm:Characteristic; - samm:name "aCharacteristic" ; - samm:dataType :AEntity. - -:AEntity a samm:Entity; - samm:name "AEntity" ; - samm:properties ( :b ) . - -:b a samm:Property; - samm:name "b" ; - samm:characteristic :bCharacteristic. - -:bCharacteristic a samm:Characteristic; - samm:name "bCharacteristic" ; - samm:dataType :BEntity. - -:BEntity a samm:Entity; - samm:name "BEntity" ; - samm:properties ( [ samm:property :a ; samm:optional true ; ] ) . - -##################################################################### -# indirect cycle via an intermediate property broken by samm:optional -##################################################################### - -:e a samm:Property; - samm:name "e" ; - samm:characteristic :eCharacteristic. - -:eCharacteristic a samm:Characteristic; - samm:name "eCharacteristic" ; - samm:dataType :EEntity. - -:EEntity a samm:Entity; - samm:name "EEntity" ; - samm:properties ( :f ) . - -:f a samm:Property; - samm:name "f" ; - samm:characteristic :fCharacteristic. - -:fCharacteristic a samm:Characteristic; - samm:name "fCharacteristic" ; - samm:dataType :FEntity. - -:FEntity a samm:Entity; - samm:name "FEntity" ; - samm:properties ( :g ) . - -:g a samm:Property; - samm:name "g" ; - samm:characteristic :gCharacteristic. - -:gCharacteristic a samm:Characteristic; - samm:name "gCharacteristic" ; - samm:dataType :GEntity. - -:GEntity a samm:Entity; - samm:name "GEntity" ; - samm:properties ( [ samm:property :e ; samm:optional true ; ] ) . - -######################################################## -# cycle but only in one of the branches of samm-c:Either -######################################################## -:h a samm:Property; - samm:name "h" ; - samm:characteristic :hCharacteristic. - -:hCharacteristic a samm-c:Either; - samm:name "hCharacteristic" ; - samm-c:left :leftCharacteristic ; - samm-c:right :rightCharacteristic. - -:leftCharacteristic a samm:Characteristic; - samm:name "leftCharacteristic" ; - samm:dataType :LeftEntity. - -:rightCharacteristic a samm:Characteristic; - samm:name "rightCharacteristic" ; - samm:dataType :RightEntity. - -:LeftEntity a samm:Entity; - samm:name "LeftEntity" ; - samm:properties ( :h ) . # direct cycle - -:RightEntity a samm:Entity; - samm:name "RightEntity" ; - samm:properties ( :i ) . # no cycle - -:i a samm:Property; - samm:name "i" ; - samm:characteristic :iCharacteristic. - -:iCharacteristic a samm:Characteristic; - samm:name "iCharacteristic" ; - samm:dataType xsd:string. - -############################################################# -# a cycle, but the properties are not referenced by an Aspect -############################################################# -:j a samm:Property; - samm:name "j" ; - samm:characteristic :jCharacteristic. - -:jCharacteristic a samm:Characteristic; - samm:name "jCharacteristic" ; - samm:dataType :JEntity. - -:JEntity a samm:Entity; - samm:name "JEntity" ; - samm:properties ( :k ) . - -:k a samm:Property; - samm:name "k" ; - samm:characteristic :kCharacteristic. - -:kCharacteristic a samm:Characteristic; - samm:name "kCharacteristic" ; - samm:dataType :KEntity. - -:KEntity a samm:Entity; - samm:name "KEntity" ; - samm:properties ( :j ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl deleted file mode 100644 index 3e7687c0b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . - -:SharedEntityWithSeeAttribute a samm:Entity ; - samm:name "SharedEntityWithSeeAttribute" ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( ) . - -samm-e:SharedEntity a samm:Entity ; - samm:name "SharedEntity" ; - samm:preferredName "Shared Entity"@en ; - samm:description "This is a shared entity."@en ; - samm:see ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl deleted file mode 100644 index 1ab4d81ec..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithExampleValue a samm:Property ; - samm:name "propertyWithExampleValue" ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl deleted file mode 100644 index 91f0d08bf..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithMultipleSeeAttributes a samm:Property ; - samm:name "propertyWithMultipleSeeAttributes" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl deleted file mode 100644 index d7fcfb382..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithSeeAttribute a samm:Property ; - samm:name "propertyWithSeeAttribute" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl deleted file mode 100644 index f10231a71..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithoutExampleValue a samm:Property ; - samm:name "propertyWithoutExampleValue" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl deleted file mode 100644 index 016d0ac0e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithoutSeeAttribute a samm:Property ; - samm:name "propertyWithoutSeeAttribute" ; - samm:preferredName "Test Property"@en ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl deleted file mode 100644 index 29652f91b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_1_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . - -:sharedPropertyWithSeeAttribute a samm:Property ; - samm:name "sharedPropertyWithSeeAttribute" ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . - -samm-e:sharedProperty a samm:Property ; - samm:name "sharedProperty" ; - samm:preferredName "Shared Property"@en ; - samm:description "This is a shared property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl deleted file mode 100644 index 0bb9d851d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithCollectionEntity.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionEntity a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:extends :ParentTestEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:ParentTestEntity a samm:AbstractEntity ; - samm:properties ( :testCollectionProperty ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl deleted file mode 100644 index 8444c9aa2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithConstraintEntity.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithConstraintEntity a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:extends :ParentTestEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:ParentTestEntity a samm:AbstractEntity ; - samm:properties ( :stringRegexcProperty ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl deleted file mode 100644 index 78509b237..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithEitherEntity.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherEntity a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:extends :ParentTestEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:ParentTestEntity a samm:AbstractEntity ; - samm:properties ( :testPropertyWithEither ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl deleted file mode 100644 index b969b5ada..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/AspectWithExtendedEntity.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithExtendedEntity a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic [ a samm-c:SortedSet ; - samm:dataType :TestEntity ] . - -:TestEntity a samm:Entity ; - samm:extends :ParentTestEntity ; - samm:properties ( ) . - -:ParentTestEntity a samm:AbstractEntity ; - samm:extends :ParentOfParentEntity ; - samm:properties ( :parentString ) . - -:ParentOfParentEntity a samm:AbstractEntity ; - samm:properties ( :booleanProperty ) . - -:StringCode a samm-c:Code ; - samm:dataType xsd:string . - -:parentString a samm:Property ; - samm:characteristic :StringCode . - -:parentOfParentString a samm:Property ; - samm:characteristic :StringCode . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl deleted file mode 100644 index fab77e084..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithCollection.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:TestEntityWithCollection a samm:Entity ; - samm:properties ( :testCollectionProperty ) ; - samm:operations ( ) . - -:testCollectionProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl deleted file mode 100644 index 1e4f867d5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithConstraint.ttl +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix unit: . -@prefix xsd: . - -:EntityWithConstraint a samm:Entity ; - samm:properties ( :stringLcProperty :doubleRcProperty :intRcProperty :bigIntRcProperty :floatRcProperty :stringRegexcProperty ) ; - samm:operations ( ) . - -:stringLcProperty a samm:Property ; - samm:characteristic :StringLengthConstraint . - -:stringRegexcProperty a samm:Property ; - samm:characteristic :RegularExpressionConstraint . - -:doubleRcProperty a samm:Property ; - samm:characteristic :DoubleRangeConstraint . - -:intRcProperty a samm:Property ; - samm:characteristic :IntegerRangeConstraint . - -:bigIntRcProperty a samm:Property ; - samm:characteristic :BigIntegerRangeConstraint . - -:floatRcProperty a samm:Property ; - samm:characteristic :FloatRangeConstraint . - -:StringLengthConstraint a samm-c:Trait ; - samm:preferredName "Used Test Constraint"@en ; - samm:description "Used Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "20"^^xsd:nonNegativeInteger ; - samm-c:maxValue "22"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-0.1"^^xsd:double ; - samm-c:maxValue "0.2"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :DoubleMeasurement . - -:IntegerRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-1"^^xsd:int ; - samm-c:maxValue "-1"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :IntegerMeasurement . - -:BigIntegerRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "10"^^xsd:int ; - samm-c:maxValue "15"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :BigIntegerMeasurement . - -:FloatRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "100"^^xsd:int ; - samm-c:maxValue "112"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :FloatMeasurement . - -:RegularExpressionConstraint a samm-c:Trait ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "Test Regular Expression Constraint"@en ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "[a-zA-Z]" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:double . - -:IntegerMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:int . - -:BigIntegerMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:integer . - -:FloatMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl deleted file mode 100644 index 4c5da92f7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithEither.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:EntityWithEither a samm:Entity ; - samm:properties ( :testPropertyWithEither ) ; - samm:operations ( ) . - -:testPropertyWithEither a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "This is a test Either."@en ; - samm:see ; - samm-c:left samm-c:Text ; - samm-c:right samm-c:Boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl deleted file mode 100644 index d351a8f7f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test.shared/1.0.0/EntityWithSimpleTypes.ttl +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:TestEntityWithSimpleTypes a samm:Entity ; - samm:properties ( :anyUriProperty :base64BinaryProperty :booleanProperty :byteProperty :curieProperty :dateProperty :dateTimeProperty :dateTimeStampProperty :dayTimeDuration :decimalProperty :doubleProperty :durationProperty :floatProperty :gDayProperty :gMonthDayProperty :gMonthProperty :gYearMonthProperty :gYearProperty :hexBinaryProperty :intProperty :integerProperty :langStringProperty :longProperty :negativeIntegerProperty :nonNegativeIntegerProperty :nonPositiveInteger :positiveIntegerProperty :shortProperty :stringProperty :timeProperty :unsignedByteProperty :unsignedIntProperty :unsignedLongProperty :unsignedShortProperty :yearMonthDurationProperty ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:booleanProperty a samm:Property ; - samm:characteristic samm-c:Boolean . - -:decimalProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:decimal - ] . - -:integerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . - -:doubleProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:double - ] . - -:floatProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:float - ] . - -:dateProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:date -] . - -:timeProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:time - ] . - -:dateTimeProperty a samm:Property ; - samm:characteristic samm-c:Timestamp . - -:dateTimeStampProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp - ] . - -:gYearProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gYear - ] . - -:gMonthProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gMonth - ] . - -:gDayProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gDay - ] . - -:gYearMonthProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gYearMonth - ] . - -:gMonthDayProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gMonthDay - ] . - -:durationProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:duration - ] . - -:yearMonthDurationProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:yearMonthDuration - ] . - -:dayTimeDuration a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:dayTimeDuration - ] . - -:byteProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:byte - ] . - -:shortProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:short - ] . - -:intProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:int - ] . - -:longProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:long - ] . - -:unsignedByteProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedByte - ] . - -:unsignedShortProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedShort - ] . - -:unsignedIntProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedInt - ] . - -:unsignedLongProperty a samm:Property ; - samm:characteristic [ - a samm-c:Quantifiable ; - samm:dataType xsd:unsignedLong ; - samm-c:unit unit:metre - ] . - -:positiveIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:positiveInteger - ] . - -:nonNegativeIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . - -:negativeIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:negativeInteger - ] . - -:nonPositiveInteger a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonPositiveInteger - ] . - -:hexBinaryProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:hexBinary - ] . - -:base64BinaryProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:base64Binary - ] . - -:anyUriProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:anyURI - ] . - -:curieProperty a samm:Property ; - samm:characteristic samm-c:UnitReference . - -:langStringProperty a samm:Property ; - samm:characteristic samm-c:MultiLanguageText . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl deleted file mode 100644 index f2f0615cb..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/Aspect.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:Aspect a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl deleted file mode 100644 index 4b69808b0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractEntity.ttl +++ /dev/null @@ -1,58 +0,0 @@ -# -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 -# -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithAbstractEntity a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :ExtendingTestEntity . - -:ExtendingTestEntity a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:preferredName "Abstract Test Entity"@en ; - samm:description "This is a abstract test entity"@en ; - samm:properties ( :abstractTestProperty ). - -:abstractTestProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl deleted file mode 100644 index 71f0e3dd8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractProperty.ttl +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 -# -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithAbstractProperty a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test entity"@en ; - samm:see ; - samm:dataType :ExtendingTestEntity . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:preferredName "Abstract Test Entity"@en ; - samm:description "This is a abstract test entity"@en ; - samm:properties ( :abstractTestProperty ). - -:abstractTestProperty a samm:AbstractProperty ; - samm:description "This is an abstract test property"@en . - -:ExtendingTestEntity a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( - [ samm:extends :abstractTestProperty ; samm:characteristic samm-c:Text ] - ) . - - - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl deleted file mode 100644 index 83367fba1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAbstractSingleEntity.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 -# -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithAbstractSingleEntity a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:dataType :ExtendingTestEntity . - -:ExtendingTestEntity a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:description "This is an abstract test entity"@en ; - samm:properties ( :abstractTestProperty ). - -:abstractTestProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl deleted file mode 100644 index 8ed63aeda..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithAllBaseAttributes.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithAllBaseAttributes a samm:Aspect ; - samm:preferredName "Aspect With Boolean"@en ; - samm:preferredName "Aspekt Mit Boolean"@de ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:see ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl deleted file mode 100644 index 29d050126..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBinary.ttl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBinary a samm:Aspect ; - samm:properties ( :testBinary ) ; - samm:operations ( ) . - -:testBinary a samm:Property ; - samm:characteristic :BinaryTestCharacteristic . - -:BinaryTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:hexBinary . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl deleted file mode 100644 index 7896d8ebe..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBlankNode.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBlankNode a samm:Aspect ; - samm:preferredName "Aspect With Blank Node"@en ; - samm:preferredName "Aspekt mit anonymen Knoten"@de ; - samm:properties ( :list ) ; - samm:operations ( ) . - -:list a samm:Property ; - samm:characteristic [ - a samm-c:Collection ; - samm:preferredName "Blank Node Collection"@en ; - samm:preferredName "Blank Node Liste"@de ; - samm:dataType xsd:string ; - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl deleted file mode 100644 index 7046e1d7f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithBoolean.ttl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithBoolean a samm:Aspect ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl deleted file mode 100644 index 19e25a1ff..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm:Characteristic ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl deleted file mode 100644 index 968f196c1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithSeeAttribute.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:testPropertyTwo a samm:Property ; - samm:characteristic :TestCharacteristicTwo . - -:TestCharacteristic a samm:Characteristic ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:see ; - samm:dataType xsd:string . - -:TestCharacteristicTwo a samm:Characteristic ; - samm:preferredName "Test Characteristic Two"@en ; - samm:description "Test Characteristic Two"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl deleted file mode 100644 index 79e439b36..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCharacteristicWithoutSeeAttribute.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCharacteristicWithoutSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm:Characteristic ; - samm:preferredName "Test Characteristic"@en ; - samm:description "Test Characteristic"@en ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl deleted file mode 100644 index 6d9c8775f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCode.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCode a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCode . - -:TestCode a samm-c:Code ; - samm:preferredName "Test Code"@en ; - samm:description "This is a test code."@en ; - samm:see ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl deleted file mode 100644 index 0ac34cf13..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollection.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollection a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl deleted file mode 100644 index c80ef78ea..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndElementCharacteristic.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionAndElementCharacteristic a samm:Aspect ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:characteristic [ - a samm-c:Collection ; - samm-c:elementCharacteristic :TestEntityCharacteristic - ] . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:properties ( :testProperty ) . - -:testProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl deleted file mode 100644 index acd1a7bfc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionAndSimpleElementCharacteristic.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionAndSimpleElementCharacteristic a samm:Aspect ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:characteristic [ - a samm-c:Collection ; - samm-c:elementCharacteristic samm-c:Text - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl deleted file mode 100644 index 162987248..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionOfSimpleType.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionOfSimpleType a samm:Aspect ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:exampleValue "35"^^xsd:int ; - samm:characteristic :IntegerList . - -:IntegerList a samm-c:List ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl deleted file mode 100644 index 7a8e26df2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithAbstractEntity.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 -# -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithAbstractEntity a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :EntityCollectionCharacteristic ; - samm:description "This is a test property"@en . - -:EntityCollectionCharacteristic a samm-c:Collection ; - samm:dataType :AbstractTestEntity ; - samm:description "This is an entity collection characteristic"@en . - -:ExtendingTestEntity a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:description "This is an abstract test entity"@en ; - samm:properties ( :abstractTestProperty ). - -:abstractTestProperty a samm:Property ; - samm:description "This is an abstract test property"@en ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl deleted file mode 100644 index 8e4b52469..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementCharacteristic.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionWithElementCharacteristic a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm-c:elementCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl deleted file mode 100644 index ca9f5bbe5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithElementConstraint.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCollectionWithElementConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.0"^^xsd:float ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm-c:elementCharacteristic [ - a samm-c:Trait ; - samm-c:baseCharacteristic :Measurement ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] - ] . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl deleted file mode 100644 index 7d899210e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl deleted file mode 100644 index 76b9fe719..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithSeeAttribute.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCollection . - -:testPropertyTwo a samm:Property ; - samm:characteristic :TestCollectionTwo . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:see ; - samm:dataType xsd:string . - -:TestCollectionTwo a samm-c:Collection ; - samm:preferredName "Test Collection Two"@en ; - samm:description "Test Collection Two"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl deleted file mode 100644 index e65ebf01b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionWithoutSeeAttribute.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionWithoutSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "Test Collection"@en ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl deleted file mode 100644 index b97ef86b3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollections.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithCollections a samm:Aspect ; - samm:properties ( :setProperty :listProperty ) ; - samm:operations ( ) . - -:listProperty a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType xsd:int - ] . - -:setProperty a samm:Property ; - samm:characteristic [ - a samm-c:Set ; - samm:dataType xsd:string - ] . - - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl deleted file mode 100644 index 94cb81ba5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCollectionsWithElementCharacteristicAndSimpleDataType.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCollectionsWithElementCharacteristicAndSimpleDataType a samm:Aspect ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCollection . - -:testPropertyTwo a samm:Property ; - samm:characteristic :TestCollectionTwo . - -:TestCollection a samm-c:Collection ; - samm:dataType xsd:string . - -:TestCollectionTwo a samm-c:Collection ; - samm-c:elementCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl deleted file mode 100644 index 684da9806..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexCollectionEnum.ttl +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithComplexCollectionEnum a samm:Aspect ; - samm:properties ( :myPropertyOne :myPropertyTwo :myPropertyThree :myPropertyFour ) ; - samm:operations ( ) . - -:myPropertyOne a samm:Property ; - samm:characteristic :MyEnumerationOne . - -:MyEnumerationOne a samm-c:Enumeration ; - samm:dataType :MyEntityOne ; - samm-c:values ( :entityInstanceOne ) . - -:MyEntityOne a samm:Entity ; - samm:properties ( :entityPropertyOne ) . - -:entityPropertyOne a samm:Property ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:dataType xsd:string . - -:entityInstanceOne a :MyEntityOne ; - :entityPropertyOne ( "fooOne" "barOne" "bazOne" ) . - -:myPropertyTwo a samm:Property ; - samm:characteristic :MyEnumerationTwo . - -:MyEnumerationTwo a samm-c:Enumeration ; - samm:dataType :MyEntityTwo ; - samm-c:values ( :entityInstanceTwo ) . - -:MyEntityTwo a samm:Entity ; - samm:properties ( :entityPropertyTwo ) . - -:entityPropertyTwo a samm:Property ; - samm:characteristic :setCharacteristic . - -:setCharacteristic a samm-c:Set ; - samm:dataType xsd:string . - -:entityInstanceTwo a :MyEntityTwo ; - :entityPropertyTwo ( "fooTwo" "barTwo" "bazTwo" ) . - -:myPropertyThree a samm:Property ; - samm:characteristic :MyEnumerationThree . - -:MyEnumerationThree a samm-c:Enumeration ; - samm:dataType :MyEntityThree ; - samm-c:values ( :entityInstanceThree ) . - -:MyEntityThree a samm:Entity ; - samm:properties ( :entityPropertyThree ) . - -:entityPropertyThree a samm:Property ; - samm:characteristic :sortedSetCharacteristic . - -:sortedSetCharacteristic a samm-c:SortedSet ; - samm:dataType xsd:string . - -:entityInstanceThree a :MyEntityThree ; - :entityPropertyThree ( "fooThree" "barThree" "bazThree" ) . - -:myPropertyFour a samm:Property ; - samm:characteristic :MyEnumerationFour . - -:MyEnumerationFour a samm-c:Enumeration ; - samm:dataType :MyEntityFour ; - samm-c:values ( :entityInstanceFour ) . - -:MyEntityFour a samm:Entity ; - samm:properties ( :entityPropertyFour ) . - -:entityPropertyFour a samm:Property ; - samm:characteristic :collectionCharacteristic . - -:collectionCharacteristic a samm-c:Collection ; - samm:dataType xsd:string . - -:entityInstanceFour a :MyEntityFour ; - :entityPropertyFour ( "fooFour" "barFour" "bazFour" ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl deleted file mode 100644 index 02267cf5d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEntityCollectionEnum.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithComplexEntityCollectionEnum a samm:Aspect ; - samm:properties ( :myPropertyOne ) ; - samm:operations ( ) . - -:myPropertyOne a samm:Property ; - samm:characteristic :MyEnumerationOne . - -:MyEnumerationOne a samm-c:Enumeration ; - samm:description "This is my enumeration one"@en ; - samm:dataType :MyEntityOne ; - samm-c:values ( :entityInstanceOne ) . - -:MyEntityOne a samm:Entity ; - samm:properties ( :entityPropertyOne ) . - -:entityPropertyOne a samm:Property ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:dataType :MyEntityTwo . - -:MyEntityTwo a samm:Entity ; - samm:properties ( :entityPropertyTwo ) . - -:entityPropertyTwo a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstanceOne a :MyEntityOne ; - :entityPropertyOne ( :entityInstanceTwo ) . - -:entityInstanceTwo a :MyEntityTwo ; - :entityPropertyTwo "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl deleted file mode 100644 index 59a34f73e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnum.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithComplexEnum a samm:Aspect ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( :numericCode :description ) . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:numericCode a samm:Property ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:ResultNoStatus a :EvaluationResult ; - :numericCode "-1"^^xsd:short ; - :description "No status" . - -:ResultGood a :EvaluationResult ; - :numericCode "1"^^xsd:short ; - :description "Good" . - -:ResultBad a :EvaluationResult ; - :numericCode "2"^^xsd:short ; - :description "Bad" . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus :ResultGood :ResultBad ) . - -:result a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:YesNo a samm-c:Enumeration ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:simpleResult a samm:Property ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl deleted file mode 100644 index 6fe0f2682..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexEnumInclOptional.ttl +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithComplexEnumInclOptional a samm:Aspect ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ - samm:property :numericCode ; - samm:optional "true"^^xsd:boolean - ] - [ - samm:property :description ; - samm:optional "true"^^xsd:boolean - ] ) . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:numericCode a samm:Property ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:ResultNoStatus a :EvaluationResult ; - :numericCode "-1"^^xsd:short ; - :description "No status" . - -:ResultGood a :EvaluationResult ; - :numericCode "1"^^xsd:short ; - :description "Good" . - -:ResultBad a :EvaluationResult ; - :numericCode "2"^^xsd:short ; - :description "Bad" . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus :ResultGood :ResultBad ) . - -:result a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:YesNo a samm-c:Enumeration ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:simpleResult a samm:Property ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl deleted file mode 100644 index 8a70dd593..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithComplexSet.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithComplexSet a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm-c:baseCharacteristic :TestSet; - samm-c:constraint :TestSetConstraint. - -:TestSet a samm-c:Set ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType :Id . - -:TestSetConstraint a samm-c:LengthConstraint; - samm:preferredName "TestSet Constraint"@en; - samm:description "Constraint for defining a non-empty set of identifiers."@en; - samm:see ; - samm-c:minValue "2"^^xsd:nonNegativeInteger. - -:Id a samm:Entity; - samm:preferredName "Unique Identifier"@en; - samm:properties ( :productId ). - -:productId a samm:Property; - samm:preferredName "Unique Identifier"@en; - samm:characteristic :ProductIdCharacteristic ; - samm:exampleValue "urn:uuid:51131FB5-42A2-4267-A402-0ECFEFAD1619"^^xsd:anyURI. - -:ProductIdCharacteristic a samm:Characteristic; - samm:preferredName "Unique Identifier Characteristic"@en; - samm:dataType xsd:anyURI. - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl deleted file mode 100644 index c83456cb1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedCollection.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstrainedCollection a samm:Aspect ; - samm:properties ( :testCollection ) ; - samm:operations ( ) . - -:testCollection a samm:Property ; - samm:characteristic :IntegerRange . - -:IntegerRange a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2"^^xsd:integer ; - samm-c:maxValue "10"^^xsd:integer ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:dataType xsd:integer ; - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl deleted file mode 100644 index fd708f8c0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstrainedSet.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithConstrainedSet a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm-c:baseCharacteristic :TestSet; - samm-c:constraint :TestSetConstraint. - -:TestSet a samm-c:Set ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType xsd:string . - -:TestSetConstraint a samm-c:LengthConstraint; - samm:preferredName "TestSet Constraint"@en; - samm:description "Constraint for defining a non-empty set of identifiers."@en; - samm:see ; - samm-c:minValue "1"^^xsd:nonNegativeInteger. diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl deleted file mode 100644 index ecb648c71..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraint.ttl +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix unit: . -@prefix xsd: . - -:AspectWithConstraint a samm:Aspect ; - samm:properties ( :stringLcProperty :doubleRcProperty :intRcProperty :bigIntRcProperty :floatRcProperty :stringRegexcProperty ) ; - samm:operations ( ) . - -:stringLcProperty a samm:Property ; - samm:characteristic :StringLengthConstraint . - -:stringRegexcProperty a samm:Property ; - samm:characteristic :RegularExpressionConstraint . - -:doubleRcProperty a samm:Property ; - samm:characteristic :DoubleRangeConstraint . - -:intRcProperty a samm:Property ; - samm:characteristic :IntegerRangeConstraint . - -:bigIntRcProperty a samm:Property ; - samm:characteristic :BigIntegerRangeConstraint . - -:floatRcProperty a samm:Property ; - samm:characteristic :FloatRangeConstraint . - -:StringLengthConstraint a samm-c:Trait ; - samm:preferredName "Used Test Constraint"@en ; - samm:description "Used Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "20"^^xsd:nonNegativeInteger ; - samm-c:maxValue "22"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-0.1"^^xsd:double ; - samm-c:maxValue "0.2"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :DoubleMeasurement . - -:IntegerRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "-1"^^xsd:int ; - samm-c:maxValue "-1"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :IntegerMeasurement . - -:BigIntegerRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "10"^^xsd:integer ; - samm-c:maxValue "15"^^xsd:integer ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :BigIntegerMeasurement . - -:FloatRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "100.0"^^xsd:float ; - samm-c:maxValue "112.0"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :FloatMeasurement . - -:RegularExpressionConstraint a samm-c:Trait ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "Test Regular Expression Constraint"@en ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "[a-zA-Z]" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:DoubleMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:double . - -:IntegerMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:int . - -:BigIntegerMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:integer . - -:FloatMeasurement a samm-c:Measurement ; - samm:description "The acceleration"@en ; - samm-c:unit unit:metrePerSecondSquared ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl deleted file mode 100644 index 1b03f8e6d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl deleted file mode 100644 index 48a595bb5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithSeeAttribute.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:testPropertyTwo a samm:Property ; - samm:characteristic :TestTraitTwo . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:TestTraitTwo a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:preferredName "Test Constraint Two"@en ; - samm:description "Test Constraint Two"@en ; - samm:see ; - samm:value "^[A-Z][A-Z][A-Z]$" ; - ] ; - samm-c:baseCharacteristic :TestCharacteristicTwo . -:TestCharacteristicTwo a samm:Characteristic; - samm:preferredName "Test Characteristic Two"@en; - samm:description "Test Characteristic Two"@en; - samm:dataType xsd:string; - samm:see . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl deleted file mode 100644 index f73bc42b8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraintWithoutSeeAttribute.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithConstraintWithoutSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl deleted file mode 100644 index df6f8787b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithConstraints.ttl +++ /dev/null @@ -1,182 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithConstraints a samm:Aspect ; - samm:properties ( :testPropertyWithRegularExpression :testPropertyWithDecimalMinDecimalMaxRangeConstraint - :testPropertyWithDecimalMaxRangeConstraint :testPropertyWithMinMaxRangeConstraint - :testPropertyWithMinRangeConstraint :testPropertyRangeConstraintWithFloatType - :testPropertyRangeConstraintWithDoubleType :testPropertyWithMinMaxLengthConstraint - :testPropertyWithMinLengthConstraint :testPropertyCollectionLengthConstraint ) ; - samm:operations ( ) . - -:testPropertyWithRegularExpression a samm:Property ; - samm:characteristic :TestRegularExpressionConstraint . - -:TestRegularExpressionConstraint a samm-c:Trait ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "Test Regular Expression Constraint"@en ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "^[a-zA-Z]\\.[0-9]" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:testPropertyWithDecimalMinDecimalMaxRangeConstraint a samm:Property ; - samm:characteristic :TestWithDecimalMinDecimalMaxRangeConstraint . - -:TestWithDecimalMinDecimalMaxRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:decimal ; - samm-c:maxValue "10.5"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDecimal . - -:testPropertyWithDecimalMaxRangeConstraint a samm:Property ; - samm:characteristic :TestWithDecimalMaxRangeConstraint . - -:TestWithDecimalMaxRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:maxValue "10.5"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] ; - samm-c:baseCharacteristic :MeasurementDecimal . - -:MeasurementDecimal a samm-c:Measurement ; - samm:dataType xsd:decimal ; - samm-c:unit unit:metrePerSecond . - -:testPropertyWithMinMaxRangeConstraint a samm:Property ; - samm:characteristic :TestWithMinMaxRangeConstraint . - -:TestWithMinMaxRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:int ; - samm-c:maxValue "10"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:testPropertyWithMinRangeConstraint a samm:Property ; - samm:characteristic :TestWithMinRangeConstraint . - -:TestWithMinRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1"^^xsd:int ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:int ; - samm-c:unit unit:metrePerSecond . - -:testPropertyRangeConstraintWithFloatType a samm:Property ; - samm:characteristic :TestRangeConstraintWithFloatType . - -:TestRangeConstraintWithFloatType a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1.0"^^xsd:float ; - samm-c:maxValue "10.0"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementWithFloatType . - -:MeasurementWithFloatType a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . - -:testPropertyRangeConstraintWithDoubleType a samm:Property ; - samm:characteristic :TestRangeConstraintWithDoubleType . - -:TestRangeConstraintWithDoubleType a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "1.0"^^xsd:double ; - samm-c:maxValue "10.0"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementWithDoubleType . - -:MeasurementWithDoubleType a samm-c:Measurement ; - samm:dataType xsd:double ; - samm-c:unit unit:metrePerSecond . - -:testPropertyWithMinMaxLengthConstraint a samm:Property ; - samm:characteristic :TestLengthConstraint . - -:TestLengthConstraint a samm-c:Trait ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "Test Length Constraint"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:testPropertyWithMinLengthConstraint a samm:Property ; - samm:characteristic :TestLengthConstraintOnlyMin . - -:TestLengthConstraintOnlyMin a samm-c:Trait ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "Test Length Constraint"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . - -:testPropertyCollectionLengthConstraint a samm:Property ; - samm:characteristic :TestLengthConstraintWithCollection . - -:TestLengthConstraintWithCollection a samm-c:Trait ; - samm:preferredName "Test Length Constraint with collection"@en ; - samm:description "Test Length Constraint with collection"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl deleted file mode 100644 index bb41037a9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurie.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCurie a samm:Aspect ; - samm:properties ( :testCurie :testCurieWithoutExampleValue ) ; - samm:operations ( ) . - -:testCurie a samm:Property ; - samm:exampleValue "unit:hectopascal"^^samm:curie ; - samm:characteristic samm-c:UnitReference . - -:testCurieWithoutExampleValue a samm:Property ; - samm:characteristic samm-c:UnitReference . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl deleted file mode 100644 index d755a92c6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCurieEnumeration.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithCurieEnumeration a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:exampleValue "unit:hectopascal"^^samm:curie ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:dataType samm:curie ; - samm-c:values ( "unit:hectopascal"^^samm:curie "unit:gram"^^samm:curie ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl deleted file mode 100644 index ecbab8e3e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomNamespace.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix custom: . - -:AspectWithCustomNamespace a samm:Aspect ; - samm:preferredName "Test Aspect"@en; - samm:description "This is a test description"@en ; - samm:properties ( ) ; - samm:operations () . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl deleted file mode 100644 index dac0a0ded..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnit.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCustomUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:dataType xsd:int ; - samm-c:unit :normLitrePerMinute . - -:normLitrePerMinute a samm:Unit ; - samm:preferredName "norm litre per minute"@en ; - samm:quantityKind unit:volumeFlowRate ; - samm:symbol "nl/min" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl deleted file mode 100644 index 86f028e99..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithCustomUnitAndQuantityKind.ttl +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithCustomUnitAndQuantityKind a samm:Aspect ; - samm:properties ( :emissions ) ; - samm:operations ( ) . - -:emissions a samm:Property ; - samm:characteristic :Emissions . - -:Emissions a samm-c:Quantifiable ; - samm:dataType xsd:int ; - samm-c:unit :gCO2eqPerkWh . - -:gCO2eqPerkWh a samm:Unit ; - samm:preferredName "gram CO₂ equivalent per kWh"@en ; - samm:quantityKind :greenhouseGasEmissions ; - samm:symbol "gCO₂eq/kWh" . - -:greenhouseGasEmissions a samm:QuantityKind ; - samm:preferredName "greenhouse gas emissions"@en . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl deleted file mode 100644 index 4f5b85b31..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDateTimeTypeForRangeConstraints.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDateTimeTypeForRangeConstraints - a samm:Aspect ; - samm:properties ( :testPropertyWithDateTime :testPropertyWithDateTimeStamp ) ; - samm:operations ( ) . - -:testPropertyWithDateTime - a samm:Property ; - samm:characteristic :testWithGregorianCalenderMinGregorianCalenderMaxDateTime . - -:testWithGregorianCalenderMinGregorianCalenderMaxDateTime - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01-01T14:23:00"^^xsd:dateTime ; - samm-c:maxValue "2000-01-02T15:23:00"^^xsd:dateTime ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDateTime . - -:MeasurementDateTime - a samm-c:Measurement ; - samm:dataType xsd:dateTime ; - samm-c:unit unit:secondUnitOfTime . - -:testPropertyWithDateTimeStamp - a samm:Property ; - samm:characteristic :testWithGregorianCalenderMinGregorianCalenderMaxDateTimeStamp . - -:testWithGregorianCalenderMinGregorianCalenderMaxDateTimeStamp - a samm-c:Trait; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01-01T14:23:00.66372+14:00"^^xsd:dateTimeStamp ; - samm-c:maxValue "2000-01-01T15:23:00.66372+14:00"^^xsd:dateTimeStamp ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDateTimeStamp . - -:MeasurementDateTimeStamp - a samm-c:Measurement ; - samm:dataType xsd:dateTimeStamp ; - samm-c:unit unit:secondUnitOfTime . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl deleted file mode 100644 index 69225842a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptionInProperty.ttl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithDescriptionInProperty a samm:Aspect ; - samm:properties ( :enabled ) ; - samm:operations ( ) . - -:enabled a samm:Property ; - samm:preferredName "Enabled/Disabled"@en ; - samm:preferredName "Aktiviert/Deaktiviert"@de ; - samm:characteristic samm-c:Boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl deleted file mode 100644 index 7fb2f842f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDescriptions.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithDescriptions a samm:Aspect ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl deleted file mode 100644 index bfa8063da..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDuration.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDuration a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestDuration . - -:TestDuration a samm-c:Duration ; - samm:preferredName "Test Duration"@en ; - samm:description "This is a test Duration"@en ; - samm:see ; - samm:dataType xsd:int ; - samm-c:unit unit:kilosecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl deleted file mode 100644 index 5ac7bc500..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithDurationTypeForRangeConstraints.ttl +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithDurationTypeForRangeConstraints - a samm:Aspect ; - samm:properties ( :testPropertyWithDayTimeDuration :testPropertyWithDuration - :testPropertyWithYearMonthDuration ) ; - samm:operations ( ) . - -:testPropertyWithDayTimeDuration - a samm:Property ; - samm:characteristic :testWithDurationMinDurationMaxDayTimeDuration . - -:testWithDurationMinDurationMaxDayTimeDuration - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "P1DT5H"^^xsd:dayTimeDuration ; - samm-c:maxValue "P1DT8H"^^xsd:dayTimeDuration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDayTimeDuration . - -:MeasurementDayTimeDuration - a samm-c:Measurement ; - samm:dataType xsd:dayTimeDuration ; - samm-c:unit unit:hour . - -:testPropertyWithDuration - a samm:Property ; - samm:characteristic :testWithDurationMinDurationMaxDuration . - -:testWithDurationMinDurationMaxDuration - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "PT1H5M0S"^^xsd:duration ; - samm-c:maxValue "PT1H5M3S"^^xsd:duration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementDuration . - -:MeasurementDuration - a samm-c:Measurement ; - samm:dataType xsd:duration ; - samm-c:unit unit:hour . - -:testPropertyWithYearMonthDuration - a samm:Property ; - samm:characteristic :testWithDurationMinDurationMaxYearMonthDuration . - -:testWithDurationMinDurationMaxYearMonthDuration - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "P5Y2M"^^xsd:yearMonthDuration ; - samm-c:maxValue "P5Y3M"^^xsd:yearMonthDuration ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementYearMonthDuration . - -:MeasurementYearMonthDuration - a samm-c:Measurement ; - samm:dataType xsd:yearMonthDuration ; - samm-c:unit unit:hour . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl deleted file mode 100644 index 572b4af85..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEither.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEither a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "This is a test Either."@en ; - samm:see ; - samm-c:left samm-c:Text ; - samm-c:right samm-c:Boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl deleted file mode 100644 index 01a7edcd3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithComplexTypes.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEitherWithComplexTypes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:dataType :LeftEntity . - -:RightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:dataType :RightEntity . - -:LeftEntity a samm:Entity ; - samm:properties ( :result ) . - -:result a samm:Property ; - samm:characteristic :ResultCharacteristic . - -:ResultCharacteristic a samm:Characteristic ; - samm:dataType xsd:string . - -:RightEntity a samm:Entity ; - samm:properties ( :error ) . - -:error a samm:Property ; - samm:characteristic :ErrorCharacteristic . - -:ErrorCharacteristic a samm:Characteristic ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl deleted file mode 100644 index ef2e390f6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl deleted file mode 100644 index 9f5f426be..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithSeeAttribute.ttl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl deleted file mode 100644 index 87d0b083d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEitherWithoutSeeAttribute.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEitherWithoutSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm-c:left :LeftType ; - samm-c:right :RightType . - -:LeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:dataType xsd:float . - -:RightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl deleted file mode 100644 index 72d458206..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodedStrings.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEncodedStrings a samm:Aspect ; - samm:preferredName "VGhpcyBpcyBhbiBBc3BlY3Qgd2l0aCBlbmNvZGVkIHRleHQu"@en ; - samm:description "Aspect With encoded text"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl deleted file mode 100644 index 6ea61845c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEncodingConstraint.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEncodingConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestEncodingConstraint . - -:TestEncodingConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:EncodingConstraint ; - samm:preferredName "Test Encoding Constraint"@en ; - samm:description "This is a test encoding constraint."@en ; - samm:see ; - samm:value samm:UTF-8 ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl deleted file mode 100644 index 93739368f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishAndGermanDescription.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnglishAndGermanDescription a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Testaspekt"@de ; - samm:description "Aspect With Multilingual Descriptions"@en ; - samm:description "Aspekt mit mehrsprachigen Beschreibungen"@de ; - samm:properties ( :testString ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:preferredName "testString"@en ; - samm:preferredName "testString"@de ; - samm:description "This is a test string"@en ; - samm:description "Es ist ein Test-String"@de ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl deleted file mode 100644 index 5afb7c5a5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnglishDescription.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnglishDescription a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "Test Aspect"@en ; - samm:properties ( :testString ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:preferredName "testString"@en ; - samm:description "testString"@en ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl deleted file mode 100644 index 8e5d048d8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntity.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntity a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl deleted file mode 100644 index e70326598..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityCollection.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityCollection a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestCollection . - -:TestCollection a samm-c:Collection ; - samm:preferredName "Test Collection"@en ; - samm:description "This is a test collection."@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl deleted file mode 100644 index f14d87edb..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumeration.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumeration a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl deleted file mode 100644 index c34405932..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndLangString.ttl +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumerationAndLangString a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:MultiLanguageText . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test."@en . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl deleted file mode 100644 index 7101252ed..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationAndNotInPayloadProperties.ttl +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityEnumerationAndNotInPayloadProperties a samm:Aspect ; - samm:preferredName "Aspect with entity enumeration and not in payload properties"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :systemState ) ; - samm:operations ( ) . - -:systemState a samm:Property ; - samm:preferredName "System State"@en ; - samm:description "The state the system is currently in, e.g. heat-up."@en ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:preferredName "System States"@en ; - samm:description "Defines which states the system may have."@en ; - samm:dataType :SystemState ; - samm-c:values ( :On :CoolDown :Off :HeatUp ) - ] . - -:SystemState a samm:Entity ; - samm:preferredName "System State"@en ; - samm:description "Represents a specific state the system may have."@en ; - samm:properties ( :state [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:Off a :SystemState ; - :state "0"^^xsd:short ; - :description "Off" . - -:On a :SystemState ; - :state "1"^^xsd:short ; - :description "On" . - -:CoolDown a :SystemState ; - :state "3"^^xsd:short ; - :description "CoolDown" . - -:HeatUp a :SystemState ; - :state "4"^^xsd:short ; - :description "HeatUp" . - -:state a samm:Property ; - samm:characteristic :Measurement . - -:description a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl deleted file mode 100644 index d8955c4f8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithNotExistingEnum.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityEnumerationWithNotExistingEnum a samm:Aspect ; - samm:preferredName "Aspect with entity enumeration"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :systemState ) ; - samm:operations ( ) . - -:systemState a samm:Property ; - samm:preferredName "System State"@en ; - samm:description "The state the system is currently in, e.g. heat-up."@en ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:preferredName "System States"@en ; - samm:description "Defines which states the system may have."@en ; - samm:dataType :SystemState ; - samm-c:values ( :Off :CoolDown :HeatUp :On ) - ] . - -:SystemState a samm:Entity ; - samm:preferredName "System State"@en ; - samm:description "Represents a specific state the system may have."@en ; - samm:properties ( :state :description ) . - -:Off a :SystemState ; - :state "0"^^xsd:short ; - :description "Off" . - -:On a :SystemState ; - :state "1"^^xsd:short ; - :description "On" . - -:CoolDown a :SystemState ; - :state "3"^^xsd:short ; - :description "CoolDown" . - -:HeatUp a :SystemState ; - :state "4"^^xsd:short ; - :description "HeatUp" . - -:state a samm:Property ; - samm:characteristic :Measurement . - -:description a samm:Property ; - samm:characteristic samm-c:Text . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl deleted file mode 100644 index 3caa99047..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties.ttl +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityEnumerationWithOptionalAndNotInPayloadProperties a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty - [ samm:property :optionalEntityProperty ; samm:optional "true"^^xsd:boolean ] - [ samm:property :notInPayloadEntityProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:notInPayloadEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :notInPayloadEntityProperty "This is not part of the payload." . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl deleted file mode 100644 index 842b50966..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityListProperty.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithNestedEntityListProperty a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :testList ( :NestedEntityInstance :NestedEntityInstanceTwo ) . - -:TestEntity a samm:Entity ; - samm:properties ( :code - [ samm:property :testList ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:NestedEntityInstance a :NestedEntity ; - :nestedEntityProperty "bar" . - -:NestedEntityInstanceTwo a :NestedEntity ; - :nestedEntityProperty "baz" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl deleted file mode 100644 index 4e8fbdfe9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithNestedEntityProperty.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithNestedEntityProperty a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :nestedEntity :NestedEntityInstance . - -:TestEntity a samm:Entity ; - samm:properties ( :code - [ samm:property :nestedEntity ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:nestedEntity a samm:Property ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:NestedEntityInstance a :NestedEntity ; - :nestedEntityProperty "bar" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl deleted file mode 100644 index 3c8b28016..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarListProperty.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithScalarListProperty a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :testList ( 1 2 3 ) . - -:TestEntity a samm:Entity ; - samm:properties ( :code - :testList ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType xsd:integer - ] . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl deleted file mode 100644 index dd0955eb5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityInstanceWithScalarProperties.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityInstanceWithScalarProperties a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestCharacteristic . - -:TestCharacteristic a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :TestEntityInstance ) . - -:TestEntityInstance a :TestEntity ; - :code "3"^^xsd:short ; - :description "foo" . - -:TestEntity a samm:Entity ; - samm:properties ( :code [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:characteristic samm-c:Text . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl deleted file mode 100644 index b70fcc948..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityList.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityList a samm:Aspect ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :TestEntity - ] . - -:TestEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl deleted file mode 100644 index 444a8e7c9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithMultipleProperties.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityWithMultipleProperties a samm:Aspect ; - samm:properties ( :testEntity ) ; - samm:operations ( ) . - -:testEntity a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl deleted file mode 100644 index 7d52e13d6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithNestedEntityListProperty.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEntityWithNestedEntityListProperty a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :Entity . - -:Entity a samm:Entity ; - samm:properties ( :code :testList ) . - -:code a samm:Property ; - samm:characteristic :ShortCode . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :NestedEntity - ] . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:NestedEntity a samm:Entity ; - samm:properties ( :nestedEntityProperty ) . - -:nestedEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl deleted file mode 100644 index aa0f1e64b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEntityWithoutProperty.ttl +++ /dev/null @@ -1,58 +0,0 @@ - # Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEntityWithoutProperty - a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty - a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :EntityCharacteristic . - -:EntityCharacteristic - a samm-c:SingleEntity ; - samm:preferredName "Test Entity Characteristic"@en ; - samm:description "This is a test Entity Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:TestEntity - a samm:Entity ; - samm:extends :AbstractEntity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( ) . - -:AbstractEntity - a samm:AbstractEntity ; - samm:preferredName "Abstract test Entity"@en ; - samm:description "This is an abstract test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty - a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl deleted file mode 100644 index 598e7b638..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumAndOptionalEnumProperties.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEnumAndOptionalEnumProperties a samm:Aspect ; - samm:properties ( :testProperty [ samm:property :optionalTestProperty ; samm:optional "true"^^xsd:boolean ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:optionalTestProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl deleted file mode 100644 index 7c17f9664..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumHavingNestedEntities.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumHavingNestedEntities a samm:Aspect ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:result a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:simpleResult a samm:Property ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultGood :ResultBad ) . - -:YesNo a samm-c:Enumeration ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" "No" ) . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evalution Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( :details ) . - -:details a samm:Property ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:dataType :DetailEntity ; - ] . - -:DetailEntity a samm:Entity ; - samm:properties ( :description :message :numericCode ) . - -:description a samm:Property ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:message a samm:Property ; - samm:characteristic samm-c:Text . - -:numericCode a samm:Property ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:ResultBad a :EvaluationResult ; - :details :NoStatusDetails . - -:ResultGood a :EvaluationResult ; - :details :SucceededStatusDetails . - -:NoStatusDetails a :DetailEntity ; - :description "No status" ; - :message "No status available" ; - :numericCode "-10"^^xsd:short . - -:SucceededStatusDetails a :DetailEntity ; - :description "Result succeeded" ; - :message "Evaluation succeeded." ; - :numericCode "10"^^xsd:short . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl deleted file mode 100644 index 49aaea9af..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumOnlyOneSee.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix rdf: . -@prefix rdfs: . -@prefix xsd: . -@prefix : . - -:AspectWithEnumOnlyOneSee a samm:Aspect; - samm:properties (:prop1 :prop2); - samm:operations (). - -:prop1 a samm:Property; - samm:characteristic :Enum1. - -:prop2 a samm:Property; - samm:characteristic :Enum2. - -:Enum1 a samm-c:Enumeration; - samm:dataType xsd:string; - samm-c:values ("a" "b"). - -:Enum2 a samm-c:Enumeration; - samm:dataType xsd:string; - samm-c:values ("1" "2"); - samm:see . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl deleted file mode 100644 index e0ca4be35..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumeration.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEnumeration a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl deleted file mode 100644 index 7dd060001..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl deleted file mode 100644 index 9a850b68b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithScalarVariable.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithScalarVariable a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "testProperty"@en ; - samm:characteristic :TestScalarEnumeration . - -:TestScalarEnumeration a samm-c:Enumeration ; - samm:preferredName "TestScalarEnumeration Result"@en ; - samm:see ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl deleted file mode 100644 index 3cf9abcd6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithSeeAttribute.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:testPropertyTwo a samm:Property ; - samm:characteristic :TestEnumerationTwo . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . - -:TestEnumerationTwo a samm-c:Enumeration ; - samm:preferredName "Test Enumeration Two"@en ; - samm:description "Test Enumeration Two"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl deleted file mode 100644 index 1d39c1802..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutScalarVariable.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithoutScalarVariable a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultGood ) . - -:ResultGood a :EvaluationResult . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl deleted file mode 100644 index 844f1b6b3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEnumerationWithoutSeeAttribute.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithEnumerationWithoutSeeAttribute a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "Test Enumeration"@en ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl deleted file mode 100644 index 0062bb3b7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithErrorCollection.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithErrorCollection a samm:Aspect ; - samm:preferredName "Errors Aspect"@en ; - samm:description "The Errors Aspect delivers a list of the currently active errors for a specific machine."@en ; - samm:properties ( :items ) ; - samm:operations ( ) . - -:items a samm:Property ; - samm:preferredName "Items"@en ; - samm:description "A list of current active errors."@en ; - samm:characteristic [ - a samm-c:Collection ; - samm:preferredName "Errors"@en ; - samm:description "A collection of Error Entities."@en ; - samm:dataType :Error - ] . - -:Error a samm:Entity ; - samm:preferredName "Error Entity"@en ; - samm:description "The Entity describing an Error."@en ; - samm:properties ( :errorNo :errorText :startTimestamp ) . - -:errorNo a samm:Property ; - samm:preferredName "Error Number"@en ; - samm:description "The number that represents the type of error which has occurred."@en ; - samm:exampleValue "123"^^xsd:int ; - samm:characteristic :ErrorNumber . - -:errorText a samm:Property ; - samm:preferredName "Error Text"@en ; - samm:description "The error text provided by the machine."@en ; - samm:exampleValue "120.6 °C" ; - samm:characteristic samm-c:Text . - -:startTimestamp a samm:Property ; - samm:preferredName "Start Timestamp"@en ; - samm:description "The timestamp denoting when the error occurred."@en ; - samm:exampleValue "2018-08-08T12:00:00.0000"^^xsd:dateTime ; - samm:characteristic samm-c:Timestamp . - -:ErrorNumber a samm-c:Code ; - samm:preferredName "Error Number"@en ; - samm:description "The numeric representation of an Error."@en ; - samm:dataType xsd:int . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl deleted file mode 100644 index b80accb9f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithEvent.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithEvent a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:properties ( ) ; - samm:operations ( ) ; - samm:events ( :SomeEvent ) . - -:SomeEvent a samm:Event ; - samm:preferredName "Some Event"@en ; - samm:description "This is some event"@en ; - samm:parameters ( :testProperty ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl deleted file mode 100644 index f4d7e8211..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExclusiveRangeConstraint.ttl +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithExclusiveRangeConstraint a samm:Aspect ; - samm:properties ( :floatProp :doubleProp :decimalProp :integerProp :intProp ) ; - samm:operations ( ) . - -:floatProp a samm:Property ; - samm:characteristic :FloatRange . - -:doubleProp a samm:Property ; - samm:characteristic :DoubleRange . - -:decimalProp a samm:Property ; - samm:characteristic :DecimalRange . - -:integerProp a samm:Property ; - samm:characteristic :IntegerRange . - -:intProp a samm:Property ; - samm:characteristic :IntRange . - -:FloatRange a samm-c:Trait; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a floating range constraint"@en ; - samm-c:minValue "12.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:float - ] . - -:DoubleRange a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a double range constraint"@en ; - samm-c:minValue "12.3"^^xsd:double ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:double ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:double - ] . - -:DecimalRange a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a decimal range constraint"@en ; - samm-c:minValue "12.3"^^xsd:decimal ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23.45"^^xsd:decimal ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:decimal - ] . - -:IntegerRange a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:description "This is a integer range constraint"@en ; - samm-c:minValue "12"^^xsd:integer ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23"^^xsd:integer ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . - -:IntRange a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "12"^^xsd:int ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "23"^^xsd:int ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:int - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl deleted file mode 100644 index e6d5e3d0d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEntity.ttl +++ /dev/null @@ -1,50 +0,0 @@ - # Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithExtendedEntity a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic [ a samm-c:SortedSet ; - samm:dataType :TestEntity ] . - -:TestEntity a samm:Entity ; - samm:extends :ParentTestEntity ; - samm:properties ( ) . - -:ParentTestEntity a samm:AbstractEntity ; - samm:extends :ParentOfParentEntity ; - samm:properties ( :parentString ) . - -:ParentOfParentEntity a samm:AbstractEntity ; - samm:properties ( :parentOfParentString ) . - -:StringCode a samm-c:Code ; - samm:dataType xsd:string . - -:parentString a samm:Property ; - samm:characteristic :StringCode . - -:parentOfParentString a samm:Property ; - samm:characteristic :StringCode . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl deleted file mode 100644 index 5d2346e75..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnums.ttl +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithExtendedEnums a samm:Aspect ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ samm:property :average ; samm:optional "true"^^xsd:boolean ] - :numericCode - :description - :nestedResult ) . - -:NestedResult a samm:Entity ; - samm:preferredName "Nested Result"@en ; - samm:description "A nested result for testing"@en ; - samm:properties ( :average :description ) . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:BigIntegerValue a samm:Characteristic ; - samm:preferredName "BigInteger Value"@en ; - samm:description "Some big integer value"@en ; - samm:dataType xsd:integer . - -:numericCode a samm:Property ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:average a samm:Property ; - samm:preferredName "Average"@en ; - samm:description "Some artifical average value"@en ; - samm:characteristic :BigIntegerValue . - -:ResultNoStatus a :EvaluationResult ; - :average "3"^^xsd:integer ; - :numericCode "-1"^^xsd:short ; - :description "No status" ; - :nestedResult :NestedResultGood . - -:ResultGood a :EvaluationResult ; - :average "4"^^xsd:integer ; - :numericCode "1"^^xsd:short ; - :description "Good" ; - :nestedResult :NestedResultGood . - -:ResultBad a :EvaluationResult ; - :average "13"^^xsd:integer ; - :numericCode "2"^^xsd:short ; - :description "Bad" ; - :nestedResult :NestedResultGood . - -:NestedResultGood a :NestedResult ; - :average "1"^^xsd:integer ; - :description "GOOD" . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus - :ResultGood - :ResultBad ) . - -:result a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:nestedResult a samm:Property ; - samm:preferredName "nested result"@en ; - samm:characteristic :NestedResultCharacteristic . - -:NestedResultCharacteristic a samm:Characteristic ; - samm:dataType :NestedResult . - -:YesNo a samm-c:Enumeration ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . - -:simpleResult a samm:Property ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl deleted file mode 100644 index 0d22e6080..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithExtendedEnumsWithNotInPayloadProperty.ttl +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithExtendedEnumsWithNotInPayloadProperty a samm:Aspect ; - samm:properties ( :result :simpleResult ) ; - samm:operations ( ) . - -:EvaluationResult a samm:Entity ; - samm:preferredName "Evaluation Result"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:properties ( [ samm:property :average ; samm:optional "true"^^xsd:boolean ] - :numericCode - [ samm:property :description ; samm:notInPayload "true"^^xsd:boolean ] - :nestedResult ) . - -:NestedResult a samm:Entity ; - samm:preferredName "Nested Result"@en ; - samm:description "A nested result for testing"@en ; - samm:properties ( :average :description ) . - -:ShortCode a samm:Characteristic ; - samm:preferredName "Short Code"@en ; - samm:description "A numeric code with dataType short"@en ; - samm:dataType xsd:short . - -:BigIntegerValue a samm:Characteristic ; - samm:preferredName "BigInteger Value"@en ; - samm:description "Some big integer value"@en ; - samm:dataType xsd:integer . - -:numericCode a samm:Property ; - samm:preferredName "Numeric Code"@en ; - samm:description "Numeric code for the evaluation result"@en ; - samm:characteristic :ShortCode . - -:description a samm:Property ; - samm:preferredName "Description"@en ; - samm:description "Human-readable description of the process result code"@en ; - samm:characteristic samm-c:Text . - -:average a samm:Property ; - samm:preferredName "Average"@en ; - samm:description "Some artifical average value"@en ; - samm:characteristic :BigIntegerValue . - -:ResultNoStatus a :EvaluationResult ; - :average "3"^^xsd:integer ; - :numericCode "-1"^^xsd:short ; - :description "No status" ; - :nestedResult :NestedResultGood . - -:ResultGood a :EvaluationResult ; - :average "4"^^xsd:integer ; - :numericCode "1"^^xsd:short ; - :description "Good" ; - :nestedResult :NestedResultGood . - -:ResultBad a :EvaluationResult ; - :average "13"^^xsd:integer ; - :numericCode "2"^^xsd:short ; - :description "Bad" ; - :nestedResult :NestedResultGood . - -:NestedResultGood a :NestedResult ; - :average "1"^^xsd:integer ; - :description "GOOD" . - -:EvaluationResults a samm-c:Enumeration ; - samm:preferredName "Evaluation Results"@en ; - samm:description "Possible values for the evaluation of a process"@en ; - samm:dataType :EvaluationResult ; - samm-c:values ( :ResultNoStatus - :ResultGood - :ResultBad ) . - -:result a samm:Property ; - samm:preferredName "result"@en ; - samm:characteristic :EvaluationResults . - -:nestedResult a samm:Property ; - samm:preferredName "nested result"@en ; - samm:characteristic :NestedResultCharacteristic . - -:NestedResultCharacteristic a samm:Characteristic ; - samm:dataType :NestedResult . - -:YesNo a samm-c:Enumeration ; - samm:preferredName "YesNo Result"@en ; - samm:dataType xsd:string ; - samm-c:values ( "Yes" - "No" ) . - -:simpleResult a samm:Property ; - samm:preferredName "simpleResult"@en ; - samm:characteristic :YesNo . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl deleted file mode 100644 index 3bf65d9c1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPoint.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithFixedPoint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestFixedPoint . - -:TestFixedPoint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:FixedPointConstraint ; - samm:preferredName "Test Fixed Point"@en ; - samm:description "This is a test fixed point constraint."@en ; - samm:see ; - samm-c:scale "5"^^xsd:positiveInteger ; - samm-c:integer "3"^^xsd:positiveInteger ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:decimal ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl deleted file mode 100644 index 70bf42533..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithFixedPointConstraint.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithFixedPointConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:FixedPointConstraint ; - samm:preferredName "Test Fixed Point"@en ; - samm:description "This is a test fixed point constraint."@en ; - samm:see ; - samm-c:scale "5"^^xsd:positiveInteger ; - samm-c:integer "3"^^xsd:positiveInteger ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl deleted file mode 100644 index 90806e5ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithGTypeForRangeConstraints.ttl +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - - -:AspectWithGTypeForRangeConstraints - a samm:Aspect ; - samm:properties ( :testPropertyWithGYear :testPropertyWithGMonth - :testPropertyWithGDay :testPropertyWithGYearMonth - :testPropertyWithGMonthYear ) ; - samm:operations ( ) . - -:testPropertyWithGYear - a samm:Property ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGYear . - -:testWithGregorianCalendarMinGregorianCalendarMaxGYear - a samm-c:Trait; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000"^^xsd:gYear ; - samm-c:maxValue "2001"^^xsd:gYear ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGYear . - -:MeasurementGYear - a samm-c:Measurement ; - samm:dataType xsd:gYear ; - samm-c:unit unit:year . - -:testPropertyWithGMonth - a samm:Property ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGMonth . - -:testWithGregorianCalendarMinGregorianCalendarMaxGMonth - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "--04"^^xsd:gMonth ; - samm-c:maxValue "--05"^^xsd:gMonth ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGMonth . - -:MeasurementGMonth - a samm-c:Measurement ; - samm:dataType xsd:gMonth ; - samm-c:unit unit:month . - -:testPropertyWithGDay - a samm:Property ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGDay . - -:testWithGregorianCalendarMinGregorianCalendarMaxGDay - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "---04"^^xsd:gDay ; - samm-c:maxValue "---05"^^xsd:gDay ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGDay . - -:MeasurementGDay - a samm-c:Measurement ; - samm:dataType xsd:gDay ; - samm-c:unit unit:day . - -:testPropertyWithGYearMonth - a samm:Property ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGYearMonth . - -:testWithGregorianCalendarMinGregorianCalendarMaxGYearMonth - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2000-01"^^xsd:gYearMonth ; - samm-c:maxValue "2000-02"^^xsd:gYearMonth ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGYearMonth . - -:MeasurementGYearMonth - a samm-c:Measurement ; - samm:dataType xsd:gYearMonth ; - samm-c:unit unit:one . - -:testPropertyWithGMonthYear - a samm:Property ; - samm:characteristic :testWithGregorianCalendarMinGregorianCalendarMaxGMonthYear . - -:testWithGregorianCalendarMinGregorianCalendarMaxGMonthYear - a samm-c:Trait ; - samm:preferredName "Test Range"@en ; - samm:description "Test Range"@en ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "--01-01"^^xsd:gMonthDay ; - samm-c:maxValue "--01-02"^^xsd:gMonthDay ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :MeasurementGMonthYear . - -:MeasurementGMonthYear - a samm-c:Measurement ; - samm:dataType xsd:gMonthDay ; - samm-c:unit unit:one . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl deleted file mode 100644 index 9eec655b5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithHtmlTags.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithHtmlTags a samm:Aspect ; - samm:preferredName "Aspect With Entity"@en ; - samm:description "Aspect With

    inside html tag

    Entity"@en ; - samm:properties ( :testEntity ) ; - samm:operations ( ) . - -:testEntity a samm:Property ; - samm:preferredName "Preferred Name '/>"@en ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl deleted file mode 100644 index f3877cfa3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLanguageConstraint.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithLanguageConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestLanguageConstraint . - -:TestLanguageConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LanguageConstraint ; - samm:preferredName "Test Language Constraint"@en ; - samm:description "This is a test language constraint."@en ; - samm:see ; - samm-c:languageCode "de" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl deleted file mode 100644 index 421d7c7f8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithLengthConstraint.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithLengthConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Test123" ; - samm:characteristic :TestLengthConstraint . - -:TestLengthConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Test Length Constraint"@en ; - samm:description "This is a test length constraint."@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl deleted file mode 100644 index 469957256..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithList.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithList a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl deleted file mode 100644 index a84eb7268..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndAdditionalProperty.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndAdditionalProperty a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:testPropertyTwo a samm:Property ; - samm:preferredName "Test Property Two"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic samm-c:Text . - -:TestList a samm-c:List ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl deleted file mode 100644 index b6e09929a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementCharacteristic.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndElementCharacteristic a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm-c:elementCharacteristic samm-c:Text . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl deleted file mode 100644 index 8b495349d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListAndElementConstraint.ttl +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListAndElementConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.0"^^xsd:float ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm-c:elementCharacteristic [ - a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement - ] . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl deleted file mode 100644 index 00e8b98da..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListEntityEnumeration.ttl +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListEntityEnumeration a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:preferredName "Test Enumeration"@en ; - samm:description "This is a test for enumeration."@en ; - samm:see ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity"@en ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:preferredName "Entity Property"@en ; - samm:description "This is a property for the test entity."@en ; - samm:characteristic :ListCharacteristic . - -:ListCharacteristic a samm-c:List ; - samm:dataType xsd:string . - -:entityInstance a :TestEntity ; - :entityProperty ( "foo" "bar" "baz" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl deleted file mode 100644 index ed42b50f2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithListWithLengthConstraint.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithListWithLengthConstraint a samm:Aspect ; - samm:properties ( :testPropertyCollectionLengthConstraint ) ; - samm:operations ( ) . - -:testPropertyCollectionLengthConstraint a samm:Property ; - samm:characteristic :TestLengthConstraintWithCollection . - -:TestLengthConstraintWithCollection a samm-c:Trait ; - samm:preferredName "Test Length Constraint with collection"@en ; - samm:description "Test Length Constraint with collection"@en ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:minValue "1"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic [ - a samm-c:List ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl deleted file mode 100644 index 1f5ba8083..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurement.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithMeasurement a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestMeasurement . - -:TestMeasurement a samm-c:Measurement ; - samm:preferredName "Test Measurement"@en ; - samm:description "This is a test Measurement"@en ; - samm:see ; - samm:dataType xsd:float ; - samm-c:unit unit:kelvin . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl deleted file mode 100644 index 652dc15b0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMeasurementWithUnit.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithMeasurementWithUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestMeasurement . - -:TestMeasurement a samm-c:Measurement ; - samm-c:unit unit:percent ; - samm:dataType xsd:float . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl deleted file mode 100644 index d6108a75f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultiLanguageText.ttl +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithMultiLanguageText a samm:Aspect ; - samm:properties ( :prop ) ; - samm:operations ( ) . - -:prop a samm:Property ; - samm:characteristic samm-c:MultiLanguageText . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl deleted file mode 100644 index 501a6e7d2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultilanguageExampleValue.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithMultilanguageExampleValue a samm:Aspect ; - samm:properties ( :prop ) ; - samm:operations ( ) . - -:prop a samm:Property ; - samm:characteristic samm-c:MultiLanguageText ; - samm:exampleValue "Multilanguage example value."@de . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl deleted file mode 100644 index d7517b6c6..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleCollectionsOfSimpleType.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleCollectionsOfSimpleType a samm:Aspect ; - samm:properties ( :testListInt :testListString ) ; - samm:operations ( ) . - -:testListInt a samm:Property ; - samm:exampleValue "35"^^xsd:int ; - samm:characteristic :IntegerList . - -:testListString a samm:Property ; - samm:exampleValue "test string" ; - samm:characteristic :StringList . - -:IntegerList a samm-c:List ; - samm:dataType xsd:int . - -:StringList a samm-c:List ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl deleted file mode 100644 index d5aba137c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntities.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntities a samm:Aspect ; - samm:properties ( :testEntityOne :testEntityTwo ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl deleted file mode 100644 index 0a98e7c96..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesAndEither.ttl +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesAndEither a samm:Aspect ; - samm:properties ( :testEntityOne :testEntityTwo :testEitherProperty ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:testEitherProperty a samm:Property ; - samm:characteristic :TestEither . - -:TestEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . - -:TestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "This is a test Either."@en ; - samm:see ; - samm-c:right :RightEitherType ; - samm-c:left :LeftEitherType . - -:RightEitherType a samm:Characteristic ; - samm:preferredName "Right either type"@en ; - samm:description "Right type Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - -:LeftEitherType a samm:Characteristic ; - samm:preferredName "Left either type"@en ; - samm:description "Left type Characteristic"@en ; - samm:see ; - samm:dataType :TestEntity . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl deleted file mode 100644 index e0e1a5857..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesOnMultipleLevels.ttl +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesOnMultipleLevels a samm:Aspect ; - samm:properties ( :testEntityOne :testEntityTwo :testString :testSecondEntity ) ; - samm:operations ( ) . - -:testEntityOne a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:testEntityTwo a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:testSecondEntity a samm:Property ; - samm:characteristic :SecondTestEntityCharacteristic . - -:testThirdEntity a samm:Property ; - samm:characteristic :ThirdTestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:properties ( :testLocalDateTime :randomValue :testThirdEntity ) . - -:SecondTestEntity a samm:Entity ; - samm:properties ( :testInt :testFloat ) . - -:ThirdTestEntity a samm:Entity ; - samm:properties ( :testString :testFloat ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTime . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . - -:SecondTestEntityCharacteristic a samm:Characteristic ; - samm:dataType :SecondTestEntity . - -:ThirdTestEntityCharacteristic a samm:Characteristic ; - samm:dataType :ThirdTestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl deleted file mode 100644 index 0eb416d85..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntitiesSameExtend.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntitiesSameExtend a samm:Aspect ; - samm:properties ( :testPropertyOne :testPropertyTwo ) ; - samm:operations ( ) . - -:testPropertyOne a samm:Property ; - samm:characteristic :testCharacteristicOne . - -:testPropertyTwo a samm:Property ; - samm:characteristic :testCharacteristicTwo . - -:testCharacteristicOne a samm:Characteristic ; - samm:dataType :testEntityOne . - -:testCharacteristicTwo a samm:Characteristic ; - samm:dataType :testEntityTwo . - -:testEntityOne a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:properties ( ) . - -:testEntityTwo a samm:Entity ; - samm:extends :AbstractTestEntity ; - samm:properties ( ) . - -:AbstractTestEntity a samm:AbstractEntity ; - samm:properties ( ). diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl deleted file mode 100644 index dc7a4ed86..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEntityCollections.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEntityCollections a samm:Aspect ; - samm:properties ( :testListOne :testListTwo ) ; - samm:operations ( ) . - -:testListOne a samm:Property ; - samm:characteristic :EntityList . - -:testListTwo a samm:Property ; - samm:characteristic :EntityList . - -:EntityList a samm-c:List ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl deleted file mode 100644 index dcbe25518..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleEnumerationsOnMultipleLevels.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithMultipleEnumerationsOnMultipleLevels a samm:Aspect ; - samm:properties ( :testPropertyWithEnumOne :testPropertyWithEnumTwo :testEntityWithEnumOne ) ; - samm:operations ( ) . - -:testPropertyWithEnumOne a samm:Property ; - samm:characteristic :TestEnumOneCharacteristic . - -:testPropertyWithEnumTwo a samm:Property ; - samm:characteristic :TestEnumTwoCharacteristic . - -:testEntityWithEnumOne a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEnumOneCharacteristic a samm-c:Enumeration ; - samm:dataType xsd:integer ; - samm-c:values ( 1 2 3 ) . - -:TestEnumTwoCharacteristic a samm-c:Enumeration ; - samm:dataType xsd:string ; - samm-c:values ( "One" "Two" "Three" ) . - -:TestEntityCharacteristic a samm-c:SingleEntity ; - samm:dataType :TestEntityWithEnumOne . - -:TestEntityWithEnumOne a samm:Entity ; - samm:properties ( :testString :testPropertyWithEnumOne :testPropertyWithEnumThree ) . - -:testString a samm:Property ; - samm:characteristic samm-c:Text . - -:testPropertyWithEnumThree a samm:Property ; - samm:characteristic :TestEnumThreeCharacteristic . - -:TestEnumThreeCharacteristic a samm-c:Enumeration ; - samm:dataType xsd:string ; - samm-c:values ( "Active" "Error" "Inactive" ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl deleted file mode 100644 index 9f3da1b93..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithMultipleSeeAttributes a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:see ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl deleted file mode 100644 index 366f4e370..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntity.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntity a samm:Aspect ; - samm:properties ( :entity ) ; - samm:operations ( ) . - -:entity a samm:Property ; - samm:characteristic :EntityCharacteristic . - -:Entity a samm:Entity ; - samm:properties ( :nestedEntity :testString ) . - -:nestedEntity a samm:Property ; - samm:characteristic :NestedEntityCharacteristic . - -:NestedTestEntity a samm:Entity ; - samm:properties ( :testString ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:EntityCharacteristic a samm:Characteristic ; - samm:dataType :Entity . - -:NestedEntityCharacteristic a samm:Characteristic ; - samm:dataType :NestedTestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl deleted file mode 100644 index cb0d1da55..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityEnumerationWithNotInPayload.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityEnumerationWithNotInPayload a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:properties ( :entityProperty - [ samm:property :nestedEntityProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:nestedEntityProperty a samm:Property ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:dataType :NestedEntity - ] . - -:NestedEntity a samm:Entity ; - samm:properties ( :notInPayloadProperty ) . - -:notInPayloadProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :nestedEntityProperty :NestedEntityInstance . - -:NestedEntityInstance a :NestedEntity ; - :notInPayloadProperty "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl deleted file mode 100644 index 0e0bd5578..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityList.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityList a samm:Aspect ; - samm:properties ( :testList ) ; - samm:operations ( ) . - -:testList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :TestFirstEntity - ] . - -:TestFirstEntity a samm:Entity ; - samm:properties ( :testString :testInt :testFloat :testSecondList ) . - -:testSecondList a samm:Property ; - samm:characteristic [ - a samm-c:List ; - samm:dataType :TestSecondEntity - ] . - -:TestSecondEntity a samm:Entity ; - samm:properties ( :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl deleted file mode 100644 index 6cb73e2d1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNestedEntityListEnumerationWithNotInPayload.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNestedEntityListEnumerationWithNotInPayload a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestEnumeration . - -:TestEnumeration a samm-c:Enumeration ; - samm:dataType :TestEntity ; - samm-c:values ( :entityInstance ) . - -:TestEntity a samm:Entity ; - samm:properties ( :entityProperty - [ samm:property :nestedEntityListProperty ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:nestedEntityListProperty a samm:Property ; - samm:characteristic [ - a samm-c:Set ; - samm:dataType :NestedEntity - ] . - -:NestedEntity a samm:Entity ; - samm:properties ( :notInPayloadProperty ) . - -:notInPayloadProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TestEntity ; - :entityProperty "This is a test." ; - :nestedEntityListProperty ( :NestedEntityInstance ) . - -:NestedEntityInstance a :NestedEntity ; - :notInPayloadProperty "foo" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl deleted file mode 100644 index 25015be4f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericRegularExpressionConstraint.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithNumericRegularExpressionConstraint a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:value "\\d*|x" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl deleted file mode 100644 index 1ba790eb2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithNumericStructuredValue.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithNumericStructuredValue a samm:Aspect ; - samm:properties ( :date ) ; - samm:operations ( ) . - -:date a samm:Property ; - samm:exampleValue "2019-09-27"^^xsd:date ; - samm:characteristic :StructuredDate . - -:StructuredDate a samm-c:StructuredValue ; - samm:dataType xsd:date ; - samm-c:deconstructionRule "(\\d{4})-(\\d{2})-(\\d{2})" ; - samm-c:elements ( :year "-" :month "-" :day ) . - -:year a samm:Property ; - samm:characteristic :Year . - -:month a samm:Property ; - samm:characteristic :Month . - -:day a samm:Property ; - samm:characteristic :Day . - -:Year a samm:Characteristic ; - samm:dataType xsd:unsignedInt . - -:Month a samm:Characteristic ; - samm:dataType xsd:unsignedInt . - -:Day a samm:Characteristic ; - samm:dataType xsd:unsignedInt . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl deleted file mode 100644 index 228930afc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperation.ttl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOperation a samm:Aspect ; - samm:properties ( ) ; - samm:operations ( :testOperation :testOperationTwo ) . - -:testOperation a samm:Operation ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( :input ) ; - samm:output :output . - -:output a samm:Property ; - samm:characteristic samm-c:Text . - -:input a samm:Property ; - samm:characteristic samm-c:Text . - -:testOperationTwo a samm:Operation ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( :input ) ; - samm:output :output . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl deleted file mode 100644 index da26fe853..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithMultipleSeeAttributes a samm:Aspect ; - samm:properties ( ) ; - samm:operations ( :testOperation ) . - -:testOperation a samm:Operation ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl deleted file mode 100644 index 7bb32ca97..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithSeeAttribute.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithSeeAttribute a samm:Aspect ; - samm:properties ( ) ; - samm:operations ( :testOperation :testOperationTwo ) . - -:testOperation a samm:Operation ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:testOperationTwo a samm:Operation ; - samm:preferredName "Test Operation Two"@en ; - samm:description "Test Operation Two"@en ; - samm:see ; - samm:see ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl deleted file mode 100644 index bc52cf20d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOperationWithoutSeeAttribute.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithOperationWithoutSeeAttribute a samm:Aspect ; - samm:properties ( ) ; - samm:operations ( :testOperation ) . - -:testOperation a samm:Operation ; - samm:preferredName "Test Operation"@en ; - samm:description "Test Operation"@en ; - samm:input ( ) ; - samm:output :output . - -:output a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl deleted file mode 100644 index 2bd935b8b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperties.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithOptionalProperties a samm:Aspect ; - samm:properties ( [ samm:property :numberProperty; samm:optional true ] :timestampProperty ) ; - samm:operations ( ) . - -:timestampProperty a samm:Property ; - samm:characteristic samm-c:Timestamp . - -:numberProperty a samm:Property ; - samm:characteristic [ - a samm-c:Quantifiable ; - samm:dataType xsd:unsignedLong ; - samm-c:unit unit:metre - ] . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl deleted file mode 100644 index ba37f3158..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertiesWithEntity.ttl +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithOptionalPropertiesWithEntity a samm:Aspect ; - samm:properties ( :testString [ - samm:property :testOptionalString ; - samm:optional "true"^^xsd:boolean - ] [ - samm:property :testOptionalEntity ; - samm:optional "true"^^xsd:boolean - ] ) ; - samm:operations ( ) . - -:testOptionalEntity a samm:Property ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:properties ( :codeProperty :testSecondString :testIntList ) . - -:codeProperty a samm:Property ; - samm:characteristic :TestCode . - -:TestCode a samm-c:Code ; - samm:preferredName "Test Code"@en ; - samm:description "This is a test code."@en ; - samm:dataType xsd:int . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testOptionalString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testSecondString a samm:Property ; - samm:exampleValue "Another Example Value Test" ; - samm:characteristic samm-c:Text . - -:testIntList a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :IntegerList . - -:IntegerList a samm-c:List ; - samm:dataType xsd:int . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:dataType :TestEntity . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl deleted file mode 100644 index c9c22fd0a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalProperty.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOptionalProperty a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl deleted file mode 100644 index df501259d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyAndConstraint.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithOptionalPropertyAndConstraint a samm:Aspect ; - samm:properties ( [ samm:property :stringProperty; samm:optional true ] ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:characteristic :TestLengthConstraint . - -:TestLengthConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm-c:maxValue "3"^^xsd:nonNegativeInteger - ] ; - samm-c:baseCharacteristic samm-c:Text . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl deleted file mode 100644 index e2f18cab2..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithOptionalPropertyWithPayloadName.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithOptionalPropertyWithPayloadName a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - samm:payloadName "test" - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl deleted file mode 100644 index f68a8a5c4..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPreferredNames.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPreferredNames a samm:Aspect ; - samm:preferredName "Aspect With Boolean"@en ; - samm:preferredName "Aspekt Mit Boolean"@de ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl deleted file mode 100644 index e00bf7631..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithProperty.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithProperty a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl deleted file mode 100644 index 423b7962e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithAllBaseAttributes.ttl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithAllBaseAttributes a samm:Aspect ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:preferredName "Test Boolean"@en ; - samm:preferredName "Test Boolean"@de ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:characteristic :BooleanTestCharacteristic ; - samm:see ; - samm:see . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl deleted file mode 100644 index cddc1a631..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithDescriptions.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithDescriptions a samm:Aspect ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:description "Test Description"@en ; - samm:description "Test Beschreibung"@de ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl deleted file mode 100644 index a13ba6a66..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPayloadName.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithPropertyWithPayloadName a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( [ - samm:property :testProperty ; - samm:payloadName "test" ; - ] ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl deleted file mode 100644 index 97c616bb8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithPreferredNames.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithPreferredNames a samm:Aspect ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:preferredName "Test Boolean"@en ; - samm:preferredName "Test Boolean"@de ; - samm:characteristic :BooleanTestCharacteristic . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl deleted file mode 100644 index ef8eb450e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithPropertyWithSee.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithPropertyWithSee a samm:Aspect ; - samm:properties ( :testBoolean ) ; - samm:operations ( ) . - -:testBoolean a samm:Property ; - samm:characteristic :BooleanTestCharacteristic ; - samm:see ; - samm:see . - -:BooleanTestCharacteristic a samm:Characteristic ; - samm:dataType xsd:boolean . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl deleted file mode 100644 index 9c343a36d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableAndUnit.ttl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableAndUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:preferredName "Test Quantifiable"@en ; - samm:description "This is a test Quantifiable"@en ; - samm:see ; - samm:dataType xsd:float ; - samm-c:unit unit:hertz . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl deleted file mode 100644 index d441b61cc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithUnit.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableWithUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm-c:unit unit:percent ; - samm:dataType xsd:float . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl deleted file mode 100644 index 8396a9084..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithQuantifiableWithoutUnit.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithQuantifiableWithoutUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:preferredName "Test Quantifiable"@en ; - samm:description "This is a test Quantifiable"@en ; - samm:see ; - samm:dataType xsd:float . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl deleted file mode 100644 index 99c909e05..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraint.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl deleted file mode 100644 index 1a721d088..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintInclBoundDefinitionProperties.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintInclBoundDefinitionProperties a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10.5"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl deleted file mode 100644 index ecf06e968..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintOnConstrainedNumericType.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintOnConstrainedNumericType a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm-c:minValue "5"^^xsd:short ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:short ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl deleted file mode 100644 index d373270c0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithBoundDefinitionAttributes.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithBoundDefinitionAttributes a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl deleted file mode 100644 index 2fd026402..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBound.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyLowerBound a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:AT_LEAST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl deleted file mode 100644 index a69fcf8a3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithOnlyLowerBoundDefinitionAndBothValues a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl deleted file mode 100644 index b0d1eb55c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyLowerBoundInclBoundDefinition a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "5.7"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:minValue "2.3"^^xsd:float ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl deleted file mode 100644 index cd19925fc..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyMinValue.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithOnlyMinValue a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestTrait . - -:TestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Constraint"@en ; - samm:description "Test Constraint"@en ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:lowerBoundDefinition samm-c:GREATER_THAN ; - ] ; - samm-c:baseCharacteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl deleted file mode 100644 index 3c6dc17a7..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBound.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyUpperBound a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "2.0"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:maxValue "2.3"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:AT_MOST ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl deleted file mode 100644 index 88306627a..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition.ttl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRangeConstraintWithOnlyUpperBoundInclBoundDefinition a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "2.0"^^xsd:float ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - samm:preferredName "Test Range Constraint"@en ; - samm:description "This is a test range constraint."@en ; - samm:see ; - samm-c:maxValue "2.3"^^xsd:float ; - samm-c:upperBoundDefinition samm-c:LESS_THAN ; - ] ; - samm-c:baseCharacteristic :Measurement . - -:Measurement a samm-c:Measurement ; - samm:dataType xsd:float ; - samm-c:unit unit:metrePerSecond . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl deleted file mode 100644 index c00a5c8e4..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxDoubleValue.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithoutMinMaxDoubleValue a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Test Aspekt"@de ; - samm:properties ( :doubleProperty ) ; - samm:operations ( ) . - -:doubleProperty a samm:Property ; - samm:preferredName "Test Double Property"@en ; - samm:preferredName "Numerischer Wert"@de ; - samm:description "A property with a numeric value."@en ; - samm:description "Eine Property mit einem numerischen Wert."@de ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range Constraint"@en ; - samm:preferredName "Test Range Constraint"@de ; - samm:description "Restricts a numeric value to values between 0 and 100."@en ; - samm:description "Beschränkt einen numerischen Wert auf Werte zwischen 0 und 100."@de ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - ] ; - samm-c:baseCharacteristic :DoubleCharacteristic . - -:DoubleCharacteristic a samm:Characteristic ; - samm:preferredName "Double Characteristic"@en ; - samm:preferredName "Numerische Charakteristik"@de ; - samm:description "Positive Numbers"@en ; - samm:description "Positive Zahlen"@de ; - samm:dataType xsd:double . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl deleted file mode 100644 index 3a5b17fad..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRangeConstraintWithoutMinMaxIntegerValue.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRangeConstraintWithoutMinMaxIntegerValue a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:preferredName "Test Aspekt"@de ; - samm:properties ( :testInt ) ; - samm:operations ( ) . - -:testInt a samm:Property ; - samm:preferredName "Test Integer Property"@en ; - samm:preferredName "Numerischer Wert"@de ; - samm:description "A property with a numeric value."@en ; - samm:description "Eine Property mit einem numerischen Wert."@de ; - samm:characteristic :TestRangeConstraint . - -:TestRangeConstraint a samm-c:Trait ; - samm:preferredName "Test Range Constraint"@en ; - samm:preferredName "Test Range Constraint"@de ; - samm:description "Restricts a numeric value to values between 0 and 100."@en ; - samm:description "Beschränkt einen numerischen Wert auf Werte zwischen 0 und 100."@de ; - samm-c:constraint [ - a samm-c:RangeConstraint ; - ] ; - samm-c:baseCharacteristic :IntegerCharacteristic . - -:IntegerCharacteristic a samm:Characteristic ; - samm:preferredName "Integer Characteristic"@en ; - samm:preferredName "Numerische Charakteristik"@de ; - samm:description "Positive Numbers"@en ; - samm:description "Positive Zahlen"@de ; - samm:dataType xsd:integer . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl deleted file mode 100644 index 7e9983eb1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptional.ttl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix xsd: . -@prefix samm: . -@prefix unit: . -@prefix samm-c: . -@prefix samm-e: . -@prefix : . - -:AspectWithRecursivePropertyWithOptional a samm:Aspect; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestItemCharacteristic . - -:TestItemCharacteristic a samm-c:SingleEntity ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - ] ). diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl deleted file mode 100644 index 3a7f8d288..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRecursivePropertyWithOptionalAndEntityProperty.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix xsd: . -@prefix samm: . -@prefix unit: . -@prefix samm-c: . -@prefix samm-e: . -@prefix : . - -:AspectWithRecursivePropertyWithOptionalAndEntityProperty a samm:Aspect; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestItemCharacteristic . - -:TestItemCharacteristic a samm-c:SingleEntity ; - samm:dataType :TestEntity . - -:TestEntity a samm:Entity ; - samm:properties ( [ - samm:property :testProperty ; - samm:optional "true"^^xsd:boolean ; - ] - :testProperty2 ). - -:testProperty2 a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl deleted file mode 100644 index c1e7736a0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRegularExpressionConstraint.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithRegularExpressionConstraint a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "3" ; - samm:characteristic :TestRegularExpressionConstraint . - -:TestRegularExpressionConstraint a samm-c:Trait ; - samm-c:constraint [ - a samm-c:RegularExpressionConstraint ; - samm:preferredName "Test Regular Expression Constraint"@en ; - samm:description "This is a test regular expression constraint."@en ; - samm:see ; - samm:value "^[0-9]*$" ; - ] ; - samm-c:baseCharacteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl deleted file mode 100644 index 064f48a63..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithRubyGemUpdateCommand.ttl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithRubyGemUpdateCommand a samm:Aspect ; - samm:preferredName "gem update --system"@en ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl deleted file mode 100644 index a12379a5d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithScriptTags.ttl +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithScriptTags a samm:Aspect ; - samm:preferredName "Aspect With Entity"@en ; - samm:properties ( :testEntity ) ; - samm:operations ( :TestOperation ) . - -:testEntity a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:characteristic :TestEntityCharacteristic . - -:TestEntity a samm:Entity ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue ) . - -:testString a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example Value Test " ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:exampleValue "2018-02-28T14:23:32.918Z"^^xsd:dateTimeStamp ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType xsd:dateTimeStamp . - -:TestEntityCharacteristic a samm:Characteristic ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:dataType :TestEntity . - -:TestOperation a samm:Operation ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:input ( :operationInput ) ; - samm:output :operationOutput . - -:operationInput a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example operation input " ; - samm:characteristic samm-c:Text . - -:operationOutput a samm:Property ; - samm:preferredName "Test preferred name with script: "@en ; - samm:description "Test description with script: "@en ; - samm:exampleValue "Example operation output " ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl deleted file mode 100644 index 6ad59c132..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSee.ttl +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSee a samm:Aspect ; - samm:preferredName "Test Aspect With See"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl deleted file mode 100644 index 7e99c4751..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSeeAttribute.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithSeeAttribute a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:see ; - samm:properties ( ) ; - samm:operations ( ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl deleted file mode 100644 index 167aa4b3b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSet.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSet a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestSet . - -:TestSet a samm-c:Set ; - samm:preferredName "Test Set"@en ; - samm:description "This is a test set."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl deleted file mode 100644 index 6dc7aee79..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleEntity.ttl +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithSimpleEntity a samm:Aspect ; - samm:properties ( :entityProperty ) ; - samm:operations ( ) . - -:entityProperty a samm:Property ; - samm:characteristic [ - a samm-c:SingleEntity ; - samm:dataType :Foo - ] . - -:Foo a samm:Entity ; - samm:properties ( :foo ) . - -:foo a samm:Property ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl deleted file mode 100644 index e23f7eafa..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleProperties.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithSimpleProperties a samm:Aspect ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :testLocalDateTimeWithoutExample :testDurationWithoutExample :randomValue ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:testLocalDateTimeWithoutExample a samm:Property ; - samm:characteristic :LocalDateTime . - -:testDurationWithoutExample a samm:Property ; - samm:characteristic :Duration . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Duration a samm:Characteristic ; - samm:dataType xsd:duration . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTime . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl deleted file mode 100644 index fc383bdeb..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimplePropertiesAndState.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithSimplePropertiesAndState a samm:Aspect ; - samm:properties ( :testString :testInt :testFloat :testLocalDateTime :randomValue :automationProperty ) ; - samm:operations ( ) . - -:testString a samm:Property ; - samm:exampleValue "Example Value Test" ; - samm:characteristic samm-c:Text . - -:testInt a samm:Property ; - samm:exampleValue "3"^^xsd:int ; - samm:characteristic :Int . - -:testFloat a samm:Property ; - samm:exampleValue "2.25"^^xsd:float ; - samm:characteristic :Float . - -:testLocalDateTime a samm:Property ; - samm:exampleValue "2018-02-28T14:23:32.918"^^xsd:dateTime ; - samm:characteristic :LocalDateTime . - -:randomValue a samm:Property ; - samm:characteristic samm-c:Text . - -:Int a samm:Characteristic ; - samm:dataType xsd:int . - -:Float a samm:Characteristic ; - samm:dataType xsd:float . - -:LocalDateTime a samm:Characteristic ; - samm:dataType xsd:dateTime . - -:automationProperty a samm:Property ; - samm:preferredName "Enabled/Disabled"@en ; - samm:preferredName "Aktiviert/Deaktiviert"@de ; - samm:characteristic :Automation . - -:Automation a samm-c:State ; - samm:description "Return status for the Set Configuration Operation"@en ; - samm:dataType xsd:string ; - samm-c:defaultValue "Automation Default Prop" ; - samm-c:values ( "Automation Default Prop" "Automation2" "Automation3" ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl deleted file mode 100644 index 3e3bb03ca..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSimpleTypes.ttl +++ /dev/null @@ -1,221 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithSimpleTypes a samm:Aspect ; - samm:properties ( :anyUriProperty :base64BinaryProperty :booleanProperty :byteProperty :curieProperty :dateProperty :dateTimeProperty :dateTimeStampProperty :dayTimeDuration :decimalProperty :doubleProperty :durationProperty :floatProperty :gDayProperty :gMonthDayProperty :gMonthProperty :gYearMonthProperty :gYearProperty :hexBinaryProperty :intProperty :integerProperty :langStringProperty :longProperty :negativeIntegerProperty :nonNegativeIntegerProperty :nonPositiveInteger :positiveIntegerProperty :shortProperty :stringProperty :timeProperty :unsignedByteProperty :unsignedIntProperty :unsignedLongProperty :unsignedShortProperty :yearMonthDurationProperty ) ; - samm:operations ( ) . - -:stringProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:booleanProperty a samm:Property ; - samm:characteristic samm-c:Boolean . - -:decimalProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:decimal - ] . - -:integerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:integer - ] . - -:doubleProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:double - ] . - -:floatProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:float - ] . - -:dateProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:date -] . - -:timeProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:time - ] . - -:dateTimeProperty a samm:Property ; - samm:characteristic samm-c:Timestamp . - -:dateTimeStampProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:dateTimeStamp - ] . - -:gYearProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gYear - ] . - -:gMonthProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gMonth - ] . - -:gDayProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gDay - ] . - -:gYearMonthProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gYearMonth - ] . - -:gMonthDayProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:gMonthDay - ] . - -:durationProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:duration - ] . - -:yearMonthDurationProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:yearMonthDuration - ] . - -:dayTimeDuration a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:dayTimeDuration - ] . - -:byteProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:description "This is a byteProperty characteristic."@en ; - samm:dataType xsd:byte - ] . - -:shortProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:short - ] . - -:intProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:int - ] . - -:longProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:long - ] . - -:unsignedByteProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedByte - ] . - -:unsignedShortProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedShort - ] . - -:unsignedIntProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:unsignedInt - ] . - -:unsignedLongProperty a samm:Property ; - samm:characteristic [ - a samm-c:Quantifiable ; - samm:dataType xsd:unsignedLong ; - samm-c:unit unit:metre - ] . - -:positiveIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:positiveInteger - ] . - -:nonNegativeIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger - ] . - -:negativeIntegerProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:negativeInteger - ] . - -:nonPositiveInteger a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:nonPositiveInteger - ] . - -:hexBinaryProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:dataType xsd:hexBinary - ] . - -:base64BinaryProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:description "This is a base64Binary characteristic."@en ; - samm:dataType xsd:base64Binary - ] . - -:anyUriProperty a samm:Property ; - samm:characteristic [ - a samm:Characteristic ; - samm:description "This is an anyURI characteristic."@en ; - samm:dataType xsd:anyURI - ] . - -:curieProperty a samm:Property ; - samm:characteristic samm-c:UnitReference . - -:langStringProperty a samm:Property ; - samm:characteristic samm-c:MultiLanguageText . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl deleted file mode 100644 index b12d05d2c..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithSortedSet.ttl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithSortedSet a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestSortedSet . - -:TestSortedSet a samm-c:SortedSet ; - samm:preferredName "Test Sorted Set"@en ; - samm:description "This is a test sorted set."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl deleted file mode 100644 index efe78609f..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithState.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithState a samm:Aspect ; - samm:properties ( :status ) ; - samm:operations () . - -:status a samm:Property ; - samm:characteristic :TestState . - -:TestState a samm-c:State ; - samm:dataType xsd:string ; - samm-c:values ( "Success" "Error" "In Progress" ) ; - samm-c:defaultValue "In Progress" . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl deleted file mode 100644 index 6800cda27..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStringEnumeration.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix unit: . -@prefix xsd: . - -:AspectWithStringEnumeration a samm:Aspect ; - samm:properties ( :enumerationProperty ) ; - samm:operations ( ) . - -:enumerationProperty a samm:Property ; - samm:characteristic [ - a samm-c:Enumeration ; - samm:dataType xsd:string ; - samm-c:values ( "foo" "bar" ) - ] . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl deleted file mode 100644 index c265232d0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithStructuredValue.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithStructuredValue a samm:Aspect ; - samm:properties ( :date ) ; - samm:operations ( ) . - -:date a samm:Property ; - samm:exampleValue "2019-09-27"^^xsd:date ; - samm:characteristic :StructuredDate . - -:StructuredDate a samm-c:StructuredValue ; - samm:dataType xsd:date ; - samm-c:deconstructionRule "(\\d{4})-(\\d{2})-(\\d{2})" ; - samm-c:elements ( :year "-" :month "-" :day ) . - -:year a samm:Property ; - samm:characteristic :Year . - -:month a samm:Property ; - samm:characteristic :Month . - -:day a samm:Property ; - samm:characteristic :Day . - -:Year a samm:Characteristic ; - samm:dataType xsd:gYear . - -:Month a samm:Characteristic ; - samm:dataType xsd:gMonth . - -:Day a samm:Characteristic ; - samm:dataType xsd:gMonthDay . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl deleted file mode 100644 index 35edaa794..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTimeSeries.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . -@prefix xsd: . -@prefix unit: . - -:AspectWithTimeSeries a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:characteristic :TestTimeSeries . - -:TestTimeSeries a samm-c:TimeSeries ; - samm:preferredName "Test Time Series"@en ; - samm:description "This is a test time series."@en ; - samm:see ; - samm:dataType :TestTimeSeriesEntity . - -:TestTimeSeriesEntity a samm:Entity ; - samm:extends samm-e:TimeSeriesEntity ; - samm:preferredName "Test Time Series Entity"@en ; - samm:description "This is a test time series entity."@en ; - samm:see ; - samm:properties ( [ samm:extends samm-e:value ; samm:characteristic samm-c:Text ] ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl deleted file mode 100644 index c16c6d4a0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithTwoLists.ttl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithTwoLists a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test description"@en ; - samm:see ; - samm:properties ( :testProperty :testPropertyTwo ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:testPropertyTwo a samm:Property ; - samm:preferredName "Test Property Two"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "Example Value" ; - samm:characteristic :TestList . - -:TestList a samm-c:List ; - samm:preferredName "Test List"@en ; - samm:description "This is a test list."@en ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl deleted file mode 100644 index 9f6a0a364..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUmlautDescription.ttl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithUmlautDescription a samm:Aspect ; - samm:preferredName "Test Aspect with Umlauts within description"@en ; - samm:preferredName "Test Aspect mit Umlauten in der Beschreibung"@de ; - samm:description "This is a test description"@en ; - samm:description "Im Wort Entität ist ein Umlaut"@de ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl deleted file mode 100644 index 328e9bded..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUnit.ttl +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -:AspectWithUnit a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :TestQuantifiable . - -:TestQuantifiable a samm-c:Quantifiable ; - samm:dataType xsd:int ; - samm-c:unit unit:bitPerSecond . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl deleted file mode 100644 index da8026294..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCharacteristic.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedCharacteristic a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :UsedTestCharacteristic . - -:UsedTestCharacteristic a samm:Characteristic ; - samm:preferredName "Used Test Characteristic"@en ; - samm:description "Used Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:UnusedTestCharacteristic a samm:Characteristic ; - samm:preferredName "Unused Test Characteristic"@en ; - samm:description "Unused Test Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl deleted file mode 100644 index 2ef0f498e..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedCollection.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedCollection a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :UsedTestCollection . - -:UsedTestCollection a samm-c:Collection ; - samm:preferredName "Used Test Collection"@en ; - samm:description "Used Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:UnusedTestCollection a samm-c:Collection ; - samm:preferredName "Unused Test Collection"@en ; - samm:description "Unused Test Collection"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl deleted file mode 100644 index 9e0b899b3..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedConstraint.ttl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedConstraint a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :UsedTestTrait . - -:UsedTestTrait a samm-c:Trait ; - samm-c:constraint [ - a samm-c:LengthConstraint ; - samm:preferredName "Used Test Constraint"@en ; - samm:description "Used Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; - ] ; - samm-c:baseCharacteristic samm-c:Text . - -:UnusedTestConstraint a samm-c:LengthConstraint ; - samm:preferredName "Unused Test Constraint"@en ; - samm:description "Unused Test Constraint"@en ; - samm:see ; - samm:see ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl deleted file mode 100644 index 14ae9872b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEither.ttl +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedEither a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :UsedTestEither . - -:UsedTestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :UsedLeftType ; - samm-c:right :UsedRightType . - -:UsedLeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:UsedRightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . - -:NonUsedTestEither a samm-c:Either ; - samm:preferredName "Test Either"@en ; - samm:description "Test Either Characteristic"@en ; - samm:see ; - samm:see ; - samm-c:left :NonUsedLeftType ; - samm-c:right :NonUsedRightType . - -:NonUsedLeftType a samm:Characteristic ; - samm:preferredName "Left Type"@en ; - samm:description "Left Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:float . - -:NonUsedRightType a samm:Characteristic ; - samm:preferredName "Right Type"@en ; - samm:description "Right Type Characteristic"@en ; - samm:see ; - samm:see ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl deleted file mode 100644 index 0eed16a03..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithUsedAndUnusedEnumeration.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithUsedAndUnusedEnumeration a samm:Aspect ; - samm:properties ( :testProperty ) ; - samm:operations ( ) . - -:testProperty a samm:Property ; - samm:characteristic :UsedTestEnumeration . - -:UsedTestEnumeration a samm-c:Enumeration ; - samm:preferredName "Used Test Enumeration"@en ; - samm:description "Used Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . - -:UnusedTestEnumeration a samm-c:Enumeration ; - samm:preferredName "Unused Test Enumeration"@en ; - samm:description "Unused Test Enumeration"@en ; - samm:see ; - samm:see ; - samm-c:values ( "foo" "bar" ) ; - samm:dataType xsd:string . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl deleted file mode 100644 index d404b37f8..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutLanguageTags.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithoutLanguageTags a samm:Aspect ; - samm:properties ( ) ; - samm:operations ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl deleted file mode 100644 index b6565595b..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutPropertiesAndOperations.ttl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:AspectWithoutPropertiesAndOperations a samm:Aspect . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl deleted file mode 100644 index df7b7c9ae..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/AspectWithoutSeeAttribute.ttl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:AspectWithoutSeeAttribute a samm:Aspect ; - samm:preferredName "Test Aspect"@en ; - samm:description "This is a test Aspect."@en ; - samm:properties ( ) ; - samm:operations ( ) . \ No newline at end of file diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl deleted file mode 100644 index f7ebda965..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest1.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property - -:EntityInstanceTest1 a samm:Aspect ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:properties ( :entityProperty ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl deleted file mode 100644 index 26f5f0ea0..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest2.ttl +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property and one optional Property, -# with the Property being present in the instance - -:EntityInstanceTest2 a samm:Aspect ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:properties ( :entityProperty [ samm:property :optionalEntityProperty; samm:optional true ] ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" ; - :optionalEntityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl deleted file mode 100644 index fc95c14de..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest3.ttl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with one mandatory property and one optional Property, -# with the Property being not present in the instance - -:EntityInstanceTest3 a samm:Aspect ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:properties ( :entityProperty [ samm:property :optionalEntityProperty; samm:optional true ] ) . - -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity ; - :entityProperty "Test" . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl deleted file mode 100644 index 02b2463ab..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityInstanceTest4.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . -@prefix unit: . - -# Test of Entity instance with two optional Properties, # with no Property being present in the instance - -:EntityInstanceTest4 a samm:Aspect ; - samm:properties ( :aspectProperty ) ; - samm:operations ( ) . - -:aspectProperty a samm:Property ; - samm:characteristic :TheEnum . - -:TheEnum a samm-c:Enumeration ; - samm:dataType :TheEntity ; - samm-c:values ( :entityInstance ) . - -:TheEntity a samm:Entity ; - samm:properties ( [ samm:property :entityProperty; samm:optional true ] [ samm:property :optionalEntityProperty; samm:optional true ] ) . -:entityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:optionalEntityProperty a samm:Property ; - samm:characteristic samm-c:Text . - -:entityInstance a :TheEntity . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl deleted file mode 100644 index 5b2c251b5..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithMultipleSeeAttributes a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:see ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl deleted file mode 100644 index fcb759c42..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalAndNotInPayloadProperty.ttl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalAndNotInPayloadProperty a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( :testPropertyOne - [ samm:property :testPropertyTwo ; samm:optional "true"^^xsd:boolean ] - [ samm:property :testPropertyThree ; samm:notInPayload "true"^^xsd:boolean ] ) . - -:testPropertyOne a samm:Property ; - samm:characteristic samm-c:Text . - -:testPropertyTwo a samm:Property ; - samm:characteristic samm-c:Text . - -:testPropertyThree a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl deleted file mode 100644 index aa918bfaa..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalProperty.ttl +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalProperty a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:optional "true"^^xsd:boolean ] ) . - -:testProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl deleted file mode 100644 index 7c50c0d03..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithOptionalPropertyWithPayloadName.ttl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithOptionalPropertyWithPayloadName a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:optional "true"^^xsd:boolean ; samm:payloadName "test" ] ) . - -:testProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl deleted file mode 100644 index 5c4a82d2d..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithPropertyWithPayloadName.ttl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:EntityWithPropertyWithPayloadName a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( [ samm:property :testProperty ; samm:payloadName "test" ] ) . - -:testProperty a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl deleted file mode 100644 index 9a83b4056..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithSeeAttribute.ttl +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithSeeAttribute a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( ) . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl deleted file mode 100644 index f685b1684..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/EntityWithoutSeeAttribute.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:EntityWithoutSeeAttribute a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl deleted file mode 100644 index a1dd3a7c1..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBlankAndAdditionalNodes.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix aux: . -@prefix xsd: . - -[ - aux:contains :ModelWithBlankAndAdditionalNodes, :testProperty, :NumberList, :Number, _:blankNode ; -] . - -:ModelWithBlankAndAdditionalNodes a samm:Aspect ; - samm:properties ( :testProperty ) . - -:testProperty a samm:Property ; - samm:characteristic :NumberList . - -:NumberList a samm-c:List ; - samm-c:elementCharacteristic _:blankNode . - -_:blankNode a samm-c:Trait ; - samm-c:baseCharacteristic :Number ; - samm-c:constraint [ a samm-c:RangeConstraint ; - samm-c:minValue "5"^^xsd:nonNegativeInteger ; - samm-c:maxValue "10"^^xsd:nonNegativeInteger ; ] . - -:Number a samm:Characteristic ; - samm:dataType xsd:nonNegativeInteger . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl deleted file mode 100644 index 5ac5e5c03..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/ModelWithBrokenCycles.ttl +++ /dev/null @@ -1,120 +0,0 @@ -# Copyright (c) 2022 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix xsd: . - -:ModelWithBrokenCycles a samm:Aspect ; - samm:properties ( :a :e :h ) . - -############################################################# -# direct cycle between two properties broken by samm:optional -############################################################# - -:a a samm:Property; - samm:characteristic :aCharacteristic. - -:aCharacteristic a samm:Characteristic; - samm:dataType :AEntity. - -:AEntity a samm:Entity; - samm:properties ( :b ) . - -:b a samm:Property; - samm:characteristic :bCharacteristic. - -:bCharacteristic a samm:Characteristic; - samm:dataType :BEntity. - -:BEntity a samm:Entity; - samm:properties ( [ samm:property :a ; samm:optional true ; ] ) . - -##################################################################### -# indirect cycle via an intermediate property broken by samm:optional -##################################################################### - -:e a samm:Property; - samm:characteristic :eCharacteristic. - -:eCharacteristic a samm:Characteristic; - samm:dataType :EEntity. - -:EEntity a samm:Entity; - samm:properties ( :f ) . - -:f a samm:Property; - samm:characteristic :fCharacteristic. - -:fCharacteristic a samm:Characteristic; - samm:dataType :FEntity. - -:FEntity a samm:Entity; - samm:properties ( :g ) . - -:g a samm:Property; - samm:characteristic :gCharacteristic. - -:gCharacteristic a samm:Characteristic; - samm:dataType :GEntity. - -:GEntity a samm:Entity; - samm:properties ( [ samm:property :e ; samm:optional true ; ] ) . - -######################################################## -# cycle but only in one of the branches of samm-c:Either -######################################################## -:h a samm:Property; - samm:characteristic :hCharacteristic. - -:hCharacteristic a samm-c:Either; - samm-c:left :leftCharacteristic ; - samm-c:right :rightCharacteristic. - -:leftCharacteristic a samm:Characteristic; - samm:dataType :LeftEntity. - -:rightCharacteristic a samm:Characteristic; - samm:dataType :RightEntity. - -:LeftEntity a samm:Entity; - samm:properties ( :h ) . # direct cycle - -:RightEntity a samm:Entity; - samm:properties ( :i ) . # no cycle - -:i a samm:Property; - samm:characteristic :iCharacteristic. - -:iCharacteristic a samm:Characteristic; - samm:dataType xsd:string. - -############################################################# -# a cycle, but the properties are not referenced by an Aspect -############################################################# -:j a samm:Property; - samm:characteristic :jCharacteristic. - -:jCharacteristic a samm:Characteristic; - samm:dataType :JEntity. - -:JEntity a samm:Entity; - samm:properties ( :k ) . - -:k a samm:Property; - samm:characteristic :kCharacteristic. - -:kCharacteristic a samm:Characteristic; - samm:dataType :KEntity. - -:KEntity a samm:Entity; - samm:properties ( :j ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl deleted file mode 100644 index 39dc1fa64..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/SharedEntityWithSeeAttribute.ttl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . - -:SharedEntityWithSeeAttribute a samm:Entity ; - samm:preferredName "Test Entity"@en ; - samm:description "This is a test entity."@en ; - samm:see ; - samm:properties ( ) . - -samm-e:SharedEntity a samm:Entity ; - samm:preferredName "Shared Entity"@en ; - samm:description "This is a shared entity."@en ; - samm:see ; - samm:properties ( ) . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl deleted file mode 100644 index f77c046cf..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithExampleValue.ttl +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithExampleValue a samm:Property ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl deleted file mode 100644 index 6897fc005..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithMultipleSeeAttributes.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithMultipleSeeAttributes a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl deleted file mode 100644 index a4ff7b5ac..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithSeeAttribute.ttl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithSeeAttribute a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . - diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl deleted file mode 100644 index 19ec4d6e9..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutExampleValue.ttl +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithoutExampleValue a samm:Property ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl deleted file mode 100644 index 3e9d94605..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/propertyWithoutSeeAttribute.ttl +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . - -:propertyWithoutSeeAttribute a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl b/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl deleted file mode 100644 index a40729b03..000000000 --- a/core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0/org.eclipse.esmf.test/1.0.0/sharedPropertyWithSeeAttribute.ttl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021 Robert Bosch Manufacturing Solutions GmbH -# -# See the AUTHORS file(s) distributed with this work for additional -# information regarding authorship. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. -# -# SPDX-License-Identifier: MPL-2.0 - -@prefix : . -@prefix samm: . -@prefix samm-c: . -@prefix samm-e: . - -:sharedPropertyWithSeeAttribute a samm:Property ; - samm:preferredName "Test Property"@en ; - samm:description "This is a test property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . - -samm-e:sharedProperty a samm:Property ; - samm:preferredName "Shared Property"@en ; - samm:description "This is a shared property."@en ; - samm:see ; - samm:exampleValue "foo" ; - samm:characteristic samm-c:Text . diff --git a/core/esmf-test-resources/pom.xml b/core/esmf-test-resources/pom.xml index 4cc6a4fd3..4f27f5d97 100644 --- a/core/esmf-test-resources/pom.xml +++ b/core/esmf-test-resources/pom.xml @@ -34,7 +34,8 @@ org.eclipse.esmf - esmf-aspect-model-resolver + esmf-aspect-meta-model-java + true com.fasterxml.jackson.core diff --git a/core/esmf-test-resources/src/main/java/org/eclipse/esmf/test/TestResources.java b/core/esmf-test-resources/src/main/java/org/eclipse/esmf/test/TestResources.java index 24b5f9890..b1bcec113 100644 --- a/core/esmf-test-resources/src/main/java/org/eclipse/esmf/test/TestResources.java +++ b/core/esmf-test-resources/src/main/java/org/eclipse/esmf/test/TestResources.java @@ -15,12 +15,10 @@ import java.io.InputStream; -import org.eclipse.esmf.aspectmodel.VersionNumber; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.ClasspathStrategy; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; +import org.eclipse.esmf.metamodel.AspectModel; import org.eclipse.esmf.samm.KnownVersion; import com.fasterxml.jackson.databind.JsonNode; @@ -29,34 +27,25 @@ import io.vavr.control.Try; public class TestResources { - private TestResources() { - } - - public static VersionedModel getModelWithoutResolution( final TestModel model, final KnownVersion knownVersion ) { - final String baseDirectory = model instanceof InvalidTestAspect ? "invalid" : "valid"; - final SammAspectMetaModelResourceResolver metaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - final String path = String.format( "%s/%s/%s/%s/%s.ttl", baseDirectory, knownVersion.toString().toLowerCase(), - model.getUrn().getNamespace(), model.getUrn().getVersion(), model.getName() ); + public static AspectModel load( final InvalidTestAspect model ) { + final String path = String.format( "invalid/%s/%s/%s.ttl", model.getUrn().getNamespace(), model.getUrn().getVersion(), + model.getName() ); final InputStream inputStream = TestResources.class.getClassLoader().getResourceAsStream( path ); - return TurtleLoader.loadTurtle( inputStream ).flatMap( rawModel -> - metaModelResourceResolver - .mergeMetaModelIntoRawModel( rawModel, VersionNumber.parse( knownVersion.toVersionString() ) ) ).get(); + final ResolutionStrategy testModelsResolutionStrategy = new ClasspathStrategy( + "invalid/" + KnownVersion.getLatest().toString().toLowerCase() ); + return new AspectModelLoader( testModelsResolutionStrategy ).load( inputStream ); } - public static Try getModel( final TestModel model, final KnownVersion knownVersion ) { - final String baseDirectory = model instanceof InvalidTestAspect ? "invalid" : "valid"; - final String modelsRoot = baseDirectory + "/" + knownVersion.toString().toLowerCase(); - return new AspectModelResolver().resolveAspectModel( new ClasspathStrategy( modelsRoot ), model.getUrn() ); + public static AspectModel load( final TestModel model ) { + final String path = String.format( "valid/%s/%s/%s.ttl", model.getUrn().getNamespace(), model.getUrn().getVersion(), + model.getName() ); + final InputStream inputStream = TestResources.class.getClassLoader().getResourceAsStream( path ); + final ResolutionStrategy testModelsResolutionStrategy = new ClasspathStrategy( "valid" ); + return new AspectModelLoader( testModelsResolutionStrategy ).load( inputStream ); } - public static Try getPayload( final TestModel model, final KnownVersion knownVersion ) { - final String baseDirectory = "payloads/" + ( model instanceof InvalidTestAspect ? "invalid" : "valid" ); - final String modelsRoot = baseDirectory + "/" + knownVersion.toString().toLowerCase(); + public static Try loadPayload( final TestModel model ) { + final String modelsRoot = "payloads"; return Try.of( () -> new ObjectMapper().readTree( Resources.getResource( modelsRoot + "/" + model.getName() + ".json" ) ) ); } - - public static Try getModel( final TestSharedModel model, final KnownVersion knownVersion ) { - final String modelsRoot = "valid/" + knownVersion.toString().toLowerCase(); - return new AspectModelResolver().resolveAspectModel( new ClasspathStrategy( modelsRoot ), model.getUrn() ); - } } diff --git a/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-meta-model-version-migrator-artifact.adoc b/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-meta-model-version-migrator-artifact.adoc deleted file mode 100644 index d16920c2d..000000000 --- a/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-meta-model-version-migrator-artifact.adoc +++ /dev/null @@ -1,31 +0,0 @@ -[tabs] -==== -Maven:: -+ --- -[source,maven,subs=attributes+] ----- - - org.eclipse.esmf - esmf-aspect-meta-model-version-migrator - {esmf-sdk-version} - ----- --- -Gradle Groovy DSL:: -+ --- -[source,gradle,subs=attributes+] ----- -implementation 'org.eclipse.esmf:esmf-aspect-meta-model-version-migrator:{esmf-sdk-version}' ----- --- -Gradle Kotlin DSL:: -+ --- -[source,gradle,subs=attributes+] ----- -implementation("org.eclipse.esmf:esmf-aspect-meta-model-version-migrator:{esmf-sdk-version}") ----- --- -==== diff --git a/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-model-resolver-artifact.adoc b/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-model-resolver-artifact.adoc deleted file mode 100644 index 2bd91fd02..000000000 --- a/documentation/developer-guide/modules/ROOT/partials/esmf-aspect-model-resolver-artifact.adoc +++ /dev/null @@ -1,31 +0,0 @@ -[tabs] -==== -Maven:: -+ --- -[source,maven,subs=attributes+] ----- - - org.eclipse.esmf - esmf-aspect-model-resolver - {esmf-sdk-version} - ----- --- -Gradle Groovy DSL:: -+ --- -[source,gradle,subs=attributes+] ----- -implementation 'org.eclipse.esmf:esmf-aspect-model-resolver:{esmf-sdk-version}' ----- --- -Gradle Kotlin DSL:: -+ --- -[source,gradle,subs=attributes+] ----- -implementation("org.eclipse.esmf:esmf-aspect-model-resolver:{esmf-sdk-version}") ----- --- -==== diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAas.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAas.java index b206f3f4f..8905b5da4 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAas.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAas.java @@ -14,29 +14,26 @@ package examples; // tag::imports[] -import java.io.File; -import java.io.IOException; - import org.eclipse.esmf.aspectmodel.aas.AspectModelAasGenerator; import org.eclipse.esmf.aspectmodel.aas.AasFileFormat; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; // end::imports[] +import java.io.File; import org.junit.jupiter.api.Test; public class GenerateAas extends AbstractGenerator { @Test - public void generate() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - + public void generate() { // tag::generate[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); + final Aspect aspect = aspectModel.aspect(); // tag::generate[] final AspectModelAasGenerator generator = new AspectModelAasGenerator(); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAspectFromAas.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAspectFromAas.java index 8ead64729..e2fc1622b 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAspectFromAas.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAspectFromAas.java @@ -14,23 +14,23 @@ package examples; // tag::imports[] - import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.List; import org.eclipse.esmf.aspectmodel.aas.AasFileFormat; import org.eclipse.esmf.aspectmodel.aas.AasToAspectModelGenerator; import org.eclipse.esmf.aspectmodel.aas.AspectModelAasGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; +// end::imports[] +import java.io.OutputStream; +import java.io.IOException; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.Test; @@ -46,9 +46,9 @@ private OutputStream outputStream( final Path directory, final String aspectName @Test public void generate() throws IOException { final Path outputDirectory = Files.createTempDirectory( "junit" ); - new AspectModelAasGenerator().generate( AasFileFormat.AASX, - AspectModelResolver.loadAndResolveModel( new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ) - .flatMap( AspectModelLoader::getSingleAspect ).get(), + final AspectModel aspectModel = new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); + new AspectModelAasGenerator().generate( AasFileFormat.AASX, aspectModel.aspect(), name -> outputStream( outputDirectory, name ) ); // tag::generate[] diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAsyncApi.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAsyncApi.java index 477694a4a..8fdea9aa5 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateAsyncApi.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateAsyncApi.java @@ -15,36 +15,33 @@ // tag::imports[] import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; import java.nio.charset.StandardCharsets; import org.eclipse.esmf.aspectmodel.generator.asyncapi.AspectModelAsyncApiGenerator; import org.eclipse.esmf.aspectmodel.generator.asyncapi.AsyncApiSchemaGenerationConfig; import org.eclipse.esmf.aspectmodel.generator.asyncapi.AsyncApiSchemaGenerationConfigBuilder; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; // end::imports[] + +import java.io.File; +import java.io.IOException; import org.junit.jupiter.api.Test; public class GenerateAsyncApi { @Test public void generateYaml() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generateYaml[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... - // end::generateYaml[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... + // end::generate[] + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generateYaml[] final ObjectMapper yamlMapper = new YAMLMapper().enable( YAMLGenerator.Feature.MINIMIZE_QUOTES ); @@ -59,11 +56,10 @@ public void generateYaml() throws IOException { // Generate pretty-printed YAML final AspectModelAsyncApiGenerator generator = new AspectModelAsyncApiGenerator(); - final JsonNode json = generator.apply( aspect, config ).getContent(); + final JsonNode json = generator.apply( aspectModel.aspect(), config ).getContent(); final String yaml = yamlMapper.writeValueAsString( json ); final ByteArrayOutputStream out = new ByteArrayOutputStream(); - out.write( yaml.getBytes( StandardCharsets.UTF_8 ) ); final String result = out.toString(); @@ -72,13 +68,12 @@ public void generateYaml() throws IOException { @Test public void generateJson() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); // tag::generateJson[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... - // end::generateJson[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... + // end::generate[] + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generateJson[] final ObjectMapper objectMapper = new ObjectMapper(); @@ -92,7 +87,7 @@ public void generateJson() throws IOException { // Generate the JSON final AspectModelAsyncApiGenerator generator = new AspectModelAsyncApiGenerator(); - final JsonNode json = generator.apply( aspect, config ).getContent(); + final JsonNode json = generator.apply( aspectModel.aspect(), config ).getContent(); // If needed, print or pretty print it into a string final ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateDiagrams.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateDiagrams.java index 4d5fea0c7..5edc18b3f 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateDiagrams.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateDiagrams.java @@ -17,28 +17,29 @@ import java.io.OutputStream; import java.util.Locale; import java.util.Set; + import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator.Format; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; +// end::imports[] import java.io.File; import java.io.IOException; -// end::imports[] import org.junit.jupiter.api.Test; public class GenerateDiagrams extends AbstractGenerator { @Test public void generateDiagram() throws IOException { // tag::generate[] - // AspectContext as returned by the AspectModelLoader - final AspectContext model = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - AspectModelLoader.getAspectContext( - new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generate[] - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( model ); // <1> + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspectModel.aspect() ); // <1> // Variant 1: Generate a diagram in SVG format using @en descriptions and preferredNames from the model final OutputStream output = outputStreamForName( "diagram.svg" ); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateHtml.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateHtml.java index 6623407bc..81a1a3faf 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateHtml.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateHtml.java @@ -25,8 +25,7 @@ import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import java.io.IOException; // end::imports[] import org.junit.jupiter.api.Test; @@ -48,7 +47,7 @@ public void generate() throws IOException { .filter( theAspect -> theAspect.getAspectModelUrn().map( urn -> urn.equals( targetAspect ) ).orElse( false ) ) .findFirst().orElseThrow(); final AspectModelDocumentationGenerator generator = // <2> - new AspectModelDocumentationGenerator( new AspectContext( model, aspect ) ); + new AspectModelDocumentationGenerator( aspect ); final Map options = Map.of(); // <3> generator.generate( this::outputStreamForName, options ); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaPojo.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaPojo.java index 8ca621878..3880004d5 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaPojo.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaPojo.java @@ -17,9 +17,9 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig; import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; + import java.io.File; import org.apache.commons.io.output.NullOutputStream; // end::imports[] @@ -28,21 +28,19 @@ public class GenerateJavaPojo { @Test public void generate() { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generate[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generate[] final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( true ) .packageName( "com.example.mycompany" ) // if left out, package is taken from Aspect's namespace .build(); - final AspectModelJavaGenerator generator = new AspectModelJavaGenerator( aspect, config ); + final AspectModelJavaGenerator generator = new AspectModelJavaGenerator( aspectModel.aspect(), config ); generator.generate( qualifiedName -> { // Create an output stream for the given qualified Java class name // end::generate[] diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaStaticClass.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaStaticClass.java index 4fc92358f..98ea84aed 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaStaticClass.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJavaStaticClass.java @@ -17,32 +17,30 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfig; import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.java.metamodel.StaticMetaModelJavaGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; +// end::imports[] + import java.io.File; import org.apache.commons.io.output.NullOutputStream; -// end::imports[] import org.junit.jupiter.api.Test; public class GenerateJavaStaticClass { @Test public void generate() { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generate[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generate[] final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() .enableJacksonAnnotations( true ) .packageName( "com.example.mycompany" ) // if left out, package is taken from Aspect's namespace .build(); - final StaticMetaModelJavaGenerator generator = new StaticMetaModelJavaGenerator( aspect, config ); + final StaticMetaModelJavaGenerator generator = new StaticMetaModelJavaGenerator( aspectModel.aspect(), config ); generator.generate( qualifiedName -> { // Create an output stream for the given qualified Java class name // end::generate[] diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonPayload.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonPayload.java index 2756e4e8d..853a81301 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonPayload.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonPayload.java @@ -14,30 +14,27 @@ package examples; // tag::imports[] -import java.io.File; -import java.io.IOException; - import org.eclipse.esmf.aspectmodel.generator.json.AspectModelJsonPayloadGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; // end::imports[] + +import java.io.File; +import java.io.IOException; import org.junit.jupiter.api.Test; public class GenerateJsonPayload extends AbstractGenerator { @Test public void generate() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generate[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generate[] - final AspectModelJsonPayloadGenerator generator = new AspectModelJsonPayloadGenerator( aspect ); + final AspectModelJsonPayloadGenerator generator = new AspectModelJsonPayloadGenerator( aspectModel.aspect() ); // Variant 1: Direct generation into a String final String jsonString = generator.generateJson(); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonSchema.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonSchema.java index 872ba5dee..eb7b35ff6 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonSchema.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateJsonSchema.java @@ -21,31 +21,29 @@ 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.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; + +// end::imports[] import java.io.File; import java.io.IOException; -// end::imports[] import org.junit.jupiter.api.Test; public class GenerateJsonSchema { @Test public void generate() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generate[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::generate[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generate[] final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() .locale( Locale.ENGLISH ) .build(); - final JsonNode jsonSchema = AspectModelJsonSchemaGenerator.INSTANCE.apply( aspect, config ).getContent(); + final JsonNode jsonSchema = AspectModelJsonSchemaGenerator.INSTANCE.apply( aspectModel.aspect(), config ).getContent(); // If needed, print or pretty print it into a string final ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateOpenApi.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateOpenApi.java index 2f27e78f0..45166f777 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateOpenApi.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateOpenApi.java @@ -14,40 +14,37 @@ package examples; // tag::imports[] - import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; import org.eclipse.esmf.aspectmodel.generator.openapi.AspectModelOpenApiGenerator; import org.eclipse.esmf.aspectmodel.generator.openapi.OpenApiSchemaGenerationConfig; import org.eclipse.esmf.aspectmodel.generator.openapi.OpenApiSchemaGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.generator.openapi.PagingOption; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import org.junit.jupiter.api.Test; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; +// end::imports[] + +import java.io.File; +import java.io.IOException; +import org.junit.jupiter.api.Test; public class GenerateOpenApi { @Test public void generateYaml() throws JsonProcessingException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::generateYaml[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... - // end::generateYaml[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... + // end::generate[] + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generateYaml[] - //language=yaml final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() // Server URL .baseUrl( "http://www.example.com" ) @@ -77,19 +74,18 @@ public void generateYaml() throws JsonProcessingException { // Generate pretty-printed YAML final AspectModelOpenApiGenerator generator = new AspectModelOpenApiGenerator(); - final String yaml = generator.apply( aspect, config ).getContentAsYaml(); + final String yaml = generator.apply( aspectModel.aspect(), config ).getContentAsYaml(); // end::generateYaml[] } @Test public void generateJson() throws IOException { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); // tag::generateJson[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... - // end::generateJson[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... + // end::generate[] + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::generateJson[] final ObjectMapper objectMapper = new ObjectMapper(); @@ -126,7 +122,7 @@ public void generateJson() throws IOException { // Generate the JSON final AspectModelOpenApiGenerator generator = new AspectModelOpenApiGenerator(); - final JsonNode json = generator.apply( aspect, config ).getContent(); + final JsonNode json = generator.apply( aspectModel.aspect(), config ).getContent(); // If needed, print or pretty print it into a string final ByteArrayOutputStream out = new ByteArrayOutputStream(); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/GenerateSql.java b/documentation/developer-guide/modules/tooling-guide/examples/GenerateSql.java index aa4d6a176..475af7da9 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/GenerateSql.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/GenerateSql.java @@ -29,7 +29,7 @@ import org.eclipse.esmf.aspectmodel.generator.sql.databricks.DatabricksType; import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; // end::imports[] import org.junit.jupiter.api.Test; diff --git a/documentation/developer-guide/modules/tooling-guide/examples/HandlingTry.java b/documentation/developer-guide/modules/tooling-guide/examples/HandlingTry.java deleted file mode 100644 index 8c300696b..000000000 --- a/documentation/developer-guide/modules/tooling-guide/examples/HandlingTry.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package examples; - -// tag::imports[] -import java.util.ArrayList; -import java.util.List; - -import io.vavr.collection.Stream; -import io.vavr.control.Try; -// end::imports[] -import org.junit.jupiter.api.Test; - -public class HandlingTry { - private Try> someMethodReturningTryOfListOfString() { - return Try.success( List.of( "hello", "world" ) ); - } - - @Test - public void handlingTry() { - // tag::handlingTry[] - final Try> tryList = someMethodReturningTryOfListOfString(); - - // Option 1: forEach to execute code on the value - tryList.forEach( valueList -> { - final List result1 = new ArrayList<>(); - for ( final String element : valueList ) { - result1.add( element.toUpperCase() ); - } - } ); - - // Option 2: map/flatMap values - final List result2 = tryList.toStream().flatMap( Stream::ofAll ) - .map( String::toUpperCase ).toJavaList(); - - // Option 3: "extract" value and throw on failure - final List valueList = tryList.getOrElseThrow( () -> - new RuntimeException( tryList.getCause() ) ); - final List result3 = new ArrayList<>(); - for ( final String element : valueList ) { - result3.add( element.toUpperCase() ); - } - // end::handlingTry[] - } -} diff --git a/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelObjects.java b/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelObjects.java index 115ff0f93..448c14fa1 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelObjects.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelObjects.java @@ -15,28 +15,33 @@ // tag::imports[] import java.io.File; -import java.util.List; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.metamodel.NamedElement; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; -import io.vavr.collection.Stream; + +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.ModelElement; // end::imports[] + import org.junit.jupiter.api.Test; public class LoadAspectModelObjects { @Test public void loadModel() { // tag::loadModel[] - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - final List result = AspectModelResolver.loadAndResolveModel( modelFile ) - .flatMap( AspectModelLoader::getElements ) - .toStream() - .flatMap( Stream::ofAll ) - .filter( element -> element.is( NamedElement.class ) ) - .map( element -> element.as( NamedElement.class ) ) - .map( modelElement -> String.format( "Model element: %s has URN %s%n", - modelElement.getName(), modelElement.getAspectModelUrn() ) ) - .toJavaList(); + final AspectModel aspectModel = new AspectModelLoader().load( + // a File, InputStream or AspectModelUrn + // end::generate[] + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) + // tag::loadModel[] + ); + + // Do something with the elements + for ( final ModelElement element : aspectModel.elements() ) { + System.out.printf( "Model element: %s has URN %s%n", element.getName(), element.urn() ); + } + + // Directly work with the Aspect, if the AspectModel happens to contain + // exactly one Aspect. If there are 0 or >1 Aspects, this will throw an exception. + System.out.println( "Aspect URN: " + aspectModel.aspect().urn() ); // end::loadModel[] } } diff --git a/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelRdf.java b/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelRdf.java index 058b46aa0..b66f75138 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelRdf.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/LoadAspectModelRdf.java @@ -17,36 +17,35 @@ import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.List; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.vocabulary.RDF; -import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; -import io.vavr.control.Try; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; + +import org.apache.jena.vocabulary.RDF; // end::imports[] + import org.junit.jupiter.api.Test; public class LoadAspectModelRdf { @Test public void loadAndResolveFromFile() { - // tag::loadAndResolveFromFile[] - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); // <1> - final Try tryModel = AspectModelResolver.loadAndResolveModel( modelFile ); // <2> - - // Let's do something with the loaded model on RDF level - tryModel.forEach( versionedModel -> { // <3> - final SAMM samm = new SAMM( KnownVersion.fromVersionString( versionedModel.getMetaModelVersion().toString() ).get() ); - final Model rdfModel = versionedModel.getModel(); - final List result = rdfModel.listStatements( null, RDF.type, samm.Aspect() ).toList();// <4> - } ); - // end::loadAndResolveFromFile[] + // tag::loadModel[] + final AspectModel aspectModel = new AspectModelLoader().load( + // a File, InputStream or AspectModelUrn + // end::generate[] + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) + // tag::loadModel[] + ); + + // Do something with the Aspect Model on the RDF level. + // Example: List the URNs of all samm:Entitys + aspectModel.mergedModel().listStatements( null, RDF.type, SammNs.SAMM.Entity() ) + .forEachRemaining( statement -> System.out.println( statement.getSubject().getURI() ) ); + // end::loadModel[] } @Test @@ -56,8 +55,8 @@ public void loadAndResolveFromUrn() { // see [.underline]#xref:tooling-guide:samm-cli.adoc#models-directory-structure[models directory structure]# final Path modelsRoot = Paths.get( "aspect-models" ); final ResolutionStrategy fileSystemStrategy = new FileSystemStrategy( modelsRoot ); - final Try tryModel = new AspectModelResolver().resolveAspectModel( fileSystemStrategy, - AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.examples.movement:1.0.0#Movement" ) ); + final AspectModelUrn urn = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.examples.movement:1.0.0#Movement" ); + final AspectModel result = new AspectModelLoader( fileSystemStrategy ).load( urn ); // end::loadAndResolveFromUrn[] } } diff --git a/documentation/developer-guide/modules/tooling-guide/examples/LoadMetaModelRdf.java b/documentation/developer-guide/modules/tooling-guide/examples/LoadMetaModelRdf.java index 8fde79ab1..7669b47fc 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/LoadMetaModelRdf.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/LoadMetaModelRdf.java @@ -14,15 +14,12 @@ package examples; // tag::imports[] -import static org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader.loadTurtle; -import static org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader.openUrl; -import java.io.InputStream; -import java.net.URL; -import java.util.Optional; +import org.apache.jena.rdf.model.Model; import org.apache.jena.vocabulary.RDF; + +import org.eclipse.esmf.aspectmodel.resolver.modelfile.MetaModelFile; +import org.eclipse.esmf.metamodel.vocabulary.SammNs; import org.eclipse.esmf.samm.KnownVersion; -import org.eclipse.esmf.aspectmodel.resolver.services.MetaModelUrls; -import org.eclipse.esmf.aspectmodel.vocabulary.SAMM; // end::imports[] import org.junit.jupiter.api.Test; @@ -31,20 +28,13 @@ public class LoadMetaModelRdf { public void loadMetaModelRdf() { // tag::loadMetaModelRdf[] final KnownVersion metaModelVersion = KnownVersion.getLatest(); - final Optional characteristicDefinitionsUrl = - MetaModelUrls.url( "characteristic", metaModelVersion, "characteristic-instances.ttl" ); + final Model characteristicDefinitions = MetaModelFile.CHARACTERISTIC_DEFINITIONS.sourceModel(); - characteristicDefinitionsUrl.ifPresent( url -> { - final InputStream inputStream = openUrl( url ); - loadTurtle( inputStream ).forEach( model -> { - // Do something with the org.apache.jena.org.rdf.model.Model - final SAMM samm = new SAMM( metaModelVersion ); - final int numberOfCharacteristicInstances = - model.listStatements( null, RDF.type, samm.Characteristic() ).toList().size(); - final String result = String.format( "Meta Model Version " + metaModelVersion.toVersionString() - + " defines " + numberOfCharacteristicInstances + " Characteristic instances" ); - } ); - } ); + // Do something with the org.apache.jena.org.rdf.model.Model + final int numberOfCharacteristicInstances = + characteristicDefinitions.listStatements( null, RDF.type, SammNs.SAMM.Characteristic() ).toList().size(); + final String result = String.format( "Meta Model Version " + metaModelVersion.toVersionString() + + " defines " + numberOfCharacteristicInstances + " Characteristic instances" ); // end::loadMetaModelRdf[] } } diff --git a/documentation/developer-guide/modules/tooling-guide/examples/MigrateAspectModel.java b/documentation/developer-guide/modules/tooling-guide/examples/MigrateAspectModel.java deleted file mode 100644 index 8d27d1617..000000000 --- a/documentation/developer-guide/modules/tooling-guide/examples/MigrateAspectModel.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package examples; - -// tag::imports[] -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; -import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; -import io.vavr.control.Try; -import java.nio.file.Paths; -// end::imports[] -import org.junit.jupiter.api.Test; - -public class MigrateAspectModel { - @Test - public void migrate() { - final ResolutionStrategy strategy = new FileSystemStrategy( Paths.get( "aspect-models" ) ); - final AspectModelUrn targetAspect - = AspectModelUrn.fromUrn( "urn:samm:org.eclipse.esmf.examples.movement:1.0.0#Movement" ); - // tag::migrate[] - // Try as returned by the AspectModelResolver - final Try tryModel = // ... - // end::migrate[] - new AspectModelResolver().resolveAspectModel( strategy, targetAspect ); - // tag::migrate[] - - final Try tryMigratedModel = tryModel.flatMap( versionedModel -> - new MigratorService().updateMetaModelVersion( versionedModel ) ); - final VersionedModel migratedModel = tryMigratedModel.getOrElseThrow( () -> - new RuntimeException( tryMigratedModel.getCause() ) ); - // end::migrate[] - } -} diff --git a/documentation/developer-guide/modules/tooling-guide/examples/SerializeAspectModel.java b/documentation/developer-guide/modules/tooling-guide/examples/SerializeAspectModel.java index 6612b7ef0..41c46e530 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/SerializeAspectModel.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/SerializeAspectModel.java @@ -18,10 +18,9 @@ // tag::imports[] import java.io.File; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; import org.eclipse.esmf.aspectmodel.serializer.AspectSerializer; -import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; // end::imports[] import org.junit.jupiter.api.Test; @@ -29,18 +28,17 @@ public class SerializeAspectModel { @Test public void serializeAspectModel() { - final File modelFile = new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ); - // tag::serialize[] - // Aspect as created by the AspectModelLoader - final Aspect aspect = // ... - // end::serialize[] - // exclude the actual loading from the example to reduce noise - AspectModelResolver.loadAndResolveModel( modelFile ).flatMap( AspectModelLoader::getSingleAspect ).get(); + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... + // end::generate[] + new AspectModelLoader().load( + new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::serialize[] // A String that contains the pretty printed Aspect Model - String aspectString = AspectSerializer.INSTANCE.apply( aspect ); + final String aspectString = + AspectSerializer.INSTANCE.apply( aspectModel.aspect() ); // end::serialize[] assertThat( aspectString ).contains( ":Movement a samm:Aspect" ); assertThat( aspectString ).contains( ":isMoving a samm:Property" ); diff --git a/documentation/developer-guide/modules/tooling-guide/examples/ValidateAspectModel.java b/documentation/developer-guide/modules/tooling-guide/examples/ValidateAspectModel.java index 51ad4778d..a1728429e 100644 --- a/documentation/developer-guide/modules/tooling-guide/examples/ValidateAspectModel.java +++ b/documentation/developer-guide/modules/tooling-guide/examples/ValidateAspectModel.java @@ -14,31 +14,31 @@ package examples; // tag::imports[] +import java.io.File; import java.util.List; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; import org.eclipse.esmf.aspectmodel.validation.services.DetailedViolationFormatter; import org.eclipse.esmf.aspectmodel.validation.services.ViolationFormatter; -import io.vavr.control.Try; -import java.io.File; +import org.eclipse.esmf.metamodel.AspectModel; // end::imports[] + import org.junit.jupiter.api.Test; public class ValidateAspectModel { @Test public void validate() { // tag::validate[] - // Try as returned by the AspectModelResolver - final Try tryModel = // ... + // AspectModel as returned by the AspectModelLoader + final AspectModel aspectModel = // ... // end::validate[] - AspectModelResolver.loadAndResolveModel( + new AspectModelLoader().load( new File( "aspect-models/org.eclipse.esmf.examples.movement/1.0.0/Movement.ttl" ) ); // tag::validate[] - final List violations = new AspectModelValidator().validateModel( tryModel ); + final List violations = new AspectModelValidator().validateModel( aspectModel ); if ( violations.isEmpty() ) { // Aspect Model is valid! return; diff --git a/documentation/developer-guide/modules/tooling-guide/pages/java-aspect-tooling.adoc b/documentation/developer-guide/modules/tooling-guide/pages/java-aspect-tooling.adoc index ad2fcd229..3376a1721 100644 --- a/documentation/developer-guide/modules/tooling-guide/pages/java-aspect-tooling.adoc +++ b/documentation/developer-guide/modules/tooling-guide/pages/java-aspect-tooling.adoc @@ -12,33 +12,6 @@ respective subsection), _or_ you can use the `aspect-model-starter` artifact tha include::esmf-developer-guide:ROOT:partial$esmf-aspect-model-starter-artifact.adoc[] -The error handling in many APIs is done using the -`https://javadoc.io/doc/io.vavr/vavr/0.10.3/io/vavr/control/Try.html[Try]` type provided by the Java -library _Vavr_. This is similar to a `java.lang.Optional` in that a successful result can be -processed using `.map()` or `.flatMap()`, but if an error occurs, the object can also provide the -original exception using the `getCause()` method. Compared with throwing exceptions, using a -`Try` as a return type instead has the advantage of enabling composable error handling. Please -see the https://www.vavr.io/vavr-docs/[Vavr User Guide] for more information. - -You generally have multiple options for handling `Try` results, similar to dealing with `Optional`: - -++++ -
    -Show used imports -++++ -[source,java,indent=0,subs="+macros,+quotes"] ----- -include::example$HandlingTry.java[tags=imports] ----- -++++ -
    -++++ - -[source,java,indent=0,subs="+macros,+quotes"] ----- -include::example$HandlingTry.java[tags=handlingTry] ----- - [[versioning]] == Getting the right version @@ -108,13 +81,13 @@ include::esmf-developer-guide:ROOT:partial$esmf-aspect-model-urn-artifact.adoc[] [[loading-and-saving]] == Loading and Saving Aspect Models -Aspect models are, like their Meta Model, described using the Resource Description Format (RDF, -xref:samm-specification:appendix:bibliography.adoc#rdf11[[rdf11\]]) and the Terse RDF Triple Language syntax (TTL, -xref:samm-specification:appendix:bibliography.adoc#turtle[[turtle\]]). There are two ways of working with Aspect models: -Either the model is loaded as an RDF model where the abstraction level directly corresponds to the RDF/Turtle -serialization, or the RDF is parsed into a native Java Aspect model representation where the abstraction level -corresponds to the SAMM concepts. Both approaches have different use cases and advantages and both are supported by the -Aspect model Java tooling: +Aspect models are, like the Semantic Aspect Meta Model, described using the Resource Description Format (RDF, +xref:samm-specification:appendix:bibliography.adoc#rdf11[[rdf11\]]) and the Terse RDF Triple Language syntax +(TTL, xref:samm-specification:appendix:bibliography.adoc#turtle[[turtle\]]). When an Aspect Model is loaded, +there are two ways of working with it: Either on the abstraction level of the underlying RDF/Turtle +serialization, or on the native Java Aspect Model level, where the model is represented as a Java object +graph. Both approaches have different use cases and advantages and both are supported by the Aspect Model Java +tooling: [width="100%", options="header", cols="50,50"] |=== @@ -122,49 +95,38 @@ Aspect model Java tooling: a| * Low level, focus on power and flexibility * Flexibly navigate and filter the model on the RDF statements level -* Work with models that are valid RDF, but incomplete Aspect models, e.g. in Aspect model editors -* Use SPARQL xref:samm-specification:appendix:bibliography.adoc#sparql[[sparql\]] to execute complex queries on Aspect models +* Work with models that are valid RDF, but incomplete Aspect Models, e.g. in Aspect model editors +* Use SPARQL xref:samm-specification:appendix:bibliography.adoc#sparql[[sparql\]] to execute complex queries on Aspect Models a| * High level, focus on convenience and type-safety -* Use Aspect-model specific interfaces for type-safe code -* Use Java-native data types (e.g. `java.math.BigInteger` for `xsd:integer`) -* Easily traverse the model on the abstraction level of Aspect model elements +* Use Aspect Model-specific interfaces for type-safe code +* Use Java native data types (e.g. `java.math.BigInteger` for `xsd:integer`) +* Easily traverse the model on the abstraction level of Aspect Model elements |=== -As a rule of thumb, if your use case mostly consists of _consuming_ Aspect models, you should prefer the Java Aspect -model, if you _create_ or _edit_ Aspect models, this is better done using the RDF API. - -[[understanding-model-resolution]] -=== Understanding Model Resolution - -Loading an Aspect model in either the RDF-based or the Java Aspect model-based APIs does not only comprise parsing the -Turtle file, but also the resolution of elements on the RDF level: - -* An Aspect model refers to meta model elements (everything that starts with `samm:`), and can refer to namespaces of - shared elements (`samm-c`, `samm-e` and `unit`) -* It can also refer to elements from other Aspect models or model elements defined in separate Turtle files - -You use the _model resolver_ to load an Aspect model, which takes care of the first point: The used meta model elements -and elements from shared namespaces are automatically resolved and added to the loaded RDF model. For the second point, -you need to provide the model resolver with the information on where to find other Aspect models: In memory, in a local -file system, in a remote model repository etc. This is done using a _resolution strategy_, which is a function from some -type `T` to a `Try` of a RDF model. Several commonly used resolution strategies are readily available: +As a rule of thumb, if your use case mostly consists of _consuming_ Aspect models, you should prefer the Java +Aspect model, if you _create_ or _edit_ Aspect models, or build code interfacing with other RDF vocabularies, +this is better done using the RDF API. -* The `FileSystemStrategy` resolves a `java.nio.file.Path` for a file relative - to the xref:tooling-guide:samm-cli.adoc#models-directory-structure[models directory] -* The `ClassPathStrategy` resolves a model from resources in the Java class path -* The `EitherStrategy` can be used to chain two different strategies of different types +[[loading-an-aspect-model-java-model-level]] +=== Loading an Aspect Model to work on the Java Aspect Model Level -To implement custom resolution strategies (e.g., to resolve models against a different blob storage API), you can base -your implementation on the `AbstractResolutionStrategy`. Using the model resolver requires at least one resolution -strategy that can resolve `AspectModelUrn`​s (because references in an Aspect model to external model elements use -their respective URNs) and can use another resolution strategy, for example for file paths. The following sections show -examples for the different variants. +To load an AspectModel, you use the `org.eclipse.esmf.aspectmodel.loader.AspectModelLoader` class. An instance +of `AspectModelLoader` provides `load()` methods to load an Aspect Model from an InputStream, one or multiple +Files, or a number of `AspectModelUrn`s (where you can delegate finding out _where_ a model element is defined +to the AspectModelLoader - details on that are explained in the next section). -[[loading-an-aspect-model-rdf-level]] -=== Loading an Aspect Model to work on the RDF Level +The `AspectModelLoader` loads Aspect Models based on the most recent version of the Semantic Aspect Meta Model +and previous versions: Models based on older meta model versions are automatically translated to models +corresponding to the latest meta model version. -The following example shows how to use the `AspectModelResolver` to load an Aspect Model +The resulting `AspectModel` object contains information about the loaded model elements, their namespaces and +the files they were defined in. Details about the structure of these objects can be found in the [Decision +Record +0007](https://github.com/eclipse-esmf/esmf-semantic-aspect-meta-model/blob/main/documentation/decisions/0007-model-resolution.md). +The `AspectModel` provides the methods `elements()`, `files()` and `namespaces()` as well as the convenience +methods `aspects()` (which returns all Aspect elements in the model) and `aspect()`, which returns the single +Aspect element if one exists. ++++
    @@ -172,7 +134,7 @@ The following example shows how to use the `AspectModelResolver` to load an Aspe ++++ [source,java,indent=0,subs="+macros,+quotes"] ---- -include::example$LoadAspectModelRdf.java[tags=imports] +include::example$LoadAspectModelObjects.java[tags=imports] ---- ++++
    @@ -180,21 +142,40 @@ include::example$LoadAspectModelRdf.java[tags=imports] [source,java,indent=0,subs="+macros,+quotes"] ---- -include::example$LoadAspectModelRdf.java[tags=loadAndResolveFromFile] +include::example$LoadAspectModelObjects.java[tags=loadModel] ---- -<1> The file must be located in a directory according to the -xref:tooling-guide:samm-cli.adoc#models-directory-structure[models directory] structure. -<2> You can check if loading succeeded using `versionedModel.isSuccess()` and -`versionedModel.isFailure()`. If loading fails, `versionedModel.getCause()` provides more -information. -<3> The code inside `forEach` is only executed if the model could be loaded successfully. -<4> List all statements in the RDF model that declare a `samm:Aspect`. +To include the Java Aspect Model artifact, use the following dependency: + +include::esmf-developer-guide:ROOT:partial$esmf-aspect-meta-model-java-artifact.adoc[] + +[[understanding-model-resolution]] +=== Understanding Model Resolution + +The example in the last section showed how a self-contained Aspect Model file can be loaded (i.e., a file that +does not refer to model element definitions in other files or namespaces). Whenever models are loaded that +could contain such references, or you want to load a model element by URN, the AspectModelLoader relies on +so-called _resolution strategies_. A resolution strategy is a function that takes a model element identifier +(a model element URN) as an input and returns the content of the file that contains the corresponding model +element definition. Note that this is not necessarily a file in the local filesystem, but it could also be a +remote file or even exist only virtually as a collection of statements in an RDF triple store. Several +`ResolutionStrategy`s are provided that can be instantiated and passed to the `AspectModelLoader` constructor +to enable it to find model element definitions: + +* The `FileSystemStrategy` resolves elements from files in the file system which are either structured in the + xref:tooling-guide:samm-cli.adoc#models-directory-structure[models directory structure] or exist as flat + list of files in one directory (by using `FileSystemStrategy` with a `FlatModelsRoot`). +* The `ClassPathStrategy` resolves model elements from resources in the Java class path. +* The `FromLoadedFileStrategy` resolves model elements from an `AspectModelFile` that already resides in + memory. +* The `EitherStrategy` can be used to chain two or more different `ResolutionStrategy`s. +* The `ExternalResolverStrategy` delegates resolution to an external command such as a script; it is used in + the implementation of the `--custom-resolver` option of the xref:tooling-guide:samm-cli.adoc[samm-cli]. + +In addition, custom resolution strategies can be provided by implementing the `ResolutionStrategy` interface. -If you want to choose which model resolution strategy is used, you use the `resolveAspectModel()` -method of the `AspectModelResolver`. In this case, you need to provide the resolution strategy and -the initial input (`InputStream`, `Model` or a `String` containing RDF/Turtle), or one or more URNs -of model elements to resolve - have a look at the methods provided by `AspectModelResolver`. +The following example demonstrates how to pass a custom instance of a `ResolutionStrategy` and resolve a model +element by URN: ++++
    @@ -213,17 +194,10 @@ include::example$LoadAspectModelRdf.java[tags=imports] include::example$LoadAspectModelRdf.java[tags=loadAndResolveFromUrn] ---- -To include the model resolver artifact, use the following dependencies: - -include::esmf-developer-guide:ROOT:partial$esmf-aspect-model-resolver-artifact.adoc[] - -[[loading-an-aspect-model-java-model-level]] -=== Loading an Aspect Model to work on the Java Aspect Model Level +[[loading-an-aspect-model-rdf-level]] +=== Loading an Aspect Model to work on the RDF Level -If you have retrieved a `Try` as shown above, you can use the `AspectModelLoader` to -turn the RDF graph representation of the Aspect Model into a type-safe Java object. You can use the -`getElements()` method to get all model elements from the Aspect Model, or, if you expect the model -to contain exactly one Aspect (for example in unit tests), you can use the `getSingleAspect()` method. +The following example shows how to use the `AspectModelResolver` to load an Aspect Model. ++++
    @@ -231,7 +205,7 @@ to contain exactly one Aspect (for example in unit tests), you can use the `getS ++++ [source,java,indent=0,subs="+macros,+quotes"] ---- -include::example$LoadAspectModelObjects.java[tags=imports] +include::example$LoadAspectModelRdf.java[tags=imports] ---- ++++
    @@ -239,19 +213,20 @@ include::example$LoadAspectModelObjects.java[tags=imports] [source,java,indent=0,subs="+macros,+quotes"] ---- -include::example$LoadAspectModelObjects.java[tags=loadModel] +include::example$LoadAspectModelRdf.java[tags=loadAndResolveFromFile] ---- -To include the Java Aspect model artifact, use the following dependencies: - -include::esmf-developer-guide:ROOT:partial$esmf-aspect-meta-model-java-artifact.adoc[] +After loading an `AspectModel` using the `AspectModelLoader`, you can access the `mergedModel()` on the +`AspectModel`, which represents the merged RDF graph of all source files that were loaded in the model and +therefore contains all transitively referenced model element definitions. Alternatively, you can also access +the `sourceModel()` of each Aspect Model file given by `files()`, which will return only the RDF graph of this +file. [[serializing-an-aspect-model]] === Serializing a Java Aspect Model into a RDF/Turtle Aspect Model -There are two serialization components available: One to turn a Java Aspect model into a Jena RDF model (the reverse -operation of what the `AspectModelLoader` does) and one to serialize the resulting Jena RDF model in Turtle syntax, -formatted according to the guidelines described in the SAMM specification. +The serialize an Aspect into its corresponding RDF/Turtle representation, you can use the `AspectSerializer`, +as demonstrated in the example below: ++++
    @@ -309,10 +284,16 @@ include::example$ValidateAspectModel.java[tags=validate] `DetailedViolationFormatter`. Note that those are only intended for text-based interfaces such as CLIs. <2> Every application dealing with validation results that needs to transform the results into some -different structure should instead implement the `Violation.Visitor` Interface with a suitable target +different structure can implement the `Violation.Visitor` Interface with a suitable target type `(String` used as an example here) and use the visitor to handle the different types of Violations in a type-safe way. +The `AspectModelValidator` also provides the `loadModel(Supplier)` method that can be used in +conjunction with `() -> new AspectModeLoader().load(...)` to have exceptions that might be created during the +Aspect Model loading process, for example due to model resolution failures or syntax errors in the input +files, be turned into a `List` that can be passed to the aforementioned violation formatters. This +allows for custom structured handling of problems that occur during model loading. + To include the model validator, use the following dependencies: include::esmf-developer-guide:ROOT:partial$esmf-aspect-model-validator-artifact.adoc[] @@ -340,8 +321,8 @@ include::example$AbstractGenerator.java[tags=outputStream] [[generating-diagrams]] === Generating SVG or PNG Diagrams -Using the `AspectModelDiagramGenerator`, automatically layouted diagrams can be created for Aspect models in the formats -PNG, SVG and https://www.graphviz.org/[Graphviz/DOT]. +Using the `AspectModelDiagramGenerator`, automatically layouted diagrams can be created for Aspect models in +the formats PNG and SVG. ++++
    @@ -391,10 +372,9 @@ include::example$GenerateHtml.java[tags=imports] include::example$GenerateHtml.java[tags=generate] ---- -<1> Load and select the Aspect from the loaded model for which generation should be generated. -<2> The HTML generator is initialized with the context consisting of the loaded RDF model and the +<1> The HTML generator is initialized with the context consisting of the loaded RDF model and the selected Aspect. -<3> HTML generation can be controlled via a map of options; using an empty map implies default values. +<2> HTML generation can be controlled via a map of options; using an empty map implies default values. [[generating-sample-json-payload]] === Generating Sample JSON Payload @@ -731,45 +711,12 @@ Example: include::example$sample-file-header.vm[] ---- -[[migrate-meta-model-version]] -== Programmatically migrate the Meta Model Version - -The meta model version migrator provides functionality to automatically migrate an Aspect model that -uses an older version of the Aspect Meta Model to an Aspect model that uses a newer (usually the -latest) version of the meta model. Calling this functionality is _only_ required if you intent to -work with the raw RDF model (i.e., the `VersionedModel`). If you use the `AspectModelLoader` to load -a model into `ModelElement`​s or `Aspect`​s, calling the `MigratorService` is not -necessary, as it will be done automatically if necessary. - -The following sample shows usage of the migration: - -++++ -
    -Show used imports -++++ -[source,java,indent=0,subs="+macros,+quotes"] ----- -include::example$MigrateAspectModel.java[tags=imports] ----- -++++ -
    -++++ - -[source,java,indent=0,subs="+macros,+quotes"] ----- -include::example$MigrateAspectModel.java[tags=migrate] ----- - -To use the meta model version migrator, you need the following dependency: - -include::esmf-developer-guide:ROOT:partial$esmf-aspect-meta-model-version-migrator-artifact.adoc[] - [[accessing-samm-programmatically]] == Accessing the SAMM programmatically -In order to access the source RDF files that describe the SAMM vocabulary, shared Characteristics and Entities as well -as Units, you can add a dependency to the `esmf-aspect-meta-model` artifact. Note that this artifact does not contain any -Java classes. +In order to access the source RDF files that describe the SAMM vocabulary, shared Characteristics and Entities +as well as Units, you can add a dependency to the `esmf-aspect-meta-model` artifact. Note that this artifact +does not provide Java classes that represent the meta model. include::esmf-developer-guide:ROOT:partial$aspect-meta-model-artifact.adoc[] @@ -801,8 +748,8 @@ structure that is present in the artifact: └── units.ttl ---- -TIP: If you use the artifact `aspect-model-resolver` instead (see section <> for infos on the -dependency) you can directly refer to the RDF files using a resource URL: +TIP: You can use the `MetaModelFile` enumeration provided by the `esmf-aspect-meta-model-java` module to +access object representations of the meta model files, for example: ++++
    diff --git a/documentation/developer-guide/modules/tooling-guide/pages/maven-plugin.adoc b/documentation/developer-guide/modules/tooling-guide/pages/maven-plugin.adoc index d17671660..70f1eb4d1 100644 --- a/documentation/developer-guide/modules/tooling-guide/pages/maven-plugin.adoc +++ b/documentation/developer-guide/modules/tooling-guide/pages/maven-plugin.adoc @@ -522,55 +522,13 @@ Configuration Properties: | `outputDirectory` | The path to the directory where the generated JSON payload will be written to. | `String` | none | {ok} |=== -== Aspect Model Migration - -The `migrate` goal migrates the given Aspect Model to the latest version of the meta model. The -default life cycle phase for the goal is `initialize`. - -Usage: - -[source,xml,subs=attributes+] ----- - - - - esmf-aspect-model-maven-plugin - - - migrate-aspect-model - - migrate - - - - - $\{path-to-models-root} - - $\{urn-of-aspect-model-to-be-included} - - $\{directory-for-generated-source-files} - - - - ----- - -Configuration Properties: - -[width="100%", options="header", cols="20,50,10,10,10"] -|=== -| Property | Description | Type | Default Value | Required -| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok} -| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok} -| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok} -| `outputDirectory` | The path to the directory where the updated Aspect Model will be written to. | `String` | none | {ok} -|=== - == Pretty Print The `prettyPrint` goal formats the given Aspect Model. The formatted file is written to the location specified in the `outputDirectory` property. The default life cycle phase for the goal is -`generate-resources`. +`generate-resources`. Note that the `prettyPrint` goal can also be used as a substitute of the +now-removed `migrate` goal, since it implies loading and automatically migrating a model to the +latest meta model version before it is pretty-printed. Usage: diff --git a/documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc b/documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc index dd213d6d8..300410400 100644 --- a/documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc +++ b/documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc @@ -63,8 +63,6 @@ The available options and their meaning can also be seen in the help text of the | _--custom-resolver_ : use an external resolver for the resolution of the model elements | `samm aspect AspectModel.ttl validate --custom-resolver myresolver.sh` .2+| [[aspect-prettyprint]] aspect prettyprint | Pretty-print Aspect Model | `samm aspect AspectModel.ttl prettyprint` | _--output, -o_ : the output will be saved to the given file | `samm aspect AspectModel.ttl prettyprint -o c:\Results\PrettyPrinted.ttl` -.2+| [[aspect-migrate]] aspect migrate | Migrate Aspect Model to the latest SAMM version | `samm aspect AspectModel.ttl migrate AspectModel.ttl` - | _--output, -o_ : the output will be saved to the given file | `samm aspect AspectModel.ttl migrate AspectModel.ttl -o c:\Results\MigratedModel.ttl` .5+| [[aspect-to-html]] aspect to html | Generate HTML documentation for an Aspect Model | `samm aspect AspectModel.ttl to html` | _--output, -o_ : the output will be saved to the given file | `samm aspect AspectModel.ttl to html -o c:\Model.html` | _--css, -c_ : CSS file with custom styles to be included in the generated HTML diff --git a/pom.xml b/pom.xml index 8f8ad5b43..581d38676 100644 --- a/pom.xml +++ b/pom.xml @@ -51,16 +51,12 @@ core/esmf-aspect-meta-model-interface core/esmf-aspect-meta-model-java - core/esmf-aspect-meta-model-resolver - core/esmf-aspect-meta-model-types - core/esmf-aspect-meta-model-version-migrator core/esmf-aspect-model-aas-generator core/esmf-aspect-model-document-generators core/esmf-aspect-model-generator core/esmf-aspect-model-jackson core/esmf-aspect-model-java-core core/esmf-aspect-model-java-generator - core/esmf-aspect-model-resolver core/esmf-aspect-model-serializer core/esmf-aspect-model-starter core/esmf-aspect-model-urn @@ -94,26 +90,6 @@ esmf-aspect-meta-model-interface ${project.version} - - org.eclipse.esmf - esmf-aspect-meta-model-resolver - ${project.version} - - - org.eclipse.esmf - esmf-aspect-model-resolver - ${project.version} - - - org.eclipse.esmf - esmf-aspect-meta-model-types - ${project.version} - - - org.eclipse.esmf - esmf-aspect-meta-model-version-migrator - ${project.version} - org.eclipse.esmf esmf-aspect-meta-model-java diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelMojo.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelMojo.java index d43bac5db..3ca82db77 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelMojo.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/AspectModelMojo.java @@ -13,42 +13,33 @@ package org.eclipse.esmf.aspectmodel; -import java.io.File; -import java.io.FileInputStream; +import static java.util.stream.Collectors.toSet; + import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; -import org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException; -import org.eclipse.esmf.aspectmodel.resolver.services.SammAspectMetaModelResourceResolver; -import org.eclipse.esmf.aspectmodel.resolver.services.TurtleLoader; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; import org.eclipse.esmf.aspectmodel.validation.services.DetailedViolationFormatter; import org.eclipse.esmf.aspectmodel.validation.services.ViolationFormatter; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.AspectModel; -import io.vavr.control.Try; +import io.vavr.control.Either; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Parameter; public abstract class AspectModelMojo extends AbstractMojo { - @Parameter( defaultValue = "${basedir}/src/main/resources/aspects" ) private final String modelsRootDirectory = System.getProperty( "user.dir" ) + "/src/main/resources/aspects"; @@ -67,72 +58,36 @@ protected void validateParameters() throws MojoExecutionException { } } - protected Set> loadAndResolveModels() { - final Path modelsRoot = Path.of( modelsRootDirectory ); - return includes.stream().map( AspectModelUrn::fromUrn ) - .map( urn -> new AspectModelResolver().resolveAspectModel( new FileSystemStrategy( modelsRoot ), urn ) - .flatMap( versionedModel -> - AspectModelLoader.getSingleAspect( versionedModel, aspect -> aspect.getName().equals( urn.getName() ) ) - .map( aspect -> new AspectContext( versionedModel, aspect ) ) ) ) - .collect( Collectors.toSet() ); - } - - protected Set loadModelsOrFail() throws MojoExecutionException { - final Set result = new HashSet<>(); - for ( final Try context : loadAndResolveModels() ) { - if ( context.isFailure() ) { - handleFailedModelResolution( context ); - } - result.add( context.get() ); - } - return result; - } - - private void handleFailedModelResolution( final Try failedModel ) throws MojoExecutionException { - final Throwable loadModelFailureCause = failedModel.getCause(); - - // Model can not be loaded, root cause e.g. File not found - if ( loadModelFailureCause instanceof IllegalArgumentException ) { - throw new MojoExecutionException( "Can not open file in models root directory.", loadModelFailureCause ); - } - - if ( loadModelFailureCause instanceof ModelResolutionException ) { - throw new MojoExecutionException( "Could not resolve all model elements", loadModelFailureCause ); - } - - // Another exception, e.g. syntax error. Let the validator handle this - final AspectModelValidator validator = new AspectModelValidator(); - final List violations = validator.validateModel( failedModel.map( AspectContext::rdfModel ) ); - final String errorMessage = detailedValidationMessages - ? new DetailedViolationFormatter().apply( violations ) - : new ViolationFormatter().apply( violations ); - throw new MojoExecutionException( errorMessage, loadModelFailureCause ); + protected Set loadAspects() throws MojoExecutionException { + Set models = loadModels(); + return models.stream().map( AspectModel::aspect ).collect( toSet() ); } - protected Map loadButNotResolveModels() throws MojoExecutionException { - final Map versionedModels = new HashMap<>(); - for ( final String urn : includes ) { - final AspectModelUrn aspectModelUrn = AspectModelUrn.fromUrn( urn ); - final String aspectModelFilePath = String.format( "%s/%s/%s/%s.ttl", modelsRootDirectory, aspectModelUrn.getNamespace(), - aspectModelUrn.getVersion(), aspectModelUrn.getName() ); - - final File inputFile = new File( aspectModelFilePath ).getAbsoluteFile(); - try ( final InputStream inputStream = new FileInputStream( inputFile ) ) { - final SammAspectMetaModelResourceResolver metaModelResourceResolver = new SammAspectMetaModelResourceResolver(); - final Try versionedModel = TurtleLoader.loadTurtle( inputStream ) - .flatMap( model -> metaModelResourceResolver.getMetaModelVersion( model ) - .flatMap( metaModelVersion -> metaModelResourceResolver.mergeMetaModelIntoRawModel( model, metaModelVersion ) ) ); - if ( versionedModel.isFailure() ) { - final String errorMessage = String.format( "Failed to load Aspect Model %s.", aspectModelUrn.getName() ); - throw new MojoExecutionException( errorMessage, versionedModel.getCause() ); + protected Set loadModels() throws MojoExecutionException { + try { + final Path modelsRoot = Path.of( modelsRootDirectory ); + final ResolutionStrategy fileSystemStrategy = new FileSystemStrategy( modelsRoot ); + final Set result = new HashSet<>(); + + for ( final String inputUrn : includes ) { + final AspectModelUrn urn = AspectModelUrn.fromUrn( inputUrn ); + final Either, AspectModel> loadingResult = new AspectModelValidator().loadModel( () -> + new AspectModelLoader( fileSystemStrategy ).load( urn ) ); + if ( loadingResult.isLeft() ) { + final List violations = loadingResult.getLeft(); + final String errorMessage = detailedValidationMessages + ? new DetailedViolationFormatter().apply( violations ) + : new ViolationFormatter().apply( violations ); + throw new MojoExecutionException( errorMessage ); } - versionedModels.put( aspectModelUrn, versionedModel.get() ); - } catch ( final IOException exception ) { - final String errorMessage = String.format( "Failed to load Aspect Model %s.", aspectModelUrn.getName() ); - throw new MojoExecutionException( errorMessage, exception ); + result.add( loadingResult.get() ); } + return result; + } catch ( final MojoExecutionException exception ) { + throw exception; + } catch ( final Throwable throwable ) { + throw new MojoExecutionException( "Processing error while loading Aspects", throwable ); } - return versionedModels; } protected FileOutputStream getOutputStreamForFile( final String artifactName, final String outputDirectory ) { @@ -144,11 +99,4 @@ protected FileOutputStream getOutputStreamForFile( final String artifactName, fi throw new RuntimeException( "Could not write to output " + outputDirectory ); } } - - protected PrintWriter initializePrintWriter( final AspectModelUrn aspectModelUrn ) throws IOException { - final String aspectModelFileName = String.format( "%s.ttl", aspectModelUrn.getName() ); - try ( final FileOutputStream streamForFile = getOutputStreamForFile( aspectModelFileName, outputDirectory ) ) { - return new PrintWriter( streamForFile ); - } - } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/CodeGenerationMojo.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/CodeGenerationMojo.java index 4bd3cc420..348e1c313 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/CodeGenerationMojo.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/CodeGenerationMojo.java @@ -55,10 +55,10 @@ protected void validateParameters( final File templateLibFile ) throws MojoExecu protected String determinePackageName( final Aspect aspect ) { if ( packageName == null || packageName.isEmpty() ) { - return aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ).orElseThrow(); + return aspect.urn().getNamespace(); } - final AspectModelUrn urn = aspect.getAspectModelUrn().orElseThrow(); + final AspectModelUrn urn = aspect.urn(); final VersionNumber versionNumber = VersionNumber.parse( urn.getVersion() ); final String interpolated = packageName.replace( "{{namespace}}", urn.getNamespace() ) .replace( "{{majorVersion}}", "" + versionNumber.getMajor() ) diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAas.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAas.java index 16b2b02f7..d81a65a94 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAas.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAas.java @@ -18,7 +18,7 @@ import org.eclipse.esmf.aspectmodel.aas.AasFileFormat; import org.eclipse.esmf.aspectmodel.aas.AspectModelAasGenerator; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -34,10 +34,10 @@ public class GenerateAas extends AspectModelMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { validateParameters(); - final Set aspectModels = loadModelsOrFail(); + final Set aspects = loadAspects(); final AspectModelAasGenerator generator = new AspectModelAasGenerator(); - for ( final AspectContext aspectModel : aspectModels ) { - generator.generate( AasFileFormat.valueOf( targetFormat.toUpperCase() ), aspectModel.aspect(), + for ( final Aspect aspect : aspects ) { + generator.generate( AasFileFormat.valueOf( targetFormat.toUpperCase() ), aspect, name -> getOutputStreamForFile( name + "." + targetFormat, outputDirectory ) ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAspectFromAas.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAspectFromAas.java index 47bef51e9..6f65a275f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAspectFromAas.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAspectFromAas.java @@ -48,7 +48,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { } private File getOutputFile( final Aspect aspect ) throws MojoExecutionException { - final AspectModelUrn urn = aspect.getAspectModelUrn().orElseThrow(); + final AspectModelUrn urn = aspect.urn(); final Path outputPath = Path.of( outputDirectory, urn.getNamespace(), urn.getVersion() ); try { Files.createDirectories( outputPath ); diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAsyncApiSpec.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAsyncApiSpec.java index 76d101f74..d68c4cc3e 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAsyncApiSpec.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateAsyncApiSpec.java @@ -15,7 +15,6 @@ import org.eclipse.esmf.aspectmodel.generator.asyncapi.AsyncApiSchemaGenerationConfig; import org.eclipse.esmf.aspectmodel.generator.asyncapi.AsyncApiSchemaGenerationConfigBuilder; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -59,12 +58,11 @@ public class GenerateAsyncApiSpec extends AspectModelMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { - final Set aspectModels = loadModelsOrFail(); + final Set aspects = loadAspects(); final Locale locale = Optional.ofNullable( language ).map( Locale::forLanguageTag ).orElse( Locale.ENGLISH ); final ApiFormat format = Try.of( () -> ApiFormat.valueOf( outputFormat.toUpperCase() ) ) .getOrElseThrow( () -> new MojoExecutionException( "Invalid output format." ) ); - for ( final AspectContext context : aspectModels ) { - final Aspect aspect = context.aspect(); + for ( final Aspect aspect : aspects ) { final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( useSemanticApiVersion ) .applicationId( applicationId ) diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDiagram.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDiagram.java index 49dd65528..cb0706b1d 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDiagram.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDiagram.java @@ -19,7 +19,7 @@ import java.util.stream.Collectors; import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -30,8 +30,7 @@ @Mojo( name = "generateDiagram", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class GenerateDiagram extends AspectModelMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateDiagram.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateDiagram.class ); @Parameter( required = true, property = "targetFormat" ) private Set targetFormats; @@ -40,20 +39,20 @@ public class GenerateDiagram extends AspectModelMojo { public void execute() throws MojoExecutionException { validateParameters(); - final Set aspectModels = loadModelsOrFail(); + final Set aspects = loadAspects(); try { final Set formats = targetFormats.stream() .map( targetFormat -> AspectModelDiagramGenerator.Format.valueOf( targetFormat.toUpperCase() ) ) .collect( Collectors.toSet() ); - for ( final AspectContext aspectModel : aspectModels ) { - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspectModel ); + for ( final Aspect aspect : aspects ) { + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspect ); generator.generateDiagrams( formats, name -> getOutputStreamForFile( name, outputDirectory ) ); } } catch ( final IOException exception ) { throw new MojoExecutionException( "Could not generate diagram.", exception ); } - logger.info( "Successfully generated Aspect Model diagram(s)." ); + LOG.info( "Successfully generated Aspect Model diagram(s)." ); } @Override diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDocumentation.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDocumentation.java index 7e179e9c7..5540c3852 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDocumentation.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateDocumentation.java @@ -20,7 +20,7 @@ import java.util.Set; import org.eclipse.esmf.aspectmodel.generator.docu.AspectModelDocumentationGenerator; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.commons.io.FileUtils; import org.apache.maven.plugin.MojoExecutionException; @@ -32,8 +32,7 @@ @Mojo( name = "generateDocumentation", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class GenerateDocumentation extends AspectModelMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateDocumentation.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateDocumentation.class ); @Parameter private final String htmlCustomCssFilePath = ""; @@ -43,9 +42,9 @@ public void execute() throws MojoExecutionException { validateParameters(); try { - final Set aspectModels = loadModelsOrFail(); - for ( final AspectContext context : aspectModels ) { - final AspectModelDocumentationGenerator generator = new AspectModelDocumentationGenerator( context ); + final Set aspects = loadAspects(); + for ( final Aspect model : aspects ) { + final AspectModelDocumentationGenerator generator = new AspectModelDocumentationGenerator( model ); final Map generationArgs = new HashMap<>(); generationArgs.put( AspectModelDocumentationGenerator.HtmlGenerationOption.STYLESHEET, "" ); //noinspection ConstantValue @@ -58,6 +57,6 @@ public void execute() throws MojoExecutionException { } catch ( final IOException exception ) { throw new MojoExecutionException( "Could not load custom CSS file.", exception ); } - logger.info( "Successfully generated Aspect model documentation." ); + LOG.info( "Successfully generated Aspect model documentation." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJavaClasses.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJavaClasses.java index 764c731d8..5688327ff 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJavaClasses.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJavaClasses.java @@ -21,7 +21,6 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -32,17 +31,15 @@ @Mojo( name = "generateJavaClasses", defaultPhase = LifecyclePhase.GENERATE_SOURCES ) public class GenerateJavaClasses extends CodeGenerationMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateJavaClasses.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateJavaClasses.class ); @Parameter( defaultValue = "false" ) private boolean disableJacksonAnnotations; @Override public void execute() throws MojoExecutionException { - final Set aspectModels = loadModelsOrFail(); - for ( final AspectContext context : aspectModels ) { - final Aspect aspect = context.aspect(); + final Set aspects = loadAspects(); + for ( final Aspect aspect : aspects ) { final File templateLibFile = Path.of( templateFile ).toFile(); validateParameters( templateLibFile ); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() @@ -53,6 +50,6 @@ public void execute() throws MojoExecutionException { .build(); new AspectModelJavaGenerator( aspect, config ).generate( nameMapper ); } - logger.info( "Successfully generated Java classes for Aspect Models." ); + LOG.info( "Successfully generated Java classes for Aspect Models." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonPayload.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonPayload.java index d3a57420c..c45770580 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonPayload.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonPayload.java @@ -17,7 +17,7 @@ import java.util.Set; import org.eclipse.esmf.aspectmodel.generator.json.AspectModelJsonPayloadGenerator; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -28,22 +28,21 @@ @Mojo( name = "generateJsonPayload", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class GenerateJsonPayload extends AspectModelMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateJsonPayload.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateJsonPayload.class ); @Override public void execute() throws MojoExecutionException, MojoFailureException { validateParameters(); - final Set aspectModels = loadModelsOrFail(); + final Set aspects = loadAspects(); try { - for ( final AspectContext context : aspectModels ) { + for ( final Aspect context : aspects ) { final AspectModelJsonPayloadGenerator generator = new AspectModelJsonPayloadGenerator( context ); generator.generateJsonPretty( name -> getOutputStreamForFile( name + ".json", outputDirectory ) ); } } catch ( final IOException exception ) { throw new MojoExecutionException( "Could not generate JSON payload.", exception ); } - logger.info( "Successfully generated example JSON payloads for Aspect Models." ); + LOG.info( "Successfully generated example JSON payloads for Aspect Models." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonSchema.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonSchema.java index 4724f23cb..aaf18767f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonSchema.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateJsonSchema.java @@ -22,7 +22,7 @@ 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.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -36,8 +36,7 @@ @Mojo( name = "generateJsonSchema", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class GenerateJsonSchema extends AspectModelMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateJsonSchema.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateJsonSchema.class ); @Parameter( defaultValue = "en" ) private String language; @@ -46,15 +45,15 @@ public class GenerateJsonSchema extends AspectModelMojo { public void execute() throws MojoExecutionException, MojoFailureException { validateParameters(); - final Set aspectModels = loadModelsOrFail(); + final Set aspects = loadAspects(); final Locale locale = Optional.ofNullable( language ).map( Locale::forLanguageTag ).orElse( Locale.ENGLISH ); try { - for ( final AspectContext context : aspectModels ) { + for ( final Aspect aspect : aspects ) { final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() .locale( locale ) .build(); - final JsonNode schema = AspectModelJsonSchemaGenerator.INSTANCE.apply( context.aspect(), config ).getContent(); - final OutputStream out = getOutputStreamForFile( context.aspect().getName() + ".schema.json", outputDirectory ); + final JsonNode schema = AspectModelJsonSchemaGenerator.INSTANCE.apply( aspect, config ).getContent(); + final OutputStream out = getOutputStreamForFile( aspect.getName() + ".schema.json", outputDirectory ); final ObjectMapper objectMapper = new ObjectMapper(); objectMapper.writerWithDefaultPrettyPrinter().writeValue( out, schema ); out.flush(); @@ -62,6 +61,6 @@ public void execute() throws MojoExecutionException, MojoFailureException { } catch ( final IOException exception ) { throw new MojoExecutionException( "Could not format JSON Schema", exception ); } - logger.info( "Successfully generated JSON Schema for Aspect Models." ); + LOG.info( "Successfully generated JSON Schema for Aspect Models." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateStaticJavaClasses.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateStaticJavaClasses.java index b463cb471..8f0606155 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateStaticJavaClasses.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/GenerateStaticJavaClasses.java @@ -21,7 +21,6 @@ import org.eclipse.esmf.aspectmodel.java.JavaCodeGenerationConfigBuilder; import org.eclipse.esmf.aspectmodel.java.metamodel.StaticMetaModelJavaGenerator; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -31,14 +30,12 @@ @Mojo( name = "generateStaticJavaClasses", defaultPhase = LifecyclePhase.GENERATE_SOURCES ) public class GenerateStaticJavaClasses extends CodeGenerationMojo { - - private final Logger logger = LoggerFactory.getLogger( GenerateStaticJavaClasses.class ); + private static final Logger LOG = LoggerFactory.getLogger( GenerateStaticJavaClasses.class ); @Override public void execute() throws MojoExecutionException { - final Set aspectModels = loadModelsOrFail(); - for ( final AspectContext context : aspectModels ) { - final Aspect aspect = context.aspect(); + final Set aspects = loadAspects(); + for ( final Aspect aspect : aspects ) { final File templateLibFile = Path.of( templateFile ).toFile(); validateParameters( templateLibFile ); final JavaCodeGenerationConfig config = JavaCodeGenerationConfigBuilder.builder() @@ -46,8 +43,8 @@ public void execute() throws MojoExecutionException { .executeLibraryMacros( executeLibraryMacros ) .templateLibFile( templateLibFile ) .build(); - new StaticMetaModelJavaGenerator( context.aspect(), config ).generate( nameMapper ); + new StaticMetaModelJavaGenerator( aspect, config ).generate( nameMapper ); } - logger.info( "Successfully generated static Java classes for Aspect Models." ); + LOG.info( "Successfully generated static Java classes for Aspect Models." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Migrate.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Migrate.java deleted file mode 100644 index 2906b495c..000000000 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Migrate.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Map; - -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.serializer.PrettyPrinter; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; - -import io.vavr.control.Try; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.LifecyclePhase; -import org.apache.maven.plugins.annotations.Mojo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Mojo( name = "migrate", defaultPhase = LifecyclePhase.INITIALIZE ) -public class Migrate extends AspectModelMojo { - private final Logger logger = LoggerFactory.getLogger( Migrate.class ); - private final MigratorService migratorService = new MigratorService(); - - @Override - public void execute() throws MojoExecutionException, MojoFailureException { - validateParameters(); - - final Map aspectModels = loadButNotResolveModels(); - for ( final Map.Entry aspectModelEntry : aspectModels.entrySet() ) { - final AspectModelUrn aspectModelUrn = aspectModelEntry.getKey(); - try ( final PrintWriter printWriter = initializePrintWriter( aspectModelUrn ) ) { - final VersionedModel versionedModel = aspectModelEntry.getValue(); - final Try migratedModel = migratorService.updateMetaModelVersion( versionedModel ); - if ( migratedModel.isFailure() ) { - final String errorMessage = String.format( "Failed to migrate Aspect Model %s.", aspectModelUrn.getName() ); - throw new MojoFailureException( errorMessage, migratedModel.getCause() ); - } - final PrettyPrinter prettyPrinter = new PrettyPrinter( migratedModel.get(), aspectModelUrn, printWriter ); - prettyPrinter.print(); - } catch ( final IOException exception ) { - throw new MojoExecutionException( "Could not write file", exception ); - } - logger.info( "Successfully migrated Aspect Model {} to latest SAMM version.", aspectModelUrn.getName() ); - } - } -} diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/PrettyPrint.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/PrettyPrint.java index 43d614686..434ef6c21 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/PrettyPrint.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/PrettyPrint.java @@ -13,13 +13,13 @@ package org.eclipse.esmf.aspectmodel; +import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintWriter; -import java.util.Map; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; -import org.eclipse.esmf.aspectmodel.serializer.PrettyPrinter; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.aspectmodel.serializer.AspectSerializer; +import org.eclipse.esmf.metamodel.Aspect; +import org.eclipse.esmf.metamodel.AspectModel; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -30,23 +30,23 @@ @Mojo( name = "prettyPrint", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class PrettyPrint extends AspectModelMojo { - private final Logger logger = LoggerFactory.getLogger( PrettyPrint.class ); + private static final Logger LOG = LoggerFactory.getLogger( PrettyPrint.class ); @Override public void execute() throws MojoExecutionException, MojoFailureException { validateParameters(); - final Map aspectModels = loadButNotResolveModels(); - for ( final Map.Entry aspectModelEntry : aspectModels.entrySet() ) { - final AspectModelUrn aspectModelUrn = aspectModelEntry.getKey(); - try ( final PrintWriter printWriter = initializePrintWriter( aspectModelUrn ) ) { - final VersionedModel versionedModel = aspectModelEntry.getValue(); - final PrettyPrinter prettyPrinter = new PrettyPrinter( versionedModel, aspectModelUrn, printWriter ); - prettyPrinter.print(); + for ( final AspectModel aspectModel : loadModels() ) { + final Aspect aspect = aspectModel.aspect(); + final String formatted = AspectSerializer.INSTANCE.apply( aspect ); + final String aspectModelFileName = String.format( "%s.ttl", aspect.getName() ); + try ( final FileOutputStream streamForFile = getOutputStreamForFile( aspectModelFileName, outputDirectory ); + final PrintWriter writer = new PrintWriter( streamForFile ) ) { + writer.println( formatted ); } catch ( final IOException exception ) { - throw new MojoExecutionException( "Could not write file", exception ); + throw new MojoExecutionException( "Could not write Aspect", exception ); } - logger.info( "Successfully printed Aspect Model {}.", aspectModelUrn.getName() ); + LOG.info( "Successfully printed Aspect Model {}.", aspect.getName() ); } } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Validate.java b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Validate.java index ffc452d6d..61ccec955 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Validate.java +++ b/tools/esmf-aspect-model-maven-plugin/src/main/java/org/eclipse/esmf/aspectmodel/Validate.java @@ -19,9 +19,8 @@ import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; import org.eclipse.esmf.aspectmodel.validation.services.ViolationFormatter; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.AspectModel; -import io.vavr.control.Try; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; @@ -31,21 +30,21 @@ @Mojo( name = "validate", defaultPhase = LifecyclePhase.VALIDATE ) public class Validate extends AspectModelMojo { - - private final Logger logger = LoggerFactory.getLogger( Validate.class ); + private static final Logger LOG = LoggerFactory.getLogger( Validate.class ); private final AspectModelValidator validator = new AspectModelValidator(); @Override public void execute() throws MojoExecutionException, MojoFailureException { validateParameters(); - final Set> resolvedModels = loadAndResolveModels(); - for ( final Try context : resolvedModels ) { - final List violations = validator.validateModel( context.map( AspectContext::rdfModel ) ); - if ( !violations.isEmpty() ) { - throw new MojoFailureException( new ViolationFormatter().apply( violations ) ); - } + final Set aspectModels = loadModels(); + final List violations = aspectModels.stream() + .flatMap( aspectModel -> validator.validateModel( aspectModel ).stream() ).toList(); + + if ( !violations.isEmpty() ) { + throw new MojoFailureException( new ViolationFormatter().apply( violations ) ); } - logger.info( "Aspect Models are valid." ); + + LOG.info( "Aspect Models are valid." ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MigrateTest.java b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MigrateTest.java deleted file mode 100644 index 57e1be965..000000000 --- a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MigrateTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspectmodel; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatCode; - -import java.io.File; - -import org.eclipse.esmf.aspectmodel.resolver.exceptions.ParserException; - -import org.apache.maven.plugin.Mojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.junit.Test; - -public class MigrateTest extends AspectModelMojoTest { - @Test - public void testMigrateValidAspectModel() throws Exception { - final File testPom = getTestFile( "src/test/resources/test-pom-valid-aspect-model-output-directory.xml" ); - final Mojo migrate = lookupMojo( "migrate", testPom ); - assertThatCode( migrate::execute ).doesNotThrowAnyException(); - assertThat( generatedFilePath( "Aspect.ttl" ) ).exists(); - } - - @Test - public void testMigrateInvalidAspectModel() throws Exception { - final File testPom = getTestFile( "src/test/resources/migrate-pom-invalid-aspect-model.xml" ); - final Mojo migrate = lookupMojo( "migrate", testPom ); - assertThatCode( migrate::execute ) - .isInstanceOf( MojoExecutionException.class ) - .hasMessage( "Failed to load Aspect Model InvalidSyntax." ) - .hasCauseInstanceOf( ParserException.class ) - .cause() - .hasMessageContaining( "Triples not terminated by DOT" ); - assertThat( generatedFilePath( "Aspect.ttl" ) ).doesNotExist(); - } -} diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MojoConfigTest.java b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MojoConfigTest.java index 9083d8302..1d2a2dbb2 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MojoConfigTest.java +++ b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/MojoConfigTest.java @@ -29,7 +29,7 @@ public void testInvalidModelsRoot() throws Exception { final File testPom = getTestFile( "src/test/resources/test-pom-invalid-models-root.xml" ); final Mojo validate = lookupMojo( "validate", testPom ); assertThatCode( validate::execute ) - .isInstanceOf( MojoFailureException.class ) + .isInstanceOf( MojoExecutionException.class ) .hasMessageContaining( "Validation failed" ); } diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/PrettyPrintTest.java b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/PrettyPrintTest.java index fa4640e47..7c92ddd12 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/PrettyPrintTest.java +++ b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/PrettyPrintTest.java @@ -18,8 +18,6 @@ import java.io.File; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.ParserException; - import org.apache.maven.plugin.Mojo; import org.apache.maven.plugin.MojoExecutionException; import org.junit.Test; @@ -39,10 +37,7 @@ public void testPrettyPrintInvalidAspectModel() throws Exception { final Mojo prettyPrint = lookupMojo( "prettyPrint", testPom ); assertThatCode( prettyPrint::execute ) .isInstanceOf( MojoExecutionException.class ) - .hasMessage( "Failed to load Aspect Model InvalidSyntax." ) - .hasCauseInstanceOf( ParserException.class ) - .cause() - .hasMessageContaining( "Triples not terminated by DOT" ); + .hasMessageContaining( "Syntax error in line 17, column 2" ); assertThat( generatedFilePath( "Aspect.ttl" ) ).doesNotExist(); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/ValidateTest.java b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/ValidateTest.java index 0f919fe23..8be7778e9 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/ValidateTest.java +++ b/tools/esmf-aspect-model-maven-plugin/src/test/java/org/eclipse/esmf/aspectmodel/ValidateTest.java @@ -18,7 +18,7 @@ import java.io.File; import org.apache.maven.plugin.Mojo; -import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.MojoExecutionException; import org.junit.Test; public class ValidateTest extends AspectModelMojoTest { @@ -35,7 +35,7 @@ public void testValidateInvalidAspectModel() throws Exception { final File testPom = getTestFile( "src/test/resources/validate-pom-invalid-aspect-model.xml" ); final Mojo validate = lookupMojo( "validate", testPom ); assertThatCode( validate::execute ) - .isInstanceOf( MojoFailureException.class ) + .isInstanceOf( MojoExecutionException.class ) .hasMessageContaining( "Syntax error in line 17, column 2" ); } } diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-aasx-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-aasx-pom-valid-aspect-model.xml index 9ee8676b3..fbc7dfe7a 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-aasx-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-aasx-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-json-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-json-pom-valid-aspect-model.xml index b969bf1ae..a6c43a8a7 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-json-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-json-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-pom-invalid-target-format.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-pom-invalid-target-format.xml index fb8750720..d01d3b2fb 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-pom-invalid-target-format.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-pom-invalid-target-format.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-xml-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-xml-pom-valid-aspect-model.xml index 7e99dd6e5..92a889044 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-xml-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-aas-xml-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-separate-schema-files.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-separate-schema-files.xml index a8cda566b..ba24abac3 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-separate-schema-files.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-separate-schema-files.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEvent diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model-language.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model-language.xml index 17e38ebd8..4c3053f6c 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model-language.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model-language.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEnglishAndGermanDescription diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model.xml index 561676d41..b2bb2b230 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-json-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-pom-invalid-format.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-pom-invalid-format.xml index 5fbef4bdf..d21b02265 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-pom-invalid-format.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-asyncapi-spec-pom-invalid-format.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-invalid-target-format.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-invalid-target-format.xml index 246a010d8..2d4cfe1dd 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-invalid-target-format.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-invalid-target-format.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-valid-aspect-model.xml index 60f0d0cae..9f5febbc3 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-diagram-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-documentation-pom-invalid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-documentation-pom-invalid-aspect-model.xml index b92e6debb..a81e6d80e 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-documentation-pom-invalid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-documentation-pom-invalid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid urn:samm:org.eclipse.esmf.test:1.0.0#InvalidSyntax diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-custom-package-name.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-custom-package-name.xml index 89238d06c..573e0ee79 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-custom-package-name.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-custom-package-name.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-invalid-template-lib-file.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-invalid-template-lib-file.xml index f7385332d..27f2d763c 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-invalid-template-lib-file.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-invalid-template-lib-file.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-package-interpolation.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-package-interpolation.xml index 7b3f26aaa..479f5738b 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-package-interpolation.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-java-classes-pom-package-interpolation.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect urn:samm:org.eclipse.esmf.test.shared:1.0.0#AspectWithExtendedEntity diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-separate-schema-files.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-separate-schema-files.xml index 00cd6a2ec..3dc77c0b0 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-separate-schema-files.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-separate-schema-files.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEntity diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-language.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-language.xml index 6a0f05524..507f1568b 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-language.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-language.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEnglishAndGermanDescription diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-with-crud-parameters.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-with-crud-parameters.xml index 9950cf67b..65eac3a9e 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-with-crud-parameters.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model-with-crud-parameters.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model.xml index 02857b1e7..ceb30a04f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-json-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-pom-invalid-format.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-pom-invalid-format.xml index c1ac26ef2..a0c3ff8ad 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-pom-invalid-format.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-pom-invalid-format.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-separate-schema-files.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-separate-schema-files.xml index 5c82456a8..94d510184 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-separate-schema-files.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-separate-schema-files.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEntity diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-valid-aspect-model.xml index a271ad93c..5cf335bc3 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-openapi-spec-yaml-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-schema-json-pom-valid-aspect-model-language.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-schema-json-pom-valid-aspect-model-language.xml index a48bad8ac..df66dc87f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-schema-json-pom-valid-aspect-model-language.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-schema-json-pom-valid-aspect-model-language.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEnglishAndGermanDescription diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-adjusted-settings.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-adjusted-settings.xml index ee7deaee0..20d6cb5a8 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-adjusted-settings.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-adjusted-settings.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithSimpleTypes diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-default-settings.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-default-settings.xml index 874c3f398..c8e0f10b7 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-default-settings.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-sql-pom-valid-aspect-model-default-settings.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithSimpleTypes diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-custom-package-name.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-custom-package-name.xml index e637eb005..b808b452b 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-custom-package-name.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-custom-package-name.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-invalid-template-lib-file.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-invalid-template-lib-file.xml index 0be031475..0fbf7ebe1 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-invalid-template-lib-file.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-invalid-template-lib-file.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-package-interpolation.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-package-interpolation.xml index d3cbd79ac..5cf58f04d 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-package-interpolation.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/generate-static-java-classes-pom-package-interpolation.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect urn:samm:org.eclipse.esmf.test.shared:1.0.0#AspectWithExtendedEntity diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/migrate-pom-invalid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/migrate-pom-invalid-aspect-model.xml index db376c7ef..0f5c60d5f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/migrate-pom-invalid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/migrate-pom-invalid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid urn:samm:org.eclipse.esmf.test:1.0.0#InvalidSyntax diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/prettyprint-pom-invalid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/prettyprint-pom-invalid-aspect-model.xml index aa35f8407..102343f9e 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/prettyprint-pom-invalid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/prettyprint-pom-invalid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid/samm_1_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid urn:samm:org.eclipse.esmf.test:1.0.0#InvalidSyntax diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-include.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-include.xml index dbb3c465d..f6b6a2bad 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-include.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-include.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-includes.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-includes.xml index bf6d6b3f4..be585d43c 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-includes.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-missing-includes.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory-language.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory-language.xml index a48bad8ac..df66dc87f 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory-language.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory-language.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEnglishAndGermanDescription diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory.xml index 5483c8b0b..887f180e4 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/test-pom-valid-aspect-model-output-directory.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-invalid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-invalid-aspect-model.xml index f8beeb4fb..9cef077d1 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-invalid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-invalid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/invalid urn:samm:org.eclipse.esmf.test:1.0.0#InvalidSyntax diff --git a/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-valid-aspect-model.xml b/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-valid-aspect-model.xml index 5e58853ab..c873dff5b 100644 --- a/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-valid-aspect-model.xml +++ b/tools/esmf-aspect-model-maven-plugin/src/test/resources/validate-pom-valid-aspect-model.xml @@ -27,7 +27,7 @@ esmf-aspect-model-maven-plugin - ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid/samm_2_0_0 + ${basedir}/../../core/esmf-test-aspect-models/src/main/resources/valid urn:samm:org.eclipse.esmf.test:1.0.0#Aspect diff --git a/tools/samm-cli/pom.xml b/tools/samm-cli/pom.xml index 4e2799014..8a3966095 100644 --- a/tools/samm-cli/pom.xml +++ b/tools/samm-cli/pom.xml @@ -41,6 +41,10 @@ + + org.eclipse.esmf + esmf-semantic-aspect-meta-model + org.eclipse.esmf esmf-aspect-model-starter @@ -278,9 +282,6 @@ - - org.eclipse.esmf:esmf-semantic-aspect-meta-model javax.annotation:jsr250-api @@ -377,9 +378,6 @@ - - org.eclipse.esmf:esmf-semantic-aspect-meta-model javax.annotation:jsr250-api diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/AbstractCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/AbstractCommand.java index 1db36e75a..50a600624 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/AbstractCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/AbstractCommand.java @@ -13,13 +13,12 @@ package org.eclipse.esmf; -import static org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.fileToUrn; - import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.nio.file.Path; import java.util.HashSet; import java.util.List; import java.util.Locale; @@ -29,93 +28,89 @@ import org.eclipse.esmf.aspectmodel.generator.LanguageCollector; import org.eclipse.esmf.aspectmodel.generator.diagram.AspectModelDiagramGenerator; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.resolver.EitherStrategy; import org.eclipse.esmf.aspectmodel.resolver.ExternalResolverStrategy; +import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; import org.eclipse.esmf.aspectmodel.resolver.ModelResolutionException; -import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidRootElementCountException; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; +import org.eclipse.esmf.aspectmodel.resolver.ResolutionStrategy; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; +import org.eclipse.esmf.aspectmodel.validation.services.DetailedViolationFormatter; import org.eclipse.esmf.aspectmodel.validation.services.ViolationFormatter; import org.eclipse.esmf.exception.CommandException; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; -import org.eclipse.esmf.metamodel.loader.AspectModelLoader; +import org.eclipse.esmf.metamodel.AspectModel; -import io.vavr.control.Try; +import io.vavr.control.Either; import org.apache.commons.io.FilenameUtils; public abstract class AbstractCommand implements Runnable { - protected Try loadAndResolveModel( final File input, final ExternalResolverMixin resolverConfig ) { - final Try versionedModel; - if ( resolverConfig.commandLine.isBlank() ) { - if ( input.isAbsolute() ) { - versionedModel = AspectModelResolver.loadAndResolveModel( input ); - } else { - final File newInput = new File( System.getProperty( "user.dir" ) + File.separator + input ); - versionedModel = AspectModelResolver.loadAndResolveModel( newInput ); - } - } else { - final AspectModelUrn urn = fileToUrn( input.getAbsoluteFile() ).get(); - versionedModel = new AspectModelResolver().resolveAspectModel( new ExternalResolverStrategy( resolverConfig.commandLine ), urn ); - } - return versionedModel; + private Path modelsRootForFile( final File file ) { + return file.toPath().getParent().getParent().getParent(); } - protected AspectContext loadModelOrFail( final String modelFileName, final ExternalResolverMixin resolverConfig ) { - final File inputFile = new File( modelFileName ); - final Try versionedModel = loadAndResolveModel( inputFile, resolverConfig ); - final Try context = versionedModel.flatMap( model -> { - final String expectedAspectName = FilenameUtils.removeExtension( inputFile.getName() ); - final Try> tryAspects = AspectModelLoader.getAspects( model ); - if ( tryAspects.isFailure() ) { - return Try.failure( tryAspects.getCause() ); - } - final List aspects = tryAspects.get(); - if ( aspects.isEmpty() ) { - return Try.failure( new InvalidRootElementCountException( "No Aspects were found in the model" ) ); - } - // If there is exactly one Aspect in the file, even if does not have the same name as the file, use it - if ( aspects.size() == 1 ) { - return Try.success( new AspectContext( model, aspects.get( 0 ) ) ); - } - return aspects.stream().filter( aspect -> aspect.getName().equals( expectedAspectName ) ) - .findFirst() - .map( aspect -> Try.success( new AspectContext( model, aspect ) ) ) - .orElseGet( () -> Try.failure( new InvalidRootElementCountException( - "Found multiple Aspects in the file " + inputFile.getAbsolutePath() + ", but none is called '" - + expectedAspectName + "': " + aspects.stream().map( Aspect::getName ) - .collect( Collectors.joining( ", " ) ) ) ) ); - } ); - - return context.recover( throwable -> { - // Model can not be loaded, root cause e.g. File not found - if ( throwable instanceof IllegalArgumentException ) { - throw new CommandException( "Can not open file for reading: " + modelFileName, throwable ); - } + protected AspectModel loadAspectModelOrFail( final String modelFileName, final ExternalResolverMixin resolverConfig ) { + return loadAspectModelOrFail( modelFileName, resolverConfig, false ); + } - if ( throwable instanceof ModelResolutionException ) { - throw new CommandException( "Could not resolve all model elements", throwable ); + protected AspectModel loadAspectModelOrFail( final String modelFileName, final ExternalResolverMixin resolverConfig, + final boolean details ) { + final File inputFile = new File( modelFileName ); + final File absoluteFile = inputFile.isAbsolute() + ? inputFile + : Path.of( System.getProperty( "user.dir" ) ).resolve( inputFile.toPath() ).toFile().getAbsoluteFile(); + + final ResolutionStrategy resolveFromWorkspace = new FileSystemStrategy( modelsRootForFile( absoluteFile ) ); + final ResolutionStrategy resolveFromCurrentDirectory = AspectModelLoader.DEFAULT_STRATEGY.get(); + final ResolutionStrategy resolutionStrategy = resolverConfig.commandLine.isBlank() + ? new EitherStrategy( resolveFromWorkspace, resolveFromCurrentDirectory ) + : new ExternalResolverStrategy( resolverConfig.commandLine ); + + final Either, AspectModel> validModelOrViolations = new AspectModelValidator().loadModel( () -> + new AspectModelLoader( resolutionStrategy ).load( absoluteFile ) ); + if ( validModelOrViolations.isLeft() ) { + final List violations = validModelOrViolations.getLeft(); + if ( details ) { + System.out.println( new DetailedViolationFormatter().apply( violations ) ); + } else { + System.out.println( new ViolationFormatter().apply( violations ) ); } - - // Another exception, e.g. syntax error. Let the validator handle this - final List violations = new AspectModelValidator().validateModel( context.map( AspectContext::rdfModel ) ); - System.out.println( new ViolationFormatter().apply( violations ) ); - System.exit( 1 ); return null; - } ).get(); + } + + return validModelOrViolations.get(); + } + + protected Aspect loadAspectOrFail( final String modelFileName, final ExternalResolverMixin resolverConfig ) { + final File inputFile = new File( modelFileName ); + final AspectModel aspectModel = loadAspectModelOrFail( modelFileName, resolverConfig ); + final List aspects = aspectModel.aspects(); + if ( aspects.isEmpty() ) { + throw new CommandException( new ModelResolutionException( "No Aspects were found in the model" ) ); + } + if ( aspects.size() == 1 ) { + return aspectModel.aspect(); + } + final String expectedAspectName = FilenameUtils.removeExtension( inputFile.getName() ); + return aspectModel.aspects().stream() + .filter( aspect -> aspect.getName().equals( expectedAspectName ) ) + .findFirst() + .orElseThrow( () -> new ModelResolutionException( + "Found multiple Aspects in the file " + inputFile.getAbsolutePath() + ", but none is called '" + + expectedAspectName + "': " + aspects.stream().map( Aspect::getName ) + .collect( Collectors.joining( ", " ) ) ) ); } protected void generateDiagram( final String inputFileName, final AspectModelDiagramGenerator.Format targetFormat, final String outputFileName, final String languageTag, final ExternalResolverMixin resolverConfig ) throws IOException { - final AspectContext context = loadModelOrFail( inputFileName, resolverConfig ); - final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( context ); + final Aspect aspect = loadAspectOrFail( inputFileName, resolverConfig ); + final AspectModelDiagramGenerator generator = new AspectModelDiagramGenerator( aspect ); final Set targetFormats = new HashSet<>(); targetFormats.add( targetFormat ); - final Set languagesUsedInModel = LanguageCollector.collectUsedLanguages( context.rdfModel().getModel() ); + final Set languagesUsedInModel = LanguageCollector.collectUsedLanguages( aspect ); if ( !languagesUsedInModel.contains( Locale.forLanguageTag( languageTag ) ) ) { throw new CommandException( String.format( "The model does not contain the desired language: %s.", languageTag ) ); } diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/SammCli.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/SammCli.java index ae16fce4d..01569bcbc 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/SammCli.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/SammCli.java @@ -19,6 +19,7 @@ import org.eclipse.esmf.aas.AasCommand; import org.eclipse.esmf.aspect.AspectCommand; +import org.eclipse.esmf.search.AspectSearchCommand; import org.eclipse.esmf.substitution.IsWindows; import org.fusesource.jansi.AnsiConsole; @@ -43,6 +44,7 @@ public class SammCli extends AbstractCommand { public SammCli() { final CommandLine initialCommandLine = new CommandLine( this ) .addSubcommand( new AspectCommand() ) + .addSubcommand( new AspectSearchCommand() ) .addSubcommand( new AasCommand() ) .setCaseInsensitiveEnumValuesAllowed( true ) .setExecutionStrategy( LoggingMixin::executionStrategy ); diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aas/to/AasToAspectCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aas/to/AasToAspectCommand.java index 47cff24c9..ba6a2070a 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aas/to/AasToAspectCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aas/to/AasToAspectCommand.java @@ -70,7 +70,7 @@ private void generateAspects( final AasToAspectModelGenerator generator ) { for ( final Aspect aspect : filteredAspects ) { final String aspectString = AspectSerializer.INSTANCE.apply( aspect ); - final File targetFile = modelsRoot.determineAspectModelFile( aspect.getAspectModelUrn().get() ); + final File targetFile = modelsRoot.determineAspectModelFile( aspect.urn() ); LOG.info( "Writing {}", targetFile.getAbsolutePath() ); final File directory = targetFile.getParentFile(); if ( !directory.exists() && !directory.mkdirs() ) { diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectCommand.java index 5ef7a0c00..6f4bad010 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectCommand.java @@ -24,9 +24,8 @@ subcommands = { CommandLine.HelpCommand.class, AspectToCommand.class, - AspectMigrateCommand.class, AspectPrettyPrintCommand.class, - AspectValidateCommand.class + AspectValidateCommand.class, }, headerHeading = "@|bold Usage|@:%n%n", descriptionHeading = "%n@|bold Description|@:%n%n", diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectMigrateCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectMigrateCommand.java deleted file mode 100644 index 54436f112..000000000 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectMigrateCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.aspect; - -import static org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.fileToUrn; -import static org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadButNotResolveModel; - -import java.io.File; -import java.io.PrintWriter; - -import org.eclipse.esmf.AbstractCommand; -import org.eclipse.esmf.LoggingMixin; -import org.eclipse.esmf.aspectmodel.serializer.PrettyPrinter; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; - -import picocli.CommandLine; - -@CommandLine.Command( name = AspectMigrateCommand.COMMAND_NAME, - description = "Migrate Aspect Model to latest Meta Model Version", - headerHeading = "@|bold Usage|@:%n%n", - descriptionHeading = "%n@|bold Description|@:%n%n", - parameterListHeading = "%n@|bold Parameters|@:%n", - optionListHeading = "%n@|bold Options|@:%n", - mixinStandardHelpOptions = true -) -public class AspectMigrateCommand extends AbstractCommand { - public static final String COMMAND_NAME = "migrate"; - - @CommandLine.Mixin - private LoggingMixin loggingMixin; - - @CommandLine.Option( names = { "--output", "-o" }, description = "Output file path (default: stdout)" ) - private String outputFilePath = "-"; - - @CommandLine.ParentCommand - private AspectCommand parentCommand; - - @Override - public void run() { - try ( final PrintWriter printWriter = new PrintWriter( getStreamForFile( outputFilePath ) ) ) { - final File inputFile = new File( parentCommand.getInput() ).getAbsoluteFile(); - final AspectModelUrn aspectModelUrn = fileToUrn( inputFile ).get(); - - final MigratorService migratorService = new MigratorService(); - loadButNotResolveModel( inputFile ).flatMap( migratorService::updateMetaModelVersion ) - .forEach( migratedModel -> { - new PrettyPrinter( migratedModel, aspectModelUrn, printWriter ).print(); - printWriter.flush(); - printWriter.close(); - } ); - } - } -} diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectPrettyPrintCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectPrettyPrintCommand.java index ef51ab6f5..4f08f6f06 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectPrettyPrintCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectPrettyPrintCommand.java @@ -13,17 +13,17 @@ package org.eclipse.esmf.aspect; -import static org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.fileToUrn; -import static org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver.loadButNotResolveModel; - import java.io.File; import java.io.PrintWriter; import org.eclipse.esmf.AbstractCommand; +import org.eclipse.esmf.ExternalResolverMixin; import org.eclipse.esmf.LoggingMixin; import org.eclipse.esmf.aspectmodel.serializer.PrettyPrinter; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.exception.CommandException; +import org.eclipse.esmf.metamodel.AspectModel; +import org.apache.commons.io.FilenameUtils; import picocli.CommandLine; @CommandLine.Command( name = AspectPrettyPrintCommand.COMMAND_NAME, @@ -40,6 +40,9 @@ public class AspectPrettyPrintCommand extends AbstractCommand { @CommandLine.Mixin private LoggingMixin loggingMixin; + @CommandLine.Mixin + private ExternalResolverMixin customResolver; + @CommandLine.Option( names = { "--output", "-o" }, description = "Output file path (default: stdout)" ) private String outputFilePath = "-"; @@ -49,14 +52,19 @@ public class AspectPrettyPrintCommand extends AbstractCommand { @Override public void run() { try ( final PrintWriter printWriter = new PrintWriter( getStreamForFile( outputFilePath ) ) ) { - final File file = new File( parentCommand.getInput() ); - final File inputFile = file.getAbsoluteFile(); - final AspectModelUrn aspectModelUrn = fileToUrn( inputFile ).get(); - loadButNotResolveModel( inputFile ).forEach( versionedModel -> { - new PrettyPrinter( versionedModel, aspectModelUrn, printWriter ).print(); - printWriter.flush(); - printWriter.close(); - } ); + final File inputFile = new File( parentCommand.getInput() ).getAbsoluteFile(); + final AspectModel aspectModel = loadAspectModelOrFail( parentCommand.getInput(), customResolver ); + aspectModel.files() + .stream() + .filter( file -> file.sourceLocation().map( sourceLocation -> sourceLocation.equals( inputFile.toURI() ) ).orElse( false ) ) + .forEach( sourceModel -> { + if ( sourceModel.aspects().size() != 1 ) { + throw new CommandException( "Can only pretty-print files that contain exactly one aspect" ); + } + new PrettyPrinter( sourceModel, printWriter ).print(); + printWriter.flush(); + printWriter.close(); + } ); } } } diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectValidateCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectValidateCommand.java index 0f65349f9..1e8fa37ac 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectValidateCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/AspectValidateCommand.java @@ -13,21 +13,18 @@ package org.eclipse.esmf.aspect; -import java.io.File; import java.util.List; import org.eclipse.esmf.AbstractCommand; import org.eclipse.esmf.ExternalResolverMixin; import org.eclipse.esmf.JansiRdfSyntaxHighlighter; import org.eclipse.esmf.LoggingMixin; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.shacl.violation.Violation; import org.eclipse.esmf.aspectmodel.validation.services.AspectModelValidator; import org.eclipse.esmf.aspectmodel.validation.services.DetailedViolationFormatter; -import org.eclipse.esmf.aspectmodel.validation.services.ViolationFormatter; import org.eclipse.esmf.aspectmodel.validation.services.ViolationRustLikeFormatter; +import org.eclipse.esmf.metamodel.AspectModel; -import io.vavr.control.Try; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import picocli.CommandLine; @@ -40,6 +37,7 @@ optionListHeading = "%n@|bold Options|@:%n", mixinStandardHelpOptions = true ) +@SuppressWarnings( "UseOfSystemOutOrSystemErr" ) public class AspectValidateCommand extends AbstractCommand { public static final String COMMAND_NAME = "validate"; private static final Logger LOG = LoggerFactory.getLogger( AspectValidateCommand.class ); @@ -53,23 +51,23 @@ public class AspectValidateCommand extends AbstractCommand { @CommandLine.Mixin private ExternalResolverMixin customResolver; + @SuppressWarnings( "FieldCanBeLocal" ) @CommandLine.Option( names = { "--details", "-d" }, description = "Print detailed reports about violations" ) private boolean details = false; @Override public void run() { - final Try versionedModel = loadAndResolveModel( new File( parentCommand.getInput() ), customResolver ); + final AspectModel aspectModel = loadAspectModelOrFail( parentCommand.getInput(), customResolver, details ); final AspectModelValidator validator = new AspectModelValidator(); - final List violations = validator.validateModel( versionedModel ); + final List violations = validator.validateModel( aspectModel ); if ( details ) { LOG.debug( "Printing detailed validation results" ); System.out.println( new DetailedViolationFormatter().apply( violations ) ); } else { LOG.debug( "Printing regular validation results" ); - final String message = versionedModel.map( model -> - new ViolationRustLikeFormatter( versionedModel.get().getRawModel(), new JansiRdfSyntaxHighlighter() ).apply( - violations ) ).getOrElse( () -> new ViolationFormatter().apply( violations ) ); + final String message = new ViolationRustLikeFormatter( aspectModel.mergedModel(), new JansiRdfSyntaxHighlighter() ).apply( + violations ); System.out.println( message ); } diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAasCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAasCommand.java index dfce41cc7..873c2574d 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAasCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAasCommand.java @@ -80,7 +80,7 @@ private JsonNode loadAspectData() { @Override public void run() { - final Aspect aspect = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ).aspect(); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); final JsonNode loadedAspectData = loadAspectData(); // we intentionally override the name of the generated artifact here to the name explicitly // desired by the user (outputFilePath), as opposed to what the model thinks it should be diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAsyncapiCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAsyncapiCommand.java index 8db28d755..77c36606b 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAsyncapiCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAsyncapiCommand.java @@ -34,7 +34,6 @@ import org.eclipse.esmf.exception.CommandException; import org.eclipse.esmf.metamodel.Aspect; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; @@ -96,7 +95,7 @@ public class AspectToAsyncapiCommand extends AbstractCommand { public void run() { final Locale locale = Optional.ofNullable( language ).map( Locale::forLanguageTag ).orElse( Locale.ENGLISH ); final AspectModelAsyncApiGenerator generator = new AspectModelAsyncApiGenerator(); - final Aspect aspect = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ).aspect(); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); final AsyncApiSchemaGenerationConfig config = AsyncApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( useSemanticApiVersion ) .applicationId( applicationId ) diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToHtmlCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToHtmlCommand.java index ea77c429f..a879d9506 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToHtmlCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToHtmlCommand.java @@ -24,7 +24,7 @@ import org.eclipse.esmf.aspect.AspectToCommand; import org.eclipse.esmf.aspectmodel.generator.docu.AspectModelDocumentationGenerator; import org.eclipse.esmf.exception.CommandException; -import org.eclipse.esmf.metamodel.AspectContext; +import org.eclipse.esmf.metamodel.Aspect; import org.apache.commons.io.FileUtils; import picocli.CommandLine; @@ -62,8 +62,8 @@ public class AspectToHtmlCommand extends AbstractCommand { @Override public void run() { try { - final AspectContext context = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ); - final AspectModelDocumentationGenerator generator = new AspectModelDocumentationGenerator( context ); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); + final AspectModelDocumentationGenerator generator = new AspectModelDocumentationGenerator( aspect ); final Map generationArgs = new HashMap<>(); generationArgs.put( AspectModelDocumentationGenerator.HtmlGenerationOption.STYLESHEET, "" ); if ( customCssFile != null ) { diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJavaCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJavaCommand.java index 5c8036692..66053ce63 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJavaCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJavaCommand.java @@ -26,10 +26,7 @@ import org.eclipse.esmf.aspectmodel.java.JavaGenerator; import org.eclipse.esmf.aspectmodel.java.metamodel.StaticMetaModelJavaGenerator; import org.eclipse.esmf.aspectmodel.java.pojo.AspectModelJavaGenerator; -import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; -import org.eclipse.esmf.exception.CommandException; import org.eclipse.esmf.metamodel.Aspect; -import org.eclipse.esmf.metamodel.AspectContext; import picocli.CommandLine; @@ -75,10 +72,10 @@ public class AspectToJavaCommand extends AbstractCommand { @Override public void run() { - final AspectContext context = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); final JavaGenerator javaGenerator = generateStaticMetaModelJavaClasses - ? getStaticModelGenerator( context ) - : getModelGenerator( context ); + ? getStaticModelGenerator( aspect ) + : getModelGenerator( aspect ); javaGenerator.generate( artifact -> { final String path = artifact.getPackageName(); final String fileName = artifact.getClassName(); @@ -90,8 +87,7 @@ private JavaCodeGenerationConfig buildConfig( final Aspect aspect ) { final File templateLibFile = Path.of( templateLib ).toFile(); final String pkgName = Optional.ofNullable( packageName ) .flatMap( pkg -> pkg.isBlank() ? Optional.empty() : Optional.of( pkg ) ) - .or( () -> aspect.getAspectModelUrn().map( AspectModelUrn::getNamespace ) ) - .orElseThrow( () -> new CommandException( "Could not determine Aspect's namespace" ) ); + .orElseGet( () -> aspect.urn().getNamespace() ); return JavaCodeGenerationConfigBuilder.builder() .executeLibraryMacros( executeLibraryMacros ) .templateLibFile( templateLibFile ) @@ -100,11 +96,11 @@ private JavaCodeGenerationConfig buildConfig( final Aspect aspect ) { .build(); } - private JavaGenerator getStaticModelGenerator( final AspectContext context ) { - return new StaticMetaModelJavaGenerator( context.aspect(), buildConfig( context.aspect() ) ); + private JavaGenerator getStaticModelGenerator( final Aspect aspect ) { + return new StaticMetaModelJavaGenerator( aspect, buildConfig( aspect ) ); } - private JavaGenerator getModelGenerator( final AspectContext context ) { - return new AspectModelJavaGenerator( context.aspect(), buildConfig( context.aspect() ) ); + private JavaGenerator getModelGenerator( final Aspect aspect ) { + return new AspectModelJavaGenerator( aspect, buildConfig( aspect ) ); } } diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonCommand.java index cb68676ae..753fce7ab 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonCommand.java @@ -49,7 +49,7 @@ public class AspectToJsonCommand extends AbstractCommand { @Override public void run() { final AspectModelJsonPayloadGenerator generator = new AspectModelJsonPayloadGenerator( - loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ) ); + loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ) ); try { // we intentionally override the name of the generated artifact here to the name explicitly desired by the user (outputFilePath), // as opposed to what the model thinks it should be called (name) diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonSchemaCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonSchemaCommand.java index 582ba3bef..950447546 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonSchemaCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToJsonSchemaCommand.java @@ -59,7 +59,7 @@ public class AspectToJsonSchemaCommand extends AbstractCommand { @Override public void run() { - final Aspect aspect = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ).aspect(); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); final Locale locale = Optional.ofNullable( language ).map( Locale::forLanguageTag ).orElse( Locale.ENGLISH ); final JsonSchemaGenerationConfig config = JsonSchemaGenerationConfigBuilder.builder() .locale( locale ) diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToOpenapiCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToOpenapiCommand.java index 7f76c8f43..6481b985e 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToOpenapiCommand.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToOpenapiCommand.java @@ -156,7 +156,7 @@ public class AspectToOpenapiCommand extends AbstractCommand { public void run() { final Locale locale = Optional.ofNullable( language ).map( Locale::forLanguageTag ).orElse( Locale.ENGLISH ); final AspectModelOpenApiGenerator generator = new AspectModelOpenApiGenerator(); - final Aspect aspect = loadModelOrFail( parentCommand.parentCommand.getInput(), customResolver ).aspect(); + final Aspect aspect = loadAspectOrFail( parentCommand.parentCommand.getInput(), customResolver ); final ObjectMapper objectMapper = new ObjectMapper(); final OpenApiSchemaGenerationConfig config = OpenApiSchemaGenerationConfigBuilder.builder() .useSemanticVersion( useSemanticApiVersion ) diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/search/AspectSearchCommand.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/search/AspectSearchCommand.java new file mode 100644 index 000000000..1a4c317c7 --- /dev/null +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/search/AspectSearchCommand.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH + * + * See the AUTHORS file(s) distributed with this work for additional + * information regarding authorship. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +package org.eclipse.esmf.search; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import org.eclipse.esmf.AbstractCommand; +import org.eclipse.esmf.ExternalResolverMixin; +import org.eclipse.esmf.LoggingMixin; +import org.eclipse.esmf.aspectmodel.AspectModelFile; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; +import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; +import org.eclipse.esmf.metamodel.AspectModel; +import org.eclipse.esmf.metamodel.ModelElement; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import picocli.CommandLine; + +@CommandLine.Command( name = AspectSearchCommand.COMMAND_NAME, + description = "Search separate Properties files used by Aspect Model", + headerHeading = "@|bold Usage|@:%n%n", + descriptionHeading = "%n@|bold Description|@:%n%n", + parameterListHeading = "%n@|bold Parameters|@:%n", + optionListHeading = "%n@|bold Options|@:%n", + mixinStandardHelpOptions = true +) +public class AspectSearchCommand extends AbstractCommand { + public static final String COMMAND_NAME = "search"; + + private static final Logger LOG = LoggerFactory.getLogger( AspectSearchCommand.class ); + + @CommandLine.Mixin + private LoggingMixin loggingMixin; + + @CommandLine.Mixin + private ExternalResolverMixin customResolver; + + @CommandLine.Parameters( paramLabel = "INPUT", description = "Input file name of the Aspect Model .ttl file", arity = "1", index = "0" ) + private String input; + + @CommandLine.Option( names = { "--models-path", "-msp" }, description = "Path to Models, where have to search" ) + private String pathToModels = "-"; + + public String getInput() { + return input; + } + + @Override + public void run() { + final AspectModel aspectModel = loadAspectModelOrFail( input, customResolver ); + + final Path directory = Paths.get( pathToModels ); + final List files = Arrays.stream( Optional.ofNullable( directory.toFile().listFiles() ).orElse( new File[] {} ) ) + .filter( file -> file.isFile() && file.getName().endsWith( ".ttl" ) && !file.getName() + .equals( Paths.get( input ).getFileName().toString() ) ) + .sorted() + .toList(); + + if ( files.isEmpty() ) { + LOG.info( "No .ttl files found in the directory '{}'", directory ); + return; + } + + final List modelUrns = aspectModel.elements().stream().map( ModelElement::urn ).toList(); + + String header = String.format( "| %-60s | %-100s | %-50s | %-60s |", + "URN of the element", "File location", "Model source", "Target element that it is referring to" ); + String separator = new String( new char[header.length()] ).replace( "\0", "-" ); + + // Print Table header + System.out.println( separator ); + System.out.println( header ); + System.out.println( separator ); + + final AspectModelLoader aspectModelLoader = new AspectModelLoader(); + + for ( final File file : files ) { + processFile( file, modelUrns, aspectModelLoader ); + } + } + + private void processFile( File file, List modelUrns, AspectModelLoader aspectModelLoader ) { + final AspectModel aspectModel = loadAspectModelOrFail( file.getPath(), customResolver ); + + for ( final AspectModelUrn modelUrn : modelUrns ) { + final List modelFiles = aspectModel.files(); + for ( final AspectModelFile modelFile : modelFiles ) { + if ( aspectModelLoader.containsDefinition( modelFile, modelUrn ) ) { + System.out.printf( "| %-60s | %-100s | %-50s | %-60s |%n", modelUrn, file.getPath(), file.getName(), "" ); + } + } + } + } +} diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_eclipse_esmf_aspectmodel_versionupdate_MigratorServiceLoader.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_eclipse_esmf_aspectmodel_versionupdate_MigratorServiceLoader.java deleted file mode 100644 index c83cf403c..000000000 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_eclipse_esmf_aspectmodel_versionupdate_MigratorServiceLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH - * - * See the AUTHORS file(s) distributed with this work for additional - * information regarding authorship. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - * - * SPDX-License-Identifier: MPL-2.0 - */ - -package org.eclipse.esmf.substitution; - -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorService; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorServiceLoader; - -import com.oracle.svm.core.annotate.Alias; -import com.oracle.svm.core.annotate.Substitute; -import com.oracle.svm.core.annotate.TargetClass; - -/** - * This is a GraalVM substitution class - * for {@link MigratorServiceLoader}. - * Reason: The original class uses the classgraph library, which does runtime classpath scanning. This is not supported as such - * in GraalVM. If in the future a known MigratorFactory should be supported by the CLI, this can be added in the substitution method. - */ -@TargetClass( MigratorServiceLoader.class ) -@SuppressWarnings( { - "unused", - "squid:S00101", // Class name uses GraalVM substitution class naming schema, see - // https://github.com/oracle/graal/tree/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk - "checkstyle:TypeName" -} ) -public final class Target_org_eclipse_esmf_aspectmodel_versionupdate_MigratorServiceLoader { - @Alias - private MigratorService migratorService; - - private Target_org_eclipse_esmf_aspectmodel_versionupdate_MigratorServiceLoader() { - } - - @Substitute - private void loadMigratorService() { - migratorService = new MigratorService(); - } -} diff --git a/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_slf4j_LoggerFactory.java b/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_slf4j_LoggerFactory.java index c211451c2..158d75e9a 100644 --- a/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_slf4j_LoggerFactory.java +++ b/tools/samm-cli/src/main/java/org/eclipse/esmf/substitution/Target_org_slf4j_LoggerFactory.java @@ -15,8 +15,6 @@ import java.util.List; -import org.eclipse.esmf.aspectmodel.versionupdate.MigratorServiceLoader; - import com.oracle.svm.core.annotate.Substitute; import com.oracle.svm.core.annotate.TargetClass; import org.slf4j.LoggerFactory; @@ -24,7 +22,7 @@ /** * This is a GraalVM substitution class - * for {@link MigratorServiceLoader}. + * for {@link LoggerFactory}. * Reason: The logger factory displays false positive logger configuration errors (only in native image setup), this silences it. */ @SuppressWarnings( { diff --git a/tools/samm-cli/src/test/java/org/eclipse/esmf/DelegatingCommandResolver.java b/tools/samm-cli/src/test/java/org/eclipse/esmf/DelegatingCommandResolver.java index 0ccf66322..39a0d39e1 100644 --- a/tools/samm-cli/src/test/java/org/eclipse/esmf/DelegatingCommandResolver.java +++ b/tools/samm-cli/src/test/java/org/eclipse/esmf/DelegatingCommandResolver.java @@ -17,12 +17,10 @@ import java.nio.file.Path; import java.nio.file.Paths; -import org.eclipse.esmf.aspectmodel.resolver.AspectModelResolver; +import org.eclipse.esmf.aspectmodel.loader.AspectModelLoader; import org.eclipse.esmf.aspectmodel.resolver.FileSystemStrategy; -import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel; import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn; - -import io.vavr.control.Try; +import org.eclipse.esmf.metamodel.AspectModel; /** * Utility class to help test custom model resolution mechanism. It simply wraps the FileSystemStrategy, delegates the resolution to it, @@ -31,9 +29,9 @@ public class DelegatingCommandResolver { public static void main( final String[] args ) throws URISyntaxException { final Path target = Paths.get( DelegatingCommandResolver.class.getResource( "/" ).toURI() ).getParent(); - final Path modelsRoot = Paths.get( target.toString(), "classes", "valid", args[0] ); - final AspectModelUrn urn = AspectModelUrn.fromUrn( args[1] ); - final Try resolution = new AspectModelResolver().resolveAspectModel( new FileSystemStrategy( modelsRoot ), urn ); - resolution.get().getModel().write( System.out ); + final Path modelsRoot = Paths.get( target.toString(), "classes", "valid" ); + final AspectModelUrn urn = AspectModelUrn.fromUrn( args[0] ); + final AspectModel aspectModel = new AspectModelLoader( new FileSystemStrategy( modelsRoot ) ).load( urn ); + aspectModel.mergedModel().write( System.out ); } } diff --git a/tools/samm-cli/src/test/java/org/eclipse/esmf/SammCliTest.java b/tools/samm-cli/src/test/java/org/eclipse/esmf/SammCliTest.java index ce8ed1cf9..2a9e88fc3 100644 --- a/tools/samm-cli/src/test/java/org/eclipse/esmf/SammCliTest.java +++ b/tools/samm-cli/src/test/java/org/eclipse/esmf/SammCliTest.java @@ -36,7 +36,6 @@ import org.eclipse.esmf.aspectmodel.shacl.violation.InvalidSyntaxViolation; import org.eclipse.esmf.samm.KnownVersion; import org.eclipse.esmf.test.InvalidTestAspect; -import org.eclipse.esmf.test.MetaModelVersions; import org.eclipse.esmf.test.TestAspect; import org.eclipse.esmf.test.TestModel; @@ -61,7 +60,7 @@ */ @ExtendWith( LogExtension.class ) @TestInstance( TestInstance.Lifecycle.PER_CLASS ) -class SammCliTest extends MetaModelVersions { +class SammCliTest { protected ProcessLauncher sammCli; private final TestModel testModel = TestAspect.ASPECT_WITH_ENTITY; private final String defaultInputFile = inputFile( testModel ).getAbsolutePath(); @@ -132,24 +131,6 @@ void testVerboseOutput() { assertThat( result.stderr() ).contains( "DEBUG " + AspectValidateCommand.class.getName() ); } - @Test - void testAspectMigrateToFile() { - final File targetFile = outputFile( "output.ttl" ); - final ExecutionResult result = - sammCli.runAndExpectSuccess( "--disable-color", "aspect", defaultInputFile, "migrate", "-o", targetFile.getAbsolutePath() ); - assertThat( result.stdout() ).isEmpty(); - assertThat( result.stderr() ).isEmpty(); - assertThat( targetFile ).exists(); - assertThat( targetFile ).content().contains( "@prefix" ); - } - - @Test - void testAspectMigrateToStdout() { - final ExecutionResult result = sammCli.runAndExpectSuccess( "--disable-color", "aspect", defaultInputFile, "migrate" ); - assertThat( result.stdout() ).contains( "@prefix" ); - assertThat( result.stderr() ).isEmpty(); - } - @Test void testAspectPrettyPrintToFile() { final File targetFile = outputFile( "output.ttl" ); @@ -1071,12 +1052,10 @@ void testAspectToSqlWithCustomColumnToStdout() { * Returns the File object for a test model file */ private File inputFile( final TestModel testModel ) { - final KnownVersion metaModelVersion = KnownVersion.getLatest(); final boolean isValid = !(testModel instanceof InvalidTestAspect); final String resourcePath = String.format( - "%s/../../core/esmf-test-aspect-models/src/main/resources/%s/%s/org.eclipse.esmf.test/1.0.0/%s.ttl", - System.getProperty( "user.dir" ), isValid ? "valid" : "invalid", metaModelVersion.toString().toLowerCase(), - testModel.getName() ); + "%s/../../core/esmf-test-aspect-models/src/main/resources/%s/org.eclipse.esmf.test/1.0.0/%s.ttl", + System.getProperty( "user.dir" ), isValid ? "valid" : "invalid", testModel.getName() ); try { return new File( resourcePath ).getCanonicalFile(); diff --git a/tools/samm-cli/src/test/java/org/eclipse/esmf/TestCommandExecutor.java b/tools/samm-cli/src/test/java/org/eclipse/esmf/TestCommandExecutor.java index 245084cbd..f08ad6223 100644 --- a/tools/samm-cli/src/test/java/org/eclipse/esmf/TestCommandExecutor.java +++ b/tools/samm-cli/src/test/java/org/eclipse/esmf/TestCommandExecutor.java @@ -58,7 +58,7 @@ void testJavaExecution() throws IOException, URISyntaxException { @Test void resolve() throws URISyntaxException { - DelegatingCommandResolver.main( new String[] { "samm_2_0_0", "urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEntity" } ); + DelegatingCommandResolver.main( new String[] { "urn:samm:org.eclipse.esmf.test:1.0.0#AspectWithEntity" } ); } @EnabledOnOs( OS.LINUX )