lutaml 0.11.6 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +20 -0
- data/.rubocop_todo.yml +0 -1
- data/Gemfile +32 -5
- data/README.adoc +3 -3
- data/README.md +6 -8
- data/Rakefile +41 -1
- data/bin/console +0 -1
- data/exe/lutaml-lml +6 -0
- data/exe/lutaml-lml-lsp +11 -0
- data/lib/compat/opal/generate_boot.rb +132 -0
- data/lib/compat/opal/js_bundle_entry.rb +42 -0
- data/lib/compat/opal/lutaml_model_boot.rb +540 -0
- data/lib/compat/opal/monitor.rb +31 -0
- data/lib/compat/opal/moxml/adapter/customized_rexml/entity_reference.rb +9 -0
- data/lib/compat/opal/moxml/adapter/customized_rexml/formatter.rb +225 -0
- data/lib/compat/opal/moxml/adapter/customized_rexml.rb +11 -0
- data/lib/compat/opal/moxml_boot.rb +68 -0
- data/lib/compat/opal/objectspace_shim.rb +23 -0
- data/lib/compat/opal/rexml/namespace.rb +59 -0
- data/lib/compat/opal/rexml/parsers/baseparser.rb +1016 -0
- data/lib/compat/opal/rexml/source.rb +214 -0
- data/lib/compat/opal/rexml/text.rb +426 -0
- data/lib/compat/opal/rexml/xmltokens.rb +45 -0
- data/lib/compat/opal/rexml_compat.rb +85 -0
- data/lib/compat/opal/yaml_compat.rb +32 -0
- data/lib/lutaml/hash_format/adapter/document.rb +10 -0
- data/lib/lutaml/hash_format/adapter/mapping.rb +17 -0
- data/lib/lutaml/hash_format/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/hash_format/adapter/standard_adapter.rb +17 -0
- data/lib/lutaml/hash_format/adapter/transform.rb +9 -0
- data/lib/lutaml/hash_format/adapter.rb +13 -0
- data/lib/lutaml/hash_format/format.rb +29 -0
- data/lib/lutaml/hash_format/type/serializers.rb +24 -0
- data/lib/lutaml/hash_format.rb +7 -0
- data/lib/lutaml/json/adapter/document.rb +13 -0
- data/lib/lutaml/json/adapter/mapping.rb +17 -0
- data/lib/lutaml/json/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/json/adapter/multi_json_adapter.rb +45 -0
- data/lib/lutaml/json/adapter/oj_adapter.rb +41 -0
- data/lib/lutaml/json/adapter/standard_adapter.rb +43 -0
- data/lib/lutaml/json/adapter/transform.rb +9 -0
- data/lib/lutaml/json/adapter/yeptris_adapter.rb +74 -0
- data/lib/lutaml/json/adapter.rb +21 -0
- data/lib/lutaml/json/format.rb +61 -0
- data/lib/lutaml/json/generator_options.rb +62 -0
- data/lib/lutaml/json/schema/json_schema.rb +62 -0
- data/lib/lutaml/json/schema.rb +9 -0
- data/lib/lutaml/json/type/serializers.rb +72 -0
- data/lib/lutaml/json.rb +7 -0
- data/lib/lutaml/jsonl/adapter/document.rb +14 -0
- data/lib/lutaml/jsonl/adapter/mapping.rb +17 -0
- data/lib/lutaml/jsonl/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/jsonl/adapter/standard_adapter.rb +34 -0
- data/lib/lutaml/jsonl/adapter/transform.rb +26 -0
- data/lib/lutaml/jsonl/adapter.rb +13 -0
- data/lib/lutaml/jsonl/format.rb +22 -0
- data/lib/lutaml/jsonl.rb +7 -0
- data/lib/lutaml/jsonld/adapter.rb +31 -0
- data/lib/lutaml/jsonld.rb +20 -0
- data/lib/lutaml/key_value/adapter/hash/document.rb +13 -0
- data/lib/lutaml/key_value/adapter/hash/mapping.rb +17 -0
- data/lib/lutaml/key_value/adapter/hash/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/hash/standard_adapter.rb +19 -0
- data/lib/lutaml/key_value/adapter/hash/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/hash.rb +15 -0
- data/lib/lutaml/key_value/adapter/json/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/json/mapping.rb +22 -0
- data/lib/lutaml/key_value/adapter/json/mapping_rule.rb +14 -0
- data/lib/lutaml/key_value/adapter/json/multi_json_adapter.rb +54 -0
- data/lib/lutaml/key_value/adapter/json/oj_adapter.rb +46 -0
- data/lib/lutaml/key_value/adapter/json/standard_adapter.rb +47 -0
- data/lib/lutaml/key_value/adapter/json/transform.rb +14 -0
- data/lib/lutaml/key_value/adapter/json/yeptris_adapter.rb +15 -0
- data/lib/lutaml/key_value/adapter/json.rb +24 -0
- data/lib/lutaml/key_value/adapter/jsonl/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/jsonl/mapping.rb +17 -0
- data/lib/lutaml/key_value/adapter/jsonl/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/jsonl/standard_adapter.rb +36 -0
- data/lib/lutaml/key_value/adapter/jsonl/transform.rb +26 -0
- data/lib/lutaml/key_value/adapter/jsonl.rb +17 -0
- data/lib/lutaml/key_value/adapter/toml/document.rb +13 -0
- data/lib/lutaml/key_value/adapter/toml/mapping.rb +26 -0
- data/lib/lutaml/key_value/adapter/toml/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/toml/teptris_adapter.rb +36 -0
- data/lib/lutaml/key_value/adapter/toml/toml_rb_adapter.rb +34 -0
- data/lib/lutaml/key_value/adapter/toml/tomlib_adapter.rb +40 -0
- data/lib/lutaml/key_value/adapter/toml/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/toml.rb +22 -0
- data/lib/lutaml/key_value/adapter/yaml/document.rb +12 -0
- data/lib/lutaml/key_value/adapter/yaml/mapping.rb +17 -0
- data/lib/lutaml/key_value/adapter/yaml/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/yaml/standard_adapter.rb +35 -0
- data/lib/lutaml/key_value/adapter/yaml/transform.rb +10 -0
- data/lib/lutaml/key_value/adapter/yaml/yeptris_adapter.rb +15 -0
- data/lib/lutaml/key_value/adapter/yaml.rb +17 -0
- data/lib/lutaml/key_value/adapter/yamls/document.rb +16 -0
- data/lib/lutaml/key_value/adapter/yamls/mapping.rb +17 -0
- data/lib/lutaml/key_value/adapter/yamls/mapping_rule.rb +9 -0
- data/lib/lutaml/key_value/adapter/yamls/standard_adapter.rb +37 -0
- data/lib/lutaml/key_value/adapter/yamls/transform.rb +26 -0
- data/lib/lutaml/key_value/adapter/yamls.rb +17 -0
- data/lib/lutaml/key_value/adapter.rb +14 -0
- data/lib/lutaml/key_value/data_model/element.rb +225 -0
- data/lib/lutaml/key_value/data_model.rb +14 -0
- data/lib/lutaml/key_value/document.rb +28 -0
- data/lib/lutaml/key_value/format.rb +26 -0
- data/lib/lutaml/key_value/mapping.rb +393 -0
- data/lib/lutaml/key_value/mapping_rule.rb +95 -0
- data/lib/lutaml/key_value/transform.rb +1223 -0
- data/lib/lutaml/key_value/transformation/collection_serializer.rb +572 -0
- data/lib/lutaml/key_value/transformation/rule_compiler.rb +299 -0
- data/lib/lutaml/key_value/transformation/value_serializer.rb +399 -0
- data/lib/lutaml/key_value/transformation.rb +1276 -0
- data/lib/lutaml/key_value/transformation_builder.rb +30 -0
- data/lib/lutaml/key_value.rb +7 -0
- data/lib/lutaml/lml/association_label_resolver.rb +52 -0
- data/lib/lutaml/lml/cli.rb +506 -0
- data/lib/lutaml/lml/data_processor/attribute_processing.rb +133 -0
- data/lib/lutaml/lml/data_processor/collection_processing.rb +37 -0
- data/lib/lutaml/lml/data_processor/instance_processing.rb +77 -0
- data/lib/lutaml/lml/data_processor/value_declaration_processing.rb +70 -0
- data/lib/lutaml/lml/data_processor/value_processing.rb +103 -0
- data/lib/lutaml/lml/data_processor/view_processing.rb +26 -0
- data/lib/lutaml/lml/data_processor.rb +59 -0
- data/lib/lutaml/lml/diagnostic.rb +149 -0
- data/lib/lutaml/lml/document_builder.rb +481 -0
- data/lib/lutaml/lml/entity_types.rb +30 -0
- data/lib/lutaml/lml/executor/adapter_helpers.rb +45 -0
- data/lib/lutaml/lml/executor/condition_evaluator.rb +169 -0
- data/lib/lutaml/lml/executor/csv_adapter.rb +88 -0
- data/lib/lutaml/lml/executor/format_adapter.rb +54 -0
- data/lib/lutaml/lml/executor/xml_adapter.rb +102 -0
- data/lib/lutaml/lml/executor.rb +96 -0
- data/lib/lutaml/lml/format/adapter/document.rb +11 -0
- data/lib/lutaml/lml/format/adapter/mapping.rb +31 -0
- data/lib/lutaml/lml/format/adapter/standard_adapter.rb +162 -0
- data/lib/lutaml/lml/format/adapter/transform.rb +11 -0
- data/lib/lutaml/lml/format.rb +29 -0
- data/lib/lutaml/lml/formatter/base.rb +79 -0
- data/lib/lutaml/lml/formatter/canonical.rb +736 -0
- data/lib/lutaml/lml/formatter/elk.rb +45 -0
- data/lib/lutaml/lml/formatter/svg_pdf/path_parser.rb +134 -0
- data/lib/lutaml/lml/formatter/svg_pdf.rb +285 -0
- data/lib/lutaml/lml/formatter.rb +11 -0
- data/lib/lutaml/lml/grammar/lml.artifact.json +14993 -0
- data/lib/lutaml/lml/grammar/lml.parg +389 -0
- data/lib/lutaml/lml/grammar.rb +60 -0
- data/lib/lutaml/lml/has_attributes.rb +14 -0
- data/lib/lutaml/lml/import_resolver.rb +96 -0
- data/lib/lutaml/lml/layout/elk_engine.rb +15 -0
- data/lib/lutaml/lml/layout/elk_graph_builder.rb +129 -0
- data/lib/lutaml/lml/layout/elk_svg_markers.rb +45 -0
- data/lib/lutaml/lml/layout/elk_svg_renderer.rb +119 -0
- data/lib/lutaml/lml/layout/engine.rb +17 -0
- data/lib/lutaml/lml/layout.rb +12 -0
- data/lib/lutaml/lml/literal_value.rb +32 -0
- data/lib/lutaml/lml/lsp/conversions.rb +78 -0
- data/lib/lutaml/lml/lsp/keywords.rb +43 -0
- data/lib/lutaml/lml/lsp/server.rb +378 -0
- data/lib/lutaml/lml/lsp/store.rb +68 -0
- data/lib/lutaml/lml/lsp/transport.rb +53 -0
- data/lib/lutaml/lml/lsp.rb +16 -0
- data/lib/lutaml/lml/model_compiler/enums.rb +172 -0
- data/lib/lutaml/lml/model_compiler/hydration.rb +123 -0
- data/lib/lutaml/lml/model_compiler/serialization_mappings.rb +188 -0
- data/lib/lutaml/lml/model_compiler/string_formats.rb +42 -0
- data/lib/lutaml/lml/model_compiler/validation.rb +65 -0
- data/lib/lutaml/lml/model_compiler.rb +323 -0
- data/lib/lutaml/lml/models/action.rb +10 -0
- data/lib/lutaml/lml/models/association.rb +29 -0
- data/lib/lutaml/lml/models/cardinality.rb +10 -0
- data/lib/lutaml/lml/models/collection.rb +11 -0
- data/lib/lutaml/lml/models/constraint.rb +23 -0
- data/lib/lutaml/lml/models/data_type.rb +41 -0
- data/lib/lutaml/lml/models/derived_field.rb +14 -0
- data/lib/lutaml/lml/models/diagram.rb +20 -0
- data/lib/lutaml/lml/models/document.rb +84 -0
- data/lib/lutaml/lml/models/enum.rb +38 -0
- data/lib/lutaml/lml/models/fidelity.rb +10 -0
- data/lib/lutaml/lml/models/group.rb +11 -0
- data/lib/lutaml/lml/models/instance.rb +26 -0
- data/lib/lutaml/lml/models/instance_collection.rb +16 -0
- data/lib/lutaml/lml/models/instances_export.rb +10 -0
- data/lib/lutaml/lml/models/instances_import.rb +11 -0
- data/lib/lutaml/lml/models/mapping.rb +15 -0
- data/lib/lutaml/lml/models/mapping_rule.rb +16 -0
- data/lib/lutaml/lml/models/member_field.rb +14 -0
- data/lib/lutaml/lml/models/namespace.rb +16 -0
- data/lib/lutaml/lml/models/operation.rb +26 -0
- data/lib/lutaml/lml/models/operation_parameter.rb +12 -0
- data/lib/lutaml/lml/models/package.rb +26 -0
- data/lib/lutaml/lml/models/primitive_type.rb +33 -0
- data/lib/lutaml/lml/models/reference.rb +23 -0
- data/lib/lutaml/lml/models/serialization_mapping.rb +19 -0
- data/lib/lutaml/lml/models/string_format.rb +16 -0
- data/lib/lutaml/lml/models/top_element_attribute.rb +116 -0
- data/lib/lutaml/lml/models/uml_class.rb +85 -0
- data/lib/lutaml/lml/models/value.rb +15 -0
- data/lib/lutaml/lml/models/view_filter.rb +11 -0
- data/lib/lutaml/lml/models/view_import.rb +11 -0
- data/lib/lutaml/lml/parser.rb +19 -0
- data/lib/lutaml/lml/pipeline.rb +73 -0
- data/lib/lutaml/lml/positioned.rb +13 -0
- data/lib/lutaml/lml/preprocessor.rb +130 -0
- data/lib/lutaml/lml/quoting.rb +60 -0
- data/lib/lutaml/lml/source.rb +49 -0
- data/lib/lutaml/lml/source_position.rb +20 -0
- data/lib/lutaml/lml/symbol_index.rb +200 -0
- data/lib/lutaml/lml/transform.rb +119 -0
- data/lib/lutaml/lml/types/text_type.rb +28 -0
- data/lib/lutaml/lml/types.rb +10 -0
- data/lib/lutaml/lml/validator.rb +458 -0
- data/lib/lutaml/lml/version.rb +10 -0
- data/lib/lutaml/lml/view_resolution.rb +32 -0
- data/lib/lutaml/lml/view_resolver.rb +48 -0
- data/lib/lutaml/lml/yaml_parser.rb +17 -0
- data/lib/lutaml/lml.rb +130 -0
- data/lib/lutaml/model/adapter_resolver.rb +487 -0
- data/lib/lutaml/model/adapter_scope.rb +64 -0
- data/lib/lutaml/model/attribute.rb +1511 -0
- data/lib/lutaml/model/attribute_validator.rb +290 -0
- data/lib/lutaml/model/cached_type_resolver/concurrent_map_cache.rb +48 -0
- data/lib/lutaml/model/cached_type_resolver/mutex_hash_cache.rb +53 -0
- data/lib/lutaml/model/cached_type_resolver.rb +145 -0
- data/lib/lutaml/model/choice.rb +343 -0
- data/lib/lutaml/model/cli.rb +85 -0
- data/lib/lutaml/model/collection.rb +740 -0
- data/lib/lutaml/model/collection_handler.rb +157 -0
- data/lib/lutaml/model/comparable_model.rb +710 -0
- data/lib/lutaml/model/comparable_nil.rb +9 -0
- data/lib/lutaml/model/comparison.rb +15 -0
- data/lib/lutaml/model/compiled_rule.rb +242 -0
- data/lib/lutaml/model/config.rb +169 -0
- data/lib/lutaml/model/configuration.rb +138 -0
- data/lib/lutaml/model/consolidation/attribute_grouper.rb +44 -0
- data/lib/lutaml/model/consolidation/dispatcher.rb +45 -0
- data/lib/lutaml/model/consolidation/engine.rb +33 -0
- data/lib/lutaml/model/consolidation/pattern_chunker.rb +87 -0
- data/lib/lutaml/model/consolidation_map.rb +68 -0
- data/lib/lutaml/model/consolidation_rule/dispatch_block.rb +34 -0
- data/lib/lutaml/model/consolidation_rule/gather_rule.rb +17 -0
- data/lib/lutaml/model/consolidation_rule/pattern_content_rule.rb +15 -0
- data/lib/lutaml/model/consolidation_rule/pattern_element_rule.rb +17 -0
- data/lib/lutaml/model/consolidation_rule.rb +27 -0
- data/lib/lutaml/model/constants.rb +11 -0
- data/lib/lutaml/model/context_registry.rb +208 -0
- data/lib/lutaml/model/deep_dupable.rb +16 -0
- data/lib/lutaml/model/error/choice_lower_bound_error.rb +9 -0
- data/lib/lutaml/model/error/choice_upper_bound_error.rb +9 -0
- data/lib/lutaml/model/error/collection_count_out_of_range_error.rb +29 -0
- data/lib/lutaml/model/error/collection_true_missing_error.rb +16 -0
- data/lib/lutaml/model/error/element_count_out_of_range_error.rb +35 -0
- data/lib/lutaml/model/error/format_adapter_not_specified_error.rb +25 -0
- data/lib/lutaml/model/error/fraction_digits_error.rb +20 -0
- data/lib/lutaml/model/error/import_model_with_root_error.rb +9 -0
- data/lib/lutaml/model/error/incorrect_mapping_argument_error.rb +6 -0
- data/lib/lutaml/model/error/incorrect_sequence_error.rb +9 -0
- data/lib/lutaml/model/error/invalid_attribute_name_error.rb +15 -0
- data/lib/lutaml/model/error/invalid_attribute_options_error.rb +16 -0
- data/lib/lutaml/model/error/invalid_attribute_type_error.rb +98 -0
- data/lib/lutaml/model/error/invalid_choice_range_error.rb +18 -0
- data/lib/lutaml/model/error/invalid_format_error.rb +11 -0
- data/lib/lutaml/model/error/invalid_value_error.rb +18 -0
- data/lib/lutaml/model/error/length_error.rb +19 -0
- data/lib/lutaml/model/error/liquid_class_not_found_error.rb +9 -0
- data/lib/lutaml/model/error/liquid_drop_already_registered_error.rb +11 -0
- data/lib/lutaml/model/error/liquid_not_enabled_error.rb +9 -0
- data/lib/lutaml/model/error/mapping_already_exists_error.rb +6 -0
- data/lib/lutaml/model/error/mapping_attribute_missing_error.rb +6 -0
- data/lib/lutaml/model/error/mapping_attribute_type_error.rb +6 -0
- data/lib/lutaml/model/error/max_exclusive_error.rb +19 -0
- data/lib/lutaml/model/error/max_inclusive_error.rb +20 -0
- data/lib/lutaml/model/error/max_length_error.rb +20 -0
- data/lib/lutaml/model/error/min_exclusive_error.rb +19 -0
- data/lib/lutaml/model/error/min_inclusive_error.rb +20 -0
- data/lib/lutaml/model/error/min_length_error.rb +20 -0
- data/lib/lutaml/model/error/mixed_content_collection_error.rb +17 -0
- data/lib/lutaml/model/error/multiple_mappings_error.rb +6 -0
- data/lib/lutaml/model/error/no_attributes_defined_liquid_error.rb +9 -0
- data/lib/lutaml/model/error/no_mapping_found_error.rb +9 -0
- data/lib/lutaml/model/error/no_root_mapping_error.rb +10 -0
- data/lib/lutaml/model/error/no_root_namespace_error.rb +10 -0
- data/lib/lutaml/model/error/ordered_content_mapping_error.rb +17 -0
- data/lib/lutaml/model/error/pattern_not_matched_error.rb +17 -0
- data/lib/lutaml/model/error/polymorphic_error.rb +14 -0
- data/lib/lutaml/model/error/register/not_registrable_class_error.rb +11 -0
- data/lib/lutaml/model/error/required_attribute_missing_error.rb +9 -0
- data/lib/lutaml/model/error/restriction_error.rb +8 -0
- data/lib/lutaml/model/error/reverse_transform_block_not_defined_error.rb +6 -0
- data/lib/lutaml/model/error/reverse_transformation_declaration_error.rb +6 -0
- data/lib/lutaml/model/error/sorting_configuration_conflict_error.rb +9 -0
- data/lib/lutaml/model/error/total_digits_error.rb +20 -0
- data/lib/lutaml/model/error/transform_block_not_defined_error.rb +6 -0
- data/lib/lutaml/model/error/type/invalid_value_error.rb +21 -0
- data/lib/lutaml/model/error/type/max_bound_error.rb +20 -0
- data/lib/lutaml/model/error/type/max_exclusive_error.rb +20 -0
- data/lib/lutaml/model/error/type/max_length_error.rb +20 -0
- data/lib/lutaml/model/error/type/min_bound_error.rb +20 -0
- data/lib/lutaml/model/error/type/min_exclusive_error.rb +20 -0
- data/lib/lutaml/model/error/type/min_length_error.rb +20 -0
- data/lib/lutaml/model/error/type/pattern_not_matched_error.rb +18 -0
- data/lib/lutaml/model/error/type.rb +19 -0
- data/lib/lutaml/model/error/type_error.rb +9 -0
- data/lib/lutaml/model/error/type_not_enabled_error.rb +9 -0
- data/lib/lutaml/model/error/type_only_mapping_error.rb +13 -0
- data/lib/lutaml/model/error/type_only_namespace_error.rb +12 -0
- data/lib/lutaml/model/error/undefined_attribute_error.rb +9 -0
- data/lib/lutaml/model/error/union_schema_unsupported_error.rb +11 -0
- data/lib/lutaml/model/error/unknown_adapter_type_error.rb +95 -0
- data/lib/lutaml/model/error/unknown_discriminator_error.rb +11 -0
- data/lib/lutaml/model/error/unknown_mapping_error.rb +18 -0
- data/lib/lutaml/model/error/unknown_sequence_mapping_error.rb +9 -0
- data/lib/lutaml/model/error/unknown_type_error.rb +32 -0
- data/lib/lutaml/model/error/unresolvable_type_error.rb +27 -0
- data/lib/lutaml/model/error/unsupported_version_error.rb +14 -0
- data/lib/lutaml/model/error/validation_error.rb +20 -0
- data/lib/lutaml/model/error/validation_failed_error.rb +9 -0
- data/lib/lutaml/model/error.rb +8 -0
- data/lib/lutaml/model/errors.rb +38 -0
- data/lib/lutaml/model/evolution_steps.rb +85 -0
- data/lib/lutaml/model/finalization_cache.rb +51 -0
- data/lib/lutaml/model/format_registry.rb +218 -0
- data/lib/lutaml/model/global_context.rb +476 -0
- data/lib/lutaml/model/global_register.rb +142 -0
- data/lib/lutaml/model/hash.rb +15 -0
- data/lib/lutaml/model/import_registry.rb +250 -0
- data/lib/lutaml/model/instrumentation.rb +304 -0
- data/lib/lutaml/model/json.rb +25 -0
- data/lib/lutaml/model/json_adapter.rb +8 -0
- data/lib/lutaml/model/jsonl.rb +15 -0
- data/lib/lutaml/model/liquefiable.rb +198 -0
- data/lib/lutaml/model/liquid/indexed_access.rb +33 -0
- data/lib/lutaml/model/liquid/mapping.rb +30 -0
- data/lib/lutaml/model/liquid.rb +10 -0
- data/lib/lutaml/model/lml/document.rb +109 -0
- data/lib/lutaml/model/lml/exporter.rb +328 -0
- data/lib/lutaml/model/lml/rejected_error.rb +32 -0
- data/lib/lutaml/model/lml/round_trip.rb +49 -0
- data/lib/lutaml/model/lml.rb +40 -0
- data/lib/lutaml/model/mapping/listener.rb +126 -0
- data/lib/lutaml/model/mapping/mapping.rb +209 -0
- data/lib/lutaml/model/mapping/mapping_rule.rb +673 -0
- data/lib/lutaml/model/mapping/model_mapping.rb +133 -0
- data/lib/lutaml/model/mapping/model_mapping_rule.rb +57 -0
- data/lib/lutaml/model/mapping_hash.rb +80 -0
- data/lib/lutaml/model/model_transformer.rb +101 -0
- data/lib/lutaml/model/one_entry_cache.rb +57 -0
- data/lib/lutaml/model/organization.rb +29 -0
- data/lib/lutaml/model/register/model_tree_importer.rb +88 -0
- data/lib/lutaml/model/register/namespace_binding.rb +92 -0
- data/lib/lutaml/model/register.rb +589 -0
- data/lib/lutaml/model/registrable.rb +8 -0
- data/lib/lutaml/model/render_policy.rb +166 -0
- data/lib/lutaml/model/restriction_validation.rb +437 -0
- data/lib/lutaml/model/runtime_compatibility.rb +144 -0
- data/lib/lutaml/model/schema/base_schema.rb +77 -0
- data/lib/lutaml/model/schema/class_loader.rb +59 -0
- data/lib/lutaml/model/schema/compiled_output.rb +83 -0
- data/lib/lutaml/model/schema/decorators/attribute.rb +116 -0
- data/lib/lutaml/model/schema/decorators/choices.rb +29 -0
- data/lib/lutaml/model/schema/decorators/class_definition.rb +84 -0
- data/lib/lutaml/model/schema/decorators/definition_collection.rb +97 -0
- data/lib/lutaml/model/schema/decorators.rb +15 -0
- data/lib/lutaml/model/schema/definitions/attribute.rb +32 -0
- data/lib/lutaml/model/schema/definitions/choice.rb +20 -0
- data/lib/lutaml/model/schema/definitions/facet.rb +40 -0
- data/lib/lutaml/model/schema/definitions/group_import.rb +22 -0
- data/lib/lutaml/model/schema/definitions/member_walk.rb +33 -0
- data/lib/lutaml/model/schema/definitions/model.rb +40 -0
- data/lib/lutaml/model/schema/definitions/namespace.rb +24 -0
- data/lib/lutaml/model/schema/definitions/restricted_type.rb +32 -0
- data/lib/lutaml/model/schema/definitions/sequence.rb +19 -0
- data/lib/lutaml/model/schema/definitions/simple_content.rb +22 -0
- data/lib/lutaml/model/schema/definitions/transform_facet.rb +21 -0
- data/lib/lutaml/model/schema/definitions/type_ref.rb +20 -0
- data/lib/lutaml/model/schema/definitions/union_type.rb +28 -0
- data/lib/lutaml/model/schema/definitions/xml_root.rb +20 -0
- data/lib/lutaml/model/schema/definitions.rb +24 -0
- data/lib/lutaml/model/schema/file_writer.rb +73 -0
- data/lib/lutaml/model/schema/generator/definition.rb +98 -0
- data/lib/lutaml/model/schema/generator/definitions_collection.rb +117 -0
- data/lib/lutaml/model/schema/generator/properties_collection.rb +65 -0
- data/lib/lutaml/model/schema/generator/property.rb +182 -0
- data/lib/lutaml/model/schema/generator/ref.rb +24 -0
- data/lib/lutaml/model/schema/generator.rb +15 -0
- data/lib/lutaml/model/schema/helpers/template_helper.rb +49 -0
- data/lib/lutaml/model/schema/helpers.rb +11 -0
- data/lib/lutaml/model/schema/json_schema.rb +17 -0
- data/lib/lutaml/model/schema/json_schema_parser.rb +91 -0
- data/lib/lutaml/model/schema/module_nesting.rb +31 -0
- data/lib/lutaml/model/schema/namespace_naming.rb +46 -0
- data/lib/lutaml/model/schema/registry_generator.rb +115 -0
- data/lib/lutaml/model/schema/renderer.rb +38 -0
- data/lib/lutaml/model/schema/renderers/base.rb +41 -0
- data/lib/lutaml/model/schema/renderers/mappings.rb +78 -0
- data/lib/lutaml/model/schema/renderers/member_decls.rb +121 -0
- data/lib/lutaml/model/schema/renderers/model.rb +133 -0
- data/lib/lutaml/model/schema/renderers/namespace.rb +30 -0
- data/lib/lutaml/model/schema/renderers/registration.rb +64 -0
- data/lib/lutaml/model/schema/renderers/required_files_calculator.rb +94 -0
- data/lib/lutaml/model/schema/renderers/restricted_type.rb +218 -0
- data/lib/lutaml/model/schema/renderers/union.rb +83 -0
- data/lib/lutaml/model/schema/renderers.rb +20 -0
- data/lib/lutaml/model/schema/rnc_compiler/source_resolver.rb +51 -0
- data/lib/lutaml/model/schema/rnc_compiler.rb +64 -0
- data/lib/lutaml/model/schema/rng_compiler/define_classifier.rb +94 -0
- data/lib/lutaml/model/schema/rng_compiler/element_visitor.rb +412 -0
- data/lib/lutaml/model/schema/rng_compiler/member_collector.rb +30 -0
- data/lib/lutaml/model/schema/rng_compiler/rng_helpers.rb +160 -0
- data/lib/lutaml/model/schema/rng_compiler/value_type_resolver.rb +129 -0
- data/lib/lutaml/model/schema/rng_compiler.rb +225 -0
- data/lib/lutaml/model/schema/schema_builder/nokogiri.rb +41 -0
- data/lib/lutaml/model/schema/schema_builder/oga.rb +92 -0
- data/lib/lutaml/model/schema/shared_methods.rb +24 -0
- data/lib/lutaml/model/schema/templates/model.erb +9 -0
- data/lib/lutaml/model/schema/templates.rb +164 -0
- data/lib/lutaml/model/schema/xml_compiler/element_order.rb +42 -0
- data/lib/lutaml/model/schema/xml_compiler/registry_generator.rb +51 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder/complex_types.rb +198 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder/members.rb +249 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder/simple_types.rb +185 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder.rb +186 -0
- data/lib/lutaml/model/schema/xml_compiler/supported_data_types.rb +100 -0
- data/lib/lutaml/model/schema/xml_compiler.rb +109 -0
- data/lib/lutaml/model/schema/yaml_schema.rb +17 -0
- data/lib/lutaml/model/schema.rb +88 -0
- data/lib/lutaml/model/schema_location.rb +18 -0
- data/lib/lutaml/model/sequence.rb +220 -0
- data/lib/lutaml/model/serializable.rb +46 -0
- data/lib/lutaml/model/serialization_adapter.rb +24 -0
- data/lib/lutaml/model/serialize/attribute_definition.rb +897 -0
- data/lib/lutaml/model/serialize/builder.rb +258 -0
- data/lib/lutaml/model/serialize/conversion_caching.rb +129 -0
- data/lib/lutaml/model/serialize/deserialization_context.rb +51 -0
- data/lib/lutaml/model/serialize/enum_handling.rb +171 -0
- data/lib/lutaml/model/serialize/format_conversion.rb +624 -0
- data/lib/lutaml/model/serialize/initialization.rb +825 -0
- data/lib/lutaml/model/serialize/model_import.rb +425 -0
- data/lib/lutaml/model/serialize/transformation_builder.rb +128 -0
- data/lib/lutaml/model/serialize/value_mapping.rb +173 -0
- data/lib/lutaml/model/serialize.rb +533 -0
- data/lib/lutaml/model/services/base.rb +13 -0
- data/lib/lutaml/model/services/logger.rb +57 -0
- data/lib/lutaml/model/services/rule_value_extractor.rb +95 -0
- data/lib/lutaml/model/services/transformer.rb +143 -0
- data/lib/lutaml/model/services/type/validator/number.rb +25 -0
- data/lib/lutaml/model/services/type/validator/string.rb +53 -0
- data/lib/lutaml/model/services/type/validator/symbol.rb +30 -0
- data/lib/lutaml/model/services/type/validator.rb +69 -0
- data/lib/lutaml/model/services/type.rb +9 -0
- data/lib/lutaml/model/services/validator.rb +143 -0
- data/lib/lutaml/model/services.rb +10 -0
- data/lib/lutaml/model/store.rb +239 -0
- data/lib/lutaml/model/toml.rb +40 -0
- data/lib/lutaml/model/transform/xml_transform.rb +5 -0
- data/lib/lutaml/model/transform.rb +229 -0
- data/lib/lutaml/model/transformation.rb +89 -0
- data/lib/lutaml/model/transformation_builder.rb +55 -0
- data/lib/lutaml/model/transformation_registry.rb +327 -0
- data/lib/lutaml/model/type/base64_binary.rb +58 -0
- data/lib/lutaml/model/type/boolean.rb +35 -0
- data/lib/lutaml/model/type/date.rb +75 -0
- data/lib/lutaml/model/type/date_time.rb +60 -0
- data/lib/lutaml/model/type/date_time_with_timezone.rb +28 -0
- data/lib/lutaml/model/type/date_with_timezone.rb +28 -0
- data/lib/lutaml/model/type/day_time_duration.rb +35 -0
- data/lib/lutaml/model/type/decimal.rb +64 -0
- data/lib/lutaml/model/type/duration.rb +82 -0
- data/lib/lutaml/model/type/email_address.rb +28 -0
- data/lib/lutaml/model/type/float.rb +33 -0
- data/lib/lutaml/model/type/hash.rb +74 -0
- data/lib/lutaml/model/type/hex_binary.rb +56 -0
- data/lib/lutaml/model/type/hostname.rb +30 -0
- data/lib/lutaml/model/type/integer.rb +62 -0
- data/lib/lutaml/model/type/ip_v4_address.rb +27 -0
- data/lib/lutaml/model/type/ip_v6_address.rb +47 -0
- data/lib/lutaml/model/type/metaschema_pattern.rb +34 -0
- data/lib/lutaml/model/type/non_negative_integer.rb +25 -0
- data/lib/lutaml/model/type/positive_integer.rb +25 -0
- data/lib/lutaml/model/type/qname.rb +85 -0
- data/lib/lutaml/model/type/reference.rb +76 -0
- data/lib/lutaml/model/type/string.rb +62 -0
- data/lib/lutaml/model/type/symbol.rb +67 -0
- data/lib/lutaml/model/type/time.rb +52 -0
- data/lib/lutaml/model/type/time_without_date.rb +50 -0
- data/lib/lutaml/model/type/token.rb +25 -0
- data/lib/lutaml/model/type/uninitialized_class_guard.rb +36 -0
- data/lib/lutaml/model/type/uri.rb +51 -0
- data/lib/lutaml/model/type/uri_reference.rb +29 -0
- data/lib/lutaml/model/type/uuid.rb +25 -0
- data/lib/lutaml/model/type/value.rb +364 -0
- data/lib/lutaml/model/type/year_month_duration.rb +29 -0
- data/lib/lutaml/model/type.rb +199 -0
- data/lib/lutaml/model/type_context.rb +294 -0
- data/lib/lutaml/model/type_registry.rb +165 -0
- data/lib/lutaml/model/type_resolver.rb +187 -0
- data/lib/lutaml/model/type_substitution.rb +117 -0
- data/lib/lutaml/model/uninitialized_class.rb +70 -0
- data/lib/lutaml/model/union.rb +363 -0
- data/lib/lutaml/model/utils.rb +352 -0
- data/lib/lutaml/model/validation/concerns/has_issues.rb +27 -0
- data/lib/lutaml/model/validation/context.rb +36 -0
- data/lib/lutaml/model/validation/issue.rb +62 -0
- data/lib/lutaml/model/validation/layer_result.rb +34 -0
- data/lib/lutaml/model/validation/profile.rb +66 -0
- data/lib/lutaml/model/validation/registry.rb +60 -0
- data/lib/lutaml/model/validation/remediation.rb +33 -0
- data/lib/lutaml/model/validation/remediation_result.rb +20 -0
- data/lib/lutaml/model/validation/report.rb +39 -0
- data/lib/lutaml/model/validation/rule.rb +59 -0
- data/lib/lutaml/model/validation.rb +137 -0
- data/lib/lutaml/model/validation_framework.rb +77 -0
- data/lib/lutaml/model/value_policy.rb +27 -0
- data/lib/lutaml/model/value_transformer.rb +25 -0
- data/lib/lutaml/model/version.rb +7 -0
- data/lib/lutaml/model/yaml.rb +15 -0
- data/lib/lutaml/model/yamls.rb +15 -0
- data/lib/lutaml/model.rb +309 -0
- data/lib/lutaml/rdf/context.rb +69 -0
- data/lib/lutaml/rdf/error.rb +7 -0
- data/lib/lutaml/rdf/iri.rb +44 -0
- data/lib/lutaml/rdf/language_tagged.rb +11 -0
- data/lib/lutaml/rdf/linked_data_transform.rb +249 -0
- data/lib/lutaml/rdf/literal.rb +62 -0
- data/lib/lutaml/rdf/mapping.rb +86 -0
- data/lib/lutaml/rdf/mapping_rule.rb +52 -0
- data/lib/lutaml/rdf/member_rule.rb +55 -0
- data/lib/lutaml/rdf/namespace.rb +58 -0
- data/lib/lutaml/rdf/namespace_set.rb +69 -0
- data/lib/lutaml/rdf/namespaces/dcterms_namespace.rb +12 -0
- data/lib/lutaml/rdf/namespaces/owl_namespace.rb +12 -0
- data/lib/lutaml/rdf/namespaces/rdf_namespace.rb +14 -0
- data/lib/lutaml/rdf/namespaces/rdfs_namespace.rb +12 -0
- data/lib/lutaml/rdf/namespaces/skos_namespace.rb +12 -0
- data/lib/lutaml/rdf/namespaces/xsd_namespace.rb +12 -0
- data/lib/lutaml/rdf/namespaces.rb +14 -0
- data/lib/lutaml/rdf/term_definition.rb +39 -0
- data/lib/lutaml/rdf/transform.rb +45 -0
- data/lib/lutaml/rdf.rb +22 -0
- data/lib/lutaml/toml/adapter/document.rb +10 -0
- data/lib/lutaml/toml/adapter/mapping.rb +26 -0
- data/lib/lutaml/toml/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/toml/adapter/teptris_adapter.rb +14 -0
- data/lib/lutaml/toml/adapter/toml_rb_adapter.rb +32 -0
- data/lib/lutaml/toml/adapter/tomlib_adapter.rb +48 -0
- data/lib/lutaml/toml/adapter/transform.rb +9 -0
- data/lib/lutaml/toml/adapter.rb +20 -0
- data/lib/lutaml/toml/format.rb +48 -0
- data/lib/lutaml/toml/type/serializers.rb +71 -0
- data/lib/lutaml/toml.rb +7 -0
- data/lib/lutaml/turtle/adapter.rb +35 -0
- data/lib/lutaml/turtle/mapping.rb +7 -0
- data/lib/lutaml/turtle/transform.rb +250 -0
- data/lib/lutaml/turtle.rb +22 -0
- data/lib/lutaml/version.rb +1 -1
- data/lib/lutaml/xml/adapter/adapter_helpers.rb +108 -0
- data/lib/lutaml/xml/adapter/base_adapter.rb +249 -0
- data/lib/lutaml/xml/adapter/leptris_adapter.rb +16 -0
- data/lib/lutaml/xml/adapter/namespace_data.rb +56 -0
- data/lib/lutaml/xml/adapter/namespace_uri_collector.rb +71 -0
- data/lib/lutaml/xml/adapter/nokogiri_adapter.rb +16 -0
- data/lib/lutaml/xml/adapter/oga_adapter.rb +20 -0
- data/lib/lutaml/xml/adapter/ox_adapter.rb +16 -0
- data/lib/lutaml/xml/adapter/plan_based_builder.rb +944 -0
- data/lib/lutaml/xml/adapter/rexml_adapter.rb +25 -0
- data/lib/lutaml/xml/adapter/xml_parser.rb +89 -0
- data/lib/lutaml/xml/adapter/xml_serializer.rb +334 -0
- data/lib/lutaml/xml/adapter.rb +24 -0
- data/lib/lutaml/xml/adapter_element.rb +339 -0
- data/lib/lutaml/xml/adapter_loader.rb +56 -0
- data/lib/lutaml/xml/attribute_namespace_resolver.rb +139 -0
- data/lib/lutaml/xml/blank_namespace.rb +51 -0
- data/lib/lutaml/xml/blank_namespace_handler.rb +50 -0
- data/lib/lutaml/xml/builder/base.rb +258 -0
- data/lib/lutaml/xml/builder/leptris.rb +13 -0
- data/lib/lutaml/xml/builder/nokogiri.rb +13 -0
- data/lib/lutaml/xml/builder/oga.rb +13 -0
- data/lib/lutaml/xml/builder/ox.rb +13 -0
- data/lib/lutaml/xml/builder/rexml.rb +13 -0
- data/lib/lutaml/xml/builder.rb +18 -0
- data/lib/lutaml/xml/configurable.rb +215 -0
- data/lib/lutaml/xml/data_model.rb +295 -0
- data/lib/lutaml/xml/decisions/decision.rb +120 -0
- data/lib/lutaml/xml/decisions/decision_context.rb +225 -0
- data/lib/lutaml/xml/decisions/decision_engine.rb +67 -0
- data/lib/lutaml/xml/decisions/decision_rule.rb +54 -0
- data/lib/lutaml/xml/decisions/element_prefix_resolver.rb +85 -0
- data/lib/lutaml/xml/decisions/rules/attribute_usage_rule.rb +37 -0
- data/lib/lutaml/xml/decisions/rules/default_preference_rule.rb +62 -0
- data/lib/lutaml/xml/decisions/rules/element_form_default_rule.rb +66 -0
- data/lib/lutaml/xml/decisions/rules/element_form_default_unqualified_rule.rb +73 -0
- data/lib/lutaml/xml/decisions/rules/element_form_option_rule.rb +83 -0
- data/lib/lutaml/xml/decisions/rules/explicit_option_rule.rb +57 -0
- data/lib/lutaml/xml/decisions/rules/format_preservation_rule.rb +74 -0
- data/lib/lutaml/xml/decisions/rules/hoisted_on_parent_rule.rb +60 -0
- data/lib/lutaml/xml/decisions/rules/inherit_from_parent_rule.rb +52 -0
- data/lib/lutaml/xml/decisions/rules/inherit_parent_prefix_rule.rb +69 -0
- data/lib/lutaml/xml/decisions/rules/namespace_scope_rule.rb +54 -0
- data/lib/lutaml/xml/decisions/rules/reuse_parent_prefix_rule.rb +78 -0
- data/lib/lutaml/xml/decisions/rules/used_prefix_rule.rb +70 -0
- data/lib/lutaml/xml/decisions/rules.rb +39 -0
- data/lib/lutaml/xml/decisions.rb +15 -0
- data/lib/lutaml/xml/declaration_handler.rb +115 -0
- data/lib/lutaml/xml/declaration_plan/attribute_node.rb +81 -0
- data/lib/lutaml/xml/declaration_plan/element_node.rb +101 -0
- data/lib/lutaml/xml/declaration_plan.rb +480 -0
- data/lib/lutaml/xml/declaration_plan_query.rb +105 -0
- data/lib/lutaml/xml/declaration_planner.rb +1914 -0
- data/lib/lutaml/xml/doctype_extractor.rb +51 -0
- data/lib/lutaml/xml/document.rb +385 -0
- data/lib/lutaml/xml/element.rb +108 -0
- data/lib/lutaml/xml/element_prefix_resolver.rb +50 -0
- data/lib/lutaml/xml/encoding_normalizer.rb +54 -0
- data/lib/lutaml/xml/error/invalid_namespace_error.rb +46 -0
- data/lib/lutaml/xml/error/invalid_xsd_type_error.rb +43 -0
- data/lib/lutaml/xml/error/namespace_mismatch_error.rb +53 -0
- data/lib/lutaml/xml/error/schema_validation_error.rb +25 -0
- data/lib/lutaml/xml/error/xml_configuration_error.rb +17 -0
- data/lib/lutaml/xml/error/xml_error.rb +21 -0
- data/lib/lutaml/xml/format.rb +364 -0
- data/lib/lutaml/xml/format_chooser.rb +214 -0
- data/lib/lutaml/xml/hoisting_algorithm.rb +234 -0
- data/lib/lutaml/xml/html_entities.rb +290 -0
- data/lib/lutaml/xml/leptris/element.rb +34 -0
- data/lib/lutaml/xml/leptris/native_emission.rb +295 -0
- data/lib/lutaml/xml/leptris/plan_compiler.rb +652 -0
- data/lib/lutaml/xml/leptris/plan_hydrator.rb +827 -0
- data/lib/lutaml/xml/leptris/plan_order.rb +72 -0
- data/lib/lutaml/xml/leptris/plan_serializer.rb +711 -0
- data/lib/lutaml/xml/leptris/plan_walk.rb +36 -0
- data/lib/lutaml/xml/leptris.rb +48 -0
- data/lib/lutaml/xml/listener.rb +33 -0
- data/lib/lutaml/xml/mapping.rb +1746 -0
- data/lib/lutaml/xml/mapping_rule.rb +688 -0
- data/lib/lutaml/xml/model_transform.rb +1824 -0
- data/lib/lutaml/xml/namespace.rb +445 -0
- data/lib/lutaml/xml/namespace_class_registry.rb +144 -0
- data/lib/lutaml/xml/namespace_collector.rb +649 -0
- data/lib/lutaml/xml/namespace_declaration.rb +202 -0
- data/lib/lutaml/xml/namespace_declaration_builder.rb +67 -0
- data/lib/lutaml/xml/namespace_declaration_data.rb +179 -0
- data/lib/lutaml/xml/namespace_inheritance_resolver.rb +142 -0
- data/lib/lutaml/xml/namespace_inheritance_strategy.rb +26 -0
- data/lib/lutaml/xml/namespace_needs.rb +255 -0
- data/lib/lutaml/xml/namespace_resolution_strategy.rb +230 -0
- data/lib/lutaml/xml/namespace_resolver.rb +219 -0
- data/lib/lutaml/xml/namespace_scope_config.rb +110 -0
- data/lib/lutaml/xml/namespace_type_resolver.rb +135 -0
- data/lib/lutaml/xml/namespace_usage.rb +121 -0
- data/lib/lutaml/xml/nested_collection_attribute.rb +95 -0
- data/lib/lutaml/xml/nokogiri/element.rb +34 -0
- data/lib/lutaml/xml/nokogiri.rb +10 -0
- data/lib/lutaml/xml/oga/element.rb +15 -0
- data/lib/lutaml/xml/oga.rb +10 -0
- data/lib/lutaml/xml/ox/element.rb +15 -0
- data/lib/lutaml/xml/ox.rb +10 -0
- data/lib/lutaml/xml/parse_session.rb +139 -0
- data/lib/lutaml/xml/parsed_namespace_declaration.rb +129 -0
- data/lib/lutaml/xml/parsed_namespace_set.rb +149 -0
- data/lib/lutaml/xml/polymorphic_value_handler.rb +41 -0
- data/lib/lutaml/xml/qualified_inheritance_strategy.rb +27 -0
- data/lib/lutaml/xml/rexml/element.rb +15 -0
- data/lib/lutaml/xml/rexml.rb +10 -0
- data/lib/lutaml/xml/schema/builder/nokogiri.rb +41 -0
- data/lib/lutaml/xml/schema/builder/oga.rb +92 -0
- data/lib/lutaml/xml/schema/builder.rb +59 -0
- data/lib/lutaml/xml/schema/builtin_types.rb +112 -0
- data/lib/lutaml/xml/schema/relaxng_schema.rb +83 -0
- data/lib/lutaml/xml/schema/xsd/all.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/annotation.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/any.rb +33 -0
- data/lib/lutaml/xml/schema/xsd/any_attribute.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/appinfo.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/attribute.rb +78 -0
- data/lib/lutaml/xml/schema/xsd/attribute_group.rb +89 -0
- data/lib/lutaml/xml/schema/xsd/base.rb +270 -0
- data/lib/lutaml/xml/schema/xsd/choice.rb +68 -0
- data/lib/lutaml/xml/schema/xsd/complex_content.rb +39 -0
- data/lib/lutaml/xml/schema/xsd/complex_type.rb +159 -0
- data/lib/lutaml/xml/schema/xsd/documentation.rb +26 -0
- data/lib/lutaml/xml/schema/xsd/element.rb +117 -0
- data/lib/lutaml/xml/schema/xsd/enumeration.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/errors/enhanced_error.rb +142 -0
- data/lib/lutaml/xml/schema/xsd/errors/error_context.rb +67 -0
- data/lib/lutaml/xml/schema/xsd/errors/message_builder.rb +103 -0
- data/lib/lutaml/xml/schema/xsd/errors/suggestion.rb +67 -0
- data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/namespace_troubleshooter.rb +96 -0
- data/lib/lutaml/xml/schema/xsd/errors/troubleshooters/troubleshooting_handler.rb +70 -0
- data/lib/lutaml/xml/schema/xsd/errors.rb +148 -0
- data/lib/lutaml/xml/schema/xsd/extension_complex_content.rb +63 -0
- data/lib/lutaml/xml/schema/xsd/extension_simple_content.rb +48 -0
- data/lib/lutaml/xml/schema/xsd/field.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/file_validation_result.rb +55 -0
- data/lib/lutaml/xml/schema/xsd/fraction_digits.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/glob.rb +105 -0
- data/lib/lutaml/xml/schema/xsd/group.rb +79 -0
- data/lib/lutaml/xml/schema/xsd/import.rb +33 -0
- data/lib/lutaml/xml/schema/xsd/include.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/key.rb +32 -0
- data/lib/lutaml/xml/schema/xsd/keyref.rb +34 -0
- data/lib/lutaml/xml/schema/xsd/length.rb +27 -0
- data/lib/lutaml/xml/schema/xsd/list.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/max_exclusive.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/max_inclusive.rb +23 -0
- data/lib/lutaml/xml/schema/xsd/max_length.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/min_exclusive.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/min_inclusive.rb +23 -0
- data/lib/lutaml/xml/schema/xsd/min_length.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/namespace_mapping.rb +37 -0
- data/lib/lutaml/xml/schema/xsd/namespace_uri_remapping.rb +79 -0
- data/lib/lutaml/xml/schema/xsd/notation.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/pattern.rb +25 -0
- data/lib/lutaml/xml/schema/xsd/redefine.rb +35 -0
- data/lib/lutaml/xml/schema/xsd/restriction_complex_content.rb +56 -0
- data/lib/lutaml/xml/schema/xsd/restriction_simple_content.rb +84 -0
- data/lib/lutaml/xml/schema/xsd/restriction_simple_type.rb +64 -0
- data/lib/lutaml/xml/schema/xsd/schema.rb +379 -0
- data/lib/lutaml/xml/schema/xsd/schema_file_validation_results.rb +55 -0
- data/lib/lutaml/xml/schema/xsd/schema_location_mapping.rb +74 -0
- data/lib/lutaml/xml/schema/xsd/schema_name_resolver.rb +32 -0
- data/lib/lutaml/xml/schema/xsd/schema_path.rb +207 -0
- data/lib/lutaml/xml/schema/xsd/schema_validator.rb +259 -0
- data/lib/lutaml/xml/schema/xsd/selector.rb +27 -0
- data/lib/lutaml/xml/schema/xsd/sequence.rb +68 -0
- data/lib/lutaml/xml/schema/xsd/serialized_schema.rb +185 -0
- data/lib/lutaml/xml/schema/xsd/simple_content.rb +61 -0
- data/lib/lutaml/xml/schema/xsd/simple_type.rb +37 -0
- data/lib/lutaml/xml/schema/xsd/total_digits.rb +29 -0
- data/lib/lutaml/xml/schema/xsd/type_index_entry.rb +40 -0
- data/lib/lutaml/xml/schema/xsd/type_resolution_result.rb +112 -0
- data/lib/lutaml/xml/schema/xsd/union.rb +30 -0
- data/lib/lutaml/xml/schema/xsd/unique.rb +31 -0
- data/lib/lutaml/xml/schema/xsd/validation_error.rb +48 -0
- data/lib/lutaml/xml/schema/xsd/validation_result.rb +86 -0
- data/lib/lutaml/xml/schema/xsd/version.rb +11 -0
- data/lib/lutaml/xml/schema/xsd/white_space.rb +27 -0
- data/lib/lutaml/xml/schema/xsd.rb +164 -0
- data/lib/lutaml/xml/schema/xsd_namespace.rb +29 -0
- data/lib/lutaml/xml/schema/xsd_schema.rb +1002 -0
- data/lib/lutaml/xml/schema.rb +16 -0
- data/lib/lutaml/xml/schema_location.rb +155 -0
- data/lib/lutaml/xml/serialization/collection_ext.rb +61 -0
- data/lib/lutaml/xml/serialization/format_conversion.rb +433 -0
- data/lib/lutaml/xml/serialization/instance_methods.rb +323 -0
- data/lib/lutaml/xml/serialization/model_import_ext.rb +40 -0
- data/lib/lutaml/xml/serialization.rb +15 -0
- data/lib/lutaml/xml/shared_dsl.rb +119 -0
- data/lib/lutaml/xml/transform.rb +6 -0
- data/lib/lutaml/xml/transformation/custom_method_wrapper.rb +258 -0
- data/lib/lutaml/xml/transformation/element_builder.rb +697 -0
- data/lib/lutaml/xml/transformation/order_reconciler.rb +282 -0
- data/lib/lutaml/xml/transformation/ordered_applier.rb +529 -0
- data/lib/lutaml/xml/transformation/rule_applier.rb +403 -0
- data/lib/lutaml/xml/transformation/rule_compiler.rb +556 -0
- data/lib/lutaml/xml/transformation/skip_logic.rb +70 -0
- data/lib/lutaml/xml/transformation/value_serializer.rb +137 -0
- data/lib/lutaml/xml/transformation.rb +454 -0
- data/lib/lutaml/xml/transformation_builder.rb +28 -0
- data/lib/lutaml/xml/transformation_support.rb +15 -0
- data/lib/lutaml/xml/type/configurable.rb +153 -0
- data/lib/lutaml/xml/type/serializers.rb +105 -0
- data/lib/lutaml/xml/type/value_xml_mapping.rb +94 -0
- data/lib/lutaml/xml/type_namespace/collector.rb +101 -0
- data/lib/lutaml/xml/type_namespace/declaration.rb +61 -0
- data/lib/lutaml/xml/type_namespace/planner.rb +121 -0
- data/lib/lutaml/xml/type_namespace/reference.rb +71 -0
- data/lib/lutaml/xml/type_namespace/resolver.rb +43 -0
- data/lib/lutaml/xml/type_namespace.rb +13 -0
- data/lib/lutaml/xml/type_namespace_resolver.rb +76 -0
- data/lib/lutaml/xml/unqualified_inheritance_strategy.rb +34 -0
- data/lib/lutaml/xml/w3c/registration.rb +66 -0
- data/lib/lutaml/xml/w3c.rb +398 -0
- data/lib/lutaml/xml/xml_attribute.rb +58 -0
- data/lib/lutaml/xml/xml_element.rb +498 -0
- data/lib/lutaml/xml/xml_namespace.rb +72 -0
- data/lib/lutaml/xml/xml_orderable.rb +17 -0
- data/lib/lutaml/xml/xsd_validator.rb +66 -0
- data/lib/lutaml/xml.rb +7 -0
- data/lib/lutaml/yaml/adapter/document.rb +12 -0
- data/lib/lutaml/yaml/adapter/mapping.rb +17 -0
- data/lib/lutaml/yaml/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/yaml/adapter/standard_adapter.rb +35 -0
- data/lib/lutaml/yaml/adapter/transform.rb +9 -0
- data/lib/lutaml/yaml/adapter/yeptris_adapter.rb +107 -0
- data/lib/lutaml/yaml/adapter.rb +18 -0
- data/lib/lutaml/yaml/format.rb +31 -0
- data/lib/lutaml/yaml/schema/yaml_schema.rb +65 -0
- data/lib/lutaml/yaml/schema.rb +9 -0
- data/lib/lutaml/yaml/type/serializers.rb +60 -0
- data/lib/lutaml/yaml.rb +7 -0
- data/lib/lutaml/yamlld/adapter.rb +20 -0
- data/lib/lutaml/yamlld.rb +25 -0
- data/lib/lutaml/yamls/adapter/document.rb +14 -0
- data/lib/lutaml/yamls/adapter/mapping.rb +30 -0
- data/lib/lutaml/yamls/adapter/mapping_rule.rb +9 -0
- data/lib/lutaml/yamls/adapter/standard_adapter.rb +56 -0
- data/lib/lutaml/yamls/adapter/transform.rb +124 -0
- data/lib/lutaml/yamls/adapter/yamls_sequence.rb +20 -0
- data/lib/lutaml/yamls/adapter/yamls_sequence_rule.rb +48 -0
- data/lib/lutaml/yamls/adapter.rb +15 -0
- data/lib/lutaml/yamls/format.rb +22 -0
- data/lib/lutaml/yamls.rb +7 -0
- data/lib/lutaml.rb +11 -5
- data/lib/tasks/benchmark_runner.rb +161 -0
- data/lib/tasks/memory_profile.rb +176 -0
- data/lib/tasks/performance.rake +80 -0
- data/lib/tasks/performance_benchmark.rb +499 -0
- data/lib/tasks/performance_comparator.rb +130 -0
- data/lib/tasks/performance_helpers.rb +149 -0
- data/lib/tasks/performance_probe.rake +33 -0
- data/lib/tasks/performance_probe.rb +106 -0
- data/lib/tasks/performance_probe_plan_walk.rb +58 -0
- data/lib/tasks/performance_probe_xml.rb +54 -0
- data/lib/tasks/xml_compiler_benchmark.rb +226 -0
- data/lib/tasks/xml_optimization_benchmark.rb +178 -0
- data/lutaml.gemspec +16 -8
- metadata +902 -83
- data/.github/workflows/docs.yml +0 -86
- data/.github/workflows/links.yml +0 -113
- data/.github/workflows/rake.yml +0 -23
- data/.github/workflows/release.yml +0 -37
- data/.gitignore +0 -29
- data/CLAUDE.md +0 -62
- data/docs/.github/workflows/docs.yml +0 -66
- data/docs/.github/workflows/links.yml +0 -78
- data/docs/CONTINUATION_PLAN.md +0 -168
- data/docs/Gemfile +0 -13
- data/docs/MIGRATION_GUIDE.md +0 -202
- data/docs/README.md +0 -252
- data/docs/REFACTOR_PLAN.md +0 -214
- data/docs/_config.yml +0 -144
- data/docs/_guides/cli-usage.adoc +0 -43
- data/docs/_guides/diagram-generation.adoc +0 -316
- data/docs/_guides/index.adoc +0 -136
- data/docs/_guides/parsing/express-parsing.adoc +0 -42
- data/docs/_guides/parsing/index.adoc +0 -78
- data/docs/_guides/parsing/qea-parsing.adoc +0 -47
- data/docs/_guides/parsing/xmi-parsing.adoc +0 -40
- data/docs/_guides/repository-management.adoc +0 -44
- data/docs/_guides/sysml-modeling.adoc +0 -37
- data/docs/_guides/uml-modeling.adoc +0 -115
- data/docs/_pages/concepts/diagram-generation.adoc +0 -337
- data/docs/_pages/concepts/lur-format.adoc +0 -711
- data/docs/_pages/concepts/qea-parsing.adoc +0 -418
- data/docs/_pages/concepts/uml-models.adoc +0 -43
- data/docs/_pages/core/architecture.adoc +0 -329
- data/docs/_pages/core/installation.adoc +0 -321
- data/docs/_pages/core/overview.adoc +0 -197
- data/docs/_pages/index.adoc +0 -49
- data/docs/_pages/uml-syntax.adoc +0 -1011
- data/docs/_references/api/parsers.adoc +0 -61
- data/docs/_references/api/presenters.adoc +0 -43
- data/docs/_references/api/repository.adoc +0 -67
- data/docs/_references/cli/commands.adoc +0 -72
- data/docs/_references/configuration/diagram-styles.adoc +0 -716
- data/docs/_references/configuration/index.adoc +0 -53
- data/docs/_references/configuration/package-metadata.adoc +0 -416
- data/docs/_references/formats/index.adoc +0 -43
- data/docs/_references/formats/lur-format.adoc +0 -39
- data/docs/_references/formats/lutaml-syntax.adoc +0 -379
- data/docs/_references/formats/qea-structure.adoc +0 -1364
- data/docs/_references/index.adoc +0 -198
- data/docs/_tutorials/documentation-site.adoc +0 -47
- data/docs/_tutorials/first-lur-package.adoc +0 -45
- data/docs/_tutorials/generating-diagrams.adoc +0 -42
- data/docs/_tutorials/getting-started.adoc +0 -45
- data/docs/_tutorials/index.adoc +0 -100
- data/docs/_tutorials/querying-models.adoc +0 -44
- data/docs/examples/build_package.rb +0 -12
- data/docs/examples/build_site.rb +0 -12
- data/docs/examples/city_model.rb +0 -21
- data/docs/examples/present_class.rb +0 -10
- data/docs/examples/query_model.rb +0 -12
- data/docs/examples/render_diagram.rb +0 -11
- data/docs/index.adoc +0 -64
- data/docs/lychee.toml +0 -50
- data/lib/lutaml/express/parsers/exp.rb +0 -28
- data/lib/lutaml/express.rb +0 -10
- data/scripts/check-site-urls.rb +0 -54
- data/scripts/check-vendor-link.py +0 -64
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
module Lutaml
|
|
2
|
+
module Model
|
|
3
|
+
class MappingRule
|
|
4
|
+
include DeepDupable
|
|
5
|
+
|
|
6
|
+
attr_reader :name,
|
|
7
|
+
:to,
|
|
8
|
+
:to_instance,
|
|
9
|
+
:as_attribute,
|
|
10
|
+
:render_nil,
|
|
11
|
+
:render_default,
|
|
12
|
+
:render_empty,
|
|
13
|
+
:treat_nil,
|
|
14
|
+
:treat_empty,
|
|
15
|
+
:treat_omitted,
|
|
16
|
+
:attribute,
|
|
17
|
+
:custom_methods,
|
|
18
|
+
:delegate,
|
|
19
|
+
:polymorphic,
|
|
20
|
+
:polymorphic_map,
|
|
21
|
+
:transform,
|
|
22
|
+
:format
|
|
23
|
+
|
|
24
|
+
ALLOWED_OPTIONS = {
|
|
25
|
+
render_nil: %i[
|
|
26
|
+
omit
|
|
27
|
+
as_nil
|
|
28
|
+
as_blank
|
|
29
|
+
as_empty
|
|
30
|
+
],
|
|
31
|
+
render_empty: %i[
|
|
32
|
+
omit
|
|
33
|
+
as_empty
|
|
34
|
+
as_blank
|
|
35
|
+
as_nil
|
|
36
|
+
],
|
|
37
|
+
}.freeze
|
|
38
|
+
|
|
39
|
+
ALLOWED_OPTIONS.each do |key, values|
|
|
40
|
+
attribute_name = key.to_s
|
|
41
|
+
values.each do |value|
|
|
42
|
+
define_method(:"#{attribute_name}_#{value}?") do
|
|
43
|
+
send(attribute_name) == value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Normalized name spellings for matching, computed once. The name
|
|
49
|
+
# is fixed after construction (attr_reader only), so the memo is
|
|
50
|
+
# safe. Hot loops used to redo Array(name).map(&:to_s) per element.
|
|
51
|
+
def name_strings
|
|
52
|
+
@name_strings ||= Array(name).map(&:to_s).freeze
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize(
|
|
56
|
+
name,
|
|
57
|
+
to:,
|
|
58
|
+
to_instance: nil,
|
|
59
|
+
as_attribute: nil,
|
|
60
|
+
render_nil: false,
|
|
61
|
+
render_default: false,
|
|
62
|
+
render_empty: false,
|
|
63
|
+
treat_nil: :nil,
|
|
64
|
+
treat_empty: :empty,
|
|
65
|
+
treat_omitted: :nil,
|
|
66
|
+
with: {},
|
|
67
|
+
attribute: false,
|
|
68
|
+
delegate: nil,
|
|
69
|
+
root_mappings: nil,
|
|
70
|
+
polymorphic: {},
|
|
71
|
+
polymorphic_map: {},
|
|
72
|
+
transform: {},
|
|
73
|
+
value_map: {},
|
|
74
|
+
serialize: true,
|
|
75
|
+
when_attribute: {}
|
|
76
|
+
)
|
|
77
|
+
@name = name
|
|
78
|
+
@to = to
|
|
79
|
+
# Dynamic symbol built per call allocated ~10% of parse objects on
|
|
80
|
+
# attribute-heavy documents; `to` is immutable, so build it once.
|
|
81
|
+
@setter_name = :"#{to}="
|
|
82
|
+
@to_instance = to_instance
|
|
83
|
+
@as_attribute = as_attribute
|
|
84
|
+
@render_nil = render_nil
|
|
85
|
+
@render_default = render_default
|
|
86
|
+
@render_empty = render_empty
|
|
87
|
+
@treat_nil = treat_nil
|
|
88
|
+
@treat_empty = treat_empty
|
|
89
|
+
@treat_omitted = treat_omitted
|
|
90
|
+
@custom_methods = with
|
|
91
|
+
@attribute = attribute
|
|
92
|
+
@delegate = delegate
|
|
93
|
+
@root_mappings = root_mappings
|
|
94
|
+
@polymorphic = polymorphic
|
|
95
|
+
@polymorphic_map = polymorphic_map
|
|
96
|
+
@transform = transform
|
|
97
|
+
@serialize_mapping = serialize
|
|
98
|
+
# Attribute-value discriminator (lutaml-model#88): select this
|
|
99
|
+
# rule's wire occurrences by a sibling attribute value, e.g.
|
|
100
|
+
# `when_attribute: { "type" => "guidance" }`.
|
|
101
|
+
@when_attribute = (when_attribute || {}).freeze
|
|
102
|
+
|
|
103
|
+
# Cache whether this rule needs the full deserialize chain.
|
|
104
|
+
# Over 95% of rules are "simple" (no custom method, no delegate).
|
|
105
|
+
@needs_full_deserialize = has_custom_method_for_deserialization? || !!delegate
|
|
106
|
+
|
|
107
|
+
# Only calculate default_value_map if value_map is not fully provided
|
|
108
|
+
if value_map.empty? || !value_map[:from] || !value_map[:to]
|
|
109
|
+
# Build value_map by starting with defaults from render_nil/render_empty,
|
|
110
|
+
# then overlaying user-provided value_map entries on top.
|
|
111
|
+
# User-provided value_map entries take PRECEDENCE over computed defaults.
|
|
112
|
+
# This ensures that value_map: { to: { empty: :empty } } overrides
|
|
113
|
+
# the default render_empty: false → :omitted behavior.
|
|
114
|
+
vm = {
|
|
115
|
+
from: (value_map[:from] || {}).dup,
|
|
116
|
+
to: (value_map[:to] || {}).dup,
|
|
117
|
+
}
|
|
118
|
+
defaults = default_value_map
|
|
119
|
+
vm[:from] = defaults[:from].merge(vm[:from])
|
|
120
|
+
vm[:to] = defaults[:to].merge(vm[:to])
|
|
121
|
+
@value_map = vm
|
|
122
|
+
else
|
|
123
|
+
# Complete value_map provided (e.g., from deep_dup), use it directly.
|
|
124
|
+
@value_map = value_map
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Freeze value_map and its inner hashes — they are never mutated after
|
|
128
|
+
# construction, and downstream code reads them on every serialization.
|
|
129
|
+
@value_map[:from].freeze
|
|
130
|
+
@value_map[:to].freeze
|
|
131
|
+
@value_map.freeze
|
|
132
|
+
|
|
133
|
+
# The :from treatment flags are read on every rule application of
|
|
134
|
+
# every parse; they are static once @value_map is final. The three
|
|
135
|
+
# Hash#[] chains per value used to cost 1.4 M value_map calls per
|
|
136
|
+
# ISO-13849 parse.
|
|
137
|
+
from_map = @value_map[:from]
|
|
138
|
+
@treat_nil_flag = from_map[:nil] != :omitted
|
|
139
|
+
@treat_empty_flag = from_map[:empty] != :omitted
|
|
140
|
+
@treat_omitted_flag = from_map[:omitted] != :omitted
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def default_value_map(options = {})
|
|
144
|
+
render_nil_as = render_as(:render_nil, :omitted, options)
|
|
145
|
+
render_empty_as = render_as(:render_empty, :empty, options)
|
|
146
|
+
|
|
147
|
+
treat_nil_as = treat_as(:treat_nil, :nil, options)
|
|
148
|
+
treat_empty_as = treat_as(:treat_empty, :empty, options)
|
|
149
|
+
treat_omitted_as = treat_as(:treat_omitted, :nil, options)
|
|
150
|
+
|
|
151
|
+
{
|
|
152
|
+
from: { omitted: treat_omitted_as, nil: treat_nil_as,
|
|
153
|
+
empty: treat_empty_as },
|
|
154
|
+
to: { omitted: :omitted, nil: render_nil_as, empty: render_empty_as },
|
|
155
|
+
}
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def render_as(key, default_value, options = {})
|
|
159
|
+
value = public_send(key)
|
|
160
|
+
value = options[key] if value.nil?
|
|
161
|
+
|
|
162
|
+
if value == true
|
|
163
|
+
key.to_s.split("_").last.to_sym
|
|
164
|
+
elsif value == false
|
|
165
|
+
:omitted
|
|
166
|
+
elsif value
|
|
167
|
+
{
|
|
168
|
+
as_empty: :empty,
|
|
169
|
+
as_blank: :blank,
|
|
170
|
+
as_nil: :nil,
|
|
171
|
+
omit: :omitted,
|
|
172
|
+
}[value]
|
|
173
|
+
else
|
|
174
|
+
default_value
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def treat_as(key, default_value, options = {})
|
|
179
|
+
public_send(key) || options[key] || default_value
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
alias from name
|
|
183
|
+
alias render_default? render_default
|
|
184
|
+
|
|
185
|
+
# Frozen default: render? only reads options (render_nil?/render_empty?/
|
|
186
|
+
# render_omitted? policies); a fresh {} per call is pure churn on the
|
|
187
|
+
# serialization hot path.
|
|
188
|
+
EMPTY_RENDER_OPTIONS = {}.freeze
|
|
189
|
+
|
|
190
|
+
# Whether this rule participates in serialization output. False
|
|
191
|
+
# marks a hydrate-only mapping: consumed by from_* but never
|
|
192
|
+
# rendered by to_*. (The value callback #serialize is separate.)
|
|
193
|
+
def serialize? = @serialize_mapping
|
|
194
|
+
alias attribute? attribute
|
|
195
|
+
|
|
196
|
+
def render?(value, instance = nil, options = EMPTY_RENDER_OPTIONS)
|
|
197
|
+
if invalid_value?(value, options)
|
|
198
|
+
false
|
|
199
|
+
# FIXED: Check if collection was mutated after initialization
|
|
200
|
+
# A non-empty collection initialized with default [] should render if mutated
|
|
201
|
+
# This handles the case where collection is mutated with << or custom methods
|
|
202
|
+
elsif mutated_collection?(value, instance)
|
|
203
|
+
true
|
|
204
|
+
elsif instance.is_a?(Lutaml::Model::Serialize) && instance.using_default?(to)
|
|
205
|
+
render_default? || RenderPolicy.derived_attribute_for?(instance, to)
|
|
206
|
+
else
|
|
207
|
+
true
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def treat?(value)
|
|
212
|
+
if value.nil?
|
|
213
|
+
treat_nil?
|
|
214
|
+
elsif Utils.uninitialized?(value)
|
|
215
|
+
treat_omitted?
|
|
216
|
+
elsif Utils.empty?(value)
|
|
217
|
+
treat_empty?
|
|
218
|
+
else
|
|
219
|
+
true
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
def render_value_for(value)
|
|
224
|
+
if value.nil?
|
|
225
|
+
value_for_option(value_map(:to)[:nil])
|
|
226
|
+
elsif Utils.empty?(value)
|
|
227
|
+
value_for_option(value_map(:to)[:empty], value)
|
|
228
|
+
elsif Utils.uninitialized?(value)
|
|
229
|
+
value_for_option(value_map(:to)[:omitted])
|
|
230
|
+
else
|
|
231
|
+
value
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
def mutated_collection?(value, instance)
|
|
236
|
+
return false if value.nil? || Utils.uninitialized?(value)
|
|
237
|
+
return false unless value.is_a?(Array) || value.is_a?(Lutaml::Model::Collection)
|
|
238
|
+
return false if value.empty? # Empty collection is still default
|
|
239
|
+
|
|
240
|
+
# If it's a non-empty collection and marked as using_default, it was mutated
|
|
241
|
+
instance.is_a?(Lutaml::Model::Serialize) && instance.using_default?(to)
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Check if value is a non-empty collection
|
|
245
|
+
def has_items?(value)
|
|
246
|
+
return false if value.nil? || Utils.uninitialized?(value)
|
|
247
|
+
return false unless value.is_a?(String) || value.is_a?(Array) || value.is_a?(Hash)
|
|
248
|
+
|
|
249
|
+
!value.empty?
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
def value_for_option(option, empty_value = nil)
|
|
253
|
+
return nil if option == :nil
|
|
254
|
+
return empty_value || "" if option == :empty
|
|
255
|
+
|
|
256
|
+
Lutaml::Model::UninitializedClass.instance
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
def render_nil?(options = {})
|
|
260
|
+
value_map(:to, options)[:nil] != :omitted
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
def render_empty?(options = {})
|
|
264
|
+
value_map(:to, options)[:empty] != :omitted
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
def render_omitted?(options = {})
|
|
268
|
+
value_map(:to, options)[:omitted] != :omitted
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
def treat_nil?(options = {})
|
|
272
|
+
return @treat_nil_flag unless options[:nil] || options[:empty] || options[:omitted]
|
|
273
|
+
|
|
274
|
+
value_map(:from, options)[:nil] != :omitted
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
def treat_empty?(options = {})
|
|
278
|
+
return @treat_empty_flag unless options[:nil] || options[:empty] || options[:omitted]
|
|
279
|
+
|
|
280
|
+
value_map(:from, options)[:empty] != :omitted
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
def treat_omitted?(options = {})
|
|
284
|
+
return @treat_omitted_flag unless options[:nil] || options[:empty] || options[:omitted]
|
|
285
|
+
|
|
286
|
+
value_map(:from, options)[:omitted] != :omitted
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def polymorphic_mapping?
|
|
290
|
+
polymorphic_map && !polymorphic_map.empty?
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
def to_value_for(model)
|
|
294
|
+
if delegate
|
|
295
|
+
model.public_send(delegate).public_send(to)
|
|
296
|
+
else
|
|
297
|
+
return if to.nil?
|
|
298
|
+
|
|
299
|
+
model.public_send(to)
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Arity of a custom (from:/to:) method, memoized per class+method:
|
|
304
|
+
# the reflection (method()/parameters) allocated per call and ran
|
|
305
|
+
# per value in the serialize/deserialize hot loops (42% of a
|
|
306
|
+
# custom-heavy to_json profile).
|
|
307
|
+
def self.custom_method_arity(klass, method_name)
|
|
308
|
+
per_klass = (@custom_method_arities ||= {}.compare_by_identity)
|
|
309
|
+
cache = (per_klass[klass] ||= {}.compare_by_identity)
|
|
310
|
+
cached = cache[method_name]
|
|
311
|
+
return cached if cached
|
|
312
|
+
|
|
313
|
+
begin
|
|
314
|
+
arity = klass.instance_method(method_name).parameters.size
|
|
315
|
+
rescue NameError
|
|
316
|
+
arity = nil
|
|
317
|
+
end
|
|
318
|
+
cache[method_name] = arity
|
|
319
|
+
arity
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
def serialize(model, parent = nil, doc = nil, context = nil)
|
|
323
|
+
if custom_methods[:to]
|
|
324
|
+
to_method = custom_methods[:to]
|
|
325
|
+
# lutaml-model#550: custom methods may declare a fourth
|
|
326
|
+
# context parameter to receive the options passed to `to_*`.
|
|
327
|
+
if self.class.custom_method_arity(model.class, to_method).to_i >= 4
|
|
328
|
+
model.public_send(to_method, model, parent, doc, context)
|
|
329
|
+
else
|
|
330
|
+
model.public_send(to_method, model, parent, doc)
|
|
331
|
+
end
|
|
332
|
+
else
|
|
333
|
+
value = to_value_for(model)
|
|
334
|
+
|
|
335
|
+
# Handle Reference types - extract the key for serialization
|
|
336
|
+
# This ensures references serialize as their key, not the resolved object
|
|
337
|
+
if value.is_a?(Lutaml::Model::Type::Reference)
|
|
338
|
+
value = value.key
|
|
339
|
+
elsif value.is_a?(Array)
|
|
340
|
+
# Handle collection of references
|
|
341
|
+
value = value.map do |v|
|
|
342
|
+
v.is_a?(Lutaml::Model::Type::Reference) ? v.key : v
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
value
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
def deserialize(model, value, attributes, mapper_class = nil,
|
|
351
|
+
context = nil, pre_cast: false)
|
|
352
|
+
if @needs_full_deserialize
|
|
353
|
+
handle_custom_method(model, value, mapper_class, context) ||
|
|
354
|
+
handle_delegate(model, value, attributes) ||
|
|
355
|
+
handle_transform_method(model, value, attributes, context,
|
|
356
|
+
pre_cast: pre_cast)
|
|
357
|
+
else
|
|
358
|
+
handle_transform_method(model, value, attributes, context,
|
|
359
|
+
pre_cast: pre_cast)
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Static per rule: placeholder `__name__` targets and inferred
|
|
364
|
+
# custom-method targets without an attribute type never change —
|
|
365
|
+
# the applier asked this per element and paid two to_s strings
|
|
366
|
+
# each time (240k allocations on the ISO-13849 serialize profile).
|
|
367
|
+
# Rules may be frozen, so no per-instance memo: one to_s instead
|
|
368
|
+
# of two is the frozen-safe diet.
|
|
369
|
+
# Discriminator pairs this rule selects (and re-emits) on, empty
|
|
370
|
+
# for an ordinary rule.
|
|
371
|
+
def when_attribute
|
|
372
|
+
@when_attribute ||= {}.freeze
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
def when_attribute?
|
|
376
|
+
!when_attribute.empty?
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
def custom_method_only?
|
|
380
|
+
name = attribute_name.to_s
|
|
381
|
+
(name.start_with?("__") && name.end_with?("__")) ||
|
|
382
|
+
(has_custom_methods? && attribute_type.nil?)
|
|
383
|
+
end
|
|
384
|
+
|
|
385
|
+
def has_custom_method_for_serialization?
|
|
386
|
+
!custom_methods.empty? && custom_methods[:to]
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
def has_custom_method_for_deserialization?
|
|
390
|
+
!custom_methods.empty? && custom_methods[:from]
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
def multiple_mappings?
|
|
394
|
+
name.is_a?(Array)
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
def raw_mapping?
|
|
398
|
+
name == Constants::RAW_MAPPING_KEY
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
def eql?(other)
|
|
402
|
+
other.class == self.class &&
|
|
403
|
+
instance_variables.all? do |var|
|
|
404
|
+
instance_variable_get(var) == other.instance_variable_get(var)
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
alias == eql?
|
|
408
|
+
|
|
409
|
+
def deep_dup
|
|
410
|
+
raise NotImplementedError, "Subclasses must implement `deep_dup`."
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# Raw value_map hash access (for compiled rules).
|
|
414
|
+
# Use value_map(key, options) for individual lookups with overrides.
|
|
415
|
+
def raw_value_map
|
|
416
|
+
@value_map
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
def value_map(key, options = {})
|
|
420
|
+
# Fast path: when no overrides, return cached value directly
|
|
421
|
+
# Callers MUST NOT mutate the returned hash
|
|
422
|
+
if !options[:nil] && !options[:empty] && !options[:omitted]
|
|
423
|
+
return @value_map[key]
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
# Slow path: merge overrides (only when options have actual values)
|
|
427
|
+
overrides = {
|
|
428
|
+
nil: options[:nil],
|
|
429
|
+
empty: options[:empty],
|
|
430
|
+
omitted: options[:omitted],
|
|
431
|
+
}.compact
|
|
432
|
+
|
|
433
|
+
@value_map[key].merge(overrides)
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
def transform_value(attribute, value, read_method, format)
|
|
437
|
+
# Fast path: no transforms at all (covers 95%+ of rules)
|
|
438
|
+
# transform defaults to {}, so check for actual content, not just truthiness
|
|
439
|
+
has_rule_transform = transform.is_a?(Class)
|
|
440
|
+
has_attr_transform = attribute&.transform.is_a?(Class)
|
|
441
|
+
return value unless has_rule_transform || has_attr_transform
|
|
442
|
+
|
|
443
|
+
transformers = get_transformers(attribute)
|
|
444
|
+
transformers = transformers.reverse if read_method == :to
|
|
445
|
+
|
|
446
|
+
return value if transformers.empty? || transformers.none? do |t|
|
|
447
|
+
t.can_transform?(read_method, format)
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
# Apply transformers in sequence
|
|
451
|
+
transformers.reduce(value) do |v, transformer|
|
|
452
|
+
if transformer.is_a?(Class) && transformer < Lutaml::Model::ValueTransformer
|
|
453
|
+
# Call class method directly: NameTransformer.from(value, :json)
|
|
454
|
+
else
|
|
455
|
+
# Hash/proc transformer
|
|
456
|
+
end
|
|
457
|
+
transformer.public_send(read_method, v, format)
|
|
458
|
+
end
|
|
459
|
+
end
|
|
460
|
+
|
|
461
|
+
def can_transform_to?(attribute, format)
|
|
462
|
+
get_transformers(attribute).any? { |t| t.can_transform?(:to, format) }
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# Frozen empty array for the common case of no transformers
|
|
466
|
+
EMPTY_TRANSFORMERS = [].freeze
|
|
467
|
+
|
|
468
|
+
# Verdict for handle_transform_method's dispatch, computed once per
|
|
469
|
+
# (rule, attribute) — both are static after definition, but rules may
|
|
470
|
+
# be frozen, so the memo lives at class level keyed on identity.
|
|
471
|
+
# :assign — no transformer runs on deserialize (fast path);
|
|
472
|
+
# :import — hash/proc transformers go through ImportTransformer.
|
|
473
|
+
TRANSFORM_DISPATCH = {}.compare_by_identity
|
|
474
|
+
|
|
475
|
+
def self.parsed_assign_writer(model_class, target)
|
|
476
|
+
key = [model_class, target]
|
|
477
|
+
writer = PARSED_ASSIGN_WRITERS[key]
|
|
478
|
+
return writer unless writer.nil?
|
|
479
|
+
|
|
480
|
+
name = :"__assign_parsed_#{target}="
|
|
481
|
+
writer = model_class.method_defined?(name) ? name : false
|
|
482
|
+
PARSED_ASSIGN_WRITERS[key] = writer
|
|
483
|
+
writer
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
# [model class, target] -> the parsed-assign writer compiled for
|
|
487
|
+
# that class's attribute, or nil when only a casting writer
|
|
488
|
+
# exists (custom writers, reflective names, enum shorthands).
|
|
489
|
+
# Class-level because mapping rules may be frozen (see the
|
|
490
|
+
# name-string note above TRANSFORM_DISPATCH). Concurrent::Map
|
|
491
|
+
# under threaded MRI, plain identity Hash under Opal — writes are
|
|
492
|
+
# idempotent (the same verdict is recomputed).
|
|
493
|
+
PARSED_ASSIGN_WRITERS = if Lutaml::Model.opal?
|
|
494
|
+
{}.compare_by_identity
|
|
495
|
+
else
|
|
496
|
+
Lutaml::Model::RuntimeCompatibility
|
|
497
|
+
.require_native("concurrent")
|
|
498
|
+
Concurrent::Map.new
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
def self.transform_dispatch(rule, attr)
|
|
502
|
+
per_attr = TRANSFORM_DISPATCH[rule]
|
|
503
|
+
if per_attr.nil?
|
|
504
|
+
per_attr = {}.compare_by_identity
|
|
505
|
+
TRANSFORM_DISPATCH[rule] = per_attr
|
|
506
|
+
end
|
|
507
|
+
verdict = per_attr[attr]
|
|
508
|
+
return verdict if verdict
|
|
509
|
+
|
|
510
|
+
rule_transform = rule.transform
|
|
511
|
+
# NB: `::Hash` — inside Lutaml::Model the bare constant `Hash` is
|
|
512
|
+
# the hash-format adapter class, so a plain is_a?(Hash) is always
|
|
513
|
+
# false here (the original dispatch shared that shadow and never
|
|
514
|
+
# took the hash-transform branch).
|
|
515
|
+
rule_has = rule_transform.is_a?(Class) ||
|
|
516
|
+
(rule_transform.is_a?(::Hash) && !rule_transform.empty?)
|
|
517
|
+
attr_transform = attr&.transform
|
|
518
|
+
attr_has = attr_transform &&
|
|
519
|
+
(attr_transform.is_a?(Class) ||
|
|
520
|
+
(attr_transform.is_a?(::Hash) && !attr_transform.empty?))
|
|
521
|
+
|
|
522
|
+
verdict = if !rule_has && !attr_has
|
|
523
|
+
:assign
|
|
524
|
+
elsif rule.get_transformers(attr).any? do |t|
|
|
525
|
+
t.is_a?(Class) && t < Lutaml::Model::ValueTransformer
|
|
526
|
+
end
|
|
527
|
+
:assign
|
|
528
|
+
else
|
|
529
|
+
:import
|
|
530
|
+
end
|
|
531
|
+
per_attr[attr] = verdict
|
|
532
|
+
verdict
|
|
533
|
+
end
|
|
534
|
+
|
|
535
|
+
def get_transformers(attribute)
|
|
536
|
+
# Fast path: most rules have no transforms at all
|
|
537
|
+
rule_transform = transform
|
|
538
|
+
attr_transform = attribute&.transform
|
|
539
|
+
|
|
540
|
+
if !rule_transform && !attr_transform
|
|
541
|
+
return EMPTY_TRANSFORMERS
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
# Build transformer list only when needed
|
|
545
|
+
transformers = []
|
|
546
|
+
transformers << rule_transform if rule_transform
|
|
547
|
+
transformers << attr_transform if attr_transform
|
|
548
|
+
transformers.select! { |t| t.is_a?(Class) }
|
|
549
|
+
transformers.freeze
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
private
|
|
553
|
+
|
|
554
|
+
# if value is nil and render nil is false, will not render
|
|
555
|
+
# if value is empty and render empty is false, will not render
|
|
556
|
+
# if value is uninitialized and render omitted is false, will not render
|
|
557
|
+
def invalid_value?(value, options)
|
|
558
|
+
if value.nil?
|
|
559
|
+
!render_nil?(options)
|
|
560
|
+
elsif Utils.empty?(value)
|
|
561
|
+
!render_empty?(options)
|
|
562
|
+
elsif Utils.uninitialized?(value)
|
|
563
|
+
!render_omitted?(options)
|
|
564
|
+
else
|
|
565
|
+
false
|
|
566
|
+
end
|
|
567
|
+
end
|
|
568
|
+
|
|
569
|
+
# Pooled invokers for symbol/string custom methods, keyed by
|
|
570
|
+
# [mapper class, method]. The receiver is stateless in the #550
|
|
571
|
+
# contract — it receives the model and value as arguments — but a
|
|
572
|
+
# fresh mapper_class.new per rule application ran the full
|
|
573
|
+
# Serializable constructor chain on every call (33% of a YAML
|
|
574
|
+
# materialization profile on the glossarist corpus). One receiver
|
|
575
|
+
# per (class, method) is pooled, with the arity probe resolved
|
|
576
|
+
# once alongside it. A custom method that stashes instance state
|
|
577
|
+
# on the receiver would observe cross-call persistence — today's
|
|
578
|
+
# fresh receiver discarded that state between calls, so such
|
|
579
|
+
# methods were already broken call-over-call.
|
|
580
|
+
def custom_method_invokers
|
|
581
|
+
@custom_method_invokers ||= {}
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
def custom_method_invoker(mapper_class, custom)
|
|
585
|
+
custom_method_invokers[[mapper_class, custom]] ||= begin
|
|
586
|
+
receiver = mapper_class.new
|
|
587
|
+
{ receiver: receiver,
|
|
588
|
+
context_arity:
|
|
589
|
+
self.class.custom_method_arity(receiver.class, custom).to_i >= 3 }
|
|
590
|
+
end
|
|
591
|
+
end
|
|
592
|
+
|
|
593
|
+
def handle_custom_method(model, value, mapper_class, context = nil)
|
|
594
|
+
custom = custom_methods[:from]
|
|
595
|
+
return if !custom || value.nil?
|
|
596
|
+
|
|
597
|
+
if custom.is_a?(String) || custom.is_a?(Symbol)
|
|
598
|
+
invoker = custom_method_invoker(mapper_class, custom)
|
|
599
|
+
# lutaml-model#550: custom methods may declare a third context
|
|
600
|
+
# parameter to receive the options passed to `from_*`.
|
|
601
|
+
if invoker[:context_arity]
|
|
602
|
+
invoker[:receiver].public_send(custom, model, value, context)
|
|
603
|
+
else
|
|
604
|
+
invoker[:receiver].public_send(custom, model, value)
|
|
605
|
+
end
|
|
606
|
+
else
|
|
607
|
+
# Callable (proc/lambda): transforms the value and the rule
|
|
608
|
+
# assigns it. Exact arity 2 receives the `from_*` context.
|
|
609
|
+
transformed = if custom.arity == 2
|
|
610
|
+
custom.call(value, context)
|
|
611
|
+
else
|
|
612
|
+
custom.call(value)
|
|
613
|
+
end
|
|
614
|
+
assign_value(model, transformed)
|
|
615
|
+
end
|
|
616
|
+
true
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
def handle_delegate(model, value, attributes)
|
|
620
|
+
return unless delegate
|
|
621
|
+
|
|
622
|
+
handle_nil_or_uninitialized(model, attributes)
|
|
623
|
+
assign_value(model.public_send(delegate), value)
|
|
624
|
+
true
|
|
625
|
+
end
|
|
626
|
+
|
|
627
|
+
def handle_nil_or_uninitialized(model, attributes)
|
|
628
|
+
delegate_value = model.public_send(delegate)
|
|
629
|
+
return if Utils.initialized?(delegate_value) && !delegate_value.nil?
|
|
630
|
+
|
|
631
|
+
model.public_send(:"#{delegate}=",
|
|
632
|
+
attributes[delegate].type(model.lutaml_register).new)
|
|
633
|
+
end
|
|
634
|
+
|
|
635
|
+
def handle_transform_method(model, value, attributes, context = nil,
|
|
636
|
+
pre_cast: false)
|
|
637
|
+
attr = attributes[to]
|
|
638
|
+
# The transform verdict (none / class-based already applied /
|
|
639
|
+
# hash-proc via ImportTransformer) is static per (rule, attr) —
|
|
640
|
+
# it was recomputed with is_a? chains on every rule application
|
|
641
|
+
# (16.8 M Kernel#is_a? per ISO-13849 parse across the walk).
|
|
642
|
+
if self.class.transform_dispatch(self, attr) == :import
|
|
643
|
+
transformed = ImportTransformer.call(value, self, attr,
|
|
644
|
+
context: context)
|
|
645
|
+
assign_value(model, transformed)
|
|
646
|
+
elsif pre_cast && collection_shaped?(value, attr) &&
|
|
647
|
+
(writer = self.class.parsed_assign_writer(model.class, to))
|
|
648
|
+
# TODO.max-perf/31: the deserializing transform already cast
|
|
649
|
+
# the value through the format-aware path — assign without
|
|
650
|
+
# repeating the cast. Custom writers and reflective names
|
|
651
|
+
# resolve nil here and keep the casting setter.
|
|
652
|
+
model.public_send(writer, value)
|
|
653
|
+
else
|
|
654
|
+
assign_value(model, value)
|
|
655
|
+
end
|
|
656
|
+
true
|
|
657
|
+
end
|
|
658
|
+
|
|
659
|
+
# Whether the value already carries the attribute's final shape:
|
|
660
|
+
# a bare single occurrence still owes the setter's one-element
|
|
661
|
+
# collection coercion, so only collection instances (and every
|
|
662
|
+
# singular value, whose cast is complete) take the no-recast lane.
|
|
663
|
+
def collection_shaped?(value, attr)
|
|
664
|
+
attr.nil? || !attr.collection? || value.is_a?(::Array) ||
|
|
665
|
+
value.is_a?(Lutaml::Model::Collection)
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
def assign_value(model, value)
|
|
669
|
+
model.public_send(@setter_name, value)
|
|
670
|
+
end
|
|
671
|
+
end
|
|
672
|
+
end
|
|
673
|
+
end
|