Skip to content

Commit d15f3c4

Browse files
committed
Improvements from PR review.
1 parent 41894c9 commit d15f3c4

File tree

1 file changed

+22
-25
lines changed
  • documentation/developer-guide/modules/tooling-guide/pages

1 file changed

+22
-25
lines changed

documentation/developer-guide/modules/tooling-guide/pages/bamm-cli.adoc

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[[bamm-cli]]
44
= BAMM CLI
55

6-
The BAMM CLI is a command line tool for the validation of Aspect models and the generation of artifacts, such as documentation or code, from Aspect models.
6+
The BAMM CLI is a command line tool for the validation of Aspect Models and the generation of artifacts, such as documentation or code, from Aspect Models.
77

88
TIP: Download latest version: icon:download[] https://github.com/OpenManufacturingPlatform/sds-sdk/releases/download/v{sds-sdk-version}/bamm-cli-{sds-sdk-version}.jar[bamm-cli-{sds-sdk-version}.jar]
99

@@ -140,11 +140,11 @@ The full command would result in:
140140
java -jar bamm-cli-{sds-sdk-version}.jar aspect _AspectModel.ttl_ to openapi -b "https://www.example.org" -r "/resources/\{resourceId}" -p _fileLocation_
141141
----
142142

143-
=== Mapping between the Aspect models and the OpenAPI Specification
143+
=== Mapping between the Aspect Models and the OpenAPI Specification
144144

145145
In this section, a detailed description of the mapping between individual Aspect elements and the OpenAPI specification is given.
146-
To make it easier to follow, the mapping is explained based on a concrete example, divided into logically coherent blocks. Please bear in mind
147-
that these blocks are snippets or fragments of a larger whole; viewed in isolation they do not necessarily form a valid or meaningful aspect model or OpenAPI specification.
146+
To make it easier to follow, the mapping is explained based on a concrete example, divided into logically coherent blocks.
147+
Please bear in mind that these blocks are snippets or fragments of a larger whole; viewed in isolation they do not necessarily form a valid or meaningful Aspect Model or OpenAPI specification.
148148

149149
==== Naming and versioning
150150

@@ -154,12 +154,12 @@ Please consider the following model fragment, with the attention focused on the
154154
@prefix bamm: <urn:bamm:io.openmanufacturing:meta-model:2.0.0#>.
155155
@prefix : <urn:bamm:test:2.0.0#>. <1>
156156
157-
:Test a bamm:Aspect;
158-
bamm:name "Test"; <3>
157+
:Test a bamm:Aspect; <3>
159158
bamm:preferredName "TestAspect"@en ; <2>
160159
bamm:preferredName "TestAspekt"@de .
161160
----
162-
<1> full URN of :Test Aspect
161+
162+
<1> prefix used to build the full URN of :Test Aspect
163163
<2> the preferred name of the Aspect in language of user's choice
164164
<3> the name of the Aspect
165165

@@ -175,12 +175,12 @@ For the generated OpenAPI Specification, the following mapping would apply:
175175
}
176176
}
177177
----
178-
<1> depending on parameters used when generating the specification, this is either the major version of the full Aspect URN (*2*.0.0),
179-
or it can be the full version (`v2.0.0`), if using `-sv` (semantic version) command line switch
178+
179+
<1> depending on parameters used when generating the specification, this is either the major version of the full Aspect URN (*2*.0.0), or it can be the full version (`v2.0.0`), if using `-sv` (semantic version) command line switch
180180
<2> if present, `bamm:preferredName` is used as the value for the `title` element of the specification
181-
<3> as `bamm:preferredName` is an optional element, in cases when it is missing the value of `bamm:name` is used instead
181+
<3> as `bamm:preferredName` is an optional element, in cases when it is missing the name of the Aspect is used instead
182182

183-
The version information as described above is also used in the url definitions of the `servers` block of the specification:
183+
The version information as described above is also used in the URL definitions of the `servers` block of the specification:
184184

185185
[source,JSON]
186186
----
@@ -222,12 +222,11 @@ For an example Aspect from the following fragment:
222222
----
223223
:Test a bamm:Aspect; <1>
224224
bamm:properties (
225-
:prop1 <2>
226-
[ bamm:property :prop2; bamm:payloadName "givenName"; ] <3>
227-
[ bamm:property :prop3; bamm:optional true; ] ). <4>
225+
:prop1 <2>
226+
[ bamm:property :prop2; bamm:payloadName "givenName"; ] <3>
227+
[ bamm:property :prop3; bamm:optional true; ] ). <4>
228228
229229
:prop1 a bamm:Property;
230-
bamm:name "property1";
231230
bamm:description "Description of Property1"@en; <5>
232231
bamm:characteristic :Enum. <6>
233232
----
@@ -237,7 +236,7 @@ an entry like the one given in the following JSON will be generated:
237236
[source,JSON]
238237
----
239238
"Test" : { // <1>
240-
"type" : "object",
239+
"type" : "object",
241240
"properties" : {
242241
"prop1" : { // <2>
243242
"description" : "Description of Property1", // <5>
@@ -251,16 +250,15 @@ an entry like the one given in the following JSON will be generated:
251250
}
252251
},
253252
"required" : [ "prop1", "givenName" ] // <2> <3>
254-
}
253+
}
255254
----
255+
256256
<1> the name of the Aspect is used to name the schema object for the aspect
257257
<2> with plain property references, the name of the property is used to name the property definition
258258
<3> in cases where a payload name is defined on a specific property, it is used in preference to the plain property name
259259
<4> if the property use is also defined as optional, the property will not be included in the list of the required properties
260260
<5> the values of `bamm:description` elements in property definitions are included in the generated JSON
261-
<6> for each of the properties characteristics an entry in `components/schemas` is generated and referenced here; if the characteristic is of complex type,
262-
the whole procedure is applied recursively to the complex type's properties
263-
261+
<6> for each of the properties characteristics an entry in `components/schemas` is generated and referenced here; if the characteristic is of complex type, the whole procedure is applied recursively to the complex type's properties
264262

265263
==== Mapping of Aspect's operations
266264

@@ -330,6 +328,7 @@ The available operations are then added to the `components/schemas` part:
330328
}
331329
}
332330
----
331+
333332
<1> the names of the input
334333
<2> and output parameters are reflected in the properties generated for the request/response objects
335334
<3> the characteristics are generated
@@ -340,18 +339,16 @@ For technical reasons, there may be a slight variation in the generated JSON dep
340339

341340
==== Mapping of Collections
342341

343-
There are some additional JSON entries generated for complex types related to various types of collections to facilitate
344-
access to the individual elements of these collections via paging. As these entries are rather of static character
345-
without direct references to any aspect elements, it suffices here to give a short overview about which kind of paging
346-
is available for which type of collection:
342+
There are some additional JSON entries generated for complex types related to various types of collections to facilitate access to the individual elements of these collections via paging.
343+
As these entries are rather of static character without direct references to any aspect elements, it suffices here to give a short overview about which kind of paging is available for which type of collection:
347344

348345
* a general Collection - cursor and/or offset based paging
349346
* TimeSeries - cursor, offset and/or time based paging
350347

351348
[[models-directory-structure]]
352349
== Understanding the models directory structure
353350

354-
An Aspect model file can contain an Aspect definition as well as other model elements that are defined in the same versioned namespace, as described in the xref:bamm-specification:ROOT:namespaces.adoc[Namespaces section of the
351+
An Aspect Model file can contain an Aspect definition as well as other model elements that are defined in the same versioned namespace, as described in the xref:bamm-specification:ROOT:namespaces.adoc[Namespaces section of the
355352
specification].
356353
Additionally, it is possible to split one versioned namespace across multiple files, for example to define a Characteristic that is usable in multiple Aspects into its own file.
357354
In order for BAMM CLI to be able to resolve references to such externally defined model elements, the model files must be organized in a directory structure as follows:

0 commit comments

Comments
 (0)