Skip to content

Commit a7a84db

Browse files
committed
Updates for Value type
1 parent b23b4e5 commit a7a84db

File tree

7 files changed

+77
-69
lines changed

7 files changed

+77
-69
lines changed

documentation/modules/ROOT/examples/aspect-sample.ttl

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,18 @@
118118
# end::value-declaration[]
119119

120120
# tag::value-in-example-value-additional[]
121-
:valueWithProperty a samm:Property ;
122-
samm:exampleValue :ValueOne ;
121+
:warningLevelProperty a samm:Property ;
122+
samm:exampleValue :GreenLight ;
123123
samm:characteristic [
124124
a samm:Characteristic ;
125-
samm:dataType xsd:integer ;
125+
samm:dataType xsd:string ;
126126
] .
127127

128-
:ValueOne a samm:Value ;
129-
samm:value 1;
130-
samm:preferredName "ValueOne Preferred Name"@en ;
131-
samm:description "The value one description"@en ;
132-
samm:see <https://en.wikipedia.org/wiki/One> .
128+
:GreenLight a samm:Value ;
129+
samm:value "green" ;
130+
samm:preferredName "Normal"@en ;
131+
samm:description "Indicates that the speed of position change is within specification."@en ;
132+
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .
133133
# end::value-in-example-value-additional[]
134134

135135
# tag::value-in-example-value-anonymous[]
@@ -145,41 +145,44 @@
145145
] .
146146
# end::value-in-example-value-anonymous[]
147147

148-
# tag::enumeration-value-type-in-value-single-instance[]
149-
:SomeValueEnum a samm-c:Enumeration ;
150-
samm:name "SomeValueEnum" ;
151-
samm:preferredName "Some Value Enum"@en ;
152-
samm:description "An enumeration of integers"@en ;
153-
samm:dataType xsd:integer ;
154-
samm-c:values ( :ValueOne ) .
148+
# tag::enumeration-value-type-is-value-reference[]
149+
:TrafficLight a samm-c:Enumeration ;
150+
samm:name "TrafficLight" ;
151+
samm:preferredName "Warning Level"@en ;
152+
samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
153+
samm:dataType xsd:string ;
154+
samm-c:values ( :GreenLight ) .
155155

156-
:ValueOne a samm:Value ;
157-
samm:value 1 ;
158-
samm:preferredName "ValueOne Preferred Name"@en ;
159-
samm:description "The value one description"@en ;
160-
samm:see <https://en.wikipedia.org/wiki/One> .
161-
# end::enumeration-value-type-in-value-single-instance[]
156+
:GreenLight a samm:Value ;
157+
samm:value "green" ;
158+
samm:preferredName "Normal"@en ;
159+
samm:description "Indicates that the speed of position change is within specification."@en ;
160+
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .
161+
# end::enumeration-value-type-is-value-reference[]
162162

163163
# tag::enumeration-value-type-in-value-mixed-instance[]
164-
:SomeValueEnum a samm-c:Enumeration ;
165-
samm:name "SomeValueEnum" ;
166-
samm:preferredName "Some Value Enum"@en ;
167-
samm:description "An enumeration of integers"@en ;
168-
samm:dataType xsd:integer ;
164+
:TrafficLight a samm-c:Enumeration ;
165+
samm:name "TrafficLight" ;
166+
samm:preferredName "Warning Level"@en ;
167+
samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
168+
samm:dataType xsd:string ;
169169
samm-c:values (
170-
:ValueOne # A reference to a globally defined samm:Value
171-
2 # A direct literal value
170+
:GreenLight # A reference to a globally defined samm:Value
171+
"yellow" # A direct literal value
172172
[
173-
a samm:Value ; # An inline complex value with additional metadata
174-
samm:value 3
173+
a samm:Value ; # An inline complex value with additional metadata
174+
samm:value "red" ;
175+
samm:preferredName "Critical Warning"@en ;
176+
samm:description "Indicates that the position change is outside the specification."@en
175177
]
176178
) .
177179

178-
:ValueOne a samm:Value ;
179-
samm:value 1 ;
180-
samm:preferredName "ValueOne Preferred Name"@en ;
181-
samm:description "The value one description"@en ;
182-
samm:see <https://en.wikipedia.org/wiki/One> .
180+
:GreenLight a samm:Value ;
181+
samm:value "green" ;
182+
samm:preferredName "Normal"@en ;
183+
samm:description "Indicates that the speed of position change is within specification."@en ;
184+
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .
185+
183186
# end::enumeration-value-type-in-value-mixed-instance[]
184187

185188
# tag::enumeration-complex-declaration[]

documentation/modules/ROOT/pages/modeling-guidelines.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,9 @@ that all model elements have], Properties have the following attributes:
162162
| Attributes | Description | Required
163163
| `samm:characteristic` | The xref:characteristics.adoc#characteristics[Characteristic] describing
164164
this Property. | {ok}
165-
| `samm:exampleValue` | An exemplary value the Property can take on that helps to understand the
166-
intended meaning of the property better. This attribute supports both scalar literal values
167-
(e.g., `xsd:string`, `xsd:float`) and entity-based example values (i.e., references to instances of
168-
xref:modeling-guidelines.adoc#value-type[samm:Value]
165+
| `samm:exampleValue` | An exemplary value that the Property can take, helping to clarify the intended meaning of the Property.
166+
This attribute supports both scalar literal values (e.g., xsd:string, xsd:float), an anonymous described scalar value,
167+
and value references that point to example values (i.e., references to instances of xref:modeling-guidelines.adoc#value-type[samm:Value]).
169168
enriched with semantic metadata). In either case, the data type of the `samm:exampleValue` must be convertible to
170169
the effective data type defined by the Property's Characteristic. For example, if the Characteristic's `samm:dataType`
171170
is `xsd:int`, a value with the type `xsd:short` is also acceptable. Refer to section xref:datatypes.adoc#implicit-conversions[Implicit Conversions]
@@ -179,7 +178,7 @@ Example with Literal type:
179178
include::example$aspect-sample.ttl[tags=property-declaration]
180179
----
181180

182-
Example with entity-based type:
181+
Example with value reference type:
183182

184183
[source,turtle,subs="attributes+"]
185184
----
@@ -322,13 +321,13 @@ or external reference—for a specific value.
322321

323322
There are several ways to define values in an Enumeration:
324323

325-
- Single Global Instance:
324+
- Value Reference example:
326325
[source,turtle,subs="attributes+"]
327326
----
328-
include::example$aspect-sample.ttl[tags=enumeration-value-type-in-value-single-instance]
327+
include::example$aspect-sample.ttl[tags=enumeration-value-type-is-value-reference]
329328
----
330329

331-
- Mixed Value Definitions:
330+
- Multiple (anonymous described scalar value and value reference) Value Definitions:
332331
[source,turtle,subs="attributes+"]
333332
----
334333
include::example$aspect-sample.ttl[tags=enumeration-value-type-in-value-mixed-instance]

esmf-semantic-aspect-meta-model/src/main/resources/samm/meta-model/2.2.0/aspect-meta-model-definitions.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ samm:parameters a mmm:Attribute ;
156156

157157
samm:exampleValue a mmm:Attribute ;
158158
rdfs:label "exampleValue" ;
159-
rdfs:comment "An exemplary value the Property can take on that helps to understand the intended meaning of the property better. This attribute supports both scalar literal values (e.g., xsd:string or xsd:float) and entity-based example values (i.e., references to instances of samm:Value enriched with semantic metadata). The data type of the samm:exampleValue must be convertable to the effective data type of the Property’s Characteristic." ;
159+
rdfs:comment "An exemplary value the Property can take on that helps to understand the intended meaning of the property better. This attribute supports both scalar literal values (e.g., xsd:string or xsd:float), an anonymous described scalar value and value references example values (i.e., references to instances of samm:Value enriched with semantic metadata). The data type of the samm:exampleValue must be convertable to the effective data type of the Property’s Characteristic." ;
160160
rdfs:domain samm:Property ;
161161
rdfs:range rdfs:Resource .
162162

esmf-semantic-aspect-meta-model/src/test/java/org/eclipse/esmf/samm/ValueTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ void multipleValueWithEnumeration ( final KnownVersion metaModelVersion ) {
2525

2626
@ParameterizedTest
2727
@MethodSource( value = "versionsStartingWith2_2_0" )
28-
void valueWithProperty ( final KnownVersion metaModelVersion ) {
29-
checkValidity( "value-shape", "ValueWithProperty", metaModelVersion );
28+
void referenceValueWithProperty ( final KnownVersion metaModelVersion ) {
29+
checkValidity( "value-shape", "ReferenceValueWithProperty", metaModelVersion );
3030
}
3131

3232
@ParameterizedTest
3333
@MethodSource( value = "versionsStartingWith2_2_0" )
34-
void valueWithExampleValue ( final KnownVersion metaModelVersion ) {
35-
checkValidity( "value-shape", "ValueWithExampleValue", metaModelVersion );
34+
void anonymousDescribedValueInExampleValue ( final KnownVersion metaModelVersion ) {
35+
checkValidity( "value-shape", "AnonymousDescribedValueInExampleValue", metaModelVersion );
3636
}
3737
}

esmf-semantic-aspect-meta-model/src/test/resources/samm_2_2_0/value-shape/org.eclipse.esmf.test/1.0.0/ValueWithExampleValue.ttl renamed to esmf-semantic-aspect-meta-model/src/test/resources/samm_2_2_0/value-shape/org.eclipse.esmf.test/1.0.0/AnonymousDescribedValueInExampleValue.ttl

File renamed without changes.

esmf-semantic-aspect-meta-model/src/test/resources/samm_2_2_0/value-shape/org.eclipse.esmf.test/1.0.0/MultipleValueWithEnumeration.ttl

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,25 @@
1515
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
1616
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
1717

18-
:SomeValueEnum a samm-c:Enumeration ;
19-
samm:name "SomeValueEnum" ;
20-
samm:preferredName "Some Value Enum"@en ;
21-
samm:description "An enumeration of integers"@en ;
22-
samm:dataType xsd:integer ;
18+
:TrafficLight a samm-c:Enumeration ;
19+
samm:name "TrafficLight" ;
20+
samm:preferredName "Warning Level"@en ;
21+
samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
22+
samm:dataType xsd:string ;
2323
samm-c:values (
24-
:ValueOne
25-
2
26-
[ a samm:Value ; samm:value 3 ]
24+
:GreenLight
25+
"yellow"
26+
[
27+
a samm:Value ;
28+
samm:value "red" ;
29+
samm:preferredName "Critical Warning"@en ;
30+
samm:description "Indicates that the position change is outside the specification."@en
31+
]
2732
) .
2833

29-
:ValueOne a samm:Value ;
30-
samm:value 1;
31-
samm:preferredName "ValueOne Preferred Name"@en ;
32-
samm:description "The value one description"@en ;
33-
samm:see <https://en.wikipedia.org/wiki/One> .
34+
:GreenLight a samm:Value ;
35+
samm:value "green" ;
36+
samm:preferredName "Normal"@en ;
37+
samm:description "Indicates that the speed of position change is within specification."@en ;
38+
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .
39+

esmf-semantic-aspect-meta-model/src/test/resources/samm_2_2_0/value-shape/org.eclipse.esmf.test/1.0.0/ValueWithProperty.ttl renamed to esmf-semantic-aspect-meta-model/src/test/resources/samm_2_2_0/value-shape/org.eclipse.esmf.test/1.0.0/ReferenceValueWithProperty.ttl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
1616
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
1717

18-
:valueWithProperty a samm:Property ;
19-
samm:exampleValue :ValueOne ;
18+
:warningLevelProperty a samm:Property ;
19+
samm:exampleValue :GreenLight ;
2020
samm:characteristic [
2121
a samm:Characteristic ;
22-
samm:dataType xsd:integer ;
22+
samm:dataType xsd:string ;
2323
] .
2424

25-
:ValueOne a samm:Value ;
26-
samm:value 1;
27-
samm:preferredName "ValueOne Preferred Name"@en ;
28-
samm:description "The value one description"@en ;
29-
samm:see <https://en.wikipedia.org/wiki/One> .
25+
:GreenLight a samm:Value ;
26+
samm:value "green" ;
27+
samm:preferredName "Normal"@en ;
28+
samm:description "Indicates that the speed of position change is within specification."@en ;
29+
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .

0 commit comments

Comments
 (0)