Skip to content

Commit 08d01da

Browse files
committed
Refine long-description section, add headings for clarity
1 parent 4d95ea1 commit 08d01da

File tree

1 file changed

+139
-43
lines changed

1 file changed

+139
-43
lines changed

documentation/modules/appendix/pages/best-practices.adoc

Lines changed: 139 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ For optimal results, also consider the following best practices:
3030
* <<reduce-technical-debt-by-choosing-meaningful-names>>
3131
* <<add-payload-names-for-properties-where-necessary>>
3232
* <<if-certain-characteristics-are-present>>
33-
* <<adjust-the-preferredName-for-reader-friendliness>>
34-
* <<separate-words-for-preferredName>>
35-
* <<capitalization-for-preferredName>>
3633

37-
In addition to that, there are also best practices for <<describing-elements>>.
34+
In addition to that, there are also best practices for:
35+
36+
* <<naming-elements-preferred-name-specifics>>
37+
* <<describing-elements>>
38+
* <<describing-elements-syntax>>
3839

3940

4041
[[apply-camel-case-to-acronyms]]
@@ -133,6 +134,15 @@ For a "Collection Aspect", consider the following name advice for the Property i
133134
|Put the Aspect's name in *singular* and add a `History` suffix to it.
134135
|===
135136

137+
[[naming-elements-preferred-name-specifics]]
138+
== Naming Elements: preferredName specifics
139+
140+
This sections details best practices for the `preferredName` attribute:
141+
142+
* <<adjust-the-preferredName-for-reader-friendliness>>
143+
* <<separate-words-for-preferredName>>
144+
* <<capitalization-for-preferredName>>
145+
136146
[[adjust-the-preferredName-for-reader-friendliness]]
137147
=== Adjust the `preferredName` for reader-friendliness
138148

@@ -196,9 +206,8 @@ The following table details examples for appropriate Preferred Names in German.
196206

197207
TIP: By using words the same way they would appear in a dictionary, the `preferredName` attribute is flexible to be used in further applications. For example, to use it to complete a sentence or message in a UI, it can be used as-is. If used to appear as a tooltip, standing alone, it can be parsed towards starting with a capital letter (recommended for English, other languages may follow different conventions).
198208

199-
200209
[[describing-elements]]
201-
== Describing Elements
210+
== Describing Elements: Writing Style
202211

203212
The `description` attribute xref:ROOT:modeling-guidelines.adoc#attributes-that-all-model-elements-have[allows for] human-readable text in a specific language.
204213
Such information provides context for anyone concerned with an Aspect Model or any applications based on it.
@@ -210,8 +219,6 @@ For optimal results, consider the following best practices:
210219
* <<easy-and-concise>>
211220
* <<start-with-a-capital-letter-and-no-article>>
212221
* <<abbreviations-and-redundancies>>
213-
* <<about-full-stops>>
214-
* <<long-descriptions>>
215222

216223
[[no-brand-names]]
217224
=== No brand names
@@ -234,9 +241,9 @@ If the `see` attribute does not suffice, you can also use the description itself
234241
.Example: indicating a definition's source for a description text
235242
[source,text,subs="attributes+,+quotes"]
236243
----
237-
information and services representing an entity from a given viewpoint
244+
Information and services representing an entity from a given viewpoint
238245
239-
[SOURCE: IEC 63278-1:2023, editorial changes, no examples]
246+
SOURCE: IEC 63278-1:2023, editorial changes, no examples
240247
----
241248

242249
[[start-with-a-capital-letter-and-no-article]]
@@ -330,22 +337,45 @@ Preferred Name: `Material Demand ID`
330337

331338
|===
332339

340+
[[describing-elements-syntax]]
341+
== Describing Elements: Syntax
342+
343+
This section details the recommended syntax for the `description` attribute.
344+
345+
The typical description looks like this:
346+
347+
.Example
348+
[source,turtle,subs="attributes+,+quotes"]
349+
----
350+
samm:description "Sentence fragment starting with a capital letter"@en ;
351+
----
352+
353+
Further details and options:
354+
355+
* <<about-full-stops>>
356+
* <<long-descriptions>>
333357

334358
[[about-full-stops]]
335-
=== About full stops
359+
=== About full stops (aka: periods)
336360

337361
If you only have one sentence fragment as a description, do not add a period.
338362

339363
First of all, it is not needed in a sentence fragment.
340-
Secondly, the description can be used as a tooltip in user interfaces, for example.
341-
Tooltips do not include full stops.
364+
Secondly, the description can be used elsewhere, for example, as a tooltip in user interfaces.
365+
Tooltips and similar UI elements do not include full stops.
342366

343367
However, if you want to add more content to the description field, do put a period after your initial sentence fragment to separate it from the rest.
344368

345-
.Only add a full stop to your sentence fragment if it is followed by more text
369+
.(1) No period for short descriptions (sentence fragment)
370+
[source,turtle,subs="attributes+,+quotes"]
371+
----
372+
samm:description "Sentence fragment starting with a capital letter and leaving out the full stop at the end"@en ;
373+
----
374+
375+
.(2) Only add a period to your sentence fragment if it is followed by more text
346376
[source,turtle,subs="attributes+,+quotes"]
347377
----
348-
samm:description "Sentence fragment starting with a capital letter. Then we add more content. All end with a full stop."@en ;
378+
samm:description "Sentence fragment starting with a capital letter and ending with a period. Because there is more content. That's why all sentences and sentence fragments end with a full stop."@en ;
349379
----
350380

351381
[[long-descriptions]]
@@ -354,30 +384,111 @@ samm:description "Sentence fragment starting with a capital letter. Then we add
354384
Adding more content to the initial sentence fragment of your description is fine.
355385
Even multiline descriptions are possible.
356386

357-
.How a longer description could look like
387+
.Example description – for an example Property called "digital representation"
358388
[source,text,subs="attributes+,+quotes"]
359389
----
360-
Sentence fragment starting with a capital letter.
390+
Information and services representing an entity from a given viewpoint
391+
392+
EXAMPLE 1: examples of information are properties (e.g. maximum temperature), actual parameters (e.g. actual velocity), events (e.g. notification of status change), schematics (electrical), and visualization information (2D and 3D drawings).
393+
394+
EXAMPLE 2: examples of services are asset services (for example providing the history of the configuration data or providing the actual velocity) and asset related services (for example providing a simulation).
395+
396+
EXAMPLE 3: examples of viewpoints are mechanical, electrical, or commercial characteristics.
397+
398+
SOURCE: IEC 63278-1:2023, editorial changes
399+
----
400+
401+
=== NOTE
402+
403+
TBD
404+
405+
=== EXAMPLE
406+
407+
TBD
408+
409+
=== SOURCE
410+
411+
TBD
412+
413+
=== Lists
414+
415+
TBD
416+
417+
=== Line breaks
418+
419+
TBD
420+
421+
[[summary-long-descriptions]]
422+
=== Summary
423+
424+
Items to structure your description:
425+
426+
* In capital letters, followed by a colon, one-lined, preceded and followed by line breaks:
427+
** `NOTE` +
428+
If several are required: numerate them – NOTE 1, NOTE 2, etc.
429+
** `EXAMPLE` +
430+
If several are required: numerate them – EXAMPLE 1, EXAMPLE 2, etc.
431+
** `SOURCE` +
432+
If several are required: numerate them – SOURCE 1, SOURCE 2, etc.
433+
* Ordered lists
434+
* Unordered lists
435+
* Line breaks, using Turtle's built-in triple quote syntax `"""`
436+
437+
.Elements a long description could include
438+
[source,text]
439+
// [source,text,subs="attributes+,+quotes"]
440+
----
441+
Sentence fragment starting with a capital letter, no article, and ending without a full stop
442+
443+
Then, add more content. Use complete sentences and end them with full stops.
444+
445+
NOTE: Highlight information with a NOTE. If you need more than one, numerate them, for example, with NOTE 1, NOTE 2, NOTE 3, etc.
361446
362-
Then we add more content. All ending with full stops. There is more to say about this. Yet another sentence.
447+
EXAMPLE 1: You can also provide examples. If there is only one example, do not add a number, just use EXAMPLE.
363448
364-
NOTE: We can highlight information with a NOTE. Even more than one, then you would numerate them like NOTE 1 etc.
449+
EXAMPLE 2: Another example. Note that every example is separated by line breaks.
365450
366-
EXAMPLE 1: We can also give an examples.
451+
EXAMPLE 3: Etc.
367452
368-
EXAMPLE 2: Or two.
453+
You can also use ordered or unordered lists.
369454
370-
EXAMPLE 3: All numbered accordingly.
455+
An example for an ordered list:
371456
372-
Or we can use ordered or unordered lists. Like:
373-
1. A list item
457+
1. A list item, starting the list which is preceded and followed by a line break
374458
2. Another list item
459+
2.1 A sub item
460+
2.1.1 A sub sub item
461+
2.1.2 Another sub sub item
462+
2.2 Another sub item
463+
3. A list item
375464
376-
And we can add sources if our definition is taken from another source. For example:
377-
[SOURCE: IEC TS 62443-1-1]
465+
An example for an unordered list:
378466
379-
Or, if we have changed a source's definition:
380-
[SOURCE: IEC 63278-1:2023, editorial changes, no examples]
467+
* A list item
468+
* Another list item
469+
** A sub item
470+
*** A sub sub item
471+
*** Another sub sub item
472+
** Another sub item
473+
* A list item
474+
475+
To be decided: Asterisk or hyphen to start a list item?
476+
477+
- A list item
478+
- Another list item
479+
-- A sub item
480+
--- A sub sub item
481+
--- Another sub sub item
482+
-- Another sub item
483+
- A list item
484+
485+
Add sources if your definition is taken from another source. For example:
486+
487+
SOURCE: IEC TS 62443-1-1
488+
489+
Or, if you adapted a source's original text:
490+
491+
SOURCE: IEC 63278-1:2023, editorial changes, no examples
381492
----
382493

383494
////
@@ -393,21 +504,6 @@ Adding line breaks to the text in the turtle file helps to display the text well
393504
394505
////
395506

396-
397-
.Example description for "digital representation"
398-
[source,text,subs="attributes+,+quotes"]
399-
----
400-
Information and services representing an entity from a given viewpoint.
401-
402-
EXAMPLE 1: examples of information are properties (e.g. maximum temperature), actual parameters (e.g. actual velocity), events (e.g. notification of status change), schematics (electrical), and visualization information (2D and 3D drawings).
403-
404-
EXAMPLE 2: examples of services are asset services (for example providing the history of the configuration data or providing the actual velocity) and asset related services (for example providing a simulation).
405-
406-
EXAMPLE 3: examples of viewpoints are mechanical, electrical, or commercial characteristics.
407-
408-
[SOURCE: IEC 63278-1:2023, editorial changes]
409-
----
410-
411507
[[choosing-a-numeric-type]]
412508
== Choosing a Numeric Type
413509

0 commit comments

Comments
 (0)