Skip to content

Commit d9fbb5e

Browse files
authored
2.3.0 Version and Validate duplicate values in Enumerations (#343)
* 2.3.0 Version and Validate duplicate values in Enumerations * Fix tests * Update message and logic
1 parent 4c4ba84 commit d9fbb5e

File tree

239 files changed

+23955
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+23955
-4
lines changed

esmf-semantic-aspect-meta-model/src/main/java/org/eclipse/esmf/samm/KnownVersion.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public enum KnownVersion {
2525
SAMM_1_0_0( 1, 0, 0 ),
2626
SAMM_2_0_0( 2, 0, 0 ),
2727
SAMM_2_1_0( 2, 1, 0 ),
28-
SAMM_2_2_0( 2, 2, 0 );
28+
SAMM_2_2_0( 2, 2, 0 ),
29+
SAMM_2_3_0( 2, 3, 0 );
2930

3031
private final int major;
3132
private final int minor;
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
# Copyright (c) 2025 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 mmm: <urn:samm:org.eclipse.esmf.samm:meta-meta-model:2.3.0#> .
13+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.3.0#> .
14+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.3.0#> .
15+
@prefix samm-e: <urn:samm:org.eclipse.esmf.samm:entity:2.3.0#> .
16+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
17+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
18+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
19+
20+
# Meta meta model attributes
21+
mmm:allowDuplicates a rdf:Property ;
22+
rdfs:label "allowDuplicates" ;
23+
rdfs:comment "Indicates whether a Collection may contain duplicate values."@en .
24+
25+
mmm:ordered a rdf:Property ;
26+
rdfs:label "ordered" ;
27+
rdfs:comment "Indicates whether the values in a Collection are ordered."@en .
28+
29+
# Meta model attributes
30+
samm-c:baseCharacteristic a mmm:Attribute ;
31+
rdfs:label "baseCharacteristic" ;
32+
rdfs:comment "Reference to the Characteristic on which a Constraint is being applied." ;
33+
rdfs:domain samm-c:Trait ;
34+
rdfs:range rdfs:Resource .
35+
36+
samm-c:constraint a mmm:Attribute ;
37+
rdfs:label "constraint" ;
38+
rdfs:comment "A constraint on a Characteristic" ;
39+
rdfs:domain samm-c:Trait ;
40+
rdfs:range samm:Constraint .
41+
42+
samm-c:languageCode a mmm:Attribute ;
43+
rdfs:label "languageCode" ;
44+
rdfs:comment """An ISO 639-1 language code for the language of the value of the constrained Property, e.g. "de".""" ;
45+
rdfs:domain samm-c:LanguageConstraint ;
46+
rdfs:range xsd:string .
47+
48+
samm-c:localeCode a mmm:Attribute ;
49+
rdfs:label "localeCode" ;
50+
rdfs:comment """An IETF BCP 47 locale code for the language of the value of the constrained Property, e.g. "de-DE".""" ;
51+
rdfs:domain samm-c:LocaleConstraint ;
52+
rdfs:range xsd:string .
53+
54+
samm-c:unit a mmm:Attribute ;
55+
rdfs:label "unit" ;
56+
rdfs:comment "Reference to a Unit as defined in the Unit catalog."@en ;
57+
rdfs:domain samm-c:Quantifiable ;
58+
rdfs:range samm:Unit .
59+
60+
samm-c:minValue a rdf:Property ;
61+
rdfs:label "minValue" ;
62+
rdfs:comment "The lower bound of a range."@en .
63+
# Note: rdfs:domain is the union of samm-c:RangeConstraint, samm-c:LengthConstraint
64+
# Note: rdfs:range can't be given since for usage in samm-c:LengthConstraint it's
65+
# xsd:nonNegativeInteger while for usage in a samm-c:RangeConstraint, it depends on the
66+
# samm:dataType of the samm-c:baseCharacteristic the constraint is used in
67+
68+
samm-c:maxValue a rdf:Property ;
69+
rdfs:label "maxValue" ;
70+
rdfs:comment "The upper bound of a range."@en .
71+
# Note: rdfs:domain is the union of samm-c:RangeConstraint, samm-c:LengthConstraint
72+
# Note: rdfs:range can't be given since for usage in samm-c:LengthConstraint it's
73+
# xsd:nonNegativeInteger while for usage in a samm-c:RangeConstraint, it depends on the
74+
# samm:dataType of the samm-c:baseCharacteristic the constraint is used in
75+
76+
samm-c:values a rdf:Property ;
77+
rdfs:label "values" ;
78+
rdfs:comment """List of possible values of the same type, e.g. ( "up" "down" "degraded" )."""@en ;
79+
rdfs:domain samm-c:Enumeration ;
80+
rdfs:range rdf:List .
81+
82+
samm-c:defaultValue a rdf:Property ;
83+
rdfs:label "defaultValue" ;
84+
rdfs:comment "The default value for the state."@en ;
85+
rdfs:domain samm-c:State .
86+
# Note: rdfs:range depends on the samm:dataType of the samm-c:State the defaultValue is used in
87+
88+
samm-c:left a rdf:Property ;
89+
rdfs:label "left" ;
90+
rdfs:comment "The left side of the Either. The attribute references another Characteristic which describes the value."@en ;
91+
rdfs:domain samm-c:Either ;
92+
rdfs:range samm:Characteristic .
93+
94+
samm-c:right a rdf:Property ;
95+
rdfs:label "right" ;
96+
rdfs:comment "The right side of the Either. The attribute references another Characteristic which describes the value."@en ;
97+
rdfs:domain samm-c:Either ;
98+
rdfs:range samm:Characteristic .
99+
100+
samm-c:lowerBoundDefinition a rdf:Property ;
101+
rdfs:label "lowerBoundDefinition" ;
102+
rdfs:comment """Defines how the "minValue" property of the Range Constraint is to be interpreted. Possible values are "AT_LEAST" and "GREATER_THAN". This is an optional property. By default the "minValue" is interpreted with "AT_LEAST" semantics."""@en ;
103+
rdfs:domain samm-c:RangeConstraint ;
104+
rdfs:range mmm:Constant .
105+
106+
samm-c:upperBoundDefinition a rdf:Property ;
107+
rdfs:label "upperBoundDefinition" ;
108+
rdfs:comment """Defines how the "maxValue" property of the Range Constraint is to be interpreted; Possible values are "LESS_THAN" and "AT_MOST". This is an optional property. By default the "maxValue" is interpreted with "AT_MOST" semantics"""@en ;
109+
rdfs:domain samm-c:RangeConstraint ;
110+
rdfs:range mmm:Constant .
111+
112+
samm-c:elements a rdf:Property ;
113+
rdfs:label "elements" ;
114+
rdfs:comment """List of elements of possibly different types, e.g. ( "literal value" :reference )"""@en ;
115+
rdfs:domain samm-c:StructuredValue ;
116+
rdfs:range rdf:List .
117+
118+
samm-c:deconstructionRule a rdf:Property ;
119+
rdfs:label "deconstructionRule" ;
120+
rdfs:comment "A regular expression that defines the groups contained in a string."@en ;
121+
rdfs:domain samm-c:StructuredValue ;
122+
rdfs:range xsd:string .
123+
124+
samm-c:scale a rdf:Property ;
125+
rdfs:label "scale" ;
126+
rdfs:comment "The scaling factor for a fixed point number."@en ;
127+
rdfs:domain samm-c:FixedPointConstraint ;
128+
rdfs:range xsd:positiveInteger .
129+
130+
samm-c:integer a rdf:Property ;
131+
rdfs:label "integer" ;
132+
rdfs:comment "The number of integral digits for a fixed point number."@en ;
133+
rdfs:domain samm-c:FixedPointConstraint ;
134+
rdfs:range xsd:positiveInteger .
135+
136+
samm-c:elementCharacteristic a rdf:Property ;
137+
rdfs:label "elementCharacteristic" ;
138+
rdfs:comment "The Characteristic which defines the elements in a Collection."@en ;
139+
rdfs:domain samm-c:Collection ;
140+
rdfs:range samm:Characteristic .
141+
142+
# Characteristics
143+
samm-c:Trait rdfs:subClassOf samm:Characteristic ;
144+
rdfs:label "Trait" ;
145+
rdfs:comment "A trait wraps another characteristic and adds a number of additional Constraints."@en .
146+
147+
samm-c:Quantifiable rdfs:subClassOf samm:Characteristic ;
148+
rdfs:label "Quantifiable" ;
149+
rdfs:comment "A value which can be quantified and may have a unit, e.g. the number of bolts required for a processing step or the expected torque with which these bolts should be tightened."@en .
150+
151+
samm-c:Measurement rdfs:subClassOf samm-c:Quantifiable ;
152+
rdfs:label "Measurement" ;
153+
rdfs:comment "A measurement is a numeric value with an associated unit and quantity kind."@en .
154+
155+
samm-c:Duration rdfs:subClassOf samm-c:Quantifiable ;
156+
rdfs:label "Duration" ;
157+
rdfs:comment "A time duration."@en .
158+
159+
samm-c:SingleEntity rdfs:subClassOf samm:Characteristic ;
160+
rdfs:label "SingleEntity" ;
161+
rdfs:comment "Describes a Property whose data type is an Entity. The Entity used as data type may be defined in the same Aspect Model or the shared Entity namespace of the BAMM."@en .
162+
163+
samm-c:Collection rdfs:subClassOf samm:Characteristic ;
164+
rdfs:label "Collection" ;
165+
rdfs:comment "A group of values which may be either of a simple or complex type. The values may be duplicated and are not ordered (i.e. bag semantics)."@en ;
166+
mmm:allowDuplicates true ;
167+
mmm:ordered false .
168+
169+
samm-c:Set rdfs:subClassOf samm-c:Collection ;
170+
rdfs:label "Set" ;
171+
rdfs:comment "A subclass of Collection which may not contain duplicates and is unordered."@en ;
172+
mmm:allowDuplicates false ;
173+
mmm:ordered false .
174+
175+
samm-c:SortedSet rdfs:subClassOf samm-c:Collection ;
176+
rdfs:label "SortedSet" ;
177+
rdfs:comment "A subclass of Collection which may not contain duplicates and is ordered."@en ;
178+
mmm:allowDuplicates false ;
179+
mmm:ordered true .
180+
181+
samm-c:List rdfs:subClassOf samm-c:Collection ;
182+
rdfs:label "List" ;
183+
rdfs:comment "A subclass of Collection which may contain duplicates and is ordered."@en ;
184+
mmm:allowDuplicates true ;
185+
mmm:ordered true .
186+
187+
samm-c:TimeSeries rdfs:subClassOf samm-c:SortedSet ;
188+
rdfs:label "TimeSeries" ;
189+
rdfs:comment "A subclass of Sorted Set containing values with the exact point in time when the values where recorded. The values for the allowDuplicates and ordered attributes are inherited from the Sorted Set."@en ;
190+
samm:dataType samm-e:TimeSeriesEntity .
191+
192+
samm-c:Enumeration rdfs:subClassOf samm:Characteristic ;
193+
rdfs:label "Enumeration" ;
194+
rdfs:comment "An enumeration represents a list of possible values."@en .
195+
196+
samm-c:State rdfs:subClassOf samm-c:Enumeration ;
197+
rdfs:label "State" ;
198+
rdfs:comment "A state is subclass of Enumeration with a default value."@en .
199+
200+
samm-c:Code rdfs:subClassOf samm:Characteristic ;
201+
rdfs:label "Code" ;
202+
rdfs:comment "Describes a Property which contains any kind of code. Note that this Characteristic does not define a samm:dataType, this must therefore be done when instantiating the Characteristic."@en .
203+
204+
samm-c:Either rdfs:subClassOf samm:Characteristic ;
205+
rdfs:label "Either" ;
206+
rdfs:comment "Describes a Property whose value can have one of two possible types (a disjoint union)."@en .
207+
208+
samm-c:StructuredValue rdfs:subClassOf samm:Characteristic ;
209+
rdfs:label "StructuredValue" ;
210+
rdfs:comment "Describes how the value of a Property is structured from parts."@en .
211+
212+
# Constraints
213+
samm-c:RangeConstraint rdfs:subClassOf samm:Constraint ;
214+
rdfs:label "RangeConstraint" ;
215+
rdfs:comment "Restricts the value range of a Property. At least one of samm-c:maxValue or samm-c:minValue must be present in a Range Constraint. Both samm-c:maxValue and samm-c:minValue are inclusive."@en .
216+
217+
samm-c:LanguageConstraint rdfs:subClassOf samm:Constraint ;
218+
rdfs:label "LanguageConstraint" ;
219+
rdfs:comment "Restricts a value to a specific language."@en .
220+
221+
samm-c:LocaleConstraint rdfs:subClassOf samm:Constraint ;
222+
rdfs:label "LocaleConstraint" ;
223+
rdfs:comment "Restricts a value to a specific locale."@en .
224+
225+
samm-c:EncodingConstraint rdfs:subClassOf samm:Constraint ;
226+
rdfs:label "EncodingConstraint" ;
227+
rdfs:comment "Restricts the encoding of a Property."@en .
228+
229+
samm-c:LengthConstraint rdfs:subClassOf samm:Constraint ;
230+
rdfs:label "LengthConstraint" ;
231+
rdfs:comment """
232+
This Constraint can be used to restrict two types of Characteristics:
233+
234+
- Characteristics that have a character value space, i.e. whose value are string-like. In this case the Constraint restricts the length of the (string-) value. The scalar data types that can be restricted are: xsd:string, xsd:date, xsd:time, xsd:dateTime, xsd:dateTimeStamp, xsd:gYear, xsd:gMonth, xsd:gMonthDay, xsd:duration, xsd:yearMonthDuration, xsd:dayTimeDuration, xsd:hexBinary, xsd:base64Binary, xsd:anyURI, samm:curie and rdf:langString.
235+
- Collection Characteristics (Collection, Set, Sorted Set, List). In this case the Constraint restricts the number of elements in the collection.
236+
237+
At least one of samm-c:maxValue or samm-c:minValue must be present in a Length Constraint.
238+
"""@en .
239+
240+
samm-c:RegularExpressionConstraint rdfs:subClassOf samm:Constraint ;
241+
rdfs:label "RegularExpressionConstraint" ;
242+
rdfs:comment "Restricts a string value to a regular expression as defined by XQuery 1.0 and XPath 2.0 Functions and Operators."@en ;
243+
samm:see <http://www.w3.org/TR/xpath-functions/#regex-syntax> .
244+
245+
samm-c:FixedPointConstraint rdfs:subClassOf samm:Constraint ;
246+
rdfs:label "FixedPointConstraint" ;
247+
rdfs:comment "Defines the scaling factor for a fixed point number."@en .
248+
249+
# Constants
250+
samm-c:AT_MOST a mmm:Constant .
251+
252+
samm-c:LESS_THAN a mmm:Constant .
253+
254+
samm-c:AT_LEAST a mmm:Constant .
255+
256+
samm-c:GREATER_THAN a mmm:Constant .
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (c) 2025 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.3.0#> .
13+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.3.0#> .
14+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
15+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
16+
17+
samm-c:Timestamp a samm:Characteristic ;
18+
samm:preferredName "Timestamp"@en ;
19+
samm:description "Describes a Property which contains the date and time with an optional timezone."@en ;
20+
samm:dataType xsd:dateTime .
21+
22+
samm-c:Text a samm:Characteristic ;
23+
samm:preferredName "Text"@en ;
24+
samm:description "Describes a Property which contains plain text. This is intended exclusively for human readable strings, not for identifiers, measurement values, etc."@en ;
25+
samm:dataType xsd:string .
26+
27+
samm-c:MultiLanguageText a samm:Characteristic ;
28+
samm:preferredName "Multi-Language Text"@en ;
29+
samm:description "Describes a Property which contains plain text in multiple languages. This is intended exclusively for human readable strings, not for identifiers, measurement values, etc."@en ;
30+
samm:dataType rdf:langString .
31+
32+
samm-c:Boolean a samm:Characteristic ;
33+
samm:preferredName "Boolean"@en ;
34+
samm:description """Represents a boolean value (i.e. a "flag")."""@en ;
35+
samm:dataType xsd:boolean .
36+
37+
samm-c:Locale a samm:Characteristic ;
38+
samm:preferredName "Locale"@en ;
39+
samm:description """Describes a Property containing a locale according to IETF BCP 47, for example "de-DE"."""@en ;
40+
samm:dataType xsd:string .
41+
42+
samm-c:Language a samm:Characteristic ;
43+
samm:preferredName "Language"@en ;
44+
samm:description """Describes a Property containing a language according to ISO 639-1, for example "de"."""@en ;
45+
samm:dataType xsd:string .
46+
47+
samm-c:UnitReference a samm:Characteristic ;
48+
samm:preferredName "Unit Reference"@en ;
49+
samm:description "Describes a Property containing a reference to one of the units in the Unit Catalog."@en ;
50+
samm:dataType samm:curie .
51+
52+
samm-c:ResourcePath a samm:Characteristic ;
53+
samm:preferredName "Resource Path"@en ;
54+
samm:description "The path of a resource."@en ;
55+
samm:dataType xsd:anyURI .
56+
57+
samm-c:MimeType a samm:Characteristic ;
58+
samm:preferredName "MIME Type"@en ;
59+
samm:description """A MIME type as defined in RFC 2046, for example "application/pdf"."""@en ;
60+
samm:dataType xsd:string .
61+
62+
samm-c:Reference a samm:Characteristic ;
63+
samm:preferredName "Reference"@en ;
64+
samm:description "Defines a unique type of Property. This reference can either be a global reference, such as a URN, or it can refer to a Property of another aspect within a different twin."@en ;
65+
samm:dataType xsd:anyURI .
66+

0 commit comments

Comments
 (0)