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,931 @@
1
+ = LML syntax: models and data instances
2
+ :toc: macro
3
+ :toclevels: 3
4
+ :example-caption!:
5
+
6
+ toc::[]
7
+
8
+ == Purpose
9
+
10
+ LML (the LutaML Modeling Language) has two layers:
11
+
12
+ * *Model definitions* — declaring classes (including collection classes),
13
+ enumerations, and their attributes (the "type" layer). (Associations between
14
+ classes are a UML *diagram*-language construct, not part of the `models` block —
15
+ see <<associations>>.)
16
+ * *Data instances* — concrete data conforming to those models (the "value"
17
+ layer).
18
+
19
+ This document is the authoritative reference for the decided
20
+ *model-definition* and *data-instance* syntax. Some decisions are not yet
21
+ implemented on `main`; those sections and the implementation-status table say
22
+ so explicitly. It is a companion to, and deliberately distinct from, the *UML
23
+ diagram* syntax documented in lutaml's `docs/_pages/uml-syntax.adoc` (formerly
24
+ `LUTAML.adoc`).
25
+
26
+ [IMPORTANT]
27
+ ====
28
+ "LutaML" names *two* languages that share a family resemblance but are not the
29
+ same:
30
+
31
+ . The *UML diagram* language (`.lutaml` files) — for drawing UML diagrams;
32
+ authoritative spec: `lutaml/docs/_pages/uml-syntax.adoc`.
33
+ . The *LML modeling* language (`.lml` files) — for defining lutaml-model models
34
+ and their data instances; *this* document.
35
+
36
+ Where a keyword appears in both with different meanings (notably `member_type`),
37
+ this document states the LML meaning and flags the divergence.
38
+ ====
39
+
40
+ === Relationship to other layers
41
+
42
+ [cols="1,3"]
43
+ |===
44
+ | Layer | LML's relationship
45
+
46
+ | UML diagram syntax (`.lutaml`)
47
+ | LML reuses several lexical/attribute conventions (visibility prefixes,
48
+ `definition {}` blocks, multiplicity brackets) but adds the `models` block,
49
+ `attribute {}` blocks, collection classes, `require`, and instance data.
50
+ Diverges on `member_type`, comments, and cardinality (see <<divergences>>).
51
+
52
+ | Ruby DSL (`Lutaml::Model::Serializable`)
53
+ | LML is an alternative surface syntax for the same model concepts. Plain
54
+ models compile to `Serializable` classes; the decided collection syntax
55
+ targets `Collection` once implemented.
56
+ |===
57
+
58
+ == Lexical elements
59
+
60
+ === Files
61
+
62
+ Model definitions and data instances are written in `.lml` files. The parser's
63
+ combined grammar also accepts `.lutaml` diagram definitions.
64
+
65
+ === Identifiers
66
+
67
+ * Class, enum, and data-type names are *conventionally* CamelCase identifiers
68
+ (e.g. `ValidationCheck`).
69
+ * Attribute and field names are *conventionally* lower_snake_case identifiers
70
+ (e.g. `dev_id`).
71
+ * Namespace qualification uses `::` (e.g. `IhoS102Check::ValidationCheck`).
72
+
73
+ NOTE: These casings are conventions, not enforced rules — the grammar's
74
+ identifier rules are more permissive (class names may contain spaces, `-`, `:`,
75
+ and `.`; attribute names accept further characters), so a non-conforming name
76
+ still parses.
77
+
78
+ === Comments
79
+
80
+ LML standardizes on `+#+` line comments (quote-aware, followed by
81
+ whitespace or end of line), and implements the RS 3001 comment forms
82
+ as first-class syntax:
83
+
84
+ [source]
85
+ ----
86
+ # This whole line is a comment
87
+ attribute dev_id { # trailing comment after content
88
+ type String
89
+ }
90
+ ----
91
+
92
+ RS 3001 comment forms are also implemented, quote-aware (a `//` inside a
93
+ string literal such as a URL survives):
94
+
95
+ [source]
96
+ ----
97
+ // leading comment
98
+ class Ceramic {
99
+ attribute url, String // tail comment
100
+ }
101
+
102
+ /* multi-line
103
+ block comment */
104
+ ----
105
+
106
+ `//` and `/* */` are consumed by the grammar itself as skip trivia
107
+ (parsanol-ruby#134): they are ignored between any two tokens — leading,
108
+ trailing, between a keyword and its name — and a comment sequence
109
+ inside a quoted string survives (string scans are atomic rules). The
110
+ grammar-level `+**+`/`+*| |*+` documentation comments (captured into
111
+ the document model) are accepted inside
112
+ class/enum/data-type/association bodies, and `+#+` remains the
113
+ LML-idiomatic marker for those. The preprocessor now only expands
114
+ `include` directives (and rejects unterminated block comments with a
115
+ precise diagnostic).
116
+
117
+ ==== Long form (primary)
118
+
119
+ [source]
120
+ ----
121
+ attribute dev_id {
122
+ type String
123
+ description "Dev ID: Development identifier for the check"
124
+ cardinality 1
125
+ }
126
+ ----
127
+
128
+ An `attribute <name> { ... }` block may contain:
129
+
130
+ * `type <Type>` — expected; see <<types>>. NOTE: the grammar does not enforce it —
131
+ an attribute with an empty body or no `type` still parses, and the compiler then
132
+ resolves the absent type to `string`.
133
+ * `cardinality <C>` — may be omitted; see <<cardinality>>. (Omitting it does *not*
134
+ make the attribute optional — the default-when-omitted caveat there explains that
135
+ omission currently means *required*.)
136
+ * `description "<text>"` — optional human-readable documentation.
137
+ * `default "<literal>"` or `default: <literal>` — literal-only default;
138
+ fires only on **absent** input (an explicit nil stays explicit). A declared
139
+ literal wins over the optional-marker nil that a `0..1` cardinality would
140
+ otherwise install.
141
+ * `values { v1, v2 }` — inline value set; expands into an anonymous baked enum.
142
+ * `values <EnumName>` — types the attribute with a named enum.
143
+ * `pattern /<regex>/` — value pattern constraint; enforced by `lutaml validate`.
144
+ * `render_nil true|false` — nil policy, mirroring lutaml-model's mapping option
145
+ name; the compiler applies it to the yaml/json mapping rules.
146
+ * `properties` beyond these (`<name> = <value>` lines) are captured but only
147
+ the two above are compiled.
148
+
149
+ ==== Comma form (RS 3001 normative)
150
+
151
+ [source]
152
+ ----
153
+ attribute location, String {
154
+ definition "Location of the studio"
155
+ }
156
+ attribute batch_ids, String { cardinality 0..n }
157
+ ----
158
+
159
+ `attribute <name>, <Type> { ... }` — the RS 3001 normative form, with the
160
+ same optional block contents as the long form (but `type` comes from the
161
+ comma position).
162
+
163
+ ==== Shorthand (convenience, inherited from the diagram syntax) [[attributes]]
164
+
165
+ The UML shorthand attribute form is also accepted:
166
+
167
+ [source]
168
+ ----
169
+ +classification: Classification [1]
170
+ data_quality_measure: String [0..*]
171
+ ----
172
+
173
+ Format: `[visibility][/]name[: Type][[multiplicity]]`, where visibility is `{plus}`
174
+ public, `-` private, `+#+` protected, `+~+` package. Long form and shorthand may be
175
+ mixed in one class body. The `/` (UML derived-attribute marker) is accepted but not
176
+ treated specially by the grammar — it is merely a permitted character in the name.
177
+
178
+ [NOTE]
179
+ ====
180
+ Two shorthand variants floated in the design issues are *not* supported; the long
181
+ form above is the only block spelling. They fail *differently*:
182
+
183
+ * From lutaml-model #174 — the inline-typed *header* form
184
+ `attribute name[card] : type { ... }` (type and cardinality on the header line,
185
+ alongside a body) — raises a hard parse error (cleanly rejected).
186
+ * From metanorma #444 — the block-internal *field* form
187
+ `attribute name { type: String [1] }` (a colon after `type`, cardinality in
188
+ brackets) — is *worse*: it parses without error but mis-binds the fields (the
189
+ `type` value becomes `":"` and `String [1]` becomes a bogus nested property),
190
+ silently producing a corrupt attribute. Do not use it.
191
+
192
+ The long-form fields are written colon-free and bracket-free: `type <Type>` and
193
+ `cardinality <C>`, each on its own line. Use the line-level shorthand under
194
+ <<attributes>> if you want the compact `name: Type [card]` spelling.
195
+ ====
196
+
197
+ ==== Types [[types]]
198
+
199
+ [cols="1,3"]
200
+ |===
201
+ | Type form | Meaning
202
+
203
+ | `String`, `Boolean`, `Integer`, `Float`, `Date`, `DateTime`, `Time`, `Uri`, `Hash` | Built-in primitive types (CamelCase; the full set mapped by the compiler's `TYPE_MAP`). `Uri` maps to `string`.
204
+ | `date_time` | Built-in date-time type (snake_case, as written in the source; an alias of `DateTime`).
205
+ | `<ClassName>` | A user-defined class in the same model (association/composition).
206
+ | `<EnumName>` | A user-defined enum in the same model. Instance data supplies a member as `EnumName::value_name` (see <<enum-ref,enum references>>).
207
+ | `reference:(Class.attribute)` | A by-key cross-reference to instances of `Class`, keyed on `attribute` (typically the target's `member_unique` key). NOTE: currently compiles to a plain `string` — the reference is *not* resolved or validated (see <<open-questions>>). Instance data supplies the referenced key value(s) as strings.
208
+ |===
209
+
210
+ ==== Cardinality [[cardinality]]
211
+
212
+ [cols="1,2,2"]
213
+ |===
214
+ | Multiplicity | Long form | Shorthand bracket
215
+
216
+ | exactly one | `cardinality 1` | `[1]`
217
+ | optional | `cardinality 0..1` | `[0..1]`
218
+ | zero-to-many | `cardinality 0..n` | `+[0..*]+`
219
+ | one-to-many | `cardinality 1..n` | `+[1..*]+`
220
+ |===
221
+
222
+ .Decision
223
+ ====
224
+ *The unbounded upper bound may be written `n` or `+*+`* — both are accepted in the
225
+ long form *and* the shorthand bracket. The `n`-vs-`+*+` split shown in the table
226
+ reflects the two source conventions but is *not* enforced: `cardinality 1..n`,
227
+ `cardinality 1..*`, `+[1..n]+`, and `+[1..*]+` all parse. Although the compiler's
228
+ unbounded-token list also contains `N` and `unbounded`, the grammar rejects those
229
+ spellings; they are not valid source syntax.
230
+
231
+ The design issues state that omitting `cardinality` should default to `0..1`
232
+ (optional). NOTE: the current implementation instead treats an attribute with no
233
+ `cardinality` as *required* (min ≥ 1); write an explicit `cardinality 0..1` for an
234
+ optional attribute until the default is aligned.
235
+ ====
236
+
237
+ [[class-level-declarations]]
238
+ === Class-level declarations
239
+
240
+ These appear directly inside a `class` (or `models`) body.
241
+
242
+ ==== Serialization mappings — `mapping <format> <class>`
243
+
244
+ Serialization mappings are declared as sibling constructs linked to their
245
+ class by name (canonical), or inside the class body (shortcut; the enclosing
246
+ class is the implied target):
247
+
248
+ [source]
249
+ ----
250
+ models Ceramics {
251
+ namespace CeramicsNs {
252
+ uri "http://example.com/ceramics"
253
+ prefix "cer"
254
+ }
255
+
256
+ class Ceramic {
257
+ attribute location, String
258
+ attribute kiln, String
259
+ attribute notes, String
260
+ }
261
+ }
262
+
263
+ mapping xml Ceramic {
264
+ element "ceramic"
265
+ namespace CeramicsNs
266
+ map_element "location" location
267
+ map_attribute "kiln" kiln
268
+ map_content notes
269
+ }
270
+
271
+ mapping key_value Ceramic {
272
+ map "full-name" location
273
+ map_key to_instance key_name
274
+ map_value as_attribute values
275
+ }
276
+ ----
277
+
278
+ XML rules compile into the lutaml-model `xml` mapping (`element`/`root`,
279
+ `namespace`, `map_element`, `map_attribute`, `map_content`,
280
+ `mixed_content`); key-value formats (`yaml`/`json`/`toml`/`key_value`)
281
+ compile into per-format key-value mappings. Map lines use LML
282
+ juxtaposition (wire name, then attribute); the legacy
283
+ `map "x", to: "y"` in-class line syntax remains accepted as a
284
+ compatibility alias. The full specification lives in the RS 3010
285
+ declarations reference (lutaml/docs, `lml-declarations.adoc`).
286
+
287
+ ==== `derive` — computed-field declarations
288
+
289
+ [source]
290
+ ----
291
+ derive urn: String
292
+ ----
293
+
294
+ Declares existence + type only; the attribute is mappable like any other.
295
+ The *computation* is bound by the binder from the grammar artifact's derive
296
+ specs — LML never defines computation. The compiled class records the
297
+ declarations in `derived_fields`.
298
+
299
+ ==== `string_format` — grammar-backed string formats
300
+
301
+ [source]
302
+ ----
303
+ class IsoIdentifier {
304
+ string_format :pubid_iso {
305
+ artifact "pubid/iso"
306
+ root "iso_identifier"
307
+ }
308
+ }
309
+ ----
310
+
311
+ A thin reference to a compiled parsanol artifact (single source of truth for
312
+ capture maps and render specs — LML never duplicates them). At compile time
313
+ the artifact resolves through the compiler's `artifact_paths:` map (reference
314
+ -> path) or `default_artifact:`, and registration via
315
+ `Parsanol::PARG::Lutaml.register` defines `from_<format>` on the compiled
316
+ model. A `models`-block-level `string_format` acts as the default for classes
317
+ without their own.
318
+
319
+ ==== `isa` — instance-type override
320
+
321
+ [source]
322
+ ----
323
+ instance S158Checks {
324
+ isa ValidationChecks
325
+ type = Type::standard # ordinary data attribute
326
+ }
327
+ ----
328
+
329
+ The override keyword is `isa`; a `type` attribute is ordinary data (pubid's
330
+ identifier-kind field is contractually named `type`). The bare
331
+ `instance <Type> { }` header form is unchanged.
332
+
333
+ === `enum` definition
334
+
335
+ [source]
336
+ ----
337
+ enum CheckClassification {
338
+ critical_error {
339
+ description "Critical Error"
340
+ }
341
+ error { description "Error" }
342
+ warning { description "Warning" }
343
+ }
344
+ ----
345
+
346
+ Each enum value is a named member with an optional `definition { ... }` block.
347
+ The decided `description "<text>"` string form is not yet implemented on `main`;
348
+ it currently becomes a nested attribute. Enum values use the decided instance
349
+ spelling `EnumName::value_name` (see <<enum-ref,enum references>>).
350
+
351
+ .Decision
352
+ ====
353
+ *Both the string form `description "..."` and the block form `definition { ... }`
354
+ are part of the decided syntax.* Only the block form currently populates
355
+ `definition` on `main`.
356
+ ====
357
+
358
+ ==== Value declarations (RS 3001 normative)
359
+
360
+ [source]
361
+ ----
362
+ enum Finish {
363
+ value "Celadon" {
364
+ definition "Pale green glaze"
365
+ label = "cel"
366
+ }
367
+ value matte { definition "Non-reflective" }
368
+ gloss
369
+ }
370
+ ----
371
+
372
+ `value <name> { ... }` is the canonical member declaration: quoted or bare
373
+ name, optional block. Block contents: `definition "..."` becomes the member
374
+ description, `name = value` pairs become typed payloads (declared via
375
+ `member_fields`), and `instance { ... }` bodies carry values-as-instances.
376
+ The bare identifier member (`gloss`) is the documented shortcut expanding
377
+ to `value gloss { }`.
378
+
379
+ ==== Enum member payloads and table-driven members
380
+
381
+ [source]
382
+ ----
383
+ enum Stage {
384
+ member_fields { abbreviation String urn_segment String }
385
+ draft10 { abbreviation = "WD" urn_segment = "wd" }
386
+ published { abbreviation = "IS" urn_segment = "published" }
387
+ }
388
+ ----
389
+
390
+ * `member_fields { <name> <Type> ... }` — the typed payload schema, required
391
+ for table-driven members and validated against inline payloads.
392
+ * Inline payload lines reuse the keyword-attribute body (`<field> = <value>`).
393
+ * `from_table "<table>" { artifact "<ref>" }` — members come from a parsanol
394
+ artifact's `tables:` section at compile time (deterministic
395
+ materialization, no runtime data dependency); rows are validated against
396
+ `member_fields` (unknown field = error; missing optional field = nil; the
397
+ member name comes from the row's `name` column). The artifact resolves
398
+ through the compiler's `artifact_paths:` map or `default_artifact:`.
399
+
400
+ === `data_type` and `primitive` (diagram language only)
401
+
402
+ [NOTE]
403
+ ====
404
+ `data_type` and `primitive` are *not* part of the LML `models {}` grammar — a
405
+ `models` block accepts only `class` and `enum` definitions. `data_type` and
406
+ `primitive` are constructs of the UML *diagram* language and are valid only inside
407
+ a `diagram { ... }` (or `view { ... }`) block:
408
+
409
+ [source]
410
+ ----
411
+ diagram MyView {
412
+ data_type "Banking Information" {
413
+ "art code" { definition { The bank ART code. } }
414
+ "CCT Number"
415
+ }
416
+ primitive Integer
417
+ }
418
+ ----
419
+
420
+ `data_type <Name> { ... }` defines an enumerated data type whose values may be
421
+ quoted and may carry `definition {}` blocks; `primitive <Name>` declares a
422
+ primitive type. See `lutaml/docs/_pages/uml-syntax.adoc`. They are documented here
423
+ only to note that they do *not* belong in an LML `models` block.
424
+ ====
425
+
426
+ On the parsed document, both are surfaced through dedicated accessors:
427
+ `document.classes`, `document.enums`, `document.data_types`, and
428
+ `document.primitives` each return their entity collection. A `data_type` or
429
+ `primitive` definition never appears in `classes` — inspect `data_types` /
430
+ `primitives` for them.
431
+
432
+ === `package`
433
+
434
+ [source]
435
+ ----
436
+ package Ceramics {
437
+ enum FiringProfile { values { "low", "medium", "high" } }
438
+
439
+ class CeramicTile {
440
+ attribute dimensions, float { cardinality 2 }
441
+ attribute firing_profile, FiringProfile
442
+ }
443
+ }
444
+ ----
445
+
446
+ A named grouping of classes, enums, data types and nested packages
447
+ (RS 3001 §Package). Package members join the document's type scope.
448
+ An enum-level `values { ... }` shorthand expands into plain members.
449
+
450
+ === Methods / operations (diagram language only)
451
+
452
+ [NOTE]
453
+ ====
454
+ UML *operations* (methods) — `[visibility] name(params): ReturnType {modifiers}`,
455
+ see `lutaml/docs/_pages/uml-syntax.adoc` §Methods — are *not* part of the LML
456
+ `class {}` grammar. A class body accepts only attributes and documentation; there is
457
+ no way to declare a method on an LML class. As with `package`, `Operation` and
458
+ `OperationParameter` model classes exist but are latent — no grammar rule produces
459
+ one (a `method` keyword and a `method_abstract` rule linger in the grammar wired to
460
+ nothing). Only `Operation` has a builder-registry entry; `OperationParameter` does
461
+ not.
462
+ ====
463
+
464
+ [[associations]]
465
+ === Associations (diagram language only)
466
+
467
+ [NOTE]
468
+ ====
469
+ `association` is a UML *diagram*-language construct, *not* part of the LML
470
+ `models {}` grammar — a `models` body accepts only `class` and `enum`, so an
471
+ `association {}` placed inside `models {}` fails to parse. Associations are valid
472
+ only in a `diagram { ... }` / `view { ... }` block. Association syntax follows the
473
+ UML diagram language (`association <Name> { ... }`); see
474
+ `lutaml/docs/_pages/uml-syntax.adoc`.
475
+
476
+ Two divergences from that doc: LML uses `owner` / `owner_type` for the association
477
+ ends where the UML diagram language uses `owned` / `owned_type`; and `member_type`
478
+ in an association body carries the diagram meaning (an association *kind*), not the
479
+ collection element type it means in a `class < Array` body.
480
+ ====
481
+
482
+ == Data instances
483
+
484
+ A data-instance file provides concrete values for a model.
485
+
486
+ === `require` — model dependency
487
+
488
+ [source]
489
+ ----
490
+ require "iho_s102_check.lml"
491
+ ----
492
+
493
+ `require "<path>"` declares the model-definition file whose classes the instances
494
+ reference; the path is recorded on the parsed document. NOTE: the current
495
+ implementation does *not* automatically load or compile the referenced model — the
496
+ model must be compiled separately (e.g. `ModelCompiler#compile`) before hydrating
497
+ the instance data. The path is intended to resolve relative to the requiring file.
498
+
499
+ [NOTE]
500
+ ====
501
+ The preprocessor also inlines the diagram language's unquoted `include <path>`
502
+ directive in `.lml` files. `require "<path>"` (quoted) is the idiomatic
503
+ instance-data form; `include <path>` (unquoted) is the diagram-language form and
504
+ is accepted but discouraged in `.lml`.
505
+
506
+ The diagram/`view` constructs — `view <Name> { import "<glob>" show A, B hide C }`
507
+ — are accepted by the shared grammar root but belong to the diagram language; see
508
+ `lutaml/docs/_pages/uml-syntax.adoc`. They are not part of the LML model/instance
509
+ layer.
510
+ ====
511
+
512
+ === Instance forms
513
+
514
+ [source]
515
+ ----
516
+ # typed instance (type is the token after `instance`)
517
+ instance IhoS102Check::ValidationCheck {
518
+ dev_id = "S102_Dev1001"
519
+ }
520
+
521
+ # named instance whose type is declared inside via `type`
522
+ instance S158Checks {
523
+ type ValidationChecks
524
+ members = [ ... ]
525
+ }
526
+ ----
527
+
528
+ An instance is either `instance <Type> { ... }` (type is the identifier after
529
+ `instance`, possibly namespaced), `instance <InitialType> { type <Type> ... }`
530
+ (an explicit `type` line inside the body wins during hydration), or the
531
+ RS 3001 quoted-name form `instance "<name>" [Type] { ... }`:
532
+
533
+ [source]
534
+ ----
535
+ instances {
536
+ instance "square" Tile {
537
+ url = "http://example.com//x"
538
+ }
539
+ }
540
+ ----
541
+
542
+ Instance collections may be named — `instances "Glazes" { ... }` or bare
543
+ `instances Glazes { ... }` — and `ref:(<collection>.<instance>)` paths
544
+ resolve through the collection name.
545
+
546
+ WARNING: The parser does *not* retain whether `=` was present. Consequently,
547
+ `type ValidationChecks` and `type = "electronic"` both become an attribute named
548
+ `type`, and the compiler treats both as an instance-type override. A compiled
549
+ model cannot currently hydrate an ordinary data attribute named `type` correctly.
550
+
551
+ A third form omits the `instance` keyword and includes a quoted name token —
552
+ `<Type> "<name>" { ... }` — for the collection/executor DSL (see <<executor>>).
553
+ It has syntax for a `template { ... }` block of reusable default values,
554
+ `extends "<base-name>"` to inherit from another named instance, and `{plus}=`
555
+ to append to an inherited list attribute (vs `=` which replaces):
556
+
557
+ [source]
558
+ ----
559
+ Product "base_computer" {
560
+ template {
561
+ components = [ Component "base_cpu" { category = "electronic" quantity = 1 } ]
562
+ }
563
+ }
564
+
565
+ Product "gaming_pc" extends "base_computer" {
566
+ name = "Gaming PC"
567
+ components += [ Component "gpu_1" { id = "GPU001" quantity = 1 } ]
568
+ }
569
+ ----
570
+
571
+ .Decision
572
+ ====
573
+ *(`template` / `extends` / `{plus}=` are Planned — parsed but not yet applied.)* The
574
+ parser records `template`, the `extends` parent, and the `{plus}=`/`extended` flag,
575
+ but document construction discards the quoted instance name because `Instance`
576
+ has no `name` field. No resolver, compiler, or executor merges these constructs:
577
+ `extends` does not currently inherit defaults and `{plus}=` does not currently
578
+ append to an inherited list. Moreover, the Executor processes only *imported*
579
+ instances (see <<executor>>) — it does not read entries declared directly in an
580
+ `instances { }` block. Treat these constructs as parse-only for now.
581
+ ====
582
+
583
+ .Decision
584
+ ====
585
+ *There is no `instance Array <Name> { ... }` wrapper.* Array/collection-ness is
586
+ carried by the instance's *type*, never by a bare `Array` keyword after
587
+ `instance`. A source form like `instance Array S158Metadata { ... }` is not
588
+ supported; write `instance S158Metadata { type Array ... }` (generic array) or
589
+ give it a defined collection type — `type <CollectionClassName>`, where that class
590
+ was declared `class <CollectionClassName> < Array`.
591
+ ====
592
+
593
+ [[enum-ref]]
594
+ === References
595
+
596
+ Reference values point at instances (or named-collection members) and
597
+ accept both spellings:
598
+
599
+ [source]
600
+ ----
601
+ glaze = ref:(Glazes.blue_matte)
602
+ other = reference:(Product.id)
603
+ ----
604
+
605
+ === Attribute values
606
+
607
+ [source]
608
+ ----
609
+ document_number = "S-158:102" # string
610
+ terminate_if_failure = true # boolean
611
+ quantity = 1 # number
612
+ classification = CheckClassification::critical_error # enum reference
613
+ data_quality_measure = [ "Logical Consistency", "Format Consistency" ] # scalar list
614
+ prerequisites = [ "S102_Dev1009" ] # reference-value list (reference:(...) type)
615
+ ----
616
+
617
+ * Scalars: `name = "string"`, `name = true`, `name = 1`, `name = 3.14`.
618
+ * Enum references: `name = EnumName::value_name` (not a quoted
619
+ string). Resolution to the compiled enum member is planned; `main` currently
620
+ retains the raw `"EnumName::value_name"` string.
621
+ * Scalar lists: `name = [ "a", "b" ]`.
622
+ * Reference-value lists: for an attribute of a `reference:(...)` type, the
623
+ referenced key values are supplied as quoted strings in a list.
624
+ * Key/value maps: `name = { id = "component_id" type = "component_type" }` — a
625
+ brace-delimited set of `key = value` pairs (grammar-only; see the warning below).
626
+ * Ranges: `name = start..end` (e.g. `name = 1..10`) (grammar-only; see the warning
627
+ below).
628
+
629
+ WARNING: Maps and ranges parse, but they do not currently survive data processing
630
+ as Ruby `Hash` / `Range` values. A map is coerced into a
631
+ `TopElementAttribute`-shaped value, while a range loses its bounds. Do not use
632
+ either in data that will be hydrated. The nested CSV `columns { ... }` map is
633
+ also not consumed by the CSV adapter (see <<executor>>).
634
+
635
+ [NOTE]
636
+ ====
637
+ An *enum-reference* value (`Enum::value`) is matched by the newline-terminated
638
+ fallback rule, so it is consumed to end of line: the closing brace of an instance
639
+ body cannot sit on the same line as an enum reference — write it on its own line.
640
+ Values with a dedicated token rule (quoted strings, booleans, numbers, ranges,
641
+ lists, maps) are not affected and may share a line with the closing brace.
642
+ ====
643
+
644
+ === Nested instances
645
+
646
+ An attribute whose type is another class holds nested `instance` blocks:
647
+
648
+ [source]
649
+ ----
650
+ compliant_standards = [
651
+ instance CompliantStandard { title = "S-102 PS" based = "2.3.0" },
652
+ instance CompliantStandard { title = "S-102 FC" based = "???" }
653
+ ]
654
+ ----
655
+
656
+ A single nested instance (not in a list) is also accepted. As an attribute value,
657
+ it currently hydrates to a one-element `Array`, even when the attribute has scalar
658
+ cardinality. Only a plain, attribute-free wrapper instance is unwrapped to the
659
+ inner object.
660
+
661
+ [[collection-instances]]
662
+ === Collection instances — Planned
663
+
664
+ The decided instance syntax supplies collection elements under the canonical
665
+ keyword *`members`*.
666
+
667
+ [source]
668
+ ----
669
+ instance S158Checks {
670
+ type ValidationChecks
671
+ members = [
672
+ instance IhoS102Check::ValidationCheck { dev_id = "S102_Dev1001" ... },
673
+ instance IhoS102Check::ValidationCheck { dev_id = "S102_Dev1002" ... }
674
+ ]
675
+ }
676
+ ----
677
+
678
+ The planned hydrator will produce a compiled `ValidationChecks` collection and
679
+ enforce `member_unique` (`dev_id`). On `main`, collection compilation and this
680
+ uniqueness check are not implemented.
681
+
682
+ .Decision
683
+ ====
684
+ *The decided member-list keyword is fixed as `members`* — not an arbitrary field
685
+ name. This resolves the source ambiguity where
686
+ `instance S158Checks { type ValidationChecks checks = [...] }` used an undeclared
687
+ `checks` field. Strict rejection of other names is not yet implemented on
688
+ `main`. Rationale: neither UML nor EXPRESS defines a generic member-list keyword
689
+ (both name collections via a property/attribute); `members` is chosen because it
690
+ is parallel to LML's own `member_type` / `member_unique`.
691
+ ====
692
+
693
+ ==== Generic arrays (`type Array`) — Planned (not yet implemented)
694
+
695
+ An instance may declare `type Array` (the built-in) to be a plain, untyped array
696
+ of its nested members — no declared `member_type` and no uniqueness key.
697
+
698
+ [source]
699
+ ----
700
+ instance S158Metadata {
701
+ type Array
702
+ members = [ instance IhoDataModels::IhoMetadata { ... } ]
703
+ }
704
+ ----
705
+
706
+ .Decision
707
+ ====
708
+ *(Planned — not yet implemented.)* `type Array` yields a generic array of the
709
+ `members`; a named `type <CollectionClassName>` (declared `class ... < Array`)
710
+ yields the typed, uniqueness-constrained collection. A collection instance
711
+ hydrates only when its type resolves to a collection (built-in `Array` or a
712
+ defined `class < Array`); otherwise it is an ordinary instance. Today the built-in
713
+ `Array` is not recognized as a collection, so a `type Array` instance currently
714
+ hydrates as an untyped hash (the same path as any unknown type).
715
+ ====
716
+
717
+ [[executor]]
718
+ == Data-instance collections and I/O (executor DSL)
719
+
720
+ Beyond individual instances, LML has a data-orchestration layer rooted in an
721
+ `instances { ... }` block. It groups named instances, declares validation
722
+ collections, and describes external import/export. It is processed by the
723
+ Executor subsystem, not the model compiler. NOTE: the Executor currently acts on
724
+ the instances produced by `import` (below); the named `instance` / `<Type> "<name>"`
725
+ entries declared directly in the block are parsed but are not themselves hydrated or
726
+ returned by the Executor.
727
+
728
+ === `instances` block
729
+
730
+ [source]
731
+ ----
732
+ instances {
733
+ collection "test_suite_1" { ... }
734
+ import { ... }
735
+ export { ... }
736
+ Product "base_computer" { ... }
737
+ }
738
+ ----
739
+
740
+ The block holds `collection`, `import`, `export`, and instance definitions — both
741
+ the named `<Type> "<name>" { ... }` form and the bare `instance <Type> { ... }` /
742
+ `instance <Name> { type <T> ... }` forms. Multiple entries *within* a single
743
+ `collection`/`import`/`export` block are collected; note, however, that in the
744
+ current implementation repeated *top-level* `collection`/`import`/`export` blocks
745
+ do not accumulate — the last one of each kind wins (see
746
+ <<implementation-status>>).
747
+
748
+ === `collection` — named instance set with validation
749
+
750
+ [source]
751
+ ----
752
+ collection "test_suite_1" {
753
+ includes [ "laptop_123", "desktop_1", "desktop_2" ]
754
+ validation {
755
+ condition "count >= 3"
756
+ condition "all? { |i| i.components.count > 0 }"
757
+ }
758
+ }
759
+ ----
760
+
761
+ `collection "<name>" { ... }` declares an `includes [ ... ]` reference list and
762
+ `validation { condition "<expr>" ... }` rules. Each `condition` is a string
763
+ expression evaluated by the ConditionEvaluator (e.g. count comparisons). NOTE:
764
+ `includes` is parsed but *not honored* — validation currently runs over *all*
765
+ imported instances, not the subset named by `includes` (the reference identifiers
766
+ are not resolved). Treat `includes`-based grouping as unimplemented.
767
+
768
+ === `import` — external data sources
769
+
770
+ [source]
771
+ ----
772
+ import {
773
+ xml "test_data/products.xml" {
774
+ map_to Product
775
+ where "//product"
776
+ }
777
+ csv "test_data/components.csv" {
778
+ map_to Component
779
+ columns { id = "component_id" type = "component_type" quantity = "count" }
780
+ }
781
+ }
782
+ ----
783
+
784
+ `import { ... }` maps external sources to instances: `xml "<path>" { map_to
785
+ <Class> where "<xpath>" }` and `csv "<path>" { map_to <Class> columns { <attr> =
786
+ "<column>" ... } }`.
787
+
788
+ [NOTE]
789
+ ====
790
+ Two current limitations of the `import` example above:
791
+
792
+ * *CSV column mapping.* The CSV adapter builds its column map from the import's
793
+ *direct* attributes (`<attr> = "<column>"` lines placed directly under
794
+ `csv "<path>" { ... }`), not from a nested `columns { ... }` block. The
795
+ nested-block form shown is parsed into a single `columns` attribute that the
796
+ adapter does not consume, so it currently yields no mappings — treat the
797
+ `columns { }` wrapper as Planned.
798
+ * *XPath with `//`.* Quoted XPath strings such as `where "//product"` survive
799
+ (string scans are atomic under the grammar-level trivia); bare (unquoted) values
800
+ beginning with `//` are still read as comments.
801
+ ====
802
+
803
+ === `export` — format targets
804
+
805
+ [source]
806
+ ----
807
+ export {
808
+ format xml { file "output/products.xml" indent true encoding "UTF-8" }
809
+ format step { file "output/products.stp" reference_format "#%{id}" }
810
+ }
811
+ ----
812
+
813
+ `export { format <fmt> { ... } }` declares output targets, with per-format options
814
+ `file`, `indent` (boolean), `encoding`, and `reference_format` (a template with
815
+ `+%{id}+` interpolation).
816
+
817
+ [NOTE]
818
+ ====
819
+ Current limitations of `export`:
820
+
821
+ * *Built-in formats.* Only `csv` and `xml` adapters are registered; the `step`
822
+ target in the example above raises `AdapterNotFoundError` unless an external
823
+ adapter has been registered separately via `FormatAdapter.register`.
824
+ * *`encoding`.* Parsed and stored, but the XML adapter does not apply it when
825
+ serializing — a non-default `encoding` currently has no effect (only `indent` is
826
+ honored).
827
+ * *`reference_format`.* Parsed but not consumed by any built-in adapter.
828
+ ====
829
+
830
+ [[divergences]]
831
+ == Validation (RS 3001 §Validation rules)
832
+
833
+ `lutaml validate` (and `Lutaml::Lml::Validator`) evaluates the RS 3001
834
+ validation rules over a parsed document and reports violations:
835
+
836
+ [cols="1,3"]
837
+ |===
838
+ | Rule | Check
839
+ | `unique_names` | type names unique across the document (classes, enums, data types, packages)
840
+ | `unique_attribute_names` | attribute names unique within each class/data type
841
+ | `mandatory_attributes` | cardinality-1 (or any positive minimum) attributes populated on instances
842
+ | `type_conformity` | instance values match declared primitive types
843
+ | `pattern_conformity` | instance values match declared `pattern /…/` constraints
844
+ | `reference_validity` | `ref:`/`reference:` paths resolve to known instances, attributes, or collections
845
+ | `reference_circularity` | reference chains are acyclic
846
+ |===
847
+
848
+ == Interleaved documents
849
+
850
+ The document root is a repetition of top-level constructs: a single file
851
+ may interleave `models` blocks, `instances` collections, bare class/enum
852
+ definitions, packages, mappings and `require` lines (RS 3001 documents
853
+ interleave declarations). Class and enum names share one type scope.
854
+
855
+ == Divergences from the UML diagram syntax
856
+
857
+ [cols="1,2,2"]
858
+ |===
859
+ | Aspect | UML diagram (`.lutaml`) | LML models/instances (`.lml`)
860
+
861
+ | `member_type` | association relationship kind | collection element type (class body); association kind (association body)
862
+ | comments | `//` (quote-aware), `/* */`, `+**+`, `+*\| \|*+` | `+#+` (idiomatic); all four are accepted, `//` and `/* */` quote-aware globally
863
+ | attribute form | UML shorthand primary | `attribute { type/cardinality/description }` blocks primary (shorthand accepted)
864
+ | cardinality upper | `+*+` | `n` (long form) / `+*+` (shorthand)
865
+ | collections | associations + multiplicity | `class < Array` + `member_type` / `member_unique`
866
+ | instances | `+instance :Name {ref} { }+` | `instance <Type> { }` / `instance "<Name>" [Type] { }` / `instance <Name> { type <T> }`
867
+ | model container | `diagram <Name> { }` | `models <Name> { }`
868
+ |===
869
+
870
+ [[decisions-summary]]
871
+ == Summary of design decisions
872
+
873
+ [cols="1,3"]
874
+ |===
875
+ | Decision | Resolution
876
+
877
+ | Comment marker (planned) | `+#+` (quote-aware; `+#+` then whitespace); diagram `//` is separate.
878
+ | `models` braces | Required. Brace-less form rejected.
879
+ | Collection declaration (planned) | `class <Name> < Array { member_type <T> member_unique <k> }`.
880
+ | `member_type` meaning (planned for class bodies) | Collection element type (class body) vs association kind (association body).
881
+ | Member list keyword (planned) | Fixed `members` (no arbitrary names).
882
+ | Array wrapper | No `instance Array <Name>`. Array-ness via `type`.
883
+ | Generic array (planned) | `type Array` → untyped array of `members`.
884
+ | Enum value docs (planned) | `description "..."` string form and `definition { }` block, both → `definition`.
885
+ | Cardinality unbounded | `n` (long form), `+*+` (shorthand). Omitted: design intent `0..1`, but the current implementation treats it as required (see the Cardinality note).
886
+ | Enum reference (planned) | `Enum::value` → resolved enum member on hydrate.
887
+ |===
888
+
889
+ [[implementation-status]]
890
+ == Implementation status (`lutaml-lml`)
891
+
892
+ [cols="1,3,1"]
893
+ |===
894
+ | Area | Status | Notes
895
+
896
+ | `+#+` comments | Implemented | Quote-aware `+#+`, `//` and `/* */` stripping all live (RS 3001 §Comment forms).
897
+ | `class < Array` + member_type/member_unique | Planned | `main` does not retain collection metadata or compile a collection.
898
+ | Enum value `description "..."`| Implemented | Both `description` and `definition` spellings populate the member description.
899
+ | Enum reference resolution | Planned | `main` currently preserves the raw `Enum::value` string.
900
+ | Collection compile + hydrate | Planned | Collection compilation, uniqueness enforcement, and member typing remain unimplemented.
901
+ | `members` keyword (strict) | Planned | `main` still accepts arbitrary nested-instance attribute names.
902
+ | Executor DSL (`instances`/`collection`/`import`/`export`) | Partial | The Executor runs `import` → validate → `export` over *imported* instances. Named instances declared in the block are parsed but not hydrated/returned; repeated *top-level* blocks of the same kind do not accumulate (last wins); only `csv`/`xml` adapters are built in.
903
+ | Named-instance `template` / `extends` / `{plus}=` | Planned (parse-only) | `template`, `parent`, and the extended flag are stored, but the quoted instance name is discarded; no resolver/executor merges them.
904
+ | Collection `includes` filtering | Not implemented | Parsed but not honored — validation runs over *all* imported instances.
905
+ | Export `encoding` / `reference_format` | Not implemented | Parsed but not applied by the built-in adapters (only `indent` is honored).
906
+ | Single-quoted strings | Raw fallback only | They retain their quote characters instead of becoming quoted-string values.
907
+ | Data attribute named `type` | Supported (`isa` override) | The instance-type override is the `isa` keyword; `type` is ordinary data.
908
+ | `mapping` blocks / `derive` / `string_format` / attribute `default` + `render_nil` / enum `member_fields` + payloads + `from_table` | Implemented | See <<class-level-declarations,class-level declarations>> and the enum section.
909
+ | Map / range attribute values | Grammar-only | Both parse, but data processing does not preserve usable `Hash` / `Range` values.
910
+ | Associations in `models {}` | Not supported (by design) | `association` is diagram-language; a `models` body accepts only `class`/`enum`.
911
+ | Attribute `type` required | Not enforced | An empty/`type`-less attribute body parses and compiles as `string`.
912
+ | `type Array` generic array | Planned | Design decided; not yet implemented.
913
+ | Attribute `values { ... }` / `constraint <name> { condition "..." }` | Not implemented | Appear in design issues #174/#285 (enumerated attribute values; attribute/class constraints); backing models exist (`Value`, `Constraint`) but there is no grammar rule yet.
914
+ | `instance Array <Name>` | Not supported (by design) | Use `type` instead.
915
+ | Brace-less `models` | Not supported (by design) | Braces required.
916
+ |===
917
+
918
+ [[open-questions]]
919
+ == Open questions
920
+
921
+ * *Member type validation:* when collections are implemented, should each entry
922
+ in `members` be validated against `member_type`, or is that left to model
923
+ validation?
924
+ * *`type Array` element typing:* should a generic array remain untyped, infer its
925
+ element type from its members, or require a declared element type?
926
+ * *Reference resolution:* `reference:(Class.attribute)` currently degrades to a
927
+ string on compile; should the compiler resolve/validate references against the
928
+ target's `member_unique` key?
929
+ * *Comment markers:* `//` is currently stripped in `.lml`; `+#+` is the decided
930
+ LML marker but remains unimplemented. Should `//` be deprecated or disallowed
931
+ once `+#+` is implemented?