lutaml-model 0.8.203 → 0.8.204
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/.gitattributes +5 -0
- data/.github/workflows/lml-conformance.yml +71 -0
- data/.gitignore +7 -0
- data/README.adoc +1 -0
- data/docs/_guides/lml-cross-language.adoc +128 -0
- data/docs/_references/lml-conformance.adoc +78 -0
- data/docs/_references/lml-contract.adoc +290 -0
- data/lib/lutaml/model/lml/artifact_verifier.rb +205 -0
- data/lib/lutaml/model/lml/bundle.rb +171 -0
- data/lib/lutaml/model/lml/document.rb +46 -10
- data/lib/lutaml/model/lml/document_validator.rb +840 -0
- data/lib/lutaml/model/lml/exporter/v1_projector.rb +102 -0
- data/lib/lutaml/model/lml/exporter/v2_projector.rb +401 -0
- data/lib/lutaml/model/lml/exporter.rb +223 -87
- data/lib/lutaml/model/lml/graph_exporter.rb +248 -0
- data/lib/lutaml/model/lml/importer.rb +180 -0
- data/lib/lutaml/model/lml/mapping_compiler.rb +401 -0
- data/lib/lutaml/model/lml/materialization.rb +257 -0
- data/lib/lutaml/model/lml/ordered_content.rb +577 -0
- data/lib/lutaml/model/lml/portable_json.rb +385 -0
- data/lib/lutaml/model/lml/rejected_error.rb +64 -15
- data/lib/lutaml/model/lml/round_trip.rb +86 -0
- data/lib/lutaml/model/lml/value_declarations.rb +84 -0
- data/lib/lutaml/model/lml.rb +61 -0
- data/lib/lutaml/model/schema/definitions/attribute.rb +4 -2
- data/lib/lutaml/model/schema/registry_generator.rb +1 -1
- data/lib/lutaml/model/schema/renderers/member_decls.rb +1 -0
- data/lib/lutaml/model/schema/xml_compiler/spec_builder/members.rb +10 -0
- data/lib/lutaml/model/sequence.rb +7 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/xml/leptris/native_emission.rb +4 -0
- data/lib/lutaml/xml/leptris/plan_serializer.rb +14 -9
- data/schema/lml/document.schema.json +179 -0
- data/scripts/lml/export_choices.rb +57 -0
- data/scripts/lml/export_conformance.rb +23 -0
- data/scripts/lml/export_mml.rb +253 -0
- data/scripts/lml/export_preservation.rb +421 -0
- data/scripts/lml/verify_artifacts.rb +31 -0
- data/spec/fixtures/lml_artifacts/model.json +1 -0
- data/spec/fixtures/lml_artifacts/valid.json +1 -0
- data/spec/fixtures/lml_artifacts/valid.sha256 +1 -0
- data/spec/fixtures/lml_conformance/core/index.json +1 -0
- data/spec/fixtures/lml_conformance/core/manifest.json +1 -0
- data/spec/fixtures/lml_conformance/core/schema.json +1 -0
- data/spec/fixtures/lml_conformance/core/schema.yaml +79 -0
- data/spec/fixtures/lml_conformance/float_vectors.generator.rb +60 -0
- data/spec/fixtures/lml_conformance/float_vectors.json +21550 -0
- data/spec/fixtures/lml_conformance/preservation/index.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/manifest.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/schema.json +1 -0
- data/spec/fixtures/lml_conformance/preservation/schema.yaml +319 -0
- data/spec/fixtures/lml_conformance/r2_refusals.generator.rb +153 -0
- data/spec/fixtures/lml_conformance/r2_refusals.json +1662 -0
- data/spec/fixtures/lml_conformance/ruby_portable_interop.generator.rb +40 -0
- data/spec/fixtures/lml_conformance/ruby_portable_interop.json +1 -0
- data/spec/fixtures/lml_contract/bundle.json +81 -0
- data/spec/fixtures/lml_contract/manifest.json +30 -0
- data/spec/fixtures/lml_contract/v1_unit.canonical.json +1 -0
- data/spec/fixtures/lml_contract/v1_unit.json +1 -0
- data/spec/fixtures/lml_contract/v2_node.canonical.json +1 -0
- data/spec/fixtures/lml_contract/v2_node.json +32 -0
- data/spec/fixtures/lml_mml/inventory.json +1 -0
- data/spec/fixtures/lml_mml/manifest.json +1 -0
- data/spec/fixtures/lml_mml/oracle.json +1 -0
- data/spec/fixtures/lml_mml/v3-mi-mixed.json +1 -0
- data/spec/fixtures/lml_mml/v3-mi-mixed.yaml +970 -0
- data/spec/fixtures/lml_mml/v4-mi-mixed.json +1 -0
- data/spec/fixtures/lml_mml/v4-mi-mixed.yaml +1516 -0
- data/spec/fixtures/lml_mml_materialization/replay.rb +37 -0
- data/spec/lutaml/model/lml_any_attribute_spec.rb +91 -0
- data/spec/lutaml/model/lml_artifact_verifier_spec.rb +86 -0
- data/spec/lutaml/model/lml_builtin_types_spec.rb +49 -0
- data/spec/lutaml/model/lml_conformance_spec.rb +178 -0
- data/spec/lutaml/model/lml_document_spec.rb +279 -0
- data/spec/lutaml/model/lml_export_validation_spec.rb +96 -0
- data/spec/lutaml/model/lml_exporter_spec.rb +127 -5
- data/spec/lutaml/model/lml_graph_exporter_spec.rb +205 -0
- data/spec/lutaml/model/lml_importer_spec.rb +290 -0
- data/spec/lutaml/model/lml_input_hardening_spec.rb +156 -0
- data/spec/lutaml/model/lml_mapping_compiler_spec.rb +256 -0
- data/spec/lutaml/model/lml_materialization_spec.rb +138 -0
- data/spec/lutaml/model/lml_mml_materialization_spec.rb +54 -0
- data/spec/lutaml/model/lml_mml_pilot_spec.rb +150 -0
- data/spec/lutaml/model/lml_model_choices_spec.rb +88 -0
- data/spec/lutaml/model/lml_ordered_content_spec.rb +243 -0
- data/spec/lutaml/model/lml_portable_json_spec.rb +310 -0
- data/spec/lutaml/model/lml_preservation_spec.rb +211 -0
- data/spec/lutaml/model/lml_review_export_spec.rb +247 -0
- data/spec/lutaml/model/lml_review_import_spec.rb +390 -0
- data/spec/lutaml/model/lml_review_misc_spec.rb +152 -0
- data/spec/lutaml/model/lml_review_round4_spec.rb +200 -0
- data/spec/lutaml/model/lml_review_round5_spec.rb +194 -0
- data/spec/lutaml/model/lml_ruby_interop_fixture_spec.rb +37 -0
- data/spec/lutaml/model/lml_shared_corpus_spec.rb +132 -0
- data/spec/lutaml/model/lml_value_declarations_spec.rb +128 -0
- data/spec/lutaml/model/schema/class_loader_spec.rb +51 -0
- data/spec/lutaml/model/schema/xml_compiler_runtime_spec.rb +20 -0
- data/spec/lutaml/model/sequence_spec.rb +48 -0
- data/spec/lutaml/xml/cdata_emission_spec.rb +68 -0
- data/spec/support/lml_any_attribute_fixtures.rb +26 -0
- data/spec/support/lml_conformance.rb +292 -0
- data/spec/support/lml_corpus.rb +75 -0
- data/spec/support/lml_export_fixtures.rb +190 -0
- data/spec/support/lml_graph_fixtures.rb +108 -0
- data/spec/support/lml_import_fixtures.rb +52 -0
- data/spec/support/lml_mapping_fixtures.rb +170 -0
- data/spec/support/lml_materialization_fixtures.rb +53 -0
- data/spec/support/lml_model_choices_fixtures.rb +150 -0
- data/spec/support/lml_order_fixtures.rb +151 -0
- metadata +92 -2
- data/lib/lutaml/model/schema/schema_builder/nokogiri.rb +0 -41
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
require "lutaml/model/lml"
|
|
5
|
+
|
|
6
|
+
module LmlModelChoicesFixtures
|
|
7
|
+
class Plain < Lutaml::Model::Serializable
|
|
8
|
+
choice(min: 1, max: 1) do
|
|
9
|
+
attribute :a, :string
|
|
10
|
+
attribute :b, :string
|
|
11
|
+
end
|
|
12
|
+
json do
|
|
13
|
+
map "a", to: :a
|
|
14
|
+
map "b", to: :b
|
|
15
|
+
end
|
|
16
|
+
xml do
|
|
17
|
+
root "choice"
|
|
18
|
+
map_element "a", to: :a
|
|
19
|
+
map_element "b", to: :b
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class Nested < Lutaml::Model::Serializable
|
|
24
|
+
choice(min: 1, max: 1) do
|
|
25
|
+
choice(min: 1, max: 1) do
|
|
26
|
+
attribute :a, :string
|
|
27
|
+
attribute :b, :string
|
|
28
|
+
end
|
|
29
|
+
attribute :c, :string
|
|
30
|
+
end
|
|
31
|
+
json do
|
|
32
|
+
map "a", to: :a
|
|
33
|
+
map "b", to: :b
|
|
34
|
+
map "c", to: :c
|
|
35
|
+
end
|
|
36
|
+
xml do
|
|
37
|
+
root "choice"
|
|
38
|
+
map_element "a", to: :a
|
|
39
|
+
map_element "b", to: :b
|
|
40
|
+
map_element "c", to: :c
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class OptionalCollection < Lutaml::Model::Serializable
|
|
45
|
+
choice(min: 1, max: 1) do
|
|
46
|
+
attribute :a, :string, collection: 0..2
|
|
47
|
+
attribute :b, :string
|
|
48
|
+
end
|
|
49
|
+
json do
|
|
50
|
+
map "a", to: :a
|
|
51
|
+
map "b", to: :b
|
|
52
|
+
end
|
|
53
|
+
xml do
|
|
54
|
+
root "choice"
|
|
55
|
+
map_element "a", to: :a
|
|
56
|
+
map_element "b", to: :b
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class BooleanMember < Lutaml::Model::Serializable
|
|
61
|
+
choice(min: 1, max: 1) do
|
|
62
|
+
attribute :a, :boolean
|
|
63
|
+
attribute :b, :string
|
|
64
|
+
end
|
|
65
|
+
json do
|
|
66
|
+
map "a", to: :a
|
|
67
|
+
map "b", to: :b
|
|
68
|
+
end
|
|
69
|
+
xml do
|
|
70
|
+
root "choice"
|
|
71
|
+
map_element "a", to: :a
|
|
72
|
+
map_element "b", to: :b
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
module LmlModelChoicesFixtures
|
|
78
|
+
class Renderable < Lutaml::Model::Serializable
|
|
79
|
+
choice(min: 1, max: 1) do
|
|
80
|
+
attribute :a, :string
|
|
81
|
+
attribute :b, :string
|
|
82
|
+
end
|
|
83
|
+
json do
|
|
84
|
+
map "a", to: :a
|
|
85
|
+
map "b", to: :b
|
|
86
|
+
end
|
|
87
|
+
xml do
|
|
88
|
+
root "choice"
|
|
89
|
+
map_element "a", to: :a, render_empty: true
|
|
90
|
+
map_element "b", to: :b, render_empty: true
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
class Unbounded < Lutaml::Model::Serializable
|
|
95
|
+
choice(min: 1, max: Float::INFINITY) do
|
|
96
|
+
attribute :a, :string, collection: 1..2
|
|
97
|
+
attribute :b, :string
|
|
98
|
+
end
|
|
99
|
+
json do
|
|
100
|
+
map "a", to: :a
|
|
101
|
+
map "b", to: :b
|
|
102
|
+
end
|
|
103
|
+
xml do
|
|
104
|
+
root "choice"
|
|
105
|
+
map_element "a", to: :a
|
|
106
|
+
map_element "b", to: :b
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
class NestedOptional < Lutaml::Model::Serializable
|
|
111
|
+
choice(min: 1, max: 1) do
|
|
112
|
+
choice(min: 0, max: 1) do
|
|
113
|
+
attribute :a, :string
|
|
114
|
+
attribute :b, :string
|
|
115
|
+
end
|
|
116
|
+
attribute :c, :string
|
|
117
|
+
end
|
|
118
|
+
json do
|
|
119
|
+
map "a", to: :a
|
|
120
|
+
map "b", to: :b
|
|
121
|
+
map "c", to: :c
|
|
122
|
+
end
|
|
123
|
+
xml do
|
|
124
|
+
root "choice"
|
|
125
|
+
map_element "a", to: :a
|
|
126
|
+
map_element "b", to: :b
|
|
127
|
+
map_element "c", to: :c
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
class Parent < Lutaml::Model::Serializable
|
|
132
|
+
attribute :child, Plain
|
|
133
|
+
json { map "child", to: :child }
|
|
134
|
+
xml do
|
|
135
|
+
root "parent"
|
|
136
|
+
map_element "child", to: :child
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
CASES = {
|
|
140
|
+
"Plain" => [{}, { a: nil }, { a: "" }, { a: " " }, { a: "x" }, { b: "y" }, { a: "x", b: "y" }],
|
|
141
|
+
"Nested" => [{}, { a: "x" }, { b: "y" }, { c: "z" }, { a: "x", b: "y" }, { a: "x", c: "z" }],
|
|
142
|
+
"OptionalCollection" => [{}, { a: [] }, { a: ["x"] }, { a: ["x", "y"] }, { a: ["x", "y", "z"] }, { b: "y" }, { a: ["x"], b: "y" }],
|
|
143
|
+
"BooleanMember" => [{}, { a: false }, { a: true }, { a: false, b: "y" }],
|
|
144
|
+
}.merge(
|
|
145
|
+
"Renderable" => [{}, { a: "" }, { a: "", b: "" }],
|
|
146
|
+
"Unbounded" => [{}, { a: [] }, { a: ["x"] }, { a: ["x", "y", "z"] }, { a: ["x"], b: "y" }],
|
|
147
|
+
"NestedOptional" => [{}, { a: "x" }, { c: "z" }, { a: "x", b: "y" }, { a: "x", c: "z" }],
|
|
148
|
+
"Parent" => [{}, { child: {} }, { child: { a: "x" } }, { child: { a: "x", b: "y" } }],
|
|
149
|
+
).freeze
|
|
150
|
+
end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
# Named fixtures for LML ordered-content capture/apply specs. The LML
|
|
6
|
+
# document addresses models by class path, so they must be nameable.
|
|
7
|
+
module LmlOrderFixtures
|
|
8
|
+
class NsA < Lutaml::Xml::Namespace
|
|
9
|
+
uri "urn:lml-order:a"
|
|
10
|
+
prefix_default "a"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class NsB < Lutaml::Xml::Namespace
|
|
14
|
+
uri "urn:lml-order:b"
|
|
15
|
+
prefix_default "b"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class Emphasis < Lutaml::Model::Serializable
|
|
19
|
+
attribute :value, :string
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
element "em"
|
|
23
|
+
map_content to: :value
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Mixed content: repeated interleaved elements, text and CDATA.
|
|
28
|
+
class Para < Lutaml::Model::Serializable
|
|
29
|
+
attribute :em, Emphasis, collection: true
|
|
30
|
+
attribute :bold, :string, collection: true
|
|
31
|
+
attribute :note, :string
|
|
32
|
+
attribute :text, :string, collection: true
|
|
33
|
+
|
|
34
|
+
xml do
|
|
35
|
+
element "p"
|
|
36
|
+
mixed_content
|
|
37
|
+
map_element "em", to: :em
|
|
38
|
+
map_element "b", to: :bold
|
|
39
|
+
map_element "note", to: :note
|
|
40
|
+
map_content to: :text
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Element-only `ordered` model with repeated interleaved elements.
|
|
45
|
+
class Transport < Lutaml::Model::Serializable
|
|
46
|
+
attribute :car, :string, collection: true
|
|
47
|
+
attribute :boat, :string, collection: true
|
|
48
|
+
|
|
49
|
+
xml do
|
|
50
|
+
element "transportation"
|
|
51
|
+
ordered
|
|
52
|
+
map_element "car", to: :car
|
|
53
|
+
map_element "boat", to: :boat
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class ItemA < Lutaml::Model::Serializable
|
|
58
|
+
attribute :value, :string
|
|
59
|
+
|
|
60
|
+
xml do
|
|
61
|
+
element "item"
|
|
62
|
+
namespace NsA
|
|
63
|
+
map_content to: :value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class ItemB < Lutaml::Model::Serializable
|
|
68
|
+
attribute :value, :string
|
|
69
|
+
|
|
70
|
+
xml do
|
|
71
|
+
element "item"
|
|
72
|
+
namespace NsB
|
|
73
|
+
map_content to: :value
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Two same-named elements told apart only by namespace.
|
|
78
|
+
class Namespaced < Lutaml::Model::Serializable
|
|
79
|
+
attribute :a_items, ItemA, collection: true
|
|
80
|
+
attribute :b_items, ItemB, collection: true
|
|
81
|
+
|
|
82
|
+
xml do
|
|
83
|
+
element "root"
|
|
84
|
+
namespace NsA
|
|
85
|
+
ordered
|
|
86
|
+
map_element "item", to: :a_items
|
|
87
|
+
map_element "item", to: :b_items
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# An element member whose output is produced by a custom method.
|
|
92
|
+
class ImperativeRule < Lutaml::Model::Serializable
|
|
93
|
+
attribute :car, :string, collection: true
|
|
94
|
+
|
|
95
|
+
xml do
|
|
96
|
+
element "imperative"
|
|
97
|
+
ordered
|
|
98
|
+
map_element "car", to: :car, with: { to: :car_to_xml, from: :car_from_xml }
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def car_to_xml(_model, _parent, _doc); end
|
|
102
|
+
|
|
103
|
+
def car_from_xml(model, value)
|
|
104
|
+
model.car = Array(value)
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# A class that generates its own element order.
|
|
109
|
+
class ImperativeOrder < Lutaml::Model::Serializable
|
|
110
|
+
attribute :car, :string, collection: true
|
|
111
|
+
|
|
112
|
+
xml do
|
|
113
|
+
element "imperative"
|
|
114
|
+
ordered
|
|
115
|
+
map_element "car", to: :car
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def element_order
|
|
119
|
+
Array(car).map { |_| Lutaml::Xml::Element.new("Element", "car") }
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
class ReservedMember < Lutaml::Model::Serializable
|
|
124
|
+
attribute :__lml_content, :string, collection: true
|
|
125
|
+
attribute :car, :string
|
|
126
|
+
|
|
127
|
+
xml do
|
|
128
|
+
element "reserved"
|
|
129
|
+
ordered
|
|
130
|
+
map_element "car", to: :car
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# No per-instance order at all.
|
|
135
|
+
class Plain < Lutaml::Model::Serializable
|
|
136
|
+
attribute :car, :string
|
|
137
|
+
|
|
138
|
+
xml do
|
|
139
|
+
element "plain"
|
|
140
|
+
map_element "car", to: :car
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
PARA_XML = "<p>hi <em>a</em> mid <![CDATA[cd]]> <b>x</b><em>b</em> " \
|
|
145
|
+
"<note>n</note> tail</p>"
|
|
146
|
+
TRANSPORT_XML = "<transportation><car>1</car><boat>2</boat><car>3</car>" \
|
|
147
|
+
"<boat>4</boat><car>5</car></transportation>"
|
|
148
|
+
NAMESPACED_XML = '<a:root xmlns:a="urn:lml-order:a" xmlns:b="urn:lml-order:b">' \
|
|
149
|
+
"<a:item>1</a:item><b:item>2</b:item><a:item>3</a:item>" \
|
|
150
|
+
"<b:item>4</b:item></a:root>"
|
|
151
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.204
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -168,6 +168,7 @@ extensions: []
|
|
|
168
168
|
extra_rdoc_files: []
|
|
169
169
|
files:
|
|
170
170
|
- ".envrc"
|
|
171
|
+
- ".gitattributes"
|
|
171
172
|
- ".github/scripts/test_installed_gem.rb"
|
|
172
173
|
- ".github/workflows/dependent-repos-todo.json"
|
|
173
174
|
- ".github/workflows/dependent-repos-tools-informational.json"
|
|
@@ -176,6 +177,7 @@ files:
|
|
|
176
177
|
- ".github/workflows/dependent-tests.yml"
|
|
177
178
|
- ".github/workflows/docs.yml"
|
|
178
179
|
- ".github/workflows/downstream-performance.yml"
|
|
180
|
+
- ".github/workflows/lml-conformance.yml"
|
|
179
181
|
- ".github/workflows/performance.yml"
|
|
180
182
|
- ".github/workflows/rake.yml"
|
|
181
183
|
- ".github/workflows/release.yml"
|
|
@@ -231,6 +233,7 @@ files:
|
|
|
231
233
|
- docs/_guides/jsonld-serialization.adoc
|
|
232
234
|
- docs/_guides/keyvalue-serialization.adoc
|
|
233
235
|
- docs/_guides/liquid-templates.adoc
|
|
236
|
+
- docs/_guides/lml-cross-language.adoc
|
|
234
237
|
- docs/_guides/missing-values-handling.adoc
|
|
235
238
|
- docs/_guides/native-engines.adoc
|
|
236
239
|
- docs/_guides/ooxml-examples.adoc
|
|
@@ -287,6 +290,8 @@ files:
|
|
|
287
290
|
- docs/_references/format-independent-features.adoc
|
|
288
291
|
- docs/_references/index.adoc
|
|
289
292
|
- docs/_references/instance-serialization.adoc
|
|
293
|
+
- docs/_references/lml-conformance.adoc
|
|
294
|
+
- docs/_references/lml-contract.adoc
|
|
290
295
|
- docs/_references/lutaml-namespace-planning.md
|
|
291
296
|
- docs/_references/parent-root-context.adoc
|
|
292
297
|
- docs/_references/plan-schema-spec.adoc
|
|
@@ -634,10 +639,22 @@ files:
|
|
|
634
639
|
- lib/lutaml/model/liquid/indexed_access.rb
|
|
635
640
|
- lib/lutaml/model/liquid/mapping.rb
|
|
636
641
|
- lib/lutaml/model/lml.rb
|
|
642
|
+
- lib/lutaml/model/lml/artifact_verifier.rb
|
|
643
|
+
- lib/lutaml/model/lml/bundle.rb
|
|
637
644
|
- lib/lutaml/model/lml/document.rb
|
|
645
|
+
- lib/lutaml/model/lml/document_validator.rb
|
|
638
646
|
- lib/lutaml/model/lml/exporter.rb
|
|
647
|
+
- lib/lutaml/model/lml/exporter/v1_projector.rb
|
|
648
|
+
- lib/lutaml/model/lml/exporter/v2_projector.rb
|
|
649
|
+
- lib/lutaml/model/lml/graph_exporter.rb
|
|
650
|
+
- lib/lutaml/model/lml/importer.rb
|
|
651
|
+
- lib/lutaml/model/lml/mapping_compiler.rb
|
|
652
|
+
- lib/lutaml/model/lml/materialization.rb
|
|
653
|
+
- lib/lutaml/model/lml/ordered_content.rb
|
|
654
|
+
- lib/lutaml/model/lml/portable_json.rb
|
|
639
655
|
- lib/lutaml/model/lml/rejected_error.rb
|
|
640
656
|
- lib/lutaml/model/lml/round_trip.rb
|
|
657
|
+
- lib/lutaml/model/lml/value_declarations.rb
|
|
641
658
|
- lib/lutaml/model/mapping/listener.rb
|
|
642
659
|
- lib/lutaml/model/mapping/mapping.rb
|
|
643
660
|
- lib/lutaml/model/mapping/mapping_rule.rb
|
|
@@ -711,7 +728,6 @@ files:
|
|
|
711
728
|
- lib/lutaml/model/schema/rng_compiler/member_collector.rb
|
|
712
729
|
- lib/lutaml/model/schema/rng_compiler/rng_helpers.rb
|
|
713
730
|
- lib/lutaml/model/schema/rng_compiler/value_type_resolver.rb
|
|
714
|
-
- lib/lutaml/model/schema/schema_builder/nokogiri.rb
|
|
715
731
|
- lib/lutaml/model/schema/shared_methods.rb
|
|
716
732
|
- lib/lutaml/model/schema/templates.rb
|
|
717
733
|
- lib/lutaml/model/schema/templates/model.erb
|
|
@@ -1114,8 +1130,14 @@ files:
|
|
|
1114
1130
|
- lib/tasks/xml_compiler_benchmark.rb
|
|
1115
1131
|
- lutaml-model.gemspec
|
|
1116
1132
|
- reference-docs/XML Entity Definitions for Characters (3rd Edition).html
|
|
1133
|
+
- schema/lml/document.schema.json
|
|
1117
1134
|
- scripts-xmi-profile/profile_xmi.rb
|
|
1118
1135
|
- scripts-xmi-profile/profile_xmi_simple.rb
|
|
1136
|
+
- scripts/lml/export_choices.rb
|
|
1137
|
+
- scripts/lml/export_conformance.rb
|
|
1138
|
+
- scripts/lml/export_mml.rb
|
|
1139
|
+
- scripts/lml/export_preservation.rb
|
|
1140
|
+
- scripts/lml/verify_artifacts.rb
|
|
1119
1141
|
- sig/lutaml/model.rbs
|
|
1120
1142
|
- spec/address_person_spec.rb
|
|
1121
1143
|
- spec/address_spec.rb
|
|
@@ -1129,6 +1151,37 @@ files:
|
|
|
1129
1151
|
- spec/fixtures/geolexica_v2_sample2.yaml
|
|
1130
1152
|
- spec/fixtures/liquid_templates/_ceramic.liquid
|
|
1131
1153
|
- spec/fixtures/liquid_templates/_ceramics_in_one.liquid
|
|
1154
|
+
- spec/fixtures/lml_artifacts/model.json
|
|
1155
|
+
- spec/fixtures/lml_artifacts/valid.json
|
|
1156
|
+
- spec/fixtures/lml_artifacts/valid.sha256
|
|
1157
|
+
- spec/fixtures/lml_conformance/core/index.json
|
|
1158
|
+
- spec/fixtures/lml_conformance/core/manifest.json
|
|
1159
|
+
- spec/fixtures/lml_conformance/core/schema.json
|
|
1160
|
+
- spec/fixtures/lml_conformance/core/schema.yaml
|
|
1161
|
+
- spec/fixtures/lml_conformance/float_vectors.generator.rb
|
|
1162
|
+
- spec/fixtures/lml_conformance/float_vectors.json
|
|
1163
|
+
- spec/fixtures/lml_conformance/preservation/index.json
|
|
1164
|
+
- spec/fixtures/lml_conformance/preservation/manifest.json
|
|
1165
|
+
- spec/fixtures/lml_conformance/preservation/schema.json
|
|
1166
|
+
- spec/fixtures/lml_conformance/preservation/schema.yaml
|
|
1167
|
+
- spec/fixtures/lml_conformance/r2_refusals.generator.rb
|
|
1168
|
+
- spec/fixtures/lml_conformance/r2_refusals.json
|
|
1169
|
+
- spec/fixtures/lml_conformance/ruby_portable_interop.generator.rb
|
|
1170
|
+
- spec/fixtures/lml_conformance/ruby_portable_interop.json
|
|
1171
|
+
- spec/fixtures/lml_contract/bundle.json
|
|
1172
|
+
- spec/fixtures/lml_contract/manifest.json
|
|
1173
|
+
- spec/fixtures/lml_contract/v1_unit.canonical.json
|
|
1174
|
+
- spec/fixtures/lml_contract/v1_unit.json
|
|
1175
|
+
- spec/fixtures/lml_contract/v2_node.canonical.json
|
|
1176
|
+
- spec/fixtures/lml_contract/v2_node.json
|
|
1177
|
+
- spec/fixtures/lml_mml/inventory.json
|
|
1178
|
+
- spec/fixtures/lml_mml/manifest.json
|
|
1179
|
+
- spec/fixtures/lml_mml/oracle.json
|
|
1180
|
+
- spec/fixtures/lml_mml/v3-mi-mixed.json
|
|
1181
|
+
- spec/fixtures/lml_mml/v3-mi-mixed.yaml
|
|
1182
|
+
- spec/fixtures/lml_mml/v4-mi-mixed.json
|
|
1183
|
+
- spec/fixtures/lml_mml/v4-mi-mixed.yaml
|
|
1184
|
+
- spec/fixtures/lml_mml_materialization/replay.rb
|
|
1132
1185
|
- spec/fixtures/metanorma_iec_title_consolidation.xml
|
|
1133
1186
|
- spec/fixtures/person.rb
|
|
1134
1187
|
- spec/fixtures/sample_model.rb
|
|
@@ -2095,7 +2148,32 @@ files:
|
|
|
2095
2148
|
- spec/lutaml/model/liquefiable_spec.rb
|
|
2096
2149
|
- spec/lutaml/model/liquid/indexed_access_spec.rb
|
|
2097
2150
|
- spec/lutaml/model/liquid_compatibility_spec.rb
|
|
2151
|
+
- spec/lutaml/model/lml_any_attribute_spec.rb
|
|
2152
|
+
- spec/lutaml/model/lml_artifact_verifier_spec.rb
|
|
2153
|
+
- spec/lutaml/model/lml_builtin_types_spec.rb
|
|
2154
|
+
- spec/lutaml/model/lml_conformance_spec.rb
|
|
2155
|
+
- spec/lutaml/model/lml_document_spec.rb
|
|
2156
|
+
- spec/lutaml/model/lml_export_validation_spec.rb
|
|
2098
2157
|
- spec/lutaml/model/lml_exporter_spec.rb
|
|
2158
|
+
- spec/lutaml/model/lml_graph_exporter_spec.rb
|
|
2159
|
+
- spec/lutaml/model/lml_importer_spec.rb
|
|
2160
|
+
- spec/lutaml/model/lml_input_hardening_spec.rb
|
|
2161
|
+
- spec/lutaml/model/lml_mapping_compiler_spec.rb
|
|
2162
|
+
- spec/lutaml/model/lml_materialization_spec.rb
|
|
2163
|
+
- spec/lutaml/model/lml_mml_materialization_spec.rb
|
|
2164
|
+
- spec/lutaml/model/lml_mml_pilot_spec.rb
|
|
2165
|
+
- spec/lutaml/model/lml_model_choices_spec.rb
|
|
2166
|
+
- spec/lutaml/model/lml_ordered_content_spec.rb
|
|
2167
|
+
- spec/lutaml/model/lml_portable_json_spec.rb
|
|
2168
|
+
- spec/lutaml/model/lml_preservation_spec.rb
|
|
2169
|
+
- spec/lutaml/model/lml_review_export_spec.rb
|
|
2170
|
+
- spec/lutaml/model/lml_review_import_spec.rb
|
|
2171
|
+
- spec/lutaml/model/lml_review_misc_spec.rb
|
|
2172
|
+
- spec/lutaml/model/lml_review_round4_spec.rb
|
|
2173
|
+
- spec/lutaml/model/lml_review_round5_spec.rb
|
|
2174
|
+
- spec/lutaml/model/lml_ruby_interop_fixture_spec.rb
|
|
2175
|
+
- spec/lutaml/model/lml_shared_corpus_spec.rb
|
|
2176
|
+
- spec/lutaml/model/lml_value_declarations_spec.rb
|
|
2099
2177
|
- spec/lutaml/model/logger_spec.rb
|
|
2100
2178
|
- spec/lutaml/model/map_all_attributes_spec.rb
|
|
2101
2179
|
- spec/lutaml/model/map_all_spec.rb
|
|
@@ -2131,6 +2209,7 @@ files:
|
|
|
2131
2209
|
- spec/lutaml/model/root_mappings_spec.rb
|
|
2132
2210
|
- spec/lutaml/model/rule_value_extractor_spec.rb
|
|
2133
2211
|
- spec/lutaml/model/runtime_compatibility_spec.rb
|
|
2212
|
+
- spec/lutaml/model/schema/class_loader_spec.rb
|
|
2134
2213
|
- spec/lutaml/model/schema/generate_many_spec.rb
|
|
2135
2214
|
- spec/lutaml/model/schema/generation_regressions_spec.rb
|
|
2136
2215
|
- spec/lutaml/model/schema/generator/definitions_collection_spec.rb
|
|
@@ -2272,6 +2351,7 @@ files:
|
|
|
2272
2351
|
- spec/lutaml/xml/attribute_element_namespace_disjoint_spec.rb
|
|
2273
2352
|
- spec/lutaml/xml/attribute_namespace_disjointness_spec.rb
|
|
2274
2353
|
- spec/lutaml/xml/builder/builder_spec.rb
|
|
2354
|
+
- spec/lutaml/xml/cdata_emission_spec.rb
|
|
2275
2355
|
- spec/lutaml/xml/clear_parse_state_spec.rb
|
|
2276
2356
|
- spec/lutaml/xml/compiled_rule_namespace_spec.rb
|
|
2277
2357
|
- spec/lutaml/xml/conformance/xml_namespaces_spec.rb
|
|
@@ -2438,6 +2518,16 @@ files:
|
|
|
2438
2518
|
- spec/person_spec.rb
|
|
2439
2519
|
- spec/sample_model_spec.rb
|
|
2440
2520
|
- spec/spec_helper.rb
|
|
2521
|
+
- spec/support/lml_any_attribute_fixtures.rb
|
|
2522
|
+
- spec/support/lml_conformance.rb
|
|
2523
|
+
- spec/support/lml_corpus.rb
|
|
2524
|
+
- spec/support/lml_export_fixtures.rb
|
|
2525
|
+
- spec/support/lml_graph_fixtures.rb
|
|
2526
|
+
- spec/support/lml_import_fixtures.rb
|
|
2527
|
+
- spec/support/lml_mapping_fixtures.rb
|
|
2528
|
+
- spec/support/lml_materialization_fixtures.rb
|
|
2529
|
+
- spec/support/lml_model_choices_fixtures.rb
|
|
2530
|
+
- spec/support/lml_order_fixtures.rb
|
|
2441
2531
|
- spec/support/test_adapter_config.rb
|
|
2442
2532
|
- spec/support/test_namespaces.rb
|
|
2443
2533
|
- spec/support/trace_helper.rb
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "nokogiri"
|
|
4
|
-
|
|
5
|
-
module Lutaml
|
|
6
|
-
module Model
|
|
7
|
-
module Schema
|
|
8
|
-
class SchemaBuilder
|
|
9
|
-
# Nokogiri adapter for XSD schema generation
|
|
10
|
-
# Wraps Nokogiri::XML::Builder to provide schema building capabilities
|
|
11
|
-
class Nokogiri
|
|
12
|
-
attr_reader :builder
|
|
13
|
-
|
|
14
|
-
def initialize(options = {}, &block)
|
|
15
|
-
encoding = options[:encoding] || "UTF-8"
|
|
16
|
-
@builder = if block
|
|
17
|
-
::Nokogiri::XML::Builder.new(encoding: encoding,
|
|
18
|
-
&block)
|
|
19
|
-
else
|
|
20
|
-
::Nokogiri::XML::Builder.new(encoding: encoding)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Generate the XSD schema XML string
|
|
25
|
-
# @param options [Hash] formatting options
|
|
26
|
-
# @option options [Boolean] :pretty Pretty print with indentation
|
|
27
|
-
# @option options [Integer] :indent Number of spaces for indentation (default: 2)
|
|
28
|
-
# @return [String] XSD XML string
|
|
29
|
-
def to_xml(options = {})
|
|
30
|
-
if options[:pretty]
|
|
31
|
-
indent = options[:indent] || 2
|
|
32
|
-
builder.to_xml(indent: indent)
|
|
33
|
-
else
|
|
34
|
-
builder.to_xml
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|