Skip to content

Commit c912678

Browse files
authored
Merge pull request #348 from bci-oss/347-remove-usage-of-samm-open
Remove usage of samm-c:OPEN
2 parents 6e36681 + 87acaf6 commit c912678

File tree

32 files changed

+92
-95
lines changed

32 files changed

+92
-95
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ This repository contains a detailed developer documentation written in AsciiDoc.
4545

4646
Are you having trouble with ESMF SDK? We want to help!
4747

48-
* Check the [ESMF SDK developer documentation](https://openmanufacturingplatform.github.io/sds-documentation/sds-developer-guide/index.html)
48+
* Check the [ESMF SDK developer documentation](https://eclipse-esmf.github.io/esmf-developer-guide/index.html)
4949
* Ask a question the [community forum](https://www.eclipse.org/forums/index.php/f/617/).
50-
* Check the SAMM [specification](https://openmanufacturingplatform.github.io/sds-documentation/bamm-specification/snapshot/index.html)
50+
* Check the SAMM [specification](https://eclipse-esmf.github.io/samm-specification/snapshot/index.html)
5151
* Having issues with the ESMF SDK? Open a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk/issues).
5252

5353
## Build and contribute
@@ -235,7 +235,7 @@ GitHub](https://github.com/eclipse-esmf/esmf-sdk/releases).
235235

236236
For information regarding running the command line tool, the available commands and their
237237
description, please have a look at the
238-
[documentation](https://openmanufacturingplatform.github.io/sds-documentation/sds-developer-guide/tooling-guide/bamm-cli.html).
238+
[documentation](https://eclipse-esmf.github.io/esmf-developer-guide/tooling-guide/samm-cli.html).
239239

240240
## License
241241

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/metamodel/Property.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ default boolean isOptional() {
5353
* By default Properties are included in the runtime data.
5454
*
5555
* @see
56-
* <a href="https://openmanufacturingplatform.github.io/sds-bamm-aspect-meta-model/bamm-specification/snapshot/modeling-guidelines.html#declaring-enumerations">BAMM Aspect Meta Model
56+
* <a href="https://eclipse-esmf.github.io/samm-specification/2.0.0/modeling-guidelines.html#declaring-enumerations">Semantic Aspect Meta Model
5757
* Specification - Declaring Enumerations</a>
5858
* @since SAMM 1.0.0
5959
*/

core/esmf-aspect-model-aas-generator/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ proper entry point. It expects an `org.eclipse.esmf.metamodel.Aspect` and return
3030

3131

3232
## Details of the Mapping Concept
33-
The mapping rules applied by the generator are explained in the [user documentation](https://openmanufacturingplatform.github.io/sds-documentation/sds-developer-guide/tooling-guide/java-aspect-tooling.html#details-mapping-aas).
34-
The rules apply to SAMM v1.0.0 [6] and AAS Specification Part 1 V3.0RC01 [7].
33+
The mapping rules applied by the generator are explained in the [user documentation](https://eclipse-esmf.github.io/esmf-developer-guide/tooling-guide/java-aspect-tooling.html#mapping-aas).
34+
The rules apply to SAMM v2.0.0 [5] and AAS Specification Part 1 V3.0RC01 [6].
3535

3636

3737
## References
@@ -43,8 +43,6 @@ The rules apply to SAMM v1.0.0 [6] and AAS Specification Part 1 V3.0RC01 [7].
4343

4444
[4] https://github.com/admin-shell-io/java-serializer
4545

46-
[5] https://openmanufacturingplatform.github.io/sds-documentation/bamm-specification/v1.0.0/characteristics.html
46+
[5] https://eclipse-esmf.github.io/samm-specification/2.0.0/index.html
4747

48-
[6] https://openmanufacturingplatform.github.io/sds-documentation/bamm-specification/v1.0.0/index.html
49-
50-
[7] https://www.plattform-i40.de/IP/Redaktion/EN/Downloads/Publikation/Details_of_the_Asset_Administration_Shell_Part1_V3.html
48+
[6] https://www.plattform-i40.de/IP/Redaktion/EN/Downloads/Publikation/Details_of_the_Asset_Administration_Shell_Part1_V3.html

core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ public AssetAdministrationShellEnvironment visitSingleEntity( final SingleEntity
607607

608608
@Override
609609
public AssetAdministrationShellEnvironment visitStructuredValue( final StructuredValue structuredValue, final Context context ) {
610-
// https://openmanufacturingplatform.github.io/sds-documentation/bamm-specification/v1.0.0/modeling-guidelines.html#declaring-structured-value
610+
// https://eclipse-esmf.github.io/samm-specification/2.0.0/modeling-guidelines.html#declaring-structured-value
611611
// AAS cannot handle structuredValues, so we can handle them as ordinary Characteristics
612612
return visitCharacteristic( structuredValue, context );
613613
}

core/esmf-aspect-model-document-generators/src/main/resources/diagram/samm_1_0_0/constraint2boxmodel.sparql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,22 @@ construct {
218218
bind( "AT_MOST" as ?upperBoundDefinitionValue )
219219
}
220220

221+
# no lowerBoundDefinition exists (RangeConstraint)
222+
optional {
223+
?constraint a samm-c:RangeConstraint .
224+
filter( not exists { ?constraint samm-c:minValue [] } )
225+
filter( not exists { ?constraint samm-c:lowerBoundDefinition [] } )
226+
bind( "OPEN" as ?lowerBoundDefinitionValue )
227+
}
228+
229+
# no upperBoundDefinition exists (RangeConstraint)
230+
optional {
231+
?constraint a samm-c:RangeConstraint .
232+
filter( not exists { ?constraint samm-c:maxValue [] } )
233+
filter( not exists { ?constraint samm-c:upperBoundDefinition [] } )
234+
bind( "OPEN" as ?upperBoundDefinitionValue )
235+
}
236+
221237
# scale and integer (FixedPoint Constraint)
222238
optional {
223239
?constraint a samm-c:FixedPointConstraint .

core/esmf-aspect-model-document-generators/src/main/resources/diagram/samm_2_0_0/constraint2boxmodel.sparql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ construct {
188188
bind( "AT_MOST" as ?upperBoundDefinitionValue )
189189
}
190190

191+
# no lowerBoundDefinition exists (RangeConstraint)
192+
optional {
193+
?constraint a samm-c:RangeConstraint .
194+
filter( not exists { ?constraint samm-c:minValue [] } )
195+
filter( not exists { ?constraint samm-c:lowerBoundDefinition [] } )
196+
bind( "OPEN" as ?lowerBoundDefinitionValue )
197+
}
198+
199+
# no upperBoundDefinition exists (RangeConstraint)
200+
optional {
201+
?constraint a samm-c:RangeConstraint .
202+
filter( not exists { ?constraint samm-c:maxValue [] } )
203+
filter( not exists { ?constraint samm-c:upperBoundDefinition [] } )
204+
bind( "OPEN" as ?upperBoundDefinitionValue )
205+
}
206+
191207
# scale and integer (FixedPoint Constraint)
192208
optional {
193209
?constraint a samm-c:FixedPointConstraint .

core/esmf-aspect-model-document-generators/src/main/resources/docu/templates/html/characteristic-documentation-lib.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#if( !$characteristic.getDataType().get().is( $Scalar ) )
3939
<a href="#$aspectModelHelper.getNameFromURN( $characteristic.getDataType().get().getUrn() )-entity"
4040
#else
41-
<a href="https://openmanufacturingplatform.github.io/sds-SAMM-aspect-meta-model/SAMM-specification/v$aspectModelHelper.getMetaModelVersion().toString()/datatypes.html" target="_blank"
41+
<a href="https://eclipse-esmf.github.io/samm-specification/$aspectModelHelper.getMetaModelVersion().toString()/datatypes.html" target="_blank"
4242
#end
4343
class="break-all underline">$characteristic.getDataType().get().getUrn()</a>
4444
#end

core/esmf-aspect-model-document-generators/src/test/java/org/eclipse/esmf/aspectmodel/generator/diagram/RangeConstraint2BoxModelTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sparqlQueryFileName, boxSelectorStatement( metaModelVersion, constraintIdentifie
5858
@ParameterizedTest
5959
@MethodSource( value = "allVersions" )
6060
public void testRangeConstraintWithOnlyMinValue( final KnownVersion metaModelVersion ) {
61-
final String constraintIdentifier = "RangeConstraint45aa6b0";
61+
final String constraintIdentifier = "RangeConstraint65abcea";
6262
final TestContext context = new TestContext( TestAspect.ASPECT_WITH_RANGE_CONSTRAINT_WITH_ONLY_MIN_VALUE, metaModelVersion );
6363
context.executeAttributeIsPresentTest( sparqlQueryFileName, boxSelectorStatement( metaModelVersion, constraintIdentifier, true ),
6464
entriesSelectorStatement( metaModelVersion, constraintIdentifier, true ), totalNumberOfExpectedEntriesPerMetaModelVersion.get( metaModelVersion ),

core/esmf-aspect-model-serializer/src/main/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitor.java

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,58 +37,58 @@
3737
import org.apache.jena.rdf.model.Statement;
3838
import org.apache.jena.vocabulary.RDF;
3939
import org.apache.jena.vocabulary.XSD;
40-
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
41-
42-
import org.eclipse.esmf.aspectmodel.vocabulary.SAMM;
43-
import org.eclipse.esmf.samm.KnownVersion;
4440
import org.eclipse.esmf.aspectmodel.resolver.exceptions.InvalidModelException;
4541
import org.eclipse.esmf.aspectmodel.resolver.services.DataType;
4642
import org.eclipse.esmf.aspectmodel.resolver.services.ExtendedXsdDataType;
43+
import org.eclipse.esmf.aspectmodel.urn.AspectModelUrn;
44+
import org.eclipse.esmf.aspectmodel.vocabulary.Namespace;
45+
import org.eclipse.esmf.aspectmodel.vocabulary.SAMM;
4746
import org.eclipse.esmf.aspectmodel.vocabulary.SAMMC;
4847
import org.eclipse.esmf.aspectmodel.vocabulary.SAMME;
49-
import org.eclipse.esmf.aspectmodel.vocabulary.Namespace;
5048
import org.eclipse.esmf.aspectmodel.vocabulary.UNIT;
49+
import org.eclipse.esmf.characteristic.Code;
50+
import org.eclipse.esmf.characteristic.Collection;
51+
import org.eclipse.esmf.characteristic.Duration;
52+
import org.eclipse.esmf.characteristic.Either;
53+
import org.eclipse.esmf.characteristic.Enumeration;
54+
import org.eclipse.esmf.characteristic.Measurement;
55+
import org.eclipse.esmf.characteristic.Quantifiable;
56+
import org.eclipse.esmf.characteristic.Set;
57+
import org.eclipse.esmf.characteristic.SingleEntity;
58+
import org.eclipse.esmf.characteristic.SortedSet;
59+
import org.eclipse.esmf.characteristic.State;
60+
import org.eclipse.esmf.characteristic.StructuredValue;
61+
import org.eclipse.esmf.characteristic.TimeSeries;
62+
import org.eclipse.esmf.characteristic.Trait;
63+
import org.eclipse.esmf.constraint.EncodingConstraint;
64+
import org.eclipse.esmf.constraint.FixedPointConstraint;
65+
import org.eclipse.esmf.constraint.LanguageConstraint;
66+
import org.eclipse.esmf.constraint.LengthConstraint;
67+
import org.eclipse.esmf.constraint.LocaleConstraint;
68+
import org.eclipse.esmf.constraint.RangeConstraint;
69+
import org.eclipse.esmf.constraint.RegularExpressionConstraint;
5170
import org.eclipse.esmf.metamodel.AbstractEntity;
5271
import org.eclipse.esmf.metamodel.Aspect;
53-
import org.eclipse.esmf.metamodel.ModelElement;
5472
import org.eclipse.esmf.metamodel.Characteristic;
55-
import org.eclipse.esmf.characteristic.Code;
56-
import org.eclipse.esmf.characteristic.Collection;
5773
import org.eclipse.esmf.metamodel.CollectionValue;
5874
import org.eclipse.esmf.metamodel.ComplexType;
5975
import org.eclipse.esmf.metamodel.Constraint;
60-
import org.eclipse.esmf.characteristic.Duration;
61-
import org.eclipse.esmf.characteristic.Either;
62-
import org.eclipse.esmf.constraint.EncodingConstraint;
6376
import org.eclipse.esmf.metamodel.EntityInstance;
64-
import org.eclipse.esmf.characteristic.Enumeration;
6577
import org.eclipse.esmf.metamodel.Event;
66-
import org.eclipse.esmf.constraint.FixedPointConstraint;
6778
import org.eclipse.esmf.metamodel.HasProperties;
79+
import org.eclipse.esmf.metamodel.ModelElement;
6880
import org.eclipse.esmf.metamodel.NamedElement;
69-
import org.eclipse.esmf.constraint.LanguageConstraint;
70-
import org.eclipse.esmf.constraint.LengthConstraint;
71-
import org.eclipse.esmf.constraint.LocaleConstraint;
72-
import org.eclipse.esmf.characteristic.Measurement;
7381
import org.eclipse.esmf.metamodel.Operation;
7482
import org.eclipse.esmf.metamodel.Property;
75-
import org.eclipse.esmf.characteristic.Quantifiable;
7683
import org.eclipse.esmf.metamodel.QuantityKind;
77-
import org.eclipse.esmf.constraint.RangeConstraint;
78-
import org.eclipse.esmf.constraint.RegularExpressionConstraint;
7984
import org.eclipse.esmf.metamodel.Scalar;
8085
import org.eclipse.esmf.metamodel.ScalarValue;
81-
import org.eclipse.esmf.characteristic.Set;
82-
import org.eclipse.esmf.characteristic.SingleEntity;
83-
import org.eclipse.esmf.characteristic.SortedSet;
84-
import org.eclipse.esmf.characteristic.State;
85-
import org.eclipse.esmf.characteristic.StructuredValue;
86-
import org.eclipse.esmf.characteristic.TimeSeries;
87-
import org.eclipse.esmf.characteristic.Trait;
8886
import org.eclipse.esmf.metamodel.Type;
8987
import org.eclipse.esmf.metamodel.Unit;
9088
import org.eclipse.esmf.metamodel.datatypes.LangString;
89+
import org.eclipse.esmf.metamodel.impl.BoundDefinition;
9190
import org.eclipse.esmf.metamodel.visitor.AspectVisitor;
91+
import org.eclipse.esmf.samm.KnownVersion;
9292

9393
/**
9494
* AspectVisitor that translates an {@link Aspect} into the corresponding {@link Model}.
@@ -175,7 +175,8 @@ private Model serializeDescriptions( final Resource elementResource, final Named
175175

176176
@SuppressWarnings( "squid:S2250" )
177177
// Amount of elements in list is regarding amount of properties in Aspect Model. Even in bigger aspects this should not lead to performance issues
178-
private Model serializePropertiesOrParameters( final Resource elementResource, final HasProperties element, final org.apache.jena.rdf.model.Property theProperty ) {
178+
private Model serializePropertiesOrParameters( final Resource elementResource, final HasProperties element,
179+
final org.apache.jena.rdf.model.Property theProperty ) {
179180
final Model model = ModelFactory.createDefaultModel();
180181
final List<RDFNode> propertiesList = new ArrayList<>();
181182
if ( resourceList.contains( elementResource ) ) {
@@ -388,10 +389,14 @@ public ElementModel visitRangeConstraint( final RangeConstraint rangeConstraint,
388389
.flatMap( maxValue -> maxValue.accept( this, rangeConstraint ).getFocusElement().stream() )
389390
.map( literal -> createStatement( resource, sammc.maxValue(), literal ) )
390391
.forEach( model::add );
391-
model.add( resource, sammc.lowerBoundDefinition(),
392-
sammc.resource( rangeConstraint.getLowerBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) );
393-
model.add( resource, sammc.upperBoundDefinition(),
394-
sammc.resource( rangeConstraint.getUpperBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) );
392+
if ( rangeConstraint.getLowerBoundDefinition() != BoundDefinition.OPEN ) {
393+
model.add( resource, sammc.lowerBoundDefinition(),
394+
sammc.resource( rangeConstraint.getLowerBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) );
395+
}
396+
if ( rangeConstraint.getUpperBoundDefinition() != BoundDefinition.OPEN ) {
397+
model.add( resource, sammc.upperBoundDefinition(),
398+
sammc.resource( rangeConstraint.getUpperBoundDefinition().toString().replace( " ", "_" ).toUpperCase() ) );
399+
}
395400
return new ElementModel( model, Optional.of( resource ) );
396401
}
397402

core/esmf-aspect-model-serializer/src/test/java/org/eclipse/esmf/aspectmodel/serializer/RdfModelCreatorVisitorTest.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@
2222

2323
import org.apache.jena.rdf.model.Model;
2424
import org.eclipse.esmf.aspectmodel.resolver.services.VersionedModel;
25-
import org.junit.jupiter.params.ParameterizedTest;
26-
import org.junit.jupiter.params.provider.EnumSource;
27-
28-
import org.eclipse.esmf.samm.KnownVersion;
29-
3025
import org.eclipse.esmf.aspectmodel.vocabulary.Namespace;
3126
import org.eclipse.esmf.metamodel.Aspect;
3227
import org.eclipse.esmf.metamodel.loader.AspectModelLoader;
28+
import org.eclipse.esmf.samm.KnownVersion;
3329
import org.eclipse.esmf.test.MetaModelVersions;
3430
import org.eclipse.esmf.test.TestAspect;
3531
import org.eclipse.esmf.test.TestModel;
3632
import org.eclipse.esmf.test.TestResources;
33+
import org.junit.jupiter.params.ParameterizedTest;
34+
import org.junit.jupiter.params.provider.EnumSource;
35+
3736
import io.vavr.control.Try;
3837

3938
public class RdfModelCreatorVisitorTest extends MetaModelVersions {
@@ -64,11 +63,8 @@ public class RdfModelCreatorVisitorTest extends MetaModelVersions {
6463
"MODEL_WITH_BROKEN_CYCLES",
6564
"MODEL_WITH_BLANK_AND_ADDITIONAL_NODES"
6665
} )
67-
public void testRdfModelCreatorVisitor( final TestAspect aspect ) {
68-
testRdfCreation( aspect, KnownVersion.getLatest() );
69-
}
70-
71-
private void testRdfCreation( final TestAspect testAspect, final KnownVersion knownVersion ) {
66+
public void testRdfModelCreatorVisitor( final TestAspect testAspect ) {
67+
final KnownVersion knownVersion = KnownVersion.getLatest();
7268
final VersionedModel versionedModel = TestResources.getModel( testAspect, knownVersion ).get();
7369

7470
final Try<Aspect> tryAspect = AspectModelLoader.getSingleAspect( versionedModel );

0 commit comments

Comments
 (0)