lutaml-model 0.8.187 → 0.8.188

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 (306) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dependent-repos-tools-informational.json +8 -0
  3. data/.github/workflows/dependent-repos-tools.json +1 -5
  4. data/.github/workflows/dependent-tests.yml +26 -2
  5. data/Gemfile +2 -0
  6. data/Rakefile +6 -0
  7. data/exe/lutaml-lml-lsp +11 -0
  8. data/lib/compat/opal/generate_boot.rb +12 -5
  9. data/lib/compat/opal/lutaml_model_boot.rb +96 -4
  10. data/lib/lutaml/lml/association_label_resolver.rb +52 -0
  11. data/lib/lutaml/lml/data_processor/attribute_processing.rb +133 -0
  12. data/lib/lutaml/lml/data_processor/collection_processing.rb +37 -0
  13. data/lib/lutaml/lml/data_processor/instance_processing.rb +77 -0
  14. data/lib/lutaml/lml/data_processor/value_declaration_processing.rb +70 -0
  15. data/lib/lutaml/lml/data_processor/value_processing.rb +103 -0
  16. data/lib/lutaml/lml/data_processor/view_processing.rb +26 -0
  17. data/lib/lutaml/lml/data_processor.rb +66 -0
  18. data/lib/lutaml/lml/diagnostic.rb +149 -0
  19. data/lib/lutaml/lml/document_builder.rb +486 -0
  20. data/lib/lutaml/lml/entity_types.rb +31 -0
  21. data/lib/lutaml/lml/executor/adapter_helpers.rb +45 -0
  22. data/lib/lutaml/lml/executor/condition_evaluator.rb +175 -0
  23. data/lib/lutaml/lml/executor/csv_adapter.rb +89 -0
  24. data/lib/lutaml/lml/executor/format_adapter.rb +54 -0
  25. data/lib/lutaml/lml/executor/xml_adapter.rb +102 -0
  26. data/lib/lutaml/lml/executor.rb +96 -0
  27. data/lib/lutaml/lml/format/adapter/document.rb +11 -0
  28. data/lib/lutaml/lml/format/adapter/mapping.rb +31 -0
  29. data/lib/lutaml/lml/format/adapter/standard_adapter.rb +164 -0
  30. data/lib/lutaml/lml/format/adapter/transform.rb +11 -0
  31. data/lib/lutaml/lml/format.rb +34 -0
  32. data/lib/lutaml/lml/formatter/base.rb +81 -0
  33. data/lib/lutaml/lml/formatter/canonical.rb +738 -0
  34. data/lib/lutaml/lml/formatter.rb +11 -0
  35. data/lib/lutaml/lml/grammar/lml.artifact.json +14993 -0
  36. data/lib/lutaml/lml/grammar/lml.parg +389 -0
  37. data/lib/lutaml/lml/grammar.rb +60 -0
  38. data/lib/lutaml/lml/has_attributes.rb +14 -0
  39. data/lib/lutaml/lml/import_resolver.rb +96 -0
  40. data/lib/lutaml/lml/layout/engine.rb +17 -0
  41. data/lib/lutaml/lml/layout.rb +9 -0
  42. data/lib/lutaml/lml/literal_value.rb +32 -0
  43. data/lib/lutaml/lml/lsp/conversions.rb +78 -0
  44. data/lib/lutaml/lml/lsp/keywords.rb +43 -0
  45. data/lib/lutaml/lml/lsp/server.rb +380 -0
  46. data/lib/lutaml/lml/lsp/store.rb +68 -0
  47. data/lib/lutaml/lml/lsp/transport.rb +53 -0
  48. data/lib/lutaml/lml/lsp.rb +16 -0
  49. data/lib/lutaml/lml/model_compiler/enums.rb +170 -0
  50. data/lib/lutaml/lml/model_compiler/hydration.rb +122 -0
  51. data/lib/lutaml/lml/model_compiler/serialization_mappings.rb +188 -0
  52. data/lib/lutaml/lml/model_compiler/string_formats.rb +42 -0
  53. data/lib/lutaml/lml/model_compiler/validation.rb +65 -0
  54. data/lib/lutaml/lml/model_compiler.rb +329 -0
  55. data/lib/lutaml/lml/models/action.rb +10 -0
  56. data/lib/lutaml/lml/models/association.rb +31 -0
  57. data/lib/lutaml/lml/models/cardinality.rb +10 -0
  58. data/lib/lutaml/lml/models/collection.rb +11 -0
  59. data/lib/lutaml/lml/models/constraint.rb +25 -0
  60. data/lib/lutaml/lml/models/data_type.rb +43 -0
  61. data/lib/lutaml/lml/models/derived_field.rb +14 -0
  62. data/lib/lutaml/lml/models/diagram.rb +22 -0
  63. data/lib/lutaml/lml/models/document.rb +86 -0
  64. data/lib/lutaml/lml/models/enum.rb +40 -0
  65. data/lib/lutaml/lml/models/fidelity.rb +10 -0
  66. data/lib/lutaml/lml/models/group.rb +11 -0
  67. data/lib/lutaml/lml/models/instance.rb +28 -0
  68. data/lib/lutaml/lml/models/instance_collection.rb +18 -0
  69. data/lib/lutaml/lml/models/instances_export.rb +10 -0
  70. data/lib/lutaml/lml/models/instances_import.rb +11 -0
  71. data/lib/lutaml/lml/models/mapping.rb +15 -0
  72. data/lib/lutaml/lml/models/mapping_rule.rb +16 -0
  73. data/lib/lutaml/lml/models/member_field.rb +16 -0
  74. data/lib/lutaml/lml/models/namespace.rb +18 -0
  75. data/lib/lutaml/lml/models/operation.rb +28 -0
  76. data/lib/lutaml/lml/models/operation_parameter.rb +12 -0
  77. data/lib/lutaml/lml/models/package.rb +28 -0
  78. data/lib/lutaml/lml/models/primitive_type.rb +35 -0
  79. data/lib/lutaml/lml/models/reference.rb +23 -0
  80. data/lib/lutaml/lml/models/serialization_mapping.rb +21 -0
  81. data/lib/lutaml/lml/models/string_format.rb +16 -0
  82. data/lib/lutaml/lml/models/top_element_attribute.rb +118 -0
  83. data/lib/lutaml/lml/models/uml_class.rb +87 -0
  84. data/lib/lutaml/lml/models/value.rb +17 -0
  85. data/lib/lutaml/lml/models/view_filter.rb +11 -0
  86. data/lib/lutaml/lml/models/view_import.rb +11 -0
  87. data/lib/lutaml/lml/parser.rb +19 -0
  88. data/lib/lutaml/lml/pipeline.rb +73 -0
  89. data/lib/lutaml/lml/positioned.rb +13 -0
  90. data/lib/lutaml/lml/preprocessor.rb +132 -0
  91. data/lib/lutaml/lml/quoting.rb +60 -0
  92. data/lib/lutaml/lml/source.rb +49 -0
  93. data/lib/lutaml/lml/source_position.rb +20 -0
  94. data/lib/lutaml/lml/symbol_index.rb +202 -0
  95. data/lib/lutaml/lml/transform.rb +119 -0
  96. data/lib/lutaml/lml/types/text_type.rb +28 -0
  97. data/lib/lutaml/lml/types.rb +10 -0
  98. data/lib/lutaml/lml/validator.rb +460 -0
  99. data/lib/lutaml/lml/view_resolution.rb +32 -0
  100. data/lib/lutaml/lml/view_resolver.rb +48 -0
  101. data/lib/lutaml/lml/yaml_parser.rb +17 -0
  102. data/lib/lutaml/lml.rb +130 -0
  103. data/lib/lutaml/model/adapter_resolver.rb +21 -2
  104. data/lib/lutaml/model/config.rb +22 -0
  105. data/lib/lutaml/model/serialize/format_conversion.rb +8 -6
  106. data/lib/lutaml/model/version.rb +1 -1
  107. data/lib/lutaml/xml/adapter/base_adapter.rb +26 -0
  108. data/lib/lutaml/xml/adapter/moxml_adapter.rb +49 -0
  109. data/lib/lutaml/xml/adapter/xml_parser.rb +4 -4
  110. data/lib/lutaml/xml/adapter/xml_serializer.rb +1 -1
  111. data/lib/lutaml/xml/adapter.rb +5 -0
  112. data/lib/lutaml/xml/adapter_loader.rb +5 -0
  113. data/lib/lutaml/xml/format.rb +23 -2
  114. data/lib/lutaml/xml/leptris/native_emission.rb +6 -1
  115. data/lib/lutaml/xml/leptris/plan_serializer.rb +5 -1
  116. data/lib/lutaml/xml/parse_session.rb +8 -1
  117. data/lib/lutaml/xml/schema/builder/moxml.rb +1 -1
  118. data/lib/lutaml/xml/schema/builder.rb +1 -1
  119. data/lib/lutaml/xml/schema/relaxng_schema.rb +1 -1
  120. data/lib/lutaml/xml/schema/vc_namespace.rb +24 -0
  121. data/lib/lutaml/xml/schema/xsd/any.rb +4 -0
  122. data/lib/lutaml/xml/schema/xsd/any_attribute.rb +4 -0
  123. data/lib/lutaml/xml/schema/xsd/base.rb +7 -0
  124. data/lib/lutaml/xml/schema/xsd/schema.rb +38 -0
  125. data/lib/lutaml/xml/schema/xsd/schema_validator.rb +1 -1
  126. data/lib/lutaml/xml/schema/xsd.rb +1 -0
  127. data/lib/lutaml/xml/schema/xsd_schema.rb +1 -1
  128. data/lib/lutaml/xml/serialization/format_conversion.rb +6 -0
  129. data/lib/lutaml/xml/xsd_validator.rb +1 -1
  130. data/lutaml-model.gemspec +2 -0
  131. data/spec/lml/fixtures/dsl/broken_diagram.lutaml +34 -0
  132. data/spec/lml/fixtures/dsl/diagram.lutaml +4 -0
  133. data/spec/lml/fixtures/dsl/diagram_attributes.lutaml +6 -0
  134. data/spec/lml/fixtures/dsl/diagram_blank_definion.lutaml +6 -0
  135. data/spec/lml/fixtures/dsl/diagram_blank_entities.lutaml +8 -0
  136. data/spec/lml/fixtures/dsl/diagram_class_assocation.lutaml +29 -0
  137. data/spec/lml/fixtures/dsl/diagram_class_fields.lutaml +25 -0
  138. data/spec/lml/fixtures/dsl/diagram_commented_includes.lutaml +5 -0
  139. data/spec/lml/fixtures/dsl/diagram_comments.lutaml +28 -0
  140. data/spec/lml/fixtures/dsl/diagram_concept_model.lutaml +132 -0
  141. data/spec/lml/fixtures/dsl/diagram_data_types.lutaml +44 -0
  142. data/spec/lml/fixtures/dsl/diagram_definitions.lutaml +25 -0
  143. data/spec/lml/fixtures/dsl/diagram_includes.lutaml +6 -0
  144. data/spec/lml/fixtures/dsl/diagram_multiply_classes.lutaml +7 -0
  145. data/spec/lml/fixtures/dsl/diagram_non_existing_include.lutaml +6 -0
  146. data/spec/lml/fixtures/dsl/shared.lutaml +5 -0
  147. data/spec/lml/fixtures/dsl/shared1.lutaml +4 -0
  148. data/spec/lml/fixtures/generated_dot/AddressClassProfile.dot +170 -0
  149. data/spec/lml/fixtures/generated_dot/AddressProfile.dot +34 -0
  150. data/spec/lml/fixtures/generated_dot/address_class_profile_with_associations.dot +127 -0
  151. data/spec/lml/fixtures/generated_dot/address_profile_with_associations.dot +28 -0
  152. data/spec/lml/fixtures/generated_dot/document.dot +28 -0
  153. data/spec/lml/fixtures/generated_dot/document.dot.backup +33 -0
  154. data/spec/lml/fixtures/generated_dot/document_with_fidelity.dot +27 -0
  155. data/spec/lml/fixtures/lml/data_s102_check.lml +79 -0
  156. data/spec/lml/fixtures/lml/data_s158_metadata.lml +28 -0
  157. data/spec/lml/fixtures/lml/iho_data_models.lml +59 -0
  158. data/spec/lml/fixtures/lml/iho_s102_check.lml +101 -0
  159. data/spec/lml/fixtures/mixed_lml/diagram.lml +26 -0
  160. data/spec/lml/fixtures/mixed_lml/instances.lml +72 -0
  161. data/spec/lml/fixtures/mixed_lml/model.lml +30 -0
  162. data/spec/lml/fixtures/real_world/basicdoc-models/AdmonitionType.lutaml +32 -0
  163. data/spec/lml/fixtures/real_world/basicdoc-models/BasicBlock.lutaml +11 -0
  164. data/spec/lml/fixtures/real_world/basicdoc-models/BasicDocument.lutaml +41 -0
  165. data/spec/lml/fixtures/real_world/basicdoc-models/BasicSection.lutaml +38 -0
  166. data/spec/lml/fixtures/real_world/basicdoc-models/BibliographicItem.lutaml +6 -0
  167. data/spec/lml/fixtures/real_world/basicdoc-models/FigureBlock.lutaml +65 -0
  168. data/spec/lml/fixtures/real_world/basicdoc-models/FormattedString.lutaml +12 -0
  169. data/spec/lml/fixtures/real_world/basicdoc-models/List.lutaml +12 -0
  170. data/spec/lml/fixtures/real_world/basicdoc-models/OrderedListType.lutaml +32 -0
  171. data/spec/lml/fixtures/real_world/basicdoc-models/Signature.lutaml +22 -0
  172. data/spec/lml/fixtures/real_world/basicdoc-models/String.lutaml +2 -0
  173. data/spec/lml/fixtures/real_world/basicdoc-models/TableBlock.lutaml +60 -0
  174. data/spec/lml/fixtures/real_world/basicdoc-models/TextElement.lutaml +13 -0
  175. data/spec/lml/fixtures/real_world/basicdoc-models/Uri.lutaml +7 -0
  176. data/spec/lml/fixtures/real_world/metanorma-model-iso/BibliographicItem.lutaml +4 -0
  177. data/spec/lml/fixtures/real_world/metanorma-model-iso/IsoAdmonitionType.lutaml +31 -0
  178. data/spec/lml/fixtures/real_world/metanorma-model-iso/IsoBibDataExtensionType.lutaml +40 -0
  179. data/spec/lml/fixtures/real_world/metanorma-model-iso/IsoSections.lutaml +30 -0
  180. data/spec/lml/fixtures/real_world/metanorma-model-iso/IsoStandardDocument.lutaml +46 -0
  181. data/spec/lml/fixtures/real_world/metanorma-model-iso/IsoTerm.lutaml +20 -0
  182. data/spec/lml/fixtures/real_world/metanorma-model-iso/StandardBibDataExtensionType.lutaml +2 -0
  183. data/spec/lml/fixtures/real_world/metanorma-model-iso/StandardDocument.lutaml +2 -0
  184. data/spec/lml/fixtures/rs3001/01_class_tail_comment.lml +5 -0
  185. data/spec/lml/fixtures/rs3001/02_definition_block.lml +9 -0
  186. data/spec/lml/fixtures/rs3001/03_package_ceramics.lml +20 -0
  187. data/spec/lml/fixtures/rs3001/04_attribute_definition_form.lml +10 -0
  188. data/spec/lml/fixtures/rs3001/05_attribute_cardinality_unbounded.lml +10 -0
  189. data/spec/lml/fixtures/rs3001/06_attribute_values_set.lml +10 -0
  190. data/spec/lml/fixtures/rs3001/07_attribute_pattern.lml +10 -0
  191. data/spec/lml/fixtures/rs3001/08_attribute_default_colon.lml +15 -0
  192. data/spec/lml/fixtures/rs3001/09_value_porcelain.lml +9 -0
  193. data/spec/lml/fixtures/rs3001/10_enum_glaze_technique.lml +19 -0
  194. data/spec/lml/fixtures/rs3001/11_enum_values_as_instances.lml +29 -0
  195. data/spec/lml/fixtures/rs3001/12_instance_named.lml +13 -0
  196. data/spec/lml/fixtures/rs3001/13_instances_collection_refs.lml +11 -0
  197. data/spec/lml/fixtures/rs3001/14_require_models.lml +7 -0
  198. data/spec/lml/fixtures/rs3001/15_comment_line.lml +1 -0
  199. data/spec/lml/fixtures/rs3001/16_comment_tail.lml +5 -0
  200. data/spec/lml/fixtures/rs3001/17_comment_documented_class.lml +5 -0
  201. data/spec/lml/fixtures/rs3001/18_comment_block.lml +4 -0
  202. data/spec/lml/fixtures/rs3001/19_top_level_instance_definition.lml +21 -0
  203. data/spec/lml/fixtures/rs3001/20_instance_typed_definition.lml +22 -0
  204. data/spec/lml/fixtures/rs3001/21_instance_collection_studios.lml +19 -0
  205. data/spec/lml/fixtures/rs3001/22_instance_collection_tiles.lml +15 -0
  206. data/spec/lml/fixtures/rs3001/23_reference_cross_collection.lml +11 -0
  207. data/spec/lml/fixtures/rs3001/24_null_and_empty.lml +15 -0
  208. data/spec/lml/fixtures/rs3001/25_string_escapes.lml +23 -0
  209. data/spec/lml/fixtures/rs3001/26_quoted_keys.lml +7 -0
  210. data/spec/lml/fixtures/test.lutaml +20 -0
  211. data/spec/lml/fixtures/test_data/components.csv +4 -0
  212. data/spec/lml/fixtures/test_data/products.xml +18 -0
  213. data/spec/lml/fixtures/uml/address_class_profile_with_associations.yml +58 -0
  214. data/spec/lml/fixtures/uml/address_profile_with_associations.yml +31 -0
  215. data/spec/lml/fixtures/uml/association.yml +11 -0
  216. data/spec/lml/fixtures/uml/class.yml +28 -0
  217. data/spec/lml/fixtures/uml/data_type.yml +30 -0
  218. data/spec/lml/fixtures/uml/diagram.yml +7 -0
  219. data/spec/lml/fixtures/uml/document.yml +44 -0
  220. data/spec/lml/fixtures/uml/document_with_fidelity.yml +47 -0
  221. data/spec/lml/fixtures/uml/enum.yml +14 -0
  222. data/spec/lml/fixtures/uml/operation.yml +8 -0
  223. data/spec/lml/fixtures/uml/package.yml +10 -0
  224. data/spec/lml/fixtures/uml/top_element.yml +11 -0
  225. data/spec/lml/fixtures/uml/top_element_attribute.yml +10 -0
  226. data/spec/lml/fixtures/uml/trigger.yml +12 -0
  227. data/spec/lml/fixtures/uml/value.yml +8 -0
  228. data/spec/lml/fixtures/view/cycle_a.lutaml +3 -0
  229. data/spec/lml/fixtures/view/cycle_b.lutaml +3 -0
  230. data/spec/lml/fixtures/view/import_model.lutaml +3 -0
  231. data/spec/lml/fixtures/view/import_view.lutaml +3 -0
  232. data/spec/lml/fixtures/view/import_with_hide.lutaml +4 -0
  233. data/spec/lml/fixtures/view/import_with_show.lutaml +4 -0
  234. data/spec/lml/fixtures/view/models/bar.lutaml +3 -0
  235. data/spec/lml/fixtures/view/models/baz.lutaml +3 -0
  236. data/spec/lml/fixtures/view/models/foo.lutaml +4 -0
  237. data/spec/lml/integration/instance_import_export_spec.rb +102 -0
  238. data/spec/lml/lml_spec_setup.rb +25 -0
  239. data/spec/lml/lutaml/lml/association_label_resolver_spec.rb +139 -0
  240. data/spec/lml/lutaml/lml/data_processor_spec.rb +274 -0
  241. data/spec/lml/lutaml/lml/declarations_spec.rb +337 -0
  242. data/spec/lml/lutaml/lml/document_builder_registry_spec.rb +52 -0
  243. data/spec/lml/lutaml/lml/document_builder_spec.rb +99 -0
  244. data/spec/lml/lutaml/lml/element_visibility_spec.rb +128 -0
  245. data/spec/lml/lutaml/lml/entity_types_spec.rb +56 -0
  246. data/spec/lml/lutaml/lml/enum_spec.rb +77 -0
  247. data/spec/lml/lutaml/lml/executor/adapter_helpers_spec.rb +96 -0
  248. data/spec/lml/lutaml/lml/executor/condition_evaluator_spec.rb +393 -0
  249. data/spec/lml/lutaml/lml/executor/csv_adapter_spec.rb +151 -0
  250. data/spec/lml/lutaml/lml/executor/format_adapter_spec.rb +31 -0
  251. data/spec/lml/lutaml/lml/executor/xml_adapter_spec.rb +201 -0
  252. data/spec/lml/lutaml/lml/executor_spec.rb +71 -0
  253. data/spec/lml/lutaml/lml/format_adapter_spec.rb +272 -0
  254. data/spec/lml/lutaml/lml/format_autoload_spec.rb +31 -0
  255. data/spec/lml/lutaml/lml/grammar_spec.rb +581 -0
  256. data/spec/lml/lutaml/lml/has_attributes_spec.rb +54 -0
  257. data/spec/lml/lutaml/lml/import_resolver_spec.rb +116 -0
  258. data/spec/lml/lutaml/lml/instance_hydration_spec.rb +178 -0
  259. data/spec/lml/lutaml/lml/lsp/server_spec.rb +285 -0
  260. data/spec/lml/lutaml/lml/model_compiler_spec.rb +406 -0
  261. data/spec/lml/lutaml/lml/models/association_spec.rb +40 -0
  262. data/spec/lml/lutaml/lml/models/collection_spec.rb +27 -0
  263. data/spec/lml/lutaml/lml/models/data_type_spec.rb +34 -0
  264. data/spec/lml/lutaml/lml/models/diagram_spec.rb +18 -0
  265. data/spec/lml/lutaml/lml/models/document_spec.rb +64 -0
  266. data/spec/lml/lutaml/lml/models/enum_spec.rb +42 -0
  267. data/spec/lml/lutaml/lml/models/inheritance_spec.rb +77 -0
  268. data/spec/lml/lutaml/lml/models/instance_collection_spec.rb +62 -0
  269. data/spec/lml/lutaml/lml/models/instance_spec.rb +81 -0
  270. data/spec/lml/lutaml/lml/models/instances_export_spec.rb +23 -0
  271. data/spec/lml/lutaml/lml/models/instances_import_spec.rb +28 -0
  272. data/spec/lml/lutaml/lml/models/package_spec.rb +26 -0
  273. data/spec/lml/lutaml/lml/models/primitive_type_spec.rb +34 -0
  274. data/spec/lml/lutaml/lml/models/top_element_attribute_spec.rb +153 -0
  275. data/spec/lml/lutaml/lml/models/uml_class_spec.rb +70 -0
  276. data/spec/lml/lutaml/lml/models_version_spec.rb +27 -0
  277. data/spec/lml/lutaml/lml/operations_spec.rb +59 -0
  278. data/spec/lml/lutaml/lml/parser_spec.rb +348 -0
  279. data/spec/lml/lutaml/lml/pipeline_spec.rb +93 -0
  280. data/spec/lml/lutaml/lml/preprocessor_spec.rb +174 -0
  281. data/spec/lml/lutaml/lml/property_laws_spec.rb +344 -0
  282. data/spec/lml/lutaml/lml/real_world_spec.rb +191 -0
  283. data/spec/lml/lutaml/lml/reference_spec.rb +64 -0
  284. data/spec/lml/lutaml/lml/round_trip_spec.rb +457 -0
  285. data/spec/lml/lutaml/lml/rs3001_corpus_spec.rb +83 -0
  286. data/spec/lml/lutaml/lml/rs3001_syntax_spec.rb +77 -0
  287. data/spec/lml/lutaml/lml/serialization_mapping_spec.rb +127 -0
  288. data/spec/lml/lutaml/lml/source_spec.rb +62 -0
  289. data/spec/lml/lutaml/lml/transform_spec.rb +37 -0
  290. data/spec/lml/lutaml/lml/types/text_type_spec.rb +43 -0
  291. data/spec/lml/lutaml/lml/validator_spec.rb +238 -0
  292. data/spec/lml/lutaml/lml/view_resolver_spec.rb +78 -0
  293. data/spec/lml/lutaml/lml/view_spec.rb +112 -0
  294. data/spec/lml/lutaml/parsers/dsl_spec.rb +275 -0
  295. data/spec/lml/lutaml/parsers/yaml_spec.rb +52 -0
  296. data/spec/lml/lutaml/qualified_type_spec.rb +33 -0
  297. data/spec/lutaml/model/adapter_type_unset_restore_spec.rb +61 -0
  298. data/spec/lutaml/model/custom_bibtex_adapter_spec.rb +4 -1
  299. data/spec/lutaml/xml/adapter/moxml_lane_spec.rb +112 -0
  300. data/spec/lutaml/xml/adapter_metadata_default_spec.rb +21 -2
  301. data/spec/lutaml/xml/adapter_moxml_engine_spec.rb +57 -0
  302. data/spec/lutaml/xml/leptris/native_emission_plain_model_spec.rb +50 -0
  303. data/spec/lutaml/xml/plain_model_mapping_resolution_spec.rb +88 -0
  304. data/spec/lutaml/xml/schema/xsd/vc_versioning_spec.rb +49 -0
  305. data/spec/lutaml/xml/schema/xsd/xsd_11_constructs_spec.rb +43 -0
  306. metadata +286 -2
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A named instances collection with its instances and imports/exports.
8
+ class InstanceCollection < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ attribute :name, :string
12
+ attribute :instances, "Lutaml::Lml::Instance", collection: true, default: []
13
+ attribute :imports, "Lutaml::Lml::InstancesImport", collection: true, default: []
14
+ attribute :exports, "Lutaml::Lml::InstancesExport", collection: true, default: []
15
+ attribute :collections, "Lutaml::Lml::Collection", collection: true, default: []
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ class InstancesExport < Lutaml::Model::Serializable
6
+ attribute :format_type, :string
7
+ attribute :attributes, "Lutaml::Lml::TopElementAttribute", collection: true, default: []
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ class InstancesImport < Lutaml::Model::Serializable
6
+ attribute :format_type, :string
7
+ attribute :file, :string
8
+ attribute :attributes, "Lutaml::Lml::TopElementAttribute", collection: true, default: []
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # A lutaml-model wire-name mapping declared inside an LML class:
6
+ # mapping yaml { map "full-name", to: "name" }
7
+ # One entry per map line; `format` is the target serialization
8
+ # (yaml, xml, json, toml, csv).
9
+ class Mapping < Lutaml::Model::Serializable
10
+ attribute :format, :string
11
+ attribute :wire, :string
12
+ attribute :to, :string
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # One line of a serialization mapping: what kind of mapping (element,
6
+ # attribute, content, map, key, value), the serialization-side wire
7
+ # name, the model attribute it binds, and the qualifier mode for
8
+ # key/value collections (to_instance, as_attribute).
9
+ class MappingRule < Lutaml::Model::Serializable
10
+ attribute :kind, :string
11
+ attribute :wire, :string
12
+ attribute :field, :string
13
+ attribute :mode, :string
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A typed payload field declared on an enum:
8
+ # member_fields { abbreviation String urn_segment String }
9
+ class MemberField < Lutaml::Model::Serializable
10
+ include Lutaml::Lml::Positioned
11
+
12
+ attribute :name, :string
13
+ attribute :type, :string
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # RS 3010 extension: a declared XML namespace (uri + optional prefix).
8
+ # The compiler generates the corresponding Lutaml::Model::XmlNamespace
9
+ # subclass for the compiled model namespace.
10
+ class Namespace < Lutaml::Model::Serializable
11
+ include Lutaml::Lml::Positioned
12
+
13
+ attribute :name, :string
14
+ attribute :uri, :string
15
+ attribute :prefix, :string
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A class operation with parameters and a return type.
8
+ class Operation < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ # From TopElement
12
+ attribute :name, :string
13
+ attribute :definition, Lutaml::Lml::Types::TextType
14
+ attribute :keyword, :string
15
+ attribute :stereotype, :string, collection: true, default: -> { [] }
16
+ attribute :visibility, :string, default: "public"
17
+
18
+ # From Operation
19
+ attribute :id, :string
20
+ attribute :return_type, :string
21
+ attribute :parameter_type, :string
22
+ attribute :is_static, :boolean, default: false
23
+ attribute :is_abstract, :boolean, default: false
24
+ attribute :owned_parameter, "Lutaml::Lml::OperationParameter", collection: true,
25
+ default: -> { [] }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ class OperationParameter < Lutaml::Model::Serializable
6
+ attribute :name, :string
7
+ attribute :type, :string
8
+ attribute :direction, :string, default: "in"
9
+ attribute :default, :string
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A package grouping model definitions.
8
+ class Package < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ # From TopElement
12
+ attribute :name, :string
13
+ attribute :definition, Lutaml::Lml::Types::TextType
14
+ attribute :keyword, :string
15
+ attribute :stereotype, :string, collection: true, default: -> { [] }
16
+ attribute :visibility, :string, default: "public"
17
+
18
+ # From Package
19
+ attribute :contents, :string, collection: true, default: -> { [] }
20
+ attribute :classes, "Lutaml::Lml::UmlClass", collection: true, default: -> { [] }
21
+ attribute :enums, "Lutaml::Lml::Enum", collection: true, default: -> { [] }
22
+ attribute :data_types, "Lutaml::Lml::DataType", collection: true, default: -> { [] }
23
+ attribute :packages, "Lutaml::Lml::Package", collection: true, default: -> { [] }
24
+ attribute :diagrams, "Lutaml::Lml::Diagram", collection: true, default: -> { [] }
25
+ attribute :default_string_formats, "Lutaml::Lml::StringFormat", collection: true, default: -> { [] }
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A primitive type declaration.
8
+ class PrimitiveType < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ # Primitives in LML are name-only entities, but the formatter
12
+ # accesses the same attributes as DataType via format_class.
13
+ attribute :name, :string
14
+ attribute :keyword, :string, default: "primitive"
15
+ attribute :definition, Lutaml::Lml::Types::TextType
16
+ attribute :stereotype, :string, collection: true, default: -> { [] }
17
+ attribute :visibility, :string, default: "public"
18
+ attribute :is_abstract, :boolean, default: false
19
+ attribute :attributes, "Lutaml::Lml::TopElementAttribute", collection: true,
20
+ default: -> { [] }
21
+ attribute :operations, "Lutaml::Lml::Operation", collection: true,
22
+ default: -> { [] }
23
+ attribute :associations, "Lutaml::Lml::Association", collection: true,
24
+ default: -> { [] }
25
+
26
+ def self.entity_type
27
+ :primitives
28
+ end
29
+
30
+ def self.classifiable?
31
+ true
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # RS 3001 par. Value type: a reference to another instance
6
+ # (`reference:(path)` / `ref:(path)`). The attribute's value slot keeps
7
+ # its primitive wire shape (a `reference` hash); this is the typed
8
+ # domain view of it, built at one canonical point
9
+ # (TopElementAttribute#reference) so validation and serialization
10
+ # consume structured references instead of re-sniffing hashes.
11
+ class Reference < Lutaml::Model::Serializable
12
+ attribute :path, :string
13
+
14
+ def segments
15
+ @segments ||= path.to_s.split(".")
16
+ end
17
+
18
+ def to_s
19
+ path.to_s
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # RS 3010 extension: a serialization mapping declared separately from
8
+ # its class and linked by target name —
9
+ # mapping xml Ceramic { element "ceramic" … }
10
+ class SerializationMapping < Lutaml::Model::Serializable
11
+ include Lutaml::Lml::Positioned
12
+
13
+ attribute :format, :string
14
+ attribute :target, :string
15
+ attribute :element_name, :string
16
+ attribute :namespace_ref, :string
17
+ attribute :mixed_content, :boolean, default: false
18
+ attribute :rules, "Lutaml::Lml::MappingRule", collection: true, default: -> { [] }
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # A grammar-backed string format declared on a class (or as a
6
+ # models-block default): a thin reference — the artifact owns the
7
+ # capture maps and render specs; LML only names format, artifact,
8
+ # and entry root.
9
+ # string_format :pubid { artifact "pubid/iso" root "iso_identifier" }
10
+ class StringFormat < Lutaml::Model::Serializable
11
+ attribute :format, :string
12
+ attribute :artifact, :string
13
+ attribute :root, :string
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # An attribute declaration or instance assignment entry.
8
+ class TopElementAttribute < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ # Core attributes
12
+ attribute :name, :string
13
+ attribute :visibility, :string, default: "public"
14
+ attribute :type, :string
15
+ attribute :id, :string
16
+ attribute :contain, :string
17
+ attribute :static, :string
18
+ attribute :cardinality, "Lutaml::Lml::Cardinality"
19
+ attribute :literal, :boolean, default: false
20
+ attribute :is_derived, :boolean, default: false
21
+ attribute :is_static, :boolean, default: false
22
+ attribute :is_read_only, :boolean, default: false
23
+ attribute :stereotype, :string, collection: true, default: -> { [] }
24
+ attribute :definition, Lutaml::Lml::Types::TextType
25
+ attribute :association, :string
26
+ attribute :default, :string
27
+ attribute :value_set, :string, collection: true, default: -> { [] }
28
+ attribute :pattern, :string
29
+ # `as :element` / `as :attribute`: the XML node kind (issue #49)
30
+ attribute :xml_role, :string
31
+
32
+ # LML-specific attributes
33
+ attribute :properties, "Lutaml::Lml::TopElementAttribute", collection: true, default: -> { [] }
34
+ attribute :value, LiteralValue
35
+ attribute :attributes, "Lutaml::Lml::TopElementAttribute", collection: true, default: -> { [] }
36
+ attribute :extended, :boolean
37
+ attribute :instances, "Lutaml::Lml::Instance", collection: true, default: -> { [] }
38
+
39
+ # Declared in full because a mapping block replaces the defaults. The
40
+ # rules below are the defaults, 1:1, except for `value`.
41
+ #
42
+ # `value` needs custom methods because a list literal reaches the model
43
+ # as a bare Array, and lutaml-model refuses one on a non-collection
44
+ # attribute: Attribute#cast splits it, then valid_collection! raises
45
+ # CollectionTrueMissingError. A custom `from` returns before that check,
46
+ # so a non-empty list survives a round trip without changing the
47
+ # serialized form. An empty list still does not: the transform skips a
48
+ # blank value before reaching the custom method, so `[]` reloads as nil.
49
+ key_value do
50
+ map "name", to: :name
51
+ map "visibility", to: :visibility
52
+ map "type", to: :type
53
+ map "id", to: :id
54
+ map "contain", to: :contain
55
+ map "static", to: :static
56
+ map "cardinality", to: :cardinality
57
+ map "literal", to: :literal
58
+ map "is_derived", to: :is_derived
59
+ map "is_static", to: :is_static
60
+ map "is_read_only", to: :is_read_only
61
+ map "stereotype", to: :stereotype
62
+ map "definition", to: :definition
63
+ map "association", to: :association
64
+ map "default", to: :default
65
+ map "value_set", to: :value_set
66
+ map "pattern", to: :pattern
67
+ map "xml_role", to: :xml_role
68
+ map "properties", to: :properties
69
+ map "value", to: :value, with: { to: :value_to, from: :value_from }
70
+ map "attributes", to: :attributes
71
+ map "extended", to: :extended
72
+ map "instances", to: :instances
73
+ end
74
+
75
+ # Public because lutaml-model invokes mapping methods via public_send.
76
+ #
77
+ # Skipping nil keeps the key out of the output, which is what the default
78
+ # mapping does. `false` is a real literal, so the guard tests for nil
79
+ # rather than truthiness.
80
+ def value_to(model, doc)
81
+ literal = model.value
82
+ return if literal.nil?
83
+
84
+ doc["value"] = unwrap_literal(literal)
85
+ end
86
+
87
+ # lutaml-model runs this on a throwaway mapper instance, so `self` is not
88
+ # the object being deserialized - `model` is. Writing to `self.value`
89
+ # here would update an object that is discarded a moment later.
90
+ def value_from(model, value)
91
+ model.value = value
92
+ end
93
+
94
+ # RS 3001 par. Value type: the typed view of a reference value
95
+ # (`reference:(...)` / `ref:(...)`). Nil for every other value shape;
96
+ # for a list of references, the first reference.
97
+ def reference
98
+ literal = value.respond_to?(:value) ? value.value : value
99
+ cargo = literal.is_a?(::Array) ? literal.first : literal
100
+ cargo = cargo.value if cargo.is_a?(LiteralValue)
101
+ return nil unless cargo.is_a?(::Hash) && cargo[:reference]
102
+
103
+ Reference.new(path: cargo[:reference].to_s)
104
+ end
105
+
106
+ private
107
+
108
+ # A LiteralValue sits at the top level for a map literal, and inside the
109
+ # array for a list of references. Writing one through unwrapped raises
110
+ # ArgumentError in the adapter.
111
+ def unwrap_literal(value)
112
+ return value.map { |item| unwrap_literal(item) } if value.is_a?(::Array)
113
+
114
+ value.is_a?(LiteralValue) ? value.value : value
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A class declaration with its members.
8
+ class UmlClass < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ # From TopElement. TextType unescapes \{ \} and normalizes lines
12
+ # on every assignment (builder, yaml, direct).
13
+ attribute :name, :string
14
+ attribute :definition, Lutaml::Lml::Types::TextType
15
+ attribute :stereotype, :string, collection: true, default: -> { [] }
16
+ attribute :visibility, :string, default: "public"
17
+ attribute :comments, :string, collection: true
18
+
19
+ # From UmlClassifier
20
+ attribute :is_abstract, :boolean, default: false
21
+
22
+ # From UmlClass
23
+ attribute :nested_classifier, :string, collection: true, default: -> { [] }
24
+ attribute :type, :string
25
+ attribute :attributes, "Lutaml::Lml::TopElementAttribute", collection: true
26
+ attribute :modifier, :string
27
+ attribute :constraints, "Lutaml::Lml::Constraint", collection: true
28
+ attribute :operations, "Lutaml::Lml::Operation", collection: true, default: -> { [] }
29
+ attribute :data_types, "Lutaml::Lml::DataType", collection: true
30
+ attribute :associations, "Lutaml::Lml::Association", collection: true
31
+ attribute :wire_mappings, "Lutaml::Lml::Mapping", collection: true, default: -> { [] }
32
+ attribute :string_formats, "Lutaml::Lml::StringFormat", collection: true, default: -> { [] }
33
+ attribute :derived_fields, "Lutaml::Lml::DerivedField", collection: true, default: -> { [] }
34
+ attribute :serialization_mappings, "Lutaml::Lml::SerializationMapping", collection: true, default: -> { [] }
35
+
36
+ # LML-specific
37
+ # In-class `namespace "uri"` declaration (issue #49)
38
+ attribute :xml_namespace, "Lutaml::Lml::Namespace"
39
+ attribute :parent_class, :string
40
+
41
+ yaml do
42
+ map "name", to: :name
43
+ map "is_abstract", to: :is_abstract
44
+ map "definition", to: :definition
45
+ map "modifier", to: :modifier
46
+ map "stereotype", to: :stereotype
47
+ map "visibility", to: :visibility
48
+ map "type", to: :type
49
+ map "xml_namespace", to: :xml_namespace
50
+ map "attributes", to: :attributes
51
+ map "operations", to: :operations
52
+ map "constraints", to: :constraints
53
+ map "data_types", to: :data_types
54
+ # Owner-side defaulting is a parent-context rule ("an
55
+ # association nested under a class defaults its owner to that
56
+ # class"); only a mapping proc can see the containing model.
57
+ map "associations", to: :associations, with: {
58
+ to: :associations_to_yaml, from: :associations_from_yaml
59
+ }
60
+ end
61
+
62
+ def associations_to_yaml(model, doc)
63
+ return unless model.associations
64
+
65
+ associations = model.associations.map(&:to_hash)
66
+ doc["associations"] = associations unless associations.empty?
67
+ end
68
+
69
+ def associations_from_yaml(model, values)
70
+ associations = values.map do |value|
71
+ value["owner_end"] = model.name if value["owner_end"].nil?
72
+ Association.from_yaml(value.to_yaml)
73
+ end
74
+
75
+ model.associations = associations
76
+ end
77
+
78
+ def self.entity_type
79
+ :classes
80
+ end
81
+
82
+ def self.classifiable?
83
+ true
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/lml/positioned"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # A value construct member.
8
+ class Value < Lutaml::Model::Serializable
9
+ include Lutaml::Lml::Positioned
10
+
11
+ attribute :name, :string
12
+ attribute :id, :string
13
+ attribute :type, :string
14
+ attribute :definition, Lutaml::Lml::Types::TextType
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ class ViewFilter < Lutaml::Model::Serializable
8
+ attribute :entity_names, :string, collection: true
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lutaml/model"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ class ViewImport < Lutaml::Model::Serializable
8
+ attribute :path, :string
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # The LML parser: raw LML text → parse tree. The grammar lives in
6
+ # grammar/lml.parg (PARG); this class is the Ruby-facing front door.
7
+ # Pipeline-level entry points live on the Lutaml::Lml module
8
+ # (parse / parse_document).
9
+ class Parser
10
+ def self.parse(input, **options)
11
+ new.parse(input, **options)
12
+ end
13
+
14
+ def parse(input, **_options)
15
+ Grammar.artifact.parse(Grammar::ENTRY, input.to_s)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "parsanol"
4
+
5
+ module Lutaml
6
+ module Lml
7
+ # Parse pipeline only: preprocess → parse → transform → process →
8
+ # build. View resolution and label enrichment are a separate,
9
+ # explicit post-parse step (ViewResolution) — file I/O for imports
10
+ # does not belong inside parsing.
11
+ class Pipeline
12
+ def self.call(input)
13
+ new(input).call
14
+ end
15
+
16
+ def initialize(input)
17
+ @input = Source.wrap(input)
18
+ end
19
+
20
+ def call
21
+ data = Preprocessor.call(@input)
22
+ hash = parse_raw(data)
23
+ hash = DataProcessor.process(hash)
24
+ build_document(hash)
25
+ end
26
+
27
+ private
28
+
29
+ def parse_raw(data)
30
+ Transform.new.apply(Parser.new.parse(data))
31
+ rescue Parsanol::ParseFailed => e
32
+ raise ::Lutaml::Lml::ParsingError.new(failure_message(e), diagnostic: parse_diagnostic(e))
33
+ end
34
+
35
+ def parse_diagnostic(error)
36
+ line, column = failure_location(error)
37
+ Diagnostic.build(
38
+ "parse/LML-001",
39
+ message: error.message.lines.first.to_s.strip,
40
+ file: @input.path,
41
+ line: line,
42
+ column: column,
43
+ )
44
+ end
45
+
46
+ # Parsanol releases up to 1.3.57 annotate native failures with a
47
+ # byte offset marker but report cause.position as 0; fixed parsanol
48
+ # already carries the correct location in the message. Only
49
+ # rebuild the location when the marker is present.
50
+ def failure_message(error)
51
+ detail = error.message.lines.first.to_s.strip
52
+ line, column = failure_location(error)
53
+ location = (" at line #{line} char #{column}." if line && !detail.match?(/at line \d+ char \d+/))
54
+ "#{detail}#{location}\ncause: #{error.parse_failure_cause&.ascii_tree}"
55
+ end
56
+
57
+ def failure_location(error)
58
+ cause = error.parse_failure_cause
59
+ offset = error.message[/@@parsanol_pos:(\d+)/, 1]&.to_i
60
+ return cause.source.line_and_column(offset) if offset && cause&.source
61
+
62
+ match = error.message.match(/at line (\d+) char (\d+)/)
63
+ match ? [match[1].to_i, match[2].to_i] : [nil, nil]
64
+ end
65
+
66
+ def build_document(hash)
67
+ document = DocumentBuilder.new(DocumentBuilder.default_registry).build(:document, hash)
68
+ document.source_path = @input.path
69
+ document
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lutaml
4
+ module Lml
5
+ # Non-serialized source metadata carried by parsed entities. These
6
+ # accessors are deliberately not lutaml-model attributes: positions
7
+ # and the source path are diagnostics metadata, not document data,
8
+ # and must not appear in to_hash/YAML/JSON output.
9
+ module Positioned
10
+ attr_accessor :source_position, :source_path
11
+ end
12
+ end
13
+ end