lutaml 0.11.9 → 0.11.10

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.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +87 -0
  3. data/.github/workflows/links.yml +113 -0
  4. data/.github/workflows/rake.yml +52 -0
  5. data/.github/workflows/release.yml +83 -0
  6. data/.gitignore +29 -0
  7. data/CLAUDE.md +27 -0
  8. data/Gemfile +2 -2
  9. data/docs/.github/workflows/docs.yml +66 -0
  10. data/docs/.github/workflows/links.yml +78 -0
  11. data/docs/CONTINUATION_PLAN.md +168 -0
  12. data/docs/Gemfile +13 -0
  13. data/docs/MIGRATION_GUIDE.md +202 -0
  14. data/docs/README.md +252 -0
  15. data/docs/REFACTOR_PLAN.md +214 -0
  16. data/docs/_config.yml +144 -0
  17. data/docs/_guides/cli-usage.adoc +43 -0
  18. data/docs/_guides/diagram-generation.adoc +316 -0
  19. data/docs/_guides/index.adoc +136 -0
  20. data/docs/_guides/parsing/express-parsing.adoc +42 -0
  21. data/docs/_guides/parsing/index.adoc +78 -0
  22. data/docs/_guides/parsing/qea-parsing.adoc +47 -0
  23. data/docs/_guides/parsing/xmi-parsing.adoc +40 -0
  24. data/docs/_guides/repository-management.adoc +44 -0
  25. data/docs/_guides/sysml-modeling.adoc +37 -0
  26. data/docs/_guides/uml-modeling.adoc +115 -0
  27. data/docs/_pages/concepts/diagram-generation.adoc +337 -0
  28. data/docs/_pages/concepts/lur-format.adoc +711 -0
  29. data/docs/_pages/concepts/qea-parsing.adoc +418 -0
  30. data/docs/_pages/concepts/uml-models.adoc +43 -0
  31. data/docs/_pages/core/architecture.adoc +329 -0
  32. data/docs/_pages/core/installation.adoc +321 -0
  33. data/docs/_pages/core/overview.adoc +197 -0
  34. data/docs/_pages/index.adoc +49 -0
  35. data/docs/_pages/uml-syntax.adoc +1011 -0
  36. data/docs/_references/api/parsers.adoc +61 -0
  37. data/docs/_references/api/presenters.adoc +43 -0
  38. data/docs/_references/api/repository.adoc +67 -0
  39. data/docs/_references/cli/commands.adoc +72 -0
  40. data/docs/_references/configuration/diagram-styles.adoc +716 -0
  41. data/docs/_references/configuration/index.adoc +53 -0
  42. data/docs/_references/configuration/package-metadata.adoc +416 -0
  43. data/docs/_references/formats/index.adoc +43 -0
  44. data/docs/_references/formats/lur-format.adoc +39 -0
  45. data/docs/_references/formats/lutaml-syntax.adoc +379 -0
  46. data/docs/_references/formats/qea-structure.adoc +1364 -0
  47. data/docs/_references/index.adoc +198 -0
  48. data/docs/_tutorials/documentation-site.adoc +47 -0
  49. data/docs/_tutorials/first-lur-package.adoc +45 -0
  50. data/docs/_tutorials/generating-diagrams.adoc +42 -0
  51. data/docs/_tutorials/getting-started.adoc +45 -0
  52. data/docs/_tutorials/index.adoc +100 -0
  53. data/docs/_tutorials/querying-models.adoc +44 -0
  54. data/docs/examples/build_package.rb +12 -0
  55. data/docs/examples/build_site.rb +12 -0
  56. data/docs/examples/city_model.rb +21 -0
  57. data/docs/examples/present_class.rb +10 -0
  58. data/docs/examples/query_model.rb +12 -0
  59. data/docs/examples/render_diagram.rb +11 -0
  60. data/docs/index.adoc +64 -0
  61. data/docs/lml-models-and-instances-syntax.adoc +931 -0
  62. data/docs/lml.adoc +210 -0
  63. data/docs/lychee.toml +50 -0
  64. data/lib/lutaml/version.rb +1 -1
  65. data/lib/lutaml.rb +6 -1
  66. data/lutaml.gemspec +8 -6
  67. metadata +75 -131
  68. data/exe/lutaml-lml +0 -6
  69. data/exe/lutaml-lml-lsp +0 -11
  70. data/lib/lutaml/lml/association_label_resolver.rb +0 -52
  71. data/lib/lutaml/lml/cli.rb +0 -506
  72. data/lib/lutaml/lml/data_processor/attribute_processing.rb +0 -133
  73. data/lib/lutaml/lml/data_processor/collection_processing.rb +0 -37
  74. data/lib/lutaml/lml/data_processor/instance_processing.rb +0 -77
  75. data/lib/lutaml/lml/data_processor/value_declaration_processing.rb +0 -70
  76. data/lib/lutaml/lml/data_processor/value_processing.rb +0 -103
  77. data/lib/lutaml/lml/data_processor/view_processing.rb +0 -26
  78. data/lib/lutaml/lml/data_processor.rb +0 -59
  79. data/lib/lutaml/lml/diagnostic.rb +0 -149
  80. data/lib/lutaml/lml/document_builder.rb +0 -481
  81. data/lib/lutaml/lml/entity_types.rb +0 -30
  82. data/lib/lutaml/lml/executor/adapter_helpers.rb +0 -45
  83. data/lib/lutaml/lml/executor/condition_evaluator.rb +0 -169
  84. data/lib/lutaml/lml/executor/csv_adapter.rb +0 -88
  85. data/lib/lutaml/lml/executor/format_adapter.rb +0 -54
  86. data/lib/lutaml/lml/executor/xml_adapter.rb +0 -102
  87. data/lib/lutaml/lml/executor.rb +0 -96
  88. data/lib/lutaml/lml/format/adapter/document.rb +0 -11
  89. data/lib/lutaml/lml/format/adapter/mapping.rb +0 -31
  90. data/lib/lutaml/lml/format/adapter/standard_adapter.rb +0 -162
  91. data/lib/lutaml/lml/format/adapter/transform.rb +0 -11
  92. data/lib/lutaml/lml/format.rb +0 -29
  93. data/lib/lutaml/lml/formatter/base.rb +0 -79
  94. data/lib/lutaml/lml/formatter/canonical.rb +0 -736
  95. data/lib/lutaml/lml/formatter/elk.rb +0 -45
  96. data/lib/lutaml/lml/formatter/svg_pdf/path_parser.rb +0 -134
  97. data/lib/lutaml/lml/formatter/svg_pdf.rb +0 -285
  98. data/lib/lutaml/lml/formatter.rb +0 -11
  99. data/lib/lutaml/lml/grammar/lml.artifact.json +0 -14993
  100. data/lib/lutaml/lml/grammar/lml.parg +0 -389
  101. data/lib/lutaml/lml/grammar.rb +0 -60
  102. data/lib/lutaml/lml/has_attributes.rb +0 -14
  103. data/lib/lutaml/lml/import_resolver.rb +0 -96
  104. data/lib/lutaml/lml/layout/elk_engine.rb +0 -15
  105. data/lib/lutaml/lml/layout/elk_graph_builder.rb +0 -129
  106. data/lib/lutaml/lml/layout/elk_svg_markers.rb +0 -45
  107. data/lib/lutaml/lml/layout/elk_svg_renderer.rb +0 -119
  108. data/lib/lutaml/lml/layout/engine.rb +0 -17
  109. data/lib/lutaml/lml/layout.rb +0 -12
  110. data/lib/lutaml/lml/literal_value.rb +0 -32
  111. data/lib/lutaml/lml/lsp/conversions.rb +0 -78
  112. data/lib/lutaml/lml/lsp/keywords.rb +0 -43
  113. data/lib/lutaml/lml/lsp/server.rb +0 -378
  114. data/lib/lutaml/lml/lsp/store.rb +0 -68
  115. data/lib/lutaml/lml/lsp/transport.rb +0 -53
  116. data/lib/lutaml/lml/lsp.rb +0 -16
  117. data/lib/lutaml/lml/model_compiler/enums.rb +0 -172
  118. data/lib/lutaml/lml/model_compiler/hydration.rb +0 -123
  119. data/lib/lutaml/lml/model_compiler/serialization_mappings.rb +0 -188
  120. data/lib/lutaml/lml/model_compiler/string_formats.rb +0 -42
  121. data/lib/lutaml/lml/model_compiler/validation.rb +0 -65
  122. data/lib/lutaml/lml/model_compiler.rb +0 -323
  123. data/lib/lutaml/lml/models/action.rb +0 -10
  124. data/lib/lutaml/lml/models/association.rb +0 -29
  125. data/lib/lutaml/lml/models/cardinality.rb +0 -10
  126. data/lib/lutaml/lml/models/collection.rb +0 -11
  127. data/lib/lutaml/lml/models/constraint.rb +0 -23
  128. data/lib/lutaml/lml/models/data_type.rb +0 -41
  129. data/lib/lutaml/lml/models/derived_field.rb +0 -14
  130. data/lib/lutaml/lml/models/diagram.rb +0 -20
  131. data/lib/lutaml/lml/models/document.rb +0 -84
  132. data/lib/lutaml/lml/models/enum.rb +0 -38
  133. data/lib/lutaml/lml/models/fidelity.rb +0 -10
  134. data/lib/lutaml/lml/models/group.rb +0 -11
  135. data/lib/lutaml/lml/models/instance.rb +0 -26
  136. data/lib/lutaml/lml/models/instance_collection.rb +0 -16
  137. data/lib/lutaml/lml/models/instances_export.rb +0 -10
  138. data/lib/lutaml/lml/models/instances_import.rb +0 -11
  139. data/lib/lutaml/lml/models/mapping.rb +0 -15
  140. data/lib/lutaml/lml/models/mapping_rule.rb +0 -16
  141. data/lib/lutaml/lml/models/member_field.rb +0 -14
  142. data/lib/lutaml/lml/models/namespace.rb +0 -16
  143. data/lib/lutaml/lml/models/operation.rb +0 -26
  144. data/lib/lutaml/lml/models/operation_parameter.rb +0 -12
  145. data/lib/lutaml/lml/models/package.rb +0 -26
  146. data/lib/lutaml/lml/models/primitive_type.rb +0 -33
  147. data/lib/lutaml/lml/models/reference.rb +0 -23
  148. data/lib/lutaml/lml/models/serialization_mapping.rb +0 -19
  149. data/lib/lutaml/lml/models/string_format.rb +0 -16
  150. data/lib/lutaml/lml/models/top_element_attribute.rb +0 -116
  151. data/lib/lutaml/lml/models/uml_class.rb +0 -85
  152. data/lib/lutaml/lml/models/value.rb +0 -15
  153. data/lib/lutaml/lml/models/view_filter.rb +0 -11
  154. data/lib/lutaml/lml/models/view_import.rb +0 -11
  155. data/lib/lutaml/lml/parser.rb +0 -19
  156. data/lib/lutaml/lml/pipeline.rb +0 -73
  157. data/lib/lutaml/lml/positioned.rb +0 -13
  158. data/lib/lutaml/lml/preprocessor.rb +0 -130
  159. data/lib/lutaml/lml/quoting.rb +0 -60
  160. data/lib/lutaml/lml/source.rb +0 -49
  161. data/lib/lutaml/lml/source_position.rb +0 -20
  162. data/lib/lutaml/lml/symbol_index.rb +0 -200
  163. data/lib/lutaml/lml/transform.rb +0 -119
  164. data/lib/lutaml/lml/types/text_type.rb +0 -28
  165. data/lib/lutaml/lml/types.rb +0 -10
  166. data/lib/lutaml/lml/validator.rb +0 -458
  167. data/lib/lutaml/lml/version.rb +0 -10
  168. data/lib/lutaml/lml/view_resolution.rb +0 -32
  169. data/lib/lutaml/lml/view_resolver.rb +0 -48
  170. data/lib/lutaml/lml/yaml_parser.rb +0 -17
  171. data/lib/lutaml/lml.rb +0 -130
@@ -0,0 +1,379 @@
1
+ ---
2
+ title: LutaML Syntax Reference
3
+ parent: File Formats
4
+ grand_parent: Reference
5
+ nav_order: 2
6
+ ---
7
+
8
+ = LutaML syntax
9
+
10
+ == `diagram` syntax
11
+
12
+ `diagram` is a root element for each diagram.
13
+
14
+ [source,java]
15
+ ----
16
+ diagram MyView {
17
+ title "My diagram"
18
+ caption "My custom caption"
19
+ fontname "Helvetica"
20
+ }
21
+ ----
22
+
23
+ where:
24
+
25
+ * `fontname` - optional, configuration option to use supplied font name
26
+ * `title` - optional, set custom title for diagram
27
+ * `caption` - optional, set custom caption for diagram
28
+
29
+ == DataTypes
30
+
31
+ Lutaml supports 3 types of data_types: `data_type`, `primitive` and `enum`.
32
+
33
+ Example of data types declaration:
34
+
35
+ [source,java]
36
+ ----
37
+ diagram MyView {
38
+ enum MyEnum {}
39
+
40
+ enum AddressClassProfile {
41
+ +addressClassProfile: CharacterString
42
+ }
43
+
44
+ data_type "Banking Information" {
45
+ "art code"
46
+ "CCT Number"
47
+ }
48
+
49
+ primitive Integer
50
+
51
+ enum Profile {
52
+ imlicistAttributeProfile: CharacterString
53
+ +attributeProfile: CharacterString
54
+ -privateAttributeProfile: CharacterString
55
+ ~friendlyAttributeProfile: CharacterString
56
+ #protectedAttributeProfile: CharacterString
57
+ }
58
+ }
59
+ ----
60
+
61
+ == Associations
62
+
63
+ === Explicit declaration
64
+
65
+ Syntax:
66
+
67
+ [source,java]
68
+ ----
69
+ association name {
70
+ owned_type association|composition|aggregation|generalization|uses
71
+ member_type association|composition|aggregation|generalization|uses
72
+ owned association_name[#attribute_name] [{property_string}][cardinality]
73
+ member association_name[#attribute_name] [{property_string}][cardinality]
74
+ }
75
+ ----
76
+
77
+ where:
78
+
79
+ * `owned_type` - optional, use to define a bidirectional association (`association`|`composition`|`aggregation`|`generalization`|`uses`)
80
+ * `member_type` - association type (`association`|`composition`|`aggregation`|`generalization`|`uses`)
81
+ * `owned|member` - end of association, use `\#attribute_name` to set a role name
82
+ * `property_string` - property string for attibutes associations
83
+ * `cardinality` - examples: '1..*', '*'
84
+
85
+ Example:
86
+
87
+ [source,java]
88
+ ----
89
+ class Association {
90
+ +association:
91
+ }
92
+ class Type {
93
+ +endType:
94
+ }
95
+
96
+ association AssociatingTypeAndAssociation {
97
+ type uses
98
+ from Association#+association {subsets relationship}[*]
99
+ to Type#+/endType {readOnly, subsets relatedElement} [1..*]
100
+ }
101
+ ----
102
+
103
+ === Undirected associations
104
+
105
+ The simplest way to define relationship between two classes is to use `generalize` keyword:
106
+
107
+ [source,java]
108
+ ----
109
+ class Pet {}
110
+ class Cat {
111
+ generalize Pet
112
+ }
113
+ ----
114
+
115
+ === Attribute relationship
116
+
117
+ Derived attribute `relatedElement` can have 1 to many `Element` associated with it through `union`
118
+
119
+ [source,java]
120
+ ----
121
+ class Relationship {
122
+ +/relatedElement: Element[1..*] {union}
123
+ }
124
+ class Element {}
125
+ ----
126
+
127
+ == Class' multiline "definition" property
128
+
129
+ === Definition
130
+
131
+ Full syntax:
132
+
133
+ [source,java]
134
+ ----
135
+ definition {
136
+ inner text
137
+ }
138
+ ----
139
+
140
+
141
+ == Attributes/entries
142
+
143
+ === Definition
144
+
145
+ Full syntax:
146
+
147
+ [source,java]
148
+ ----
149
+ [visibility][/][attribute] name [:type][multiplicity][=initial value][{attribute body}]
150
+ ----
151
+
152
+ where:
153
+
154
+ * `visibility` can be equal to
155
+ ** `-`: private
156
+ ** `+`: public
157
+ ** `#`: protected
158
+ ** `~`: friendly
159
+
160
+ * `attribute` - attrbute keyword
161
+ * `/` - symbolizes a derived attribute.
162
+ * `multiplicity` - Multiplicity is in square brackets (e.g. [1..*]).
163
+ * `initial value` - Default value specifies the initial value of the attribute.
164
+ * `{attribute body}` - Body of attribute, additional properties for attribute
165
+
166
+
167
+ One can use explicit or implicit syntax for attribute definition
168
+
169
+ explicit syntax:
170
+
171
+ [source,java]
172
+ ----
173
+ class A {
174
+ attribute my_attribute
175
+ }
176
+
177
+ enum A {
178
+ entry my_val2
179
+ }
180
+ ----
181
+
182
+ implicit syntax:
183
+
184
+ [source,java]
185
+ ----
186
+ class A {
187
+ my_attribute
188
+ }
189
+
190
+ enum A {
191
+ my_val2
192
+ }
193
+ ----
194
+
195
+ [[attribute-visibility]]
196
+ === Attribute visibility
197
+
198
+ Syntax for defining visibility: `[+|-|#|~] [attribute] attribute_name`.
199
+
200
+ LutaML uses these modificators to define attribute (entry) visbility:
201
+
202
+ `+`:: public
203
+ `-`:: private
204
+ `#`:: protected
205
+ `~`:: package
206
+
207
+ example:
208
+
209
+ [source,java]
210
+ ----
211
+ class Figure {
212
+ // Public attribute `radius`
213
+ + radius
214
+ // private attribute `filled`
215
+ - filled
216
+ // protected attribute `length`
217
+ # length
218
+ }
219
+ ----
220
+
221
+ === Additional attribute' properties
222
+
223
+ example:
224
+
225
+ [source,java]
226
+ ----
227
+ class Figure {
228
+ + radius {
229
+ definition {
230
+ Radius of the Figure
231
+ }
232
+ }
233
+ }
234
+ ----
235
+
236
+ == Methods
237
+
238
+ Syntax for defining methods:
239
+
240
+ [source,java]
241
+ ----
242
+ [visbility] method-name (parameter-list): return type {property-modifier}
243
+ ----
244
+
245
+ where:
246
+
247
+ * `visibility` can be equal to
248
+ ** `-`: private
249
+ ** `+`: public
250
+ ** `#`: protected
251
+ ** `~`: friendly
252
+
253
+ * `parameter-list`: parameter list
254
+
255
+ * `property-modifier`: can be equal to
256
+ ** `redefines`
257
+ ** `query`
258
+ ** `ordered` (defaults to `unordered`)
259
+ ** `unique`(defaults to `nonunique`)
260
+
261
+ Syntax for a `parameter-list`:
262
+
263
+ [source,java]
264
+ ----
265
+ [direction] name:type [multiplicity] [=default] [{property string}]
266
+ ----
267
+
268
+ where:
269
+
270
+ * `direction` can be equal to
271
+ ** `in`
272
+ ** `out`
273
+ ** `inout`
274
+ ** `return`
275
+
276
+ == import files
277
+
278
+ Use `include` special word:
279
+
280
+ [source,java]
281
+ ----
282
+ include path/to/file
283
+ ----
284
+
285
+ == Package syntax
286
+
287
+ Namespaces
288
+
289
+ A named element is an element that can have a name and a defined visibility (public, private, protected, package):
290
+
291
+ [source,java]
292
+ ----
293
+ + => public
294
+ - => private
295
+ # => protected
296
+ ~ => package
297
+ ----
298
+
299
+ The name of the element and its visibility are optional.
300
+
301
+ [source,java]
302
+ ----
303
+ package Customers {
304
+ class Insurance {}
305
+ - class PrivateInsurance {}
306
+ # class ProtectedInsurance {}
307
+ }
308
+ ----
309
+
310
+ == Code comments
311
+
312
+ Use `//` notation for LutaML comments skipped by parser, example:
313
+
314
+ [source,java]
315
+ ----
316
+ // TODO: implement
317
+ abstract class Pet {}
318
+ ----
319
+
320
+ == Comment objects diagram
321
+
322
+ Use `\**`(one line comment) or `*| |*`(multiline comment) to create comment object for diagram entry.
323
+
324
+ If this syntax is used inside a `class`/`enum`/`association` block, it will be created for owner of this block.
325
+
326
+ [source,java]
327
+ ----
328
+ ** I am a document comment
329
+
330
+ *|
331
+ This is a
332
+ multiply
333
+ lines document comment.
334
+ *|
335
+
336
+ class A
337
+ enum B {
338
+ ** one line enum comment
339
+ foo
340
+ *|
341
+ This is a
342
+ multiply
343
+ lines class comment.
344
+ *|
345
+ bar
346
+ }
347
+ ----
348
+
349
+ == Syntax comments
350
+
351
+ Use `//` to create syntax comment, chars after `//` will be ignored during processing.
352
+
353
+ [source,java]
354
+ ----
355
+ // TODO: attributes
356
+ class A
357
+ enum B {
358
+ // Write docs
359
+ foo
360
+ bar
361
+ }
362
+ ----
363
+
364
+ == Value specification
365
+
366
+ A value specification indicates one or several values in a model. Examples for value specifications include simple, mathematical expressions, such as `4+2`, and expressions with values from the object model, `Integer::MAX_INT-1`
367
+
368
+ [source,java]
369
+ ----
370
+ class {Class name, if any} {as ref name, optional} {
371
+ {attribute name} = {attribute value}
372
+ {attribute name}:{attribute class} = {attribute value}
373
+ }
374
+
375
+ instance :{Class name, if any} {as ref name, optional} {
376
+ {attribute name} = {attribute value}
377
+ {attribute name}:{attribute class} = {attribute value}
378
+ }
379
+ ----