metanorma-plugin-lutaml 0.7.30 → 0.7.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +10 -8
- data/README.adoc +16 -1030
- data/docs/usages/enterprise_architect.adoc +583 -0
- data/docs/usages/express.adoc +299 -0
- data/docs/usages/json_yaml.adoc +1034 -0
- data/docs/usages/lutaml-gml.adoc +73 -0
- data/docs/usages/lutaml-uml.adoc +73 -0
- data/lib/metanorma/plugin/lutaml/asciidoctor/preprocessor.rb +1 -1
- data/lib/metanorma/plugin/lutaml/base_structured_text_preprocessor.rb +192 -0
- data/lib/metanorma/plugin/lutaml/content.rb +89 -0
- data/lib/metanorma/plugin/lutaml/data2_text_preprocessor.rb +45 -0
- data/lib/metanorma/plugin/lutaml/express_remarks_decorator.rb +19 -6
- data/lib/metanorma/plugin/lutaml/json2_text_preprocessor.rb +43 -0
- data/lib/metanorma/plugin/lutaml/liquid/custom_blocks/key_iterator.rb +31 -0
- data/lib/metanorma/plugin/lutaml/liquid/custom_filters/loadfile.rb +18 -0
- data/lib/metanorma/plugin/lutaml/liquid/custom_filters/replace_regex.rb +14 -0
- data/lib/metanorma/plugin/lutaml/liquid/custom_filters/values.rb +13 -0
- data/lib/metanorma/plugin/lutaml/liquid/multiply_local_file_system.rb +29 -22
- data/lib/metanorma/plugin/lutaml/liquid_drops/gml_dictionary_drop.rb +1 -1
- data/lib/metanorma/plugin/lutaml/lutaml_diagram_base.rb +1 -1
- data/lib/metanorma/plugin/lutaml/lutaml_diagram_block_macro.rb +2 -1
- data/lib/metanorma/plugin/lutaml/lutaml_ea_diagram_block_macro.rb +2 -1
- data/lib/metanorma/plugin/lutaml/lutaml_ea_xmi_base.rb +48 -36
- data/lib/metanorma/plugin/lutaml/lutaml_figure_inline_macro.rb +2 -1
- data/lib/metanorma/plugin/lutaml/lutaml_gml_dictionary_block_macro.rb +3 -1
- data/lib/metanorma/plugin/lutaml/lutaml_klass_table_block_macro.rb +2 -1
- data/lib/metanorma/plugin/lutaml/lutaml_preprocessor.rb +15 -2
- data/lib/metanorma/plugin/lutaml/lutaml_table_inline_macro.rb +2 -1
- data/lib/metanorma/plugin/lutaml/source_extractor.rb +97 -0
- data/lib/metanorma/plugin/lutaml/utils.rb +59 -26
- data/lib/metanorma/plugin/lutaml/version.rb +1 -1
- data/lib/metanorma/plugin/lutaml/yaml2_text_preprocessor.rb +41 -0
- data/lib/metanorma-plugin-lutaml.rb +3 -0
- data/metanorma-plugin-lutaml.gemspec +7 -1
- metadata +35 -6
- data/lib/metanorma/plugin/lutaml/liquid_templates/test.rb +0 -1
- /data/lib/metanorma/plugin/lutaml/liquid/{custom_filters.rb → custom_filters/html2adoc.rb} +0 -0
@@ -0,0 +1,583 @@
|
|
1
|
+
|
2
|
+
== Usage with Enterprise Architect (UML in XMI)
|
3
|
+
|
4
|
+
=== General
|
5
|
+
|
6
|
+
The LutaML plugin supports working with Enterprise Architect exported XMI files
|
7
|
+
to render UML diagrams and class definitions.
|
8
|
+
|
9
|
+
The commands are prefixed as `lutaml_ea_*` to denote their specific use with
|
10
|
+
Enterprise Architect XMI files.
|
11
|
+
|
12
|
+
|
13
|
+
=== Document attribute `:lutaml-xmi-index:`
|
14
|
+
|
15
|
+
This attribute allows specifying one or more XMI files to defined names
|
16
|
+
for later use with `lutaml_ea_*` commands.
|
17
|
+
|
18
|
+
Syntax:
|
19
|
+
|
20
|
+
[source,adoc]
|
21
|
+
----
|
22
|
+
:lutaml-xmi-index: index_name; index_path[; config=config_path]
|
23
|
+
----
|
24
|
+
|
25
|
+
where:
|
26
|
+
|
27
|
+
`index_name`:: name of index
|
28
|
+
`index_path`:: path to XMI file for the later use with `lutaml_ea_*` command
|
29
|
+
`config_path`:: optional, location of YAML configuration file that specifies
|
30
|
+
what packages to include in the render, what render style is desired and
|
31
|
+
location of the root package.
|
32
|
+
|
33
|
+
|
34
|
+
[example]
|
35
|
+
.Define two indexes in the document and use them in the `lutaml_ea_xmi` command
|
36
|
+
====
|
37
|
+
[source,adoc]
|
38
|
+
----
|
39
|
+
:lutaml-xmi-index: first-xmi-index; /path/to/first.xmi
|
40
|
+
:lutaml-xmi-index: second-xmi-index; /path/to/second.xmi; config=/path/to/config.yml
|
41
|
+
|
42
|
+
[lutaml_ea_xmi,index=first-xmi-index]
|
43
|
+
--
|
44
|
+
...
|
45
|
+
--
|
46
|
+
|
47
|
+
lutaml_ea_diagram::[name="NameOfDiagramInSecondXmiIndex",base_path="./xmi-images",format="png",index="second-xmi-index"]
|
48
|
+
...
|
49
|
+
----
|
50
|
+
|
51
|
+
The command `lutaml_ea_xmi` will load the XMI file from the path
|
52
|
+
`/path/to/first.xmi` which is specified by the `index`: `first-xmi-index`.
|
53
|
+
|
54
|
+
The command `lutaml_ea_diagram` will load the XMI file from the path
|
55
|
+
`/path/to/second.xmi` which is specified by the `index`: `second-xmi-index`.
|
56
|
+
====
|
57
|
+
|
58
|
+
|
59
|
+
=== Rendering a Enterprise Architect diagram from XMI: `lutaml_ea_diagram`
|
60
|
+
|
61
|
+
This command allows to quickly render a LutaML diagram as an image file by
|
62
|
+
specifying the name of diagram.
|
63
|
+
|
64
|
+
Syntax:
|
65
|
+
|
66
|
+
[source,adoc]
|
67
|
+
----
|
68
|
+
lutaml_ea_diagram::[{options}]
|
69
|
+
----
|
70
|
+
|
71
|
+
where `{options}` is a hash of options, where:
|
72
|
+
|
73
|
+
`name`:: (mandatory) name of the diagram to render.
|
74
|
+
`base_path`:: (mandatory) base path where the diagram images are located.
|
75
|
+
`format`:: (optional) format of the image file. Defaults to `png`.
|
76
|
+
`index`:: (optional) index name of the XMI file. If the index is not provided,
|
77
|
+
the command will look for the diagram in the first XMI file specified through
|
78
|
+
the `lutaml_ea_xmi` command.
|
79
|
+
`package`:: (optional) name of the package which contains the diagram. If the
|
80
|
+
package is not provided, the command will look for the diagram across all
|
81
|
+
packages in the XMI file.
|
82
|
+
|
83
|
+
The diagram with name `name_of_diagram` will be converted into the following
|
84
|
+
Metanorma block:
|
85
|
+
|
86
|
+
[source,adoc]
|
87
|
+
----
|
88
|
+
[[figure-{{ diagram.xmi_id }}]]
|
89
|
+
.{{ diagram.name }}
|
90
|
+
image::{{ image_base_path }}/{{ diagram.xmi_id }}.{{ format | default: 'png' }}[]
|
91
|
+
----
|
92
|
+
|
93
|
+
[example]
|
94
|
+
.Specifying a diagram within an XMI file
|
95
|
+
====
|
96
|
+
[source,adoc]
|
97
|
+
----
|
98
|
+
lutaml_ea_diagram::[name="name_of_diagram",base_path="/path/to/xmi-images",format="png"]
|
99
|
+
----
|
100
|
+
|
101
|
+
Renders the diagram with name `name_of_diagram` from the XMI file in PNG format,
|
102
|
+
where the EA images exported with the XMI file are at `/path/to/xmi-images`.
|
103
|
+
====
|
104
|
+
|
105
|
+
[example]
|
106
|
+
.Specifying a diagram within a specific package (if there are multiple diagrams with the same name)
|
107
|
+
====
|
108
|
+
[source,adoc]
|
109
|
+
----
|
110
|
+
lutaml_ea_diagram::[name="DiagramName",package="PackageA",base_path="/path/to/xmi-images"]
|
111
|
+
----
|
112
|
+
|
113
|
+
The search wil be restricted to the diagrams named `DiagramName` in the
|
114
|
+
`PackageA` package.
|
115
|
+
====
|
116
|
+
|
117
|
+
[example]
|
118
|
+
.Specifying a diagram using a specific index
|
119
|
+
====
|
120
|
+
[source,adoc]
|
121
|
+
----
|
122
|
+
:lutaml-xmi-index: index_name; /path/to/xmi-file.xmi
|
123
|
+
|
124
|
+
...
|
125
|
+
|
126
|
+
lutaml_ea_diagram::[name="name_of_diagram",base_path="/path/to/xmi-images",format="png",index="index_name"]
|
127
|
+
----
|
128
|
+
|
129
|
+
Renders the diagram with name `name_of_diagram` from the XMI file in PNG format,
|
130
|
+
where the EA images exported with the XMI file are at `/path/to/xmi-images` and
|
131
|
+
the XMI file defined in the index `index_name`.
|
132
|
+
====
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
=== Generating a class definition table for a class: `lutaml_klass_table`
|
137
|
+
|
138
|
+
This command allows to render a LutaML table of a class by using Liquid Drop.
|
139
|
+
|
140
|
+
The table will show:
|
141
|
+
|
142
|
+
* Class Name
|
143
|
+
* Class Definition
|
144
|
+
* Inherited Properties
|
145
|
+
* Self-defined Properties
|
146
|
+
* Properties Inherited from Association
|
147
|
+
* Properties Defined in Association
|
148
|
+
|
149
|
+
[source,adoc]
|
150
|
+
----
|
151
|
+
lutaml_klass_table::/path/to/example.xmi[name="NameOfClass",template="/path/to/templates/_my_klass_table.liquid"]
|
152
|
+
----
|
153
|
+
|
154
|
+
The command accepts the options listed below:
|
155
|
+
|
156
|
+
* `/path/to/example.xmi` specifies the path of xmi file.
|
157
|
+
|
158
|
+
* `name` option only, `name` option with `package` option or `path` option.
|
159
|
+
One of 3 forms of options can be used to specify the name of the class.
|
160
|
+
|
161
|
+
** `name="NameOfClass"` specifies the name of the `class`.
|
162
|
+
(e.g. `name="Building"`)
|
163
|
+
If there are multiple classes with the same name, other form of options
|
164
|
+
are recommended to specify the class.
|
165
|
+
|
166
|
+
** `package="NameOfPackage"name="NameOfClass"` specifies the name of the
|
167
|
+
`class` (specified by `name` option) inside the `package`
|
168
|
+
(specified by `package` option).
|
169
|
+
The `package` option must be used with the `name` option.
|
170
|
+
(e.g. `package="uro",name="_BoundarySurface"`)
|
171
|
+
|
172
|
+
** `path="PathOfClass"` specifies the `absolute` path of the `class`
|
173
|
+
which is started with `::`
|
174
|
+
(e.g. `path="::EA_Model::Conceptual Models::i-UR::Urban Planning ADE 3.
|
175
|
+
1::uro::_BoundarySurface"`)
|
176
|
+
or `relative` path of the `class` which is not started with `::`
|
177
|
+
(e.g. `path="uro::_BoundarySurface"`).
|
178
|
+
The last part of the path separated by `::` is the name of the `class`.
|
179
|
+
The other parts of the path are the names of the `packages`.
|
180
|
+
|
181
|
+
* `template="/path/to/templates/_my_klass_table.liquid"` specifies the path of
|
182
|
+
the liquid template. (Optional)
|
183
|
+
By default, it will look for the template `_klass_table.liquid` defined in
|
184
|
+
`lib/metanorma/plugin/lutaml/templates`. This template can be customized by
|
185
|
+
changing the template path in the `template` option.
|
186
|
+
|
187
|
+
* `guidance="/path/to/my_guidance.yml"` specifies the path of
|
188
|
+
the yaml file of the guidance. (Optional)
|
189
|
+
|
190
|
+
The guidance file should be in the following format:
|
191
|
+
|
192
|
+
[source,yaml]
|
193
|
+
----
|
194
|
+
---
|
195
|
+
classes:
|
196
|
+
- name: Name Of Class
|
197
|
+
attributes:
|
198
|
+
- name: Name Of Attribute (e.g. gml:boundedBy)
|
199
|
+
used: false
|
200
|
+
guidance: |
|
201
|
+
Drop guidance message here.
|
202
|
+
...
|
203
|
+
----
|
204
|
+
|
205
|
+
If you want to define the guidance, you can define the `name` of the class
|
206
|
+
under `classes`. Then define which `attributes` you want to add guidance by the
|
207
|
+
`name`. Set `used` to show the attribute is used or not. Drop the message of
|
208
|
+
guidance in `guidance`.
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
=== Usage of `lutaml_ea_xmi` command
|
214
|
+
|
215
|
+
The `lutaml_ea_xmi` command supersedes the `lutaml_uml_datamodel_description`
|
216
|
+
command which it is functionally equivalent to.
|
217
|
+
|
218
|
+
This command renders data model packages and its dependent objects for supplied
|
219
|
+
XMI file, by using Liquid Drop objects.
|
220
|
+
|
221
|
+
NOTE: The performance of `lutaml_ea_xmi` exceeds
|
222
|
+
`lutaml_uml_datamodel_description` by 10~20 times (Tested with a 10.6MB XMI file
|
223
|
+
with 120,000+ lines).
|
224
|
+
|
225
|
+
NOTE: To migrate to this command from `lutaml_uml_datamodel_description`, just
|
226
|
+
replace the command `lutaml_uml_datamodel_description` by `lutaml_ea_xmi`.
|
227
|
+
|
228
|
+
Replace:
|
229
|
+
|
230
|
+
[source,adoc]
|
231
|
+
----
|
232
|
+
[lutaml_uml_datamodel_description, path/to/example.xmi]
|
233
|
+
...
|
234
|
+
----
|
235
|
+
|
236
|
+
By:
|
237
|
+
|
238
|
+
[source,adoc]
|
239
|
+
----
|
240
|
+
[lutaml_ea_xmi, path/to/example.xmi]
|
241
|
+
...
|
242
|
+
----
|
243
|
+
|
244
|
+
You can define guidance in the configuration file as well. The configuration
|
245
|
+
file will looks like:
|
246
|
+
|
247
|
+
[source,yaml]
|
248
|
+
----
|
249
|
+
packages:
|
250
|
+
- my_package
|
251
|
+
guidance: "path/to/guidance.yaml"
|
252
|
+
----
|
253
|
+
|
254
|
+
The guidance file should be in the following format:
|
255
|
+
|
256
|
+
[source,yaml]
|
257
|
+
----
|
258
|
+
---
|
259
|
+
classes:
|
260
|
+
- name: "NameOfClass"
|
261
|
+
attributes:
|
262
|
+
- name: Name Of Attribute (e.g. gml:boundedBy)
|
263
|
+
used: false
|
264
|
+
guidance: |
|
265
|
+
Drop guidance message here.
|
266
|
+
...
|
267
|
+
----
|
268
|
+
|
269
|
+
If you want to define the guidance, you can define the `name` of the class
|
270
|
+
under `classes`. Then define which `attributes` you want to add guidance by the
|
271
|
+
`name`. Set `used` to show the attribute is used or not. Drop the message of
|
272
|
+
guidance in `guidance`.
|
273
|
+
|
274
|
+
The `name` of class can be defined in the following ways:
|
275
|
+
|
276
|
+
* `name: "NameOfClass"` specifies the name of the `class`.
|
277
|
+
(e.g. `name: "Building"`)
|
278
|
+
If there are multiple classes with the same name, it is recommended to
|
279
|
+
specify the class by absolute path.
|
280
|
+
|
281
|
+
* `name: "::NameOfPackage::NameOfClass"` specifies the name of the `class` in
|
282
|
+
`absolute` path.
|
283
|
+
(e.g. `name: "::EA_Model::Conceptual Models::CityGML2.0::bldg::Building"`)
|
284
|
+
|
285
|
+
|
286
|
+
=== Usage of `lutaml_uml_datamodel_description` command
|
287
|
+
|
288
|
+
This command allows to quickly render data model packages and its dependent
|
289
|
+
objects for supplied XMI file.
|
290
|
+
|
291
|
+
Given an Enterprise Architect `example.xmi` file with 2 packages:
|
292
|
+
|
293
|
+
* 'Another'
|
294
|
+
* 'CityGML'
|
295
|
+
|
296
|
+
The `lutaml_uml_datamodel_description` command can be used:
|
297
|
+
|
298
|
+
[source,adoc]
|
299
|
+
----
|
300
|
+
[lutaml_uml_datamodel_description, path/to/example.xmi]
|
301
|
+
--
|
302
|
+
[.before]
|
303
|
+
....
|
304
|
+
my text
|
305
|
+
....
|
306
|
+
|
307
|
+
[.diagram_include_block, base_path="requirements/", format="emf"]
|
308
|
+
....
|
309
|
+
Diagram text
|
310
|
+
....
|
311
|
+
|
312
|
+
[.include_block, package="Another", base_path="spec/fixtures"]
|
313
|
+
....
|
314
|
+
my text
|
315
|
+
....
|
316
|
+
|
317
|
+
[.include_block, base_path="spec/fixtures"]
|
318
|
+
....
|
319
|
+
my text
|
320
|
+
....
|
321
|
+
|
322
|
+
[.before, package="Another"]
|
323
|
+
....
|
324
|
+
text before Another package
|
325
|
+
....
|
326
|
+
|
327
|
+
[.after, package="Another"]
|
328
|
+
....
|
329
|
+
text after Another package
|
330
|
+
....
|
331
|
+
|
332
|
+
[.after, package="CityGML"]
|
333
|
+
....
|
334
|
+
text after CityGML package
|
335
|
+
....
|
336
|
+
|
337
|
+
[.after]
|
338
|
+
....
|
339
|
+
footer text
|
340
|
+
....
|
341
|
+
--
|
342
|
+
--
|
343
|
+
----
|
344
|
+
|
345
|
+
Where:
|
346
|
+
|
347
|
+
* `path/to/example.xmi` - required, path to the XMI file to render
|
348
|
+
|
349
|
+
* `[.before]` - block text that adds additional text before the rendered output, can be used only once, additional occurrences of command will overwrite text, not that `literal` block style must be used in there(eg `....`)
|
350
|
+
|
351
|
+
* `[.after]` - block text that adds additional text after the rendered output, can be used only once, additional occurrences of command will overwrite text
|
352
|
+
|
353
|
+
* `[.after, package="Another"]` - block text to be inserted before(after in case of `.before` name) the package
|
354
|
+
|
355
|
+
* `[.package_text, position="after", package="Another"]` - include custom adoc code into package rendered body, `position` is a a required attribute which tells where to insert the code.
|
356
|
+
|
357
|
+
* `[.package_text, package="Another"]` - same as above, but include block will be included only for supplied package name
|
358
|
+
|
359
|
+
* `[.diagram_include_block]` - block text to automatically include diagram images. Attribute `base_path` is a required attribute to supply path prefix where to look for a diagram image. `format` is an optional attribute that tells what file extension to use when including diagram file.
|
360
|
+
+
|
361
|
+
The logic is as follows:
|
362
|
+
[source,adoc]
|
363
|
+
----
|
364
|
+
{% for diagram in package.diagrams %}
|
365
|
+
[[figure-{{ diagram.xmi_id }}]]
|
366
|
+
.{{ diagram.name }}
|
367
|
+
image::{{ image_base_path }}/{{ diagram.xmi_id }}.{{ format | default: 'png' }}[]
|
368
|
+
|
369
|
+
{% if diagram.definition %}
|
370
|
+
{{ diagram.definition | html2adoc }}
|
371
|
+
{% endif %}
|
372
|
+
{% endfor %}
|
373
|
+
----
|
374
|
+
|
375
|
+
For instance, the script will take package diagrams supplied in the XMI file and will try to include `image` with the name equal to diagram' xmi_id attribute plus `.png`. Also one can add any text to the command text, it will be added as paragraph before each image include.
|
376
|
+
|
377
|
+
* `[.diagram_include_block, package="Another"]` - same as above, but diagram will be included only for supplied package name
|
378
|
+
|
379
|
+
* `[.include_block, base_path="spec/fixtures"]` - command to include files (`*.adoc` or `*.liquid`) for each package name. Attribute `base_path` is a required attribute to supply path prefix where to look for file to include. command will look for a file called `base_path` + `/` `_package_name`(downcase, replace : -> '', ' ' -> '_') + `.adoc`[`.liquid`], eg for package 'My Package name' and `base_path` eq to `my/path`, command will look for the following file path: `my/path/_my_package_name.adoc`.
|
380
|
+
|
381
|
+
* `[.include_block, package="Another", base_path="spec/fixtures"]` - same as above, but include block will be included only for supplied package name
|
382
|
+
|
383
|
+
|
384
|
+
NOTE: .after, .before, package_text and include_block commandses all can be used with additional option - `liquid`, if this option is supplied then the code inside block will be interpolated in liquid context
|
385
|
+
|
386
|
+
|
387
|
+
=== Referencing objects generated by LutaML
|
388
|
+
|
389
|
+
|
390
|
+
There are two other commands that are used to refer to LutaML generated document elements:
|
391
|
+
|
392
|
+
* `lutaml_figure`. Provides a reference anchor to a figure defined in the XMI
|
393
|
+
file, using its XMI ID for reference.
|
394
|
+
|
395
|
+
* `lutaml_table`. Provides a reference anchor to the definition tables of a
|
396
|
+
particular package, class, enumeration or data type object in the XMI.
|
397
|
+
|
398
|
+
|
399
|
+
The syntax is as follows:
|
400
|
+
|
401
|
+
[source,adoc]
|
402
|
+
----
|
403
|
+
// For lutaml_figure
|
404
|
+
This is lutaml_figure::[package="Wrapper root package", name="Fig B1 Full model"] figure
|
405
|
+
|
406
|
+
// For lutaml_table
|
407
|
+
This is lutaml_table::[package="Wrapper root package"] package
|
408
|
+
This is lutaml_table::[package="Wrapper root package", class="my name"] class
|
409
|
+
This is lutaml_table::[package="Wrapper root package", enum="my name"] enumeration
|
410
|
+
This is lutaml_table::[package="Wrapper root package", data_type="my name"] data type
|
411
|
+
----
|
412
|
+
|
413
|
+
This code will be transformed into `<<figure-{diagram.xmi_id}>>` and will point to diagram figure. One can only use this command when document rendered `lutaml_uml_datamodel_description` command as it needs diagram lookup table in order to reference package diagram.
|
414
|
+
|
415
|
+
Will produce this output:
|
416
|
+
|
417
|
+
[source,adoc]
|
418
|
+
----
|
419
|
+
my text
|
420
|
+
== CityGML package
|
421
|
+
=== CityGML overview
|
422
|
+
|
423
|
+
Diagram text
|
424
|
+
|
425
|
+
[[figure-EAID_ACBB5EE3_3428_40f5_9C7C_E41923419F29]]
|
426
|
+
.CityGML Package Diagram
|
427
|
+
image::requirements/EAID_ACBB5EE3_3428_40f5_9C7C_E41923419F29.png[]
|
428
|
+
|
429
|
+
BuildingFurnitureFunctionValue is a code list that enumerates the different purposes of a BuildingFurniture.
|
430
|
+
|
431
|
+
[[figure-EAID_938AE961_1C57_4052_B964_997D1894A58D]]
|
432
|
+
.Use of ISO and OASIS standards in CityGML
|
433
|
+
image::requirements/EAID_938AE961_1C57_4052_B964_997D1894A58D.png[]
|
434
|
+
|
435
|
+
The CityGML package is organized into
|
436
|
+
2 packages with 1 modules:
|
437
|
+
|
438
|
+
. Another package
|
439
|
+
. CityTML package
|
440
|
+
|
441
|
+
my text
|
442
|
+
|
443
|
+
Content for CityGML package
|
444
|
+
|
445
|
+
==== Defining tables
|
446
|
+
|
447
|
+
.<<section-EAPK_9C96A88B_E98B_490b_8A9C_24AEDAC64293>> -- Elements of “Another::AbstractAtomicTimeseries” (class)
|
448
|
+
|
449
|
+
[[section-EAPK_9C96A88B_E98B_490b_8A9C_24AEDAC64293]]
|
450
|
+
.Elements of “Another::AbstractAtomicTimeseries” (class)
|
451
|
+
[width="100%",cols="a,a,a,a,a,a,a,a"]
|
452
|
+
|===
|
453
|
+
h|Name: 7+| AbstractAtomicTimeseries
|
454
|
+
h|Definition: 7+|
|
455
|
+
h|Stereotype: 7+| interface
|
456
|
+
h|Abstract: 7+|
|
457
|
+
h|Associations: 7+| (none)
|
458
|
+
.4+h|Public attributes:
|
459
|
+
| _Name_
|
460
|
+
2+| _Definition_
|
461
|
+
| _Derived_
|
462
|
+
| _Obligation_
|
463
|
+
| _Maximum occurrence_
|
464
|
+
| _Data type_
|
465
|
+
| adeOfAbstractAtomicTimeseries
|
466
|
+
2+|
|
467
|
+
|
|
468
|
+
| C
|
469
|
+
| *
|
470
|
+
| ADEOfAbstractAtomicTimeseries
|
471
|
+
| observationProperty
|
472
|
+
2+|
|
473
|
+
|
|
474
|
+
| M
|
475
|
+
| 1
|
476
|
+
| CharacterString
|
477
|
+
| uom
|
478
|
+
2+|
|
479
|
+
|
|
480
|
+
| C
|
481
|
+
| 1
|
482
|
+
| CharacterString
|
483
|
+
h|Constraints: 7+| (none)
|
484
|
+
|===
|
485
|
+
|
486
|
+
=== Additional Information
|
487
|
+
|
488
|
+
text after CityGML package
|
489
|
+
----
|
490
|
+
|
491
|
+
In addition to the XMI file, this command also supports a YAML configuration file
|
492
|
+
that specifies:
|
493
|
+
|
494
|
+
* What packages to include in the render;
|
495
|
+
|
496
|
+
* What render style is desired;
|
497
|
+
|
498
|
+
* Location of the root package (which package should the iterative process start
|
499
|
+
at);
|
500
|
+
|
501
|
+
* Which EA extensions to be loaded.
|
502
|
+
|
503
|
+
The format for using the YAML configuration file:
|
504
|
+
|
505
|
+
[source,yaml]
|
506
|
+
----
|
507
|
+
---
|
508
|
+
packages:
|
509
|
+
# includes these packages
|
510
|
+
- "Package *"
|
511
|
+
- two*
|
512
|
+
- three
|
513
|
+
# skips these packages
|
514
|
+
- skip: four
|
515
|
+
render_style: entity_list | data_dictionary | default
|
516
|
+
section_depth: 2
|
517
|
+
ea_extension:
|
518
|
+
- "CityGML_MDG_Technology.xml"
|
519
|
+
- "xmi_definition_for_some_standard.xml"
|
520
|
+
----
|
521
|
+
|
522
|
+
Where:
|
523
|
+
|
524
|
+
* `packages` - required, root element with the list of strings or objects
|
525
|
+
|
526
|
+
* `Package *` - pattern matching, specifies lookup condition for packages to
|
527
|
+
render.
|
528
|
+
+
|
529
|
+
NOTE: In this example, it is equal to the following regular expression: `/^Package.*$/`
|
530
|
+
|
531
|
+
* `skip: four` - object with package name to skip
|
532
|
+
|
533
|
+
* `render_style` - what template to use to render packages, can be one of:
|
534
|
+
|
535
|
+
** `entity_list`
|
536
|
+
|
537
|
+
** `data_dictionary`; or
|
538
|
+
|
539
|
+
** `default`
|
540
|
+
|
541
|
+
* `section_depth` - what package to use as root package for render.
|
542
|
+
e.g., a `section_depth` equal to `2` tells the processor to use the first
|
543
|
+
nested package of the first root packages in XMI file.
|
544
|
+
+
|
545
|
+
EXAMPLE: If the XMI file has this package structure, and we have `section_depth`
|
546
|
+
equal to 2, root package will be `one-1`.
|
547
|
+
+
|
548
|
+
[source,json]
|
549
|
+
----
|
550
|
+
[
|
551
|
+
{
|
552
|
+
name: 'One',
|
553
|
+
packages: [{ name: 'one-1' }, { name: 'one-2' }]
|
554
|
+
},
|
555
|
+
{
|
556
|
+
name: 'Two',
|
557
|
+
packages: [{ name: 'two-1' }, { name: 'two-2' }]
|
558
|
+
}
|
559
|
+
]
|
560
|
+
----
|
561
|
+
|
562
|
+
* `ea_extension` - optional, list of EA extensions to load. Some XMI files may
|
563
|
+
contain elements that cannot be resolved by default, for example CityGML
|
564
|
+
elements. You can use `ea_extension` to load the definition of these elements
|
565
|
+
in XML format (`CityGML_MDG_Technology.xml`) in order to resolve them. The
|
566
|
+
location of the xml files is relative to the config YAML file.
|
567
|
+
|
568
|
+
Usage with command:
|
569
|
+
|
570
|
+
[source,adoc]
|
571
|
+
--
|
572
|
+
[lutaml_uml_datamodel_description, path/to/example.xmi, path/to/config.yml]
|
573
|
+
----
|
574
|
+
[.diagram_include_block, base_path="models/Images", format="png"]
|
575
|
+
...
|
576
|
+
...
|
577
|
+
----
|
578
|
+
--
|
579
|
+
|
580
|
+
The processor will read the supplied YAML config file (`path/to/config.yml`),
|
581
|
+
and iterate through packages according to the order supplied in the file. All
|
582
|
+
packages that matches `skip` in the YAML config file will be skipped during
|
583
|
+
render.
|