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,61 @@
1
+ ---
2
+ permalink: /references/api/parsers/
3
+ title: Parser APIs
4
+ parent: Reference
5
+ ---
6
+ = Parser APIs
7
+
8
+ Select the parser for the input language and check its result type before
9
+ passing the result to another component. The split gems do not share a
10
+ universal `Lutaml::Parser.parse` entry point.
11
+
12
+ [cols="1,2,2",options="header"]
13
+ |===
14
+ |Input |Entry point |Result
15
+ |LML text |`Lutaml::Lml.parse_document(input)` |`Lutaml::Lml::Document`, without view resolution.
16
+ |LML diagram/view |`Lutaml::Lml.parse(input)` |An LML document with view imports and filtering resolved.
17
+ |EXPRESS |`Lutaml::Express::Parsers::Exp.parse(io)` |The EXPRESS repository returned by Expressir.
18
+ |LUR package |`Lutaml::UmlRepository::Repository.from_package(path)` |A UML repository.
19
+ |QEA or XMI |A separately installed format provider |A provider-specific result; convert it to a UML document before repository construction.
20
+ |===
21
+
22
+ == LML input
23
+
24
+ [source,ruby]
25
+ ----
26
+ require "lutaml"
27
+
28
+ document = Lutaml::Lml.parse_document("diagram City { class Building {} }")
29
+ puts document.classes.first.name
30
+ ----
31
+
32
+ This prints `Building`. For files, open the input and pass the IO object.
33
+ `parse` performs the additional view-resolution stage needed by diagram views.
34
+ Parsing failures raise LML errors such as `Lutaml::Lml::ParsingError`.
35
+ Do not treat an LML document as a `Lutaml::Uml::Document` merely because both
36
+ have a `classes` collection.
37
+
38
+ == EXPRESS input
39
+
40
+ Pass an open IO to the umbrella's EXPRESS adapter:
41
+
42
+ [source,ruby]
43
+ ----
44
+ require "lutaml"
45
+
46
+ repository = File.open("schema.exp") do |input|
47
+ Lutaml::Express::Parsers::Exp.parse(input)
48
+ end
49
+ ----
50
+
51
+ The result belongs to Expressir's model family. Use Expressir's repository
52
+ operations rather than the UML query API on that result.
53
+
54
+ == QEA and XMI integration
55
+
56
+ `lutaml-uml` 1.0.3's repository layer does not import QEA or XMI itself.
57
+ Its `from_file` method raises `ArgumentError` for those extensions.
58
+ An importer must supply a `Lutaml::Uml::Document`; then use
59
+ `Repository.from_document(document)`.
60
+ See link:{site-baseurl}/guides/parsing/qea-parsing/[Integrating QEA Parsing]
61
+ for the integration boundary and validation steps.
@@ -0,0 +1,43 @@
1
+ ---
2
+ permalink: /references/api/presenters/
3
+ title: Presenter APIs
4
+ parent: Reference
5
+ ---
6
+ = Presenter APIs
7
+
8
+ Presenters turn UML elements into text, table rows, and hashes without changing
9
+ the model. They live under `Lutaml::UmlRepository::Presenters`.
10
+
11
+ == Present a class
12
+
13
+ Save this beside `city_model.rb` from
14
+ link:{site-baseurl}/tutorials/getting-started/[Getting Started]:
15
+
16
+ [source,ruby]
17
+ ----
18
+ include::../../examples/present_class.rb[]
19
+ ----
20
+
21
+ Run it with `bundle exec ruby present_class.rb`. The output starts with
22
+ `Class: Building`. Requiring the concrete class presenter registers it with
23
+ the factory before the factory selects it.
24
+
25
+ == Factory and output contract
26
+
27
+ `PresenterFactory.create(element, repository = nil, context = nil)` chooses
28
+ a registered presenter by the element's class, then by its ancestors.
29
+ It raises `ArgumentError` if no presenter is registered for the type.
30
+
31
+ Concrete presenters implement:
32
+
33
+ * `to_text`: a text description.
34
+ * `to_table_row`: a hash suitable for a table row.
35
+ * `to_hash`: structured output for callers to serialize as JSON or YAML.
36
+
37
+ The base `ElementPresenter` provides shared helpers; it does not implement
38
+ those output methods. Instantiate a concrete presenter instead.
39
+
40
+ For an application-specific type, subclass the base, implement all three
41
+ outputs as public methods, then call
42
+ `PresenterFactory.register(element_class, presenter_class)`.
43
+ Keep the repository argument when output needs qualified names or relationships.
@@ -0,0 +1,67 @@
1
+ ---
2
+ permalink: /references/api/repository/
3
+ title: Repository API
4
+ parent: Reference
5
+ ---
6
+ = Repository API
7
+
8
+ `Lutaml::UmlRepository::Repository`, supplied by `lutaml-uml`, wraps a
9
+ `Lutaml::Uml::Document` with indexes, queries, statistics, and package I/O.
10
+ Load it with `require "lutaml"` when using the umbrella gem.
11
+
12
+ == Construction and package I/O
13
+
14
+ [cols="2,3",options="header"]
15
+ |===
16
+ |Method |Contract
17
+ |`.from_document(document, options = {})` |Build indexes for a typed UML document.
18
+ |`.from_package(path)` |Load a LUR ZIP package, including its stored indexes.
19
+ |`.from_file(path, options = {})` |Accept `.lur` files; reject other extensions with `ArgumentError`.
20
+ |`.from_package_lazy(path)` |Load the document and defer index construction.
21
+ |`#export_to_package(path, options = {})` |Write a LUR package from the repository.
22
+ |===
23
+
24
+ For export with `lutaml-uml` 1.0.3, also require `lutaml/uml/version` to load the
25
+ component version used in package metadata. See the executable
26
+ link:{site-baseurl}/tutorials/first-lur-package/[LUR package tutorial].
27
+
28
+ `.from_file_cached(source_path, lur_path: nil) { |path| ... }` uses an existing
29
+ cache when it is at least as new as the source. Otherwise, the block must
30
+ return a UML document to index and save. The method does not choose an external
31
+ QEA or XMI parser for you.
32
+
33
+ == Lookups
34
+
35
+ * `find_package(path, raise_on_error: false)` and
36
+ `find_class(qualified_name, raise_on_error: false)` return an element or `nil`.
37
+ * `list_packages(path = "ModelRoot", recursive: false)` returns package objects.
38
+ * `classes_in_package(path, recursive: false)` returns matching classifiers.
39
+ * `find_classes_by_stereotype(name)` uses the stereotype index.
40
+ * `package_tree(path = "ModelRoot", max_depth: nil)` returns the package hierarchy.
41
+ * `find_diagram(name)`, `diagrams_in_package(path)`, and `all_diagrams` access
42
+ diagram objects already present in the document; they do not render SVG.
43
+
44
+ Qualified paths use `::`, for example `ModelRoot::City::Building`.
45
+ Use the actual package hierarchy rather than a source filename as the path.
46
+
47
+ == Search, queries, and statistics
48
+
49
+ `search(text, types: [:class, :attribute, :association], fields: [:name])`
50
+ returns grouped results under `:classes`, `:attributes`, and `:associations`,
51
+ plus `:total`. Structured queries return model objects:
52
+
53
+ [source,ruby]
54
+ ----
55
+ classes = repository.query do |query|
56
+ query.classes.where(name: /Building/).order_by(:name).limit(10)
57
+ end.all
58
+ ----
59
+
60
+ In `lutaml-uml` 1.0.3, the DSL's `in_package` condition raises `NameError` for
61
+ an unresolved `PackagePath` constant. Use `classes_in_package(path)` for that
62
+ operation rather than adding `in_package` to a query chain.
63
+
64
+ `statistics` returns a hash of counts and model metrics.
65
+ The synthetic `ModelRoot` contributes to package counts.
66
+ See link:{site-baseurl}/tutorials/querying-models/[Searching and Querying Models]
67
+ for a complete runnable example.
@@ -0,0 +1,72 @@
1
+ ---
2
+ permalink: /references/cli/commands/
3
+ title: Command-Line Compatibility
4
+ parent: Reference
5
+ ---
6
+ = Command-Line Compatibility
7
+
8
+ The LutaML family has been split into separate gems. Historical examples using
9
+ `lutaml uml ...` are not a command reference for the current umbrella package.
10
+ In `lutaml-uml` 1.0.3, the packaged `lutaml` executable requires
11
+ `lutaml/cli`, but that implementation is absent from the gem. The umbrella
12
+ checkout does not supply it either. Use the Ruby APIs below for these workflows.
13
+
14
+ Do not interpret a command name in an older tutorial as evidence that the
15
+ corresponding executable is available in your installed version.
16
+
17
+ [[build]]
18
+ == Build a package
19
+
20
+ Use `repository.export_to_package("model.lur")` after constructing a UML
21
+ repository. The link:{site-baseurl}/tutorials/first-lur-package/[package tutorial]
22
+ has a complete runnable script, including current component initialization.
23
+
24
+ [[search]]
25
+ == Search
26
+
27
+ Use `repository.search("Building", types: [:class])`. Read the grouped results
28
+ and `:total` from the returned hash. For object filtering, use the
29
+ link:{site-baseurl}/tutorials/querying-models/[query DSL].
30
+
31
+ [[export]]
32
+ == Export model data
33
+
34
+ `repository.document.to_yaml` serializes the typed UML document to YAML.
35
+ Write that string with `File.write("model.yaml", ...)` when you need a plain
36
+ model file. Use `export_to_package` when you also need repository metadata
37
+ and indexes in a LUR archive.
38
+
39
+ [[ls]]
40
+ == List elements
41
+
42
+ Use `repository.list_packages("ModelRoot", recursive: true)` for package objects
43
+ or `repository.classes_in_package(path, recursive: true)` for classifiers.
44
+ These are Ruby return values; callers choose the text or table format.
45
+
46
+ [[tree]]
47
+ == Inspect the hierarchy
48
+
49
+ `repository.package_tree("ModelRoot", max_depth: 3)` returns a nested hierarchy.
50
+ It does not print a terminal tree by itself. Use the returned structure in your
51
+ own presentation, or generate a model browser.
52
+
53
+ [[stats]]
54
+ == Read statistics
55
+
56
+ `repository.statistics` returns a hash, including `:total_packages`,
57
+ `:total_classes`, and `:total_diagrams`. Counts include the synthetic root
58
+ package. Rebuild the repository if you change its underlying document.
59
+
60
+ [[docs]]
61
+ == Generate documentation
62
+
63
+ Use `Lutaml::UmlRepository::StaticSite.generate(repository, output: "browser.html")`.
64
+ See link:{site-baseurl}/tutorials/documentation-site/[Creating a Documentation Site]
65
+ for output modes and local inspection.
66
+
67
+ [[serve]]
68
+ == Serve generated files
69
+
70
+ The static output can be served by an ordinary HTTP server. For example,
71
+ `python3 -m http.server 8000` serves the current directory when Python 3 is
72
+ available. Publishing and server configuration are separate from model generation.