Skip to content

Commit 45b8c48

Browse files
committed
Add initial support for SAMM 2.2.0
1 parent 2ea8c35 commit 45b8c48

29 files changed

+639
-2
lines changed

core/esmf-aspect-meta-model-java/src/main/java/org/eclipse/esmf/aspectmodel/versionupdate/MetaModelVersionMigrator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private MetaModelVersionMigrator() {
4545
}
4646

4747
private final List<Migrator> migrators = ImmutableList.<Migrator> builder()
48+
.add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_2_1_0, KnownVersion.SAMM_2_2_0 ) )
4849
.add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_2_0_0, KnownVersion.SAMM_2_1_0 ) )
4950
.add( new SammMetaModelVersionUriRewriter( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) )
5051
.add( new SammRemoveSammNameMigrator( KnownVersion.SAMM_1_0_0, KnownVersion.SAMM_2_0_0 ) )

core/esmf-aspect-meta-model-java/src/test-shared/java/org/eclipse/esmf/test/AssertTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package org.eclipse.esmf.test;
1515

16-
import static org.eclipse.esmf.metamodel.DataTypes.xsd;
16+
import static org.eclipse.esmf.metamodel.DataTypes.*;
1717
import static org.eclipse.esmf.metamodel.Elements.*;
1818
import static org.eclipse.esmf.metamodel.builder.SammBuilder.*;
1919
import static org.eclipse.esmf.test.shared.AspectModelAsserts.assertThat;
@@ -32,6 +32,7 @@
3232
import org.eclipse.esmf.metamodel.Property;
3333
import org.eclipse.esmf.metamodel.constraint.RangeConstraint;
3434
import org.eclipse.esmf.metamodel.vocabulary.SammNs;
35+
import org.eclipse.esmf.samm.KnownVersion;
3536

3637
import org.apache.jena.datatypes.xsd.XSDDatatype;
3738
import org.junit.jupiter.api.Test;
@@ -138,7 +139,7 @@ void testAssertionsWithBuilder() {
138139
.characteristic()
139140
.hasDataType( xsd.string )
140141
.sourceFile()
141-
.hasLocation( "urn:samm:org.eclipse.esmf.samm:characteristic:2.1.0" );
142+
.hasLocation( "urn:samm:org.eclipse.esmf.samm:characteristic:" + KnownVersion.getLatest().toVersionString() );
142143

143144
final RangeConstraint rangeConstraint = rangeConstraint()
144145
.minValue( value( 5, xsd.integer ) )
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:org.eclipse.esmf.samm:foo:1.0.0#> .
13+
14+
<urn:samm:org.eclipse.esmf.samm:aspect-model:TestAspect:1.0.0> a samm:Aspect ;
15+
samm:preferredName "Test Aspect"@en ;
16+
samm:properties ( ) ;
17+
samm:operations ( ) .
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:foo:something:else#> .
13+
14+
<urn:samm:org.eclipse.esmf.samm:TestAspect:1.1.0> a samm:Aspect;
15+
samm:preferredName "Test Aspect"@en;
16+
samm:properties () ;
17+
samm:operations () .
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:foo:org.eclipse.esmf.samm:meta-model:2.0.0#> .
13+
14+
<urn:samm:org.eclipse.esmf.samm:aspect-model:TestAspect:1.1.0> a samm:Aspect ;
15+
samm:preferredName "Test Aspect"@en ;
16+
samm:properties ( ) ;
17+
samm:operations ( ) .
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
13+
14+
<urn:samm:org.eclipse.esmf.samm:aspect-model:TestAspect:1.1.0> a samm:Aspect ;
15+
samm:preferredName "Test Aspect"@en ;
16+
samm:properties ( ) ;
17+
samm:operations ( ) .
18+
19+
<urn:samm:org.eclipse.esmf.samm:aspect-model:AnotherTestAspect:1.1.0> a samm:Aspect ;
20+
samm:preferredName "Another Test Aspect"@en ;
21+
samm:properties ( ) ;
22+
samm:operations ( ) .
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
14+
@prefix : <urn:samm:org.eclipse.esmf.test:1.0.0#> .
15+
16+
:AnotherTest a samm:Aspect ;
17+
samm:preferredName "Another Test"@en ;
18+
samm:properties ( :foo ) ;
19+
samm:operations ( ) .
20+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
14+
@prefix : <urn:samm:org.eclipse.esmf.test:1.0.0#> .
15+
16+
:AspectInPreviousNamespace a samm:Aspect ;
17+
samm:properties ( :distinctProperty ) ;
18+
samm:operations ( ) .
19+
20+
:distinctProperty a samm:Property ;
21+
samm:characteristic samm-c:Text .
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
@prefix aux: <urn:bamm:io.openmanufacturing:aspect-model:aux#> .
2+
@prefix ns: <urn:bamm:org.eclipse.esmf.test:1.0.0#BammAspectWithoutPrefixes> .
3+
ns: a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Aspect> ;
4+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
5+
"Aspect for movement information"@en ;
6+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
7+
"BammAspectWithoutPrefixes" ;
8+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#operations>
9+
() ;
10+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
11+
"BammAspectWithoutPrefixes"@en ;
12+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#properties>
13+
( <urn:bamm:org.eclipse.esmf.test:1.0.0#moving> <urn:bamm:org.eclipse.esmf.test:1.0.0#speedLimitWarning> <urn:bamm:org.eclipse.esmf.test:1.0.0#position> ) .
14+
<urn:bamm:org.eclipse.esmf.test:1.0.0#moving>
15+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
16+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
17+
<urn:bamm:io.openmanufacturing:characteristic:1.0.0#Boolean> ;
18+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
19+
"Flag indicating if the position is changing"@en ;
20+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
21+
"moving" ;
22+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
23+
"Moving"@en .
24+
<urn:bamm:org.eclipse.esmf.test:1.0.0#z>
25+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
26+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
27+
<urn:bamm:org.eclipse.esmf.test:1.0.0#Coordinate> ;
28+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
29+
"z coordinate in space"@en ;
30+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
31+
"z" ;
32+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
33+
"z"@en .
34+
<urn:bamm:org.eclipse.esmf.test:1.0.0#y>
35+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
36+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
37+
<urn:bamm:org.eclipse.esmf.test:1.0.0#Coordinate> ;
38+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
39+
"y coordinate in space"@en ;
40+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
41+
"y" ;
42+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
43+
"y"@en .
44+
<urn:bamm:org.eclipse.esmf.test:1.0.0#Coordinate>
45+
a <urn:bamm:io.openmanufacturing:characteristic:1.0.0#Measurement> ;
46+
<urn:bamm:io.openmanufacturing:characteristic:1.0.0#unit>
47+
<urn:bamm:io.openmanufacturing:unit:1.0.0#metre> ;
48+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#dataType>
49+
<http://www.w3.org/2001/XMLSchema#float> ;
50+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
51+
"Represents a coordinate along an axis in space."@en ;
52+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
53+
"Coordinate" ;
54+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
55+
"Coordinate"@en .
56+
<urn:bamm:org.eclipse.esmf.test:1.0.0#speedLimitWarning>
57+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
58+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
59+
<urn:bamm:org.eclipse.esmf.test:1.0.0#WarningLevel> ;
60+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
61+
"Indicats if speed limit is adhered to."@en ;
62+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
63+
"speedLimitWarning" ;
64+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
65+
"Speed Limit Warning"@en .
66+
<urn:bamm:org.eclipse.esmf.test:1.0.0#SpatialPosition>
67+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Entity> ;
68+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
69+
"Position in space, described along three axis, with the third axis optional, if all positions are in a plane."@en ;
70+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
71+
"SpatialPosition" ;
72+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
73+
"Spatial Position"@en ;
74+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#properties>
75+
( <urn:bamm:org.eclipse.esmf.test:1.0.0#x> <urn:bamm:org.eclipse.esmf.test:1.0.0#y>
76+
[ <urn:bamm:io.openmanufacturing:meta-model:1.0.0#optional>
77+
true ;
78+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#property>
79+
<urn:bamm:org.eclipse.esmf.test:1.0.0#z>
80+
]
81+
) .
82+
<urn:bamm:org.eclipse.esmf.test:1.0.0#x>
83+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
84+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
85+
<urn:bamm:org.eclipse.esmf.test:1.0.0#Coordinate> ;
86+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
87+
"x coordinate in space"@en ;
88+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
89+
"x" ;
90+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
91+
"x"@en .
92+
<urn:bamm:org.eclipse.esmf.test:1.0.0#position>
93+
a <urn:bamm:io.openmanufacturing:meta-model:1.0.0#Property> ;
94+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#characteristic>
95+
[ a <urn:bamm:io.openmanufacturing:characteristic:1.0.0#SingleEntity> ;
96+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#dataType>
97+
<urn:bamm:org.eclipse.esmf.test:1.0.0#SpatialPosition> ;
98+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
99+
"Represents a single location in space."@en ;
100+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
101+
"SpatialPositionCharacteristic" ;
102+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
103+
"Spatial Position Characteristic"@en
104+
] ;
105+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
106+
"Indicates a position"@en ;
107+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
108+
"position" ;
109+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
110+
"Position"@en .
111+
<urn:bamm:org.eclipse.esmf.test:1.0.0#WarningLevel>
112+
a <urn:bamm:io.openmanufacturing:characteristic:1.0.0#Enumeration> ;
113+
<urn:bamm:io.openmanufacturing:characteristic:1.0.0#values>
114+
( "green" "yellow" "red" ) ;
115+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#dataType>
116+
<http://www.w3.org/2001/XMLSchema#string> ;
117+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#description>
118+
"Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
119+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#name>
120+
"WarningLevel" ;
121+
<urn:bamm:io.openmanufacturing:meta-model:1.0.0#preferredName>
122+
"Warning Level"@en .
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
12+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
14+
@prefix : <urn:samm:org.eclipse.esmf.test:1.0.0#> .
15+
16+
:FailingTest a samm:Aspect ;
17+
samm:preferredName "Failing Test"@en ;
18+
samm:properties ( :notExisting ) ;
19+
samm:operations ( ) .

0 commit comments

Comments
 (0)