Skip to content

Commit 72a80b5

Browse files
authored
Merge pull request #361 from eclipse-esmf/355-clarify-usage-of-rdflangstring-for-values
Clarify usage of rdf:langString for values
2 parents 65e29a1 + b110392 commit 72a80b5

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

documentation/modules/ROOT/pages/datatypes.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SPDX-License-Identifier: MPL-2.0
1313
[[data-types]]
1414
= Data Types
1515

16-
This page details *scalar* data types. Such a scalar data type gets used by a Characteristic to further define a Property.
16+
This page details *scalar* data types. Such a scalar data type gets used by a Characteristic to further define a Property.
1717

1818
For modeling Properties that require non-scalar data types, use xref:entities.adoc[Entities].
1919

@@ -92,6 +92,9 @@ definition in the respective standards and an informative description of their v
9292
| `https://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal[rdf:langString]` | Strings with language tags | "Hello"@en, "Hallo"@de. Note that this is written in RDF/Turtle syntax, and that only "Hello" and "Hallo" are the actual values. | {ok}
9393
|===
9494

95+
NOTE: When using `rdf:langString`, a language tag *must always* be provided using the `@` syntax (e.g., `"Hello"@en`).
96+
Using a typed literal form such as `"Hello"^^rdf:langString` is *invalid* and *should cause* the model loading or validation to fail.
97+
9598
The following types defined by the XSD and RDF specifications, respectively, are considered
9699
unsuitable in Aspect Models and _should not_ be used:
97100

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ SPDX-License-Identifier: MPL-2.0
1818
=== Notes
1919

2020
* As mentioned in the xref:index.adoc[Introduction], Aspect Models are described in RDF Turtle
21-
xref:samm-specification:appendix:bibliography.adoc#turtle[[turtle\]]. The aspect specification will
22-
therefore assume basic familiarity with Turtle.
21+
xref:samm-specification:appendix:bibliography.adoc#turtle[[turtle\]]. The aspect specification will
22+
therefore assume basic familiarity with Turtle.
2323
* For the definition of the different Model elements please refer to the
24-
xref:meta-model-elements.adoc[Meta Model Elements].
24+
xref:meta-model-elements.adoc[Meta Model Elements].
2525

2626

2727
[[naming-rules]]
@@ -32,22 +32,22 @@ https://en.wikipedia.org/wiki/Naming_convention_(programming)#Java[Java naming c
3232
classes, properties and methods.
3333

3434
* The names of Aspects, Entities, Events, Constraints and Characteristics follow the naming conventions for
35-
Java classes, i.e. UpperCamelCase.
35+
Java classes, i.e. UpperCamelCase.
3636
* The names of Properties, Operations and Units follow the naming conventions of Java methods, i.e.
37-
lowerCamelCase.
37+
lowerCamelCase.
3838

3939
[[rdf-turtle-formatting-rules]]
4040
=== RDF/Turtle formatting rules
4141

4242
* Each Aspect Model is defined in a separate TTL (Turtle) file.
4343
* The Turtle file containing an Aspect Model must have the same name as the Aspect.
4444
* Aspect Model files must be UTF-8 encoded and should not contain a
45-
https://en.wikipedia.org/wiki/Byte_order_mark[byte order mark].
45+
https://en.wikipedia.org/wiki/Byte_order_mark[byte order mark].
4646
* There should be one empty line between model element definitions.
4747
* Indentation should be done with three spaces.
4848
* There should be a space before every separating semicolon.
4949
* There should be padding spaces inside RDF lists and anonymous nodes (i.e. inside brackets and
50-
square brackets)
50+
square brackets)
5151

5252
[[attributes-that-all-model-elements-have]]
5353
=== Attributes that all model elements have
@@ -59,13 +59,13 @@ attributes:
5959
|===
6060
| Attributes | Description | Required
6161
| `samm:preferredName` | Human readable name in a specific language. This attribute may be defined
62-
multiple times for different languages but only once for a specific language. There should be at
63-
least one preferredName defined with an "en" language tag. | {nok}
62+
multiple times for different languages but only once for a specific language. There should be at
63+
least one preferredName defined with an "en" language tag. | {nok}
6464
| `samm:description` | Human readable description in a specific language. This attribute may be
65-
defined multiple times for different languages but only once for a specific language. There should
66-
be at least one description defined with an "en" language tag. | {nok}
65+
defined multiple times for different languages but only once for a specific language. There should
66+
be at least one description defined with an "en" language tag. | {nok}
6767
| `samm:see` | A reference to a related element in an external taxonomy, ontology or other standards
68-
document. The datatype is `xsd:anyURI`. This attribute may be defined multiple times. | {nok}
68+
document. The datatype is `xsd:anyURI`. This attribute may be defined multiple times. | {nok}
6969
|===
7070

7171
NOTE: Although both `samm:preferredName` and `samm:description` should be set at least once in every
@@ -125,15 +125,15 @@ addition to the general attributes, every Aspect Model element has the following
125125
|===
126126
| Attributes | Description | Required
127127
| `samm:properties` | The list of Properties of this Aspect. Leaving out this
128-
attribute completely is equivalent to having it present with an empty list as value. | {nok}
128+
attribute completely is equivalent to having it present with an empty list as value. | {nok}
129129
| `samm:operations` | The list of Operations of this Aspect. Leaving out this
130-
attribute completely is equivalent to having it present with an empty list as value. | {nok}
130+
attribute completely is equivalent to having it present with an empty list as value. | {nok}
131131
| `samm:events` | The list of Events of this Aspect. | {nok}
132132
|===
133133

134134
* Aspects follow the naming conventions for Java classes, i.e. UpperCamelCase.
135135
* Each Aspect Model must be defined in its own file. The file name must be the same as the Aspect's
136-
name.
136+
name.
137137
* The hierarchical namespace part in the Aspect's URN can be freely chosen.
138138

139139
The definition of an Aspect should therefore have the following structure in TTL syntax; note though
@@ -161,7 +161,7 @@ that all model elements have], Properties have the following attributes:
161161
|===
162162
| Attributes | Description | Required
163163
| `samm:characteristic` | The xref:characteristics.adoc#characteristics[Characteristic] describing
164-
this Property. | {ok}
164+
this Property. | {ok}
165165
| `samm:exampleValue` | An exemplary value that the Property can take, helping to clarify the intended meaning of the Property.
166166
This attribute supports both scalar literal values (e.g., xsd:string, xsd:float), an anonymous described scalar value,
167167
and value references that point to example values (i.e., references to instances of xref:modeling-guidelines.adoc#value-type[samm:Value]).
@@ -474,7 +474,7 @@ for Properties when all of the following conditions are met:
474474
* The value has a well-known structure consisting of different, separate parts
475475
* The parts can and should be described in more detail
476476
* The Property should not be decomposed/deconstructed into an Entity with separate Properties for
477-
each part
477+
each part
478478

479479
One of the main use cases is complex identifiers that encode context information such as provenance
480480
information, version numbers, locations codes and so on. It is unreasonable to split such a value up
@@ -493,10 +493,10 @@ Characteristic, and after that a complete concrete example is given.
493493
|===
494494
| Name | Example Value | Deconstruction Rule | Elements
495495
| ISO 8601 date | "2019-09-27"^^`xsd:date` | `(\d\{4})-(\d\{2})-(\d\{2})` | ( `:year` "-" `:month`
496-
"-" `:day` )
496+
"-" `:day` )
497497
| Email Address | "\[email protected]" | `([\w\.-]+)@([\w\.-]+\.\w{2,4})` | ( `:username` "@" `:host` )
498498
| Hex-encoded color | "0xAC03BE" | `0x([0-9A-Fa-f]\{2})([0-9A-Fa-f]\{2})([0-9A-Fa-f]\{2})` | ( "0x"
499-
`:red` `:green` `:blue` )
499+
`:red` `:green` `:blue` )
500500
|===
501501

502502
The following code shows the Aspect Model for the first example from the table. Note that when
@@ -538,7 +538,7 @@ include::example$reference-declaration.ttl[tags=content]
538538

539539
As explained in the section xref:modeling-guidelines.adoc#declaring-quantifiable-values-and-measurements[Declaring Quantifiables and Measurements], some values only make sense when they also have a unit assigned to them.
540540
This unit definition is in many cases fixed at design time, does not change thereafter and therefore at runtime (in the JSON payload for example), only the actual value is transported. +
541-
There may be scenarios, however, where this permanent fixation on a specific unit might not be sufficient because the unit can only be determined dynamically
541+
There may be scenarios, however, where this permanent fixation on a specific unit might not be sufficient because the unit can only be determined dynamically
542542
at runtime, or is a kind of configuration parameter which must be set when the system is being deployed/starting up. In cases like this, a xref:characteristics.adoc#unit-reference-characteristic[UnitReference] characteristic instance can be used to include a dynamic reference to the desired unit from the xref:appendix:unitcatalog.adoc[Unit catalog] and this information is then always included in the payload. The runtime payload refers to the unit using its `samm:curie`, i.e., the unit's URN's element name prefixed with `unit:`.
543543

544544
For example an Aspect with the following model:
@@ -554,7 +554,7 @@ can produce a JSON payload that could look something like this:
554554
----
555555
{
556556
"value" : 2.25,
557-
"unit" : "unit:hectopascal"
557+
"unit" : "unit:hectopascal"
558558
}
559559
----
560560

@@ -611,7 +611,7 @@ Entities have the following attributes:
611611
|===
612612
| Attributes | Description | Required
613613
| `samm:properties` | The list of Properties which make up the Entity. Leaving out this
614-
attribute completely is equivalent to having it present with an empty list as value.| {nok}
614+
attribute completely is equivalent to having it present with an empty list as value.| {nok}
615615
| `samm:extends` | The Entity which is extended by this Entity | {nok}
616616
|===
617617

@@ -707,7 +707,7 @@ Operations have the following attributes:
707707
|===
708708
| Attributes | Description | Required
709709
| `samm:input` | A list of references to Properties that describe the input to the operation. The
710-
attribute must be present, but the list may be empty. | {ok}
710+
attribute must be present, but the list may be empty. | {ok}
711711
| `samm:output` | A single reference to a Property that describes the output of the operation. |
712712
{nok}
713713
|===

0 commit comments

Comments
 (0)