Skip to content

Commit b90b1d7

Browse files
authored
Merge pull request #302 from eclipse-esmf/138-describe-semantics-of-reference-submodel-element
Add Reference Characteristic definition and shape.
2 parents cacdf2a + c20a1bc commit b90b1d7

File tree

8 files changed

+204
-80
lines changed

8 files changed

+204
-80
lines changed

documentation/modules/ROOT/diagrams/characteristics-instances.dot

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ digraph characteristics_instances {
131131
</table>>
132132
]
133133

134+
Reference [
135+
label =
136+
<<table border="0" cellpadding="5" cellspacing="0" cellborder="1" href="../characteristics.html#reference-characteristic">
137+
<tr>
138+
<td><u>Reference</u></td>
139+
</tr>
140+
<tr>
141+
<td>dataType : xsd:anyURI</td>
142+
</tr>
143+
</table>>
144+
]
145+
134146
MultiLanguageText [
135147
label =
136148
<<table border="0" cellpadding="5" cellspacing="0" cellborder="1" href="../characteristics.html#multi-language-text-characteristic">
@@ -181,6 +193,7 @@ digraph characteristics_instances {
181193
{ rank = same;
182194
Timestamp;
183195
UnitReference;
196+
Reference;
184197
ResourcePath;
185198
MimeType;
186199
Boolean;
@@ -192,12 +205,14 @@ digraph characteristics_instances {
192205
Locale -> Characteristic
193206
Language -> Characteristic
194207
UnitReference -> Characteristic
208+
Reference -> Characteristic
195209
MultiLanguageText -> Characteristic
196210
ResourcePath -> Characteristic
197211
MimeType -> Characteristic
198212

199213
Timestamp -> Text [style=invis]
200214
UnitReference -> MultiLanguageText [style=invis]
215+
Reference -> MultiLanguageText [style=invis]
201216
ResourcePath -> Locale[style=invis]
202217
MimeType -> Language [style=invis]
203218
Boolean -> Language [style=invis]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#
2+
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
3+
#
4+
# See the AUTHORS file(s) distributed with this work for additional
5+
# information regarding authorship.
6+
#
7+
# This Source Code Form is subject to the terms of the Mozilla Public
8+
# License, v. 2.0. If a copy of the MPL was not distributed with this
9+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
#
11+
# SPDX-License-Identifier: MPL-2.0
12+
#
13+
@prefix : <urn:samm:org.eclipse.esmf.samm.test:1.0.0#> .
14+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
15+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
16+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.2.0#> .
17+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
18+
19+
# tag::content[]
20+
:TestProperty a samm:Property ;
21+
samm:characteristic samm-c:Reference .
22+
# end::content[]

documentation/modules/ROOT/images/characteristics-instances.svg

Lines changed: 99 additions & 80 deletions
Loading

documentation/modules/ROOT/pages/characteristics.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,21 @@ See xref:modeling-guidelines.adoc#using-unit-reference[Using Unit Reference] for
447447

448448
dataType: `xref:datatypes.adoc#data-types[samm:curie]`
449449

450+
[[reference-characteristic]]
451+
=== Reference
452+
[.element-urn]
453+
--
454+
{samm-c}Reference
455+
--
456+
457+
A reference is a value that refers to a concept such as a resource or a model element.
458+
It can be a xref:namespaces.adoc#meta-model-identifiers-definition[SAMM meta model identifier],
459+
a xref:namespaces.adoc#aspect-model-element-identifiers-definition[SAMM model element identifier],
460+
a resource URI, or a URI referring to a concept in a different formalism or vocabulary.
461+
The value follows the same rules as a xref:modeling-guidelines.adoc#adding-external-references[samm:see reference].
462+
463+
See xref:modeling-guidelines.adoc#declaring-reference[declaring Reference] for usage in an Aspect Model.
464+
450465
[[constraints]]
451466
== Constraints
452467

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,21 @@ deconstruction rule corresponds with the named fields; secondly, it is used for
445445
check if it can be deconstructed using the deconstruction rule and reconstructed using the elements,
446446
i.e., that the deconstruction rule actually does what the model author intended.
447447

448+
[[declaring-reference]]
449+
==== Declaring Reference
450+
451+
The xref:characteristics.adoc#reference-characteristic[Reference] Characteristic is intended to be used
452+
for scenarios where a reference to a concept external to the Aspect Model is required, but the value of the
453+
reference (i.e., the identifier of the linked concept) is not known at modeling time yet. Other than that,
454+
it is conceptually similar to a xref:modeling-guidelines.adoc#adding-external-references[samm:see reference].
455+
456+
:attribute-missing: skip
457+
[source,turtle,subs="attributes+"]
458+
----
459+
include::example$reference-declaration.ttl[tags=content]
460+
----
461+
:attribute-missing: warn
462+
448463
[[using-unit-reference]]
449464
==== Using Unit Reference
450465

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@ samm-c:MimeType a samm:Characteristic ;
5959
samm:description """A MIME type as defined in RFC 2046, for example "application/pdf"."""@en ;
6060
samm:dataType xsd:string .
6161

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+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.eclipse.esmf.samm;
2+
3+
import org.junit.jupiter.params.ParameterizedTest;
4+
import org.junit.jupiter.params.provider.MethodSource;
5+
6+
class ReferenceShapeTest extends AbstractShapeTest {
7+
8+
@ParameterizedTest
9+
@MethodSource( value = "versionsStartingWith2_2_0" )
10+
void testValidReferenceExpectSuccess( final KnownVersion metaModelVersion ) {
11+
checkValidity( "reference-shape", "TestReference", metaModelVersion );
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
3+
#
4+
# See the AUTHORS file(s) distributed with this work for additional
5+
# information regarding authorship.
6+
#
7+
# This Source Code Form is subject to the terms of the Mozilla Public
8+
# License, v. 2.0. If a copy of the MPL was not distributed with this
9+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
10+
#
11+
# SPDX-License-Identifier: MPL-2.0
12+
#
13+
@prefix : <urn:samm:org.eclipse.esmf.samm.test:1.0.0#> .
14+
@prefix samm: <urn:samm:org.eclipse.esmf.samm:meta-model:2.2.0#> .
15+
@prefix samm-c: <urn:samm:org.eclipse.esmf.samm:characteristic:2.2.0#> .
16+
@prefix unit: <urn:samm:org.eclipse.esmf.samm:unit:2.2.0#> .
17+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
18+
19+
:TestProperty a samm:Property ;
20+
samm:characteristic samm-c:Reference .

0 commit comments

Comments
 (0)