Skip to content

Commit 8837b20

Browse files
committed
Remove duplicate element definitions from aspect sample model
1 parent ff04c00 commit 8837b20

File tree

2 files changed

+55
-48
lines changed

2 files changed

+55
-48
lines changed

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

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777

7878
# tag::quantity-declaration[]
7979
:Parameter a samm:Entity ;
80-
samm:extends samm-e:Quantity ;
81-
samm:properties (
82-
[ samm:extends samm-e:value ; samm:characteristic :ParameterValueCharacteristic ]
83-
) .
80+
samm:extends samm-e:Quantity ;
81+
samm:properties (
82+
[ samm:extends samm-e:value ; samm:characteristic :ParameterValueCharacteristic ]
83+
) .
8484
:ParameterValueCharacteristic a samm:Characteristic ;
85-
samm:dataType xsd:integer .
85+
samm:dataType xsd:integer .
8686
# end::quantity-declaration[]
8787

8888
# tag::enumeration-simple-declaration-string[]
@@ -145,28 +145,17 @@
145145
] .
146146
# end::value-in-example-value-anonymous[]
147147

148-
# tag::enumeration-value-type-is-value-reference[]
148+
# tag::enumeration-value-type-common-start[]
149149
:TrafficLight a samm-c:Enumeration ;
150-
samm:name "TrafficLight" ;
151150
samm:preferredName "Warning Level"@en ;
152151
samm:description "Represents if speed of position change is within specification (green), within tolerance (yellow), or outside specification (red)."@en ;
153152
samm:dataType xsd:string ;
154-
samm-c:values ( :GreenLight ) .
155-
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> .
153+
samm-c:values (
154+
# end::enumeration-value-type-common-start[]
155+
# tag::enumeration-value-type-is-value-reference[]
156+
:GreenLight
161157
# end::enumeration-value-type-is-value-reference[]
162-
163158
# tag::enumeration-value-type-in-value-mixed-instance[]
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 ;
169-
samm-c:values (
170159
:GreenLight # A reference to named described scalar value
171160
"yellow" # A direct literal value
172161
[
@@ -175,23 +164,29 @@
175164
samm:preferredName "Critical Warning"@en ;
176165
samm:description "Indicates that the position change is outside the specification."@en
177166
]
167+
# end::enumeration-value-type-in-value-mixed-instance[]
168+
# tag::enumeration-value-type-common-end[]
178169
) .
170+
# end::enumeration-value-type-common-end[]
179171

172+
# tag::enumeration-value-green-light[]
180173
:GreenLight a samm:Value ;
181174
samm:value "green" ;
182175
samm:preferredName "Normal"@en ;
183176
samm:description "Indicates that the speed of position change is within specification."@en ;
184177
samm:see <https://en.wikipedia.org/wiki/Traffic_light> .
185-
186-
# end::enumeration-value-type-in-value-mixed-instance[]
178+
# end::enumeration-value-green-light[]
187179

188180
# tag::enumeration-complex-declaration[]
189181
:Results a samm-c:Enumeration ;
190182
samm:dataType :Result ;
191183
samm-c:values ( :Success :Failed ) .
192184

193185
:Result a samm:Entity ;
194-
samm:properties ( :status [ samm:property :description; samm:notInPayload "true"^^xsd:boolean ] ) .
186+
samm:properties (
187+
:status
188+
[ samm:property :description; samm:notInPayload "true"^^xsd:boolean ]
189+
) .
195190

196191
:Success a :Result ;
197192
:status "SUCCESS" ;
@@ -229,32 +224,32 @@
229224

230225
# tag::extending-entity-declaration[]
231226
:Student a samm:Entity ;
232-
samm:extends :Person ;
233-
samm:properties ( :studentNumber ) .
227+
samm:extends :Person ;
228+
samm:properties ( :studentNumber ) .
234229

235230
:Teacher a samm:Entity ;
236-
samm:extends :Person ;
237-
samm:properties ( :employeeNumber ) .
231+
samm:extends :Person ;
232+
samm:properties ( :employeeNumber ) .
238233

239234
:Person a samm:Entity ;
240-
samm:properties ( :name :surname ) .
235+
samm:properties ( :name :surname ) .
241236
# end::extending-entity-declaration[]
242237

243238
:studentNumber a samm:Property ;
244-
samm:characteristic samm-c:Text .
239+
samm:characteristic samm-c:Text .
245240

246241
:employeeNumber a samm:Property ;
247-
samm:characteristic samm-c:Text .
242+
samm:characteristic samm-c:Text .
248243

249244
:name a samm:Property ;
250-
samm:characteristic samm-c:Text .
245+
samm:characteristic samm-c:Text .
251246

252247
:surname a samm:Property ;
253-
samm:characteristic samm-c:Text .
248+
samm:characteristic samm-c:Text .
254249

255250
# tag::abstract-entity-declaration[]
256251
:VehicleComponent a samm:AbstractEntity ;
257-
samm:properties ( :typeNumber :manufacturer ) .
252+
samm:properties ( :typeNumber :manufacturer ) .
258253

259254
:Steeringwheel a samm:Entity ;
260255
samm:extends :VehicleComponent ;
@@ -269,7 +264,7 @@
269264
samm:characteristic samm-c:Boolean .
270265

271266
:material a samm:Property ;
272-
samm:characteristic samm-c:Text .
267+
samm:characteristic samm-c:Text .
273268

274269
# tag::operation-declaration[]
275270
:toggle a samm:Operation ;
@@ -303,30 +298,31 @@
303298

304299
# tag::see-url-declaration[]
305300
:lastName a samm:Property ;
306-
samm:see <https://schema.org/familyName> ;
307-
samm:see <http://xmlns.com/foaf/0.1/lastName> ;
308-
samm:characteristic samm-c:Text .
301+
samm:see <https://schema.org/familyName> ;
302+
samm:see <http://xmlns.com/foaf/0.1/lastName> ;
303+
samm:characteristic samm-c:Text .
309304
# end::see-url-declaration[]
310305

311306
# tag::see-oid-declaration[]
312307
:filterName a samm:Property ;
313-
samm:see <urn:oid:1.3.6.1.4.1.1919.1.1.2> ;
314-
samm:characteristic samm-c:Text .
308+
samm:see <urn:oid:1.3.6.1.4.1.1919.1.1.2> ;
309+
samm:characteristic samm-c:Text .
315310
# end::see-oid-declaration[]
316311

317312
# tag::see-irdi-declaration[]
318313
:drillDiameter a samm:Property ;
319-
# Reference to IRDI 0173-1#02-AAC895#009
320-
samm:see <urn:irdi:0173-1#02-AAC895%23009> ;
321-
samm:characteristic :Diameter .
314+
# Reference to IRDI 0173-1#02-AAC895#009
315+
samm:see <urn:irdi:0173-1#02-AAC895%23009> ;
316+
samm:characteristic :Diameter .
322317
# end::see-irdi-declaration[]
323318

324-
:Diameter a samm:Characteristic .
319+
:Diameter a samm:Characteristic ;
320+
samm:dataType xsd:int .
325321

326322
# tag::see-dontuse[]
327323
:organizationPerson a samm:Property ;
328-
samm:description "See ISO/IEC 11179-6:2015(E), section 3.35"@en ;
329-
samm:characteristic samm-c:Text .
324+
samm:description "See ISO/IEC 11179-6:2015(E), section 3.35"@en ;
325+
samm:characteristic samm-c:Text .
330326
# end::see-dontuse[]
331327

332328
# tag::measurement-declaration[]

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,27 @@ or external reference—for a specific value.
321321

322322
There are several ways to define values in an Enumeration:
323323

324-
- Value Reference example:
324+
Value references can be used as values:
325+
325326
[source,turtle,subs="attributes+"]
326327
----
328+
include::example$aspect-sample.ttl[tags=enumeration-value-type-common-start]
327329
include::example$aspect-sample.ttl[tags=enumeration-value-type-is-value-reference]
330+
include::example$aspect-sample.ttl[tags=enumeration-value-type-common-end]
331+
332+
include::example$aspect-sample.ttl[tags=enumeration-value-green-light]
328333
----
329334

330-
- Multiple (anonymous described scalar value and value reference) Value Definitions:
335+
It's also possible to combine value references, anoymous described scalar values
336+
and named described scalar values:
337+
331338
[source,turtle,subs="attributes+"]
332339
----
340+
include::example$aspect-sample.ttl[tags=enumeration-value-type-common-start]
333341
include::example$aspect-sample.ttl[tags=enumeration-value-type-in-value-mixed-instance]
342+
include::example$aspect-sample.ttl[tags=enumeration-value-type-common-end]
343+
344+
include::example$aspect-sample.ttl[tags=enumeration-value-green-light]
334345
----
335346

336347

0 commit comments

Comments
 (0)