lutaml-model 0.8.4 → 0.8.5
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/.github/workflows/dependent-tests.yml +3 -1
- data/.rubocop.yml +18 -0
- data/.rubocop_todo.yml +12 -18
- data/Gemfile +2 -0
- data/README.adoc +114 -2
- data/docs/_guides/index.adoc +18 -0
- data/docs/_guides/jsonld-serialization.adoc +217 -0
- data/docs/_guides/rdf-serialization.adoc +344 -0
- data/docs/_guides/turtle-serialization.adoc +224 -0
- data/docs/_pages/serialization_adapters.adoc +31 -0
- data/docs/_references/index.adoc +1 -0
- data/docs/_references/rdf-namespaces.adoc +243 -0
- data/docs/index.adoc +3 -2
- data/lib/lutaml/jsonld/adapter.rb +23 -0
- data/lib/lutaml/jsonld/context.rb +69 -0
- data/lib/lutaml/jsonld/term_definition.rb +39 -0
- data/lib/lutaml/jsonld/transform.rb +174 -0
- data/lib/lutaml/jsonld.rb +23 -0
- data/lib/lutaml/model/format_registry.rb +10 -1
- data/lib/lutaml/model/serialize/format_conversion.rb +17 -1
- data/lib/lutaml/model/version.rb +1 -1
- data/lib/lutaml/model.rb +6 -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/literal.rb +62 -0
- data/lib/lutaml/rdf/mapping.rb +71 -0
- data/lib/lutaml/rdf/mapping_rule.rb +35 -0
- data/lib/lutaml/rdf/member_rule.rb +13 -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/transform.rb +36 -0
- data/lib/lutaml/rdf.rb +19 -0
- data/lib/lutaml/turtle/adapter.rb +35 -0
- data/lib/lutaml/turtle/mapping.rb +7 -0
- data/lib/lutaml/turtle/transform.rb +158 -0
- data/lib/lutaml/turtle.rb +22 -0
- data/spec/lutaml/integration/edge_cases_spec.rb +109 -0
- data/spec/lutaml/integration/multi_format_spec.rb +106 -0
- data/spec/lutaml/integration/round_trip_spec.rb +170 -0
- data/spec/lutaml/jsonld/adapter_spec.rb +46 -0
- data/spec/lutaml/jsonld/context_spec.rb +114 -0
- data/spec/lutaml/jsonld/term_definition_spec.rb +55 -0
- data/spec/lutaml/jsonld/transform_spec.rb +211 -0
- data/spec/lutaml/rdf/graph_serialization_spec.rb +137 -0
- data/spec/lutaml/rdf/iri_spec.rb +73 -0
- data/spec/lutaml/rdf/literal_spec.rb +98 -0
- data/spec/lutaml/rdf/mapping_spec.rb +164 -0
- data/spec/lutaml/rdf/member_rule_spec.rb +17 -0
- data/spec/lutaml/rdf/namespace_set_spec.rb +115 -0
- data/spec/lutaml/rdf/namespace_spec.rb +241 -0
- data/spec/lutaml/rdf/rdf_transform_spec.rb +82 -0
- data/spec/lutaml/turtle/adapter_spec.rb +47 -0
- data/spec/lutaml/turtle/mapping_spec.rb +123 -0
- data/spec/lutaml/turtle/transform_spec.rb +273 -0
- metadata +50 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
require "lutaml/turtle"
|
|
5
|
+
|
|
6
|
+
RSpec.describe Lutaml::Turtle::Mapping do
|
|
7
|
+
subject(:mapping) { described_class.new }
|
|
8
|
+
|
|
9
|
+
describe "#namespace" do
|
|
10
|
+
it "builds a NamespaceSet from namespace classes" do
|
|
11
|
+
mapping.namespace(
|
|
12
|
+
Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
13
|
+
Lutaml::Rdf::Namespaces::DctermsNamespace,
|
|
14
|
+
)
|
|
15
|
+
expect(mapping.namespace_set.size).to eq(2)
|
|
16
|
+
expect(mapping.namespace_set["skos"]).to eq(Lutaml::Rdf::Namespaces::SkosNamespace)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe "#subject" do
|
|
21
|
+
it "sets subject generator block" do
|
|
22
|
+
mapping.subject { |obj| "http://example.org/#{obj.name}" }
|
|
23
|
+
expect(mapping.rdf_subject).to be_a(Proc)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe "#type" do
|
|
28
|
+
it "sets RDF type" do
|
|
29
|
+
mapping.type("skos:Concept")
|
|
30
|
+
expect(mapping.rdf_type).to eq("skos:Concept")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "#predicate" do
|
|
35
|
+
it "registers MappingRule with namespace reference" do
|
|
36
|
+
mapping.predicate(
|
|
37
|
+
:prefLabel,
|
|
38
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
39
|
+
to: :name,
|
|
40
|
+
)
|
|
41
|
+
expect(mapping.rdf_predicates.length).to eq(1)
|
|
42
|
+
rule = mapping.rdf_predicates.first
|
|
43
|
+
expect(rule).to be_a(Lutaml::Rdf::MappingRule)
|
|
44
|
+
expect(rule.predicate_name).to eq("prefLabel")
|
|
45
|
+
expect(rule.to).to eq(:name)
|
|
46
|
+
expect(rule.lang_tagged).to be(false)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
it "registers MappingRule with lang_tagged option" do
|
|
50
|
+
mapping.predicate(
|
|
51
|
+
:prefLabel,
|
|
52
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
53
|
+
to: :name,
|
|
54
|
+
lang_tagged: true,
|
|
55
|
+
)
|
|
56
|
+
expect(mapping.rdf_predicates.first.lang_tagged).to be(true)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it "registers multiple predicates" do
|
|
60
|
+
mapping.predicate(:prefLabel,
|
|
61
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace, to: :name)
|
|
62
|
+
mapping.predicate(:source,
|
|
63
|
+
namespace: Lutaml::Rdf::Namespaces::DctermsNamespace, to: :source)
|
|
64
|
+
expect(mapping.rdf_predicates.length).to eq(2)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it "resolves predicate URI" do
|
|
68
|
+
mapping.predicate(:prefLabel,
|
|
69
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace, to: :name)
|
|
70
|
+
rule = mapping.rdf_predicates.first
|
|
71
|
+
expect(rule.uri).to eq("http://www.w3.org/2004/02/skos/core#prefLabel")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
it "produces prefixed name" do
|
|
75
|
+
mapping.predicate(:prefLabel,
|
|
76
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace, to: :name)
|
|
77
|
+
rule = mapping.rdf_predicates.first
|
|
78
|
+
expect(rule.prefixed_name).to eq("skos:prefLabel")
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it "validates namespace is a Rdf::Namespace subclass" do
|
|
82
|
+
expect do
|
|
83
|
+
mapping.predicate(:foo, namespace: String, to: :bar)
|
|
84
|
+
end.to raise_error(ArgumentError, /Rdf::Namespace/)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it "validates :to is required" do
|
|
88
|
+
expect do
|
|
89
|
+
mapping.predicate(:foo,
|
|
90
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace, to: nil)
|
|
91
|
+
end.to raise_error(ArgumentError, /required/)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
describe "#deep_dup" do
|
|
96
|
+
before do
|
|
97
|
+
mapping.namespace(
|
|
98
|
+
Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
99
|
+
Lutaml::Rdf::Namespaces::DctermsNamespace,
|
|
100
|
+
)
|
|
101
|
+
mapping.subject { |m| "http://example.org/#{m.name}" }
|
|
102
|
+
mapping.type("skos:Concept")
|
|
103
|
+
mapping.predicate(:prefLabel,
|
|
104
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace, to: :name)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
it "copies all fields" do
|
|
108
|
+
duped = mapping.deep_dup
|
|
109
|
+
expect(duped.namespace_set.size).to eq(2)
|
|
110
|
+
expect(duped.rdf_subject).to be_a(Proc)
|
|
111
|
+
expect(duped.rdf_type).to eq("skos:Concept")
|
|
112
|
+
expect(duped.rdf_predicates.length).to eq(1)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
it "does not share predicate state with original" do
|
|
116
|
+
duped = mapping.deep_dup
|
|
117
|
+
duped.predicate(:source,
|
|
118
|
+
namespace: Lutaml::Rdf::Namespaces::DctermsNamespace, to: :source)
|
|
119
|
+
expect(mapping.rdf_predicates.length).to eq(1)
|
|
120
|
+
expect(duped.rdf_predicates.length).to eq(2)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
require "lutaml/turtle"
|
|
5
|
+
|
|
6
|
+
RSpec.describe Lutaml::Turtle::Transform do
|
|
7
|
+
before do
|
|
8
|
+
stub_const("TurtleTestModel", Class.new(Lutaml::Model::Serializable) do
|
|
9
|
+
attribute :name, :string
|
|
10
|
+
attribute :description, :string
|
|
11
|
+
attribute :code, :string
|
|
12
|
+
|
|
13
|
+
turtle do
|
|
14
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
15
|
+
Lutaml::Rdf::Namespaces::DctermsNamespace
|
|
16
|
+
|
|
17
|
+
subject { |m| "http://example.org/concept/#{m.code}" }
|
|
18
|
+
|
|
19
|
+
type "skos:Concept"
|
|
20
|
+
|
|
21
|
+
predicate :prefLabel,
|
|
22
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
23
|
+
to: :name,
|
|
24
|
+
lang_tagged: true
|
|
25
|
+
|
|
26
|
+
predicate :definition,
|
|
27
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
28
|
+
to: :description
|
|
29
|
+
|
|
30
|
+
predicate :notation,
|
|
31
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
32
|
+
to: :code
|
|
33
|
+
end
|
|
34
|
+
end)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
let(:instance) do
|
|
38
|
+
TurtleTestModel.new(name: "test concept",
|
|
39
|
+
description: "A test description",
|
|
40
|
+
code: "2119")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe "model_to_data" do
|
|
44
|
+
let(:result) { instance.to_turtle }
|
|
45
|
+
|
|
46
|
+
it "generates prefix declarations for used namespaces" do
|
|
47
|
+
expect(result).to include("@prefix skos: <http://www.w3.org/2004/02/skos/core#>")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "generates subject URI" do
|
|
51
|
+
expect(result).to include("<http://example.org/concept/2119>")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it "generates rdf:type triple using compact prefix" do
|
|
55
|
+
expect(result).to include("a skos:Concept")
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
it "generates predicate triples" do
|
|
59
|
+
expect(result).to include("skos:notation \"2119\"")
|
|
60
|
+
expect(result).to include("skos:definition \"A test description\"")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
it "terminates with a period" do
|
|
64
|
+
expect(result.strip).to end_with(".")
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
describe "special character escaping" do
|
|
69
|
+
let(:instance) do
|
|
70
|
+
TurtleTestModel.new(name: "has \"quotes\" and\nnewlines",
|
|
71
|
+
description: "back\\slash",
|
|
72
|
+
code: "1")
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it "escapes double quotes in literals" do
|
|
76
|
+
result = instance.to_turtle
|
|
77
|
+
expect(result).to include('\\"quotes\\"')
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it "handles multiline literals via triple-quoted strings" do
|
|
81
|
+
result = instance.to_turtle
|
|
82
|
+
expect(result).to include("has")
|
|
83
|
+
expect(result).to include("newlines")
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
it "escapes backslashes in literals" do
|
|
87
|
+
result = instance.to_turtle
|
|
88
|
+
expect(result).to include("back\\\\slash")
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
describe "numeric and boolean values" do
|
|
93
|
+
before do
|
|
94
|
+
stub_const("TypedModel", Class.new(Lutaml::Model::Serializable) do
|
|
95
|
+
attribute :label, :string
|
|
96
|
+
attribute :count, :integer
|
|
97
|
+
attribute :active, :boolean
|
|
98
|
+
|
|
99
|
+
turtle do
|
|
100
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace
|
|
101
|
+
|
|
102
|
+
subject { |_| "http://example.org/1" }
|
|
103
|
+
|
|
104
|
+
predicate :prefLabel,
|
|
105
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
106
|
+
to: :label
|
|
107
|
+
|
|
108
|
+
predicate :notation,
|
|
109
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
110
|
+
to: :count
|
|
111
|
+
|
|
112
|
+
predicate :note,
|
|
113
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
114
|
+
to: :active
|
|
115
|
+
end
|
|
116
|
+
end)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it "serializes integers as native Turtle literals" do
|
|
120
|
+
instance = TypedModel.new(label: "test", count: 42, active: true)
|
|
121
|
+
result = instance.to_turtle
|
|
122
|
+
expect(result).to match(/skos:notation 42/)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it "serializes booleans as native Turtle literals" do
|
|
126
|
+
instance = TypedModel.new(label: "test", count: 1, active: true)
|
|
127
|
+
result = instance.to_turtle
|
|
128
|
+
expect(result).to match(/skos:note true/)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
describe "model without subject" do
|
|
133
|
+
before do
|
|
134
|
+
stub_const("NoSubjectModel", Class.new(Lutaml::Model::Serializable) do
|
|
135
|
+
attribute :name, :string
|
|
136
|
+
|
|
137
|
+
turtle do
|
|
138
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace
|
|
139
|
+
type "skos:Concept"
|
|
140
|
+
predicate :prefLabel,
|
|
141
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
142
|
+
to: :name
|
|
143
|
+
end
|
|
144
|
+
end)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
it "raises MissingSubjectError" do
|
|
148
|
+
instance = NoSubjectModel.new(name: "test")
|
|
149
|
+
expect { instance.to_turtle }
|
|
150
|
+
.to raise_error(Lutaml::Turtle::MissingSubjectError)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
describe "model with nil values" do
|
|
155
|
+
let(:instance) { TurtleTestModel.new(name: "test", code: "2119") }
|
|
156
|
+
|
|
157
|
+
it "omits predicates for nil attributes" do
|
|
158
|
+
result = instance.to_turtle
|
|
159
|
+
expect(result).not_to include("definition")
|
|
160
|
+
expect(result).to include("prefLabel")
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
describe "model with no predicates producing data" do
|
|
165
|
+
before do
|
|
166
|
+
stub_const("EmptyPredModel", Class.new(Lutaml::Model::Serializable) do
|
|
167
|
+
attribute :name, :string
|
|
168
|
+
|
|
169
|
+
turtle do
|
|
170
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace
|
|
171
|
+
|
|
172
|
+
subject { |m| "http://example.org/#{m.name}" }
|
|
173
|
+
|
|
174
|
+
predicate :prefLabel,
|
|
175
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
176
|
+
to: :name
|
|
177
|
+
end
|
|
178
|
+
end)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
let(:instance) { EmptyPredModel.new(name: nil) }
|
|
182
|
+
|
|
183
|
+
it "returns empty string when no data" do
|
|
184
|
+
expect(instance.to_turtle).to eq("")
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
describe "collection predicates" do
|
|
189
|
+
before do
|
|
190
|
+
stub_const("CollectionModel", Class.new(Lutaml::Model::Serializable) do
|
|
191
|
+
attribute :labels, :string, collection: true
|
|
192
|
+
|
|
193
|
+
turtle do
|
|
194
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace
|
|
195
|
+
|
|
196
|
+
subject { |_| "http://example.org/1" }
|
|
197
|
+
|
|
198
|
+
predicate :prefLabel,
|
|
199
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
200
|
+
to: :labels
|
|
201
|
+
end
|
|
202
|
+
end)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
it "generates triples for all collection values" do
|
|
206
|
+
instance = CollectionModel.new(labels: ["en", "fr"])
|
|
207
|
+
result = instance.to_turtle
|
|
208
|
+
expect(result).to include('"en"')
|
|
209
|
+
expect(result).to include('"fr"')
|
|
210
|
+
expect(result).to include("skos:prefLabel")
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
describe "full URI type (no prefix)" do
|
|
215
|
+
before do
|
|
216
|
+
stub_const("FullUriTypeModel", Class.new(Lutaml::Model::Serializable) do
|
|
217
|
+
attribute :name, :string
|
|
218
|
+
|
|
219
|
+
turtle do
|
|
220
|
+
namespace Lutaml::Rdf::Namespaces::SkosNamespace
|
|
221
|
+
|
|
222
|
+
subject { |m| "http://example.org/#{m.name}" }
|
|
223
|
+
|
|
224
|
+
type "http://example.org/MyType"
|
|
225
|
+
|
|
226
|
+
predicate :prefLabel,
|
|
227
|
+
namespace: Lutaml::Rdf::Namespaces::SkosNamespace,
|
|
228
|
+
to: :name
|
|
229
|
+
end
|
|
230
|
+
end)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
it "uses full URI as-is when no colon prefix" do
|
|
234
|
+
instance = FullUriTypeModel.new(name: "test")
|
|
235
|
+
result = instance.to_turtle
|
|
236
|
+
expect(result).to include("<http://example.org/MyType>")
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
describe "data_to_model (deserialization)" do
|
|
241
|
+
let(:turtle_input) do
|
|
242
|
+
<<~TURTLE
|
|
243
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
244
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
245
|
+
|
|
246
|
+
<http://example.org/concept/2119> a skos:Concept ;
|
|
247
|
+
skos:prefLabel "test concept"@en ;
|
|
248
|
+
skos:definition "A test description" ;
|
|
249
|
+
skos:notation "2119" .
|
|
250
|
+
TURTLE
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
it "deserializes string attributes" do
|
|
254
|
+
model = TurtleTestModel.from_turtle(turtle_input)
|
|
255
|
+
expect(model.code).to eq("2119")
|
|
256
|
+
expect(model.description).to eq("A test description")
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
it "deserializes language-tagged values" do
|
|
260
|
+
model = TurtleTestModel.from_turtle(turtle_input)
|
|
261
|
+
expect(model.name).to eq("test concept")
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
describe "round-trip" do
|
|
266
|
+
it "preserves data through model → Turtle → model" do
|
|
267
|
+
turtle = instance.to_turtle
|
|
268
|
+
restored = TurtleTestModel.from_turtle(turtle)
|
|
269
|
+
expect(restored.code).to eq("2119")
|
|
270
|
+
expect(restored.description).to eq("A test description")
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
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.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -198,12 +198,15 @@ files:
|
|
|
198
198
|
- docs/_guides/creating-xsd.adoc
|
|
199
199
|
- docs/_guides/document-validation.adoc
|
|
200
200
|
- docs/_guides/index.adoc
|
|
201
|
+
- docs/_guides/jsonld-serialization.adoc
|
|
201
202
|
- docs/_guides/keyvalue-serialization.adoc
|
|
202
203
|
- docs/_guides/liquid-templates.adoc
|
|
203
204
|
- docs/_guides/missing-values-handling.adoc
|
|
204
205
|
- docs/_guides/ooxml-examples.adoc
|
|
206
|
+
- docs/_guides/rdf-serialization.adoc
|
|
205
207
|
- docs/_guides/schema-generation.adoc
|
|
206
208
|
- docs/_guides/schema-import.adoc
|
|
209
|
+
- docs/_guides/turtle-serialization.adoc
|
|
207
210
|
- docs/_guides/value-transformations.adoc
|
|
208
211
|
- docs/_guides/xml-mapping.adoc
|
|
209
212
|
- docs/_guides/xml-mappings-guide.adoc
|
|
@@ -253,6 +256,7 @@ files:
|
|
|
253
256
|
- docs/_references/instance-serialization.adoc
|
|
254
257
|
- docs/_references/lutaml-namespace-planning.md
|
|
255
258
|
- docs/_references/parent-root-context.adoc
|
|
259
|
+
- docs/_references/rdf-namespaces.adoc
|
|
256
260
|
- docs/_references/reference_type.adoc
|
|
257
261
|
- docs/_references/serialization-model-mappings.adoc
|
|
258
262
|
- docs/_references/three-phase-namespace-architecture.adoc
|
|
@@ -313,6 +317,11 @@ files:
|
|
|
313
317
|
- lib/lutaml/jsonl/adapter/mapping_rule.rb
|
|
314
318
|
- lib/lutaml/jsonl/adapter/standard_adapter.rb
|
|
315
319
|
- lib/lutaml/jsonl/adapter/transform.rb
|
|
320
|
+
- lib/lutaml/jsonld.rb
|
|
321
|
+
- lib/lutaml/jsonld/adapter.rb
|
|
322
|
+
- lib/lutaml/jsonld/context.rb
|
|
323
|
+
- lib/lutaml/jsonld/term_definition.rb
|
|
324
|
+
- lib/lutaml/jsonld/transform.rb
|
|
316
325
|
- lib/lutaml/key_value.rb
|
|
317
326
|
- lib/lutaml/key_value/adapter.rb
|
|
318
327
|
- lib/lutaml/key_value/adapter/hash.rb
|
|
@@ -589,6 +598,24 @@ files:
|
|
|
589
598
|
- lib/lutaml/model/version.rb
|
|
590
599
|
- lib/lutaml/model/yaml.rb
|
|
591
600
|
- lib/lutaml/model/yamls.rb
|
|
601
|
+
- lib/lutaml/rdf.rb
|
|
602
|
+
- lib/lutaml/rdf/error.rb
|
|
603
|
+
- lib/lutaml/rdf/iri.rb
|
|
604
|
+
- lib/lutaml/rdf/language_tagged.rb
|
|
605
|
+
- lib/lutaml/rdf/literal.rb
|
|
606
|
+
- lib/lutaml/rdf/mapping.rb
|
|
607
|
+
- lib/lutaml/rdf/mapping_rule.rb
|
|
608
|
+
- lib/lutaml/rdf/member_rule.rb
|
|
609
|
+
- lib/lutaml/rdf/namespace.rb
|
|
610
|
+
- lib/lutaml/rdf/namespace_set.rb
|
|
611
|
+
- lib/lutaml/rdf/namespaces.rb
|
|
612
|
+
- lib/lutaml/rdf/namespaces/dcterms_namespace.rb
|
|
613
|
+
- lib/lutaml/rdf/namespaces/owl_namespace.rb
|
|
614
|
+
- lib/lutaml/rdf/namespaces/rdf_namespace.rb
|
|
615
|
+
- lib/lutaml/rdf/namespaces/rdfs_namespace.rb
|
|
616
|
+
- lib/lutaml/rdf/namespaces/skos_namespace.rb
|
|
617
|
+
- lib/lutaml/rdf/namespaces/xsd_namespace.rb
|
|
618
|
+
- lib/lutaml/rdf/transform.rb
|
|
592
619
|
- lib/lutaml/toml.rb
|
|
593
620
|
- lib/lutaml/toml/adapter.rb
|
|
594
621
|
- lib/lutaml/toml/adapter/document.rb
|
|
@@ -598,6 +625,10 @@ files:
|
|
|
598
625
|
- lib/lutaml/toml/adapter/tomlib_adapter.rb
|
|
599
626
|
- lib/lutaml/toml/adapter/transform.rb
|
|
600
627
|
- lib/lutaml/toml/type/serializers.rb
|
|
628
|
+
- lib/lutaml/turtle.rb
|
|
629
|
+
- lib/lutaml/turtle/adapter.rb
|
|
630
|
+
- lib/lutaml/turtle/mapping.rb
|
|
631
|
+
- lib/lutaml/turtle/transform.rb
|
|
601
632
|
- lib/lutaml/xml.rb
|
|
602
633
|
- lib/lutaml/xml/adapter.rb
|
|
603
634
|
- lib/lutaml/xml/adapter/adapter_helpers.rb
|
|
@@ -1513,6 +1544,13 @@ files:
|
|
|
1513
1544
|
- spec/fixtures/xml/user.xsd
|
|
1514
1545
|
- spec/fixtures/xml/valid_math_document.xml
|
|
1515
1546
|
- spec/fixtures/yamls_range_concept.rb
|
|
1547
|
+
- spec/lutaml/integration/edge_cases_spec.rb
|
|
1548
|
+
- spec/lutaml/integration/multi_format_spec.rb
|
|
1549
|
+
- spec/lutaml/integration/round_trip_spec.rb
|
|
1550
|
+
- spec/lutaml/jsonld/adapter_spec.rb
|
|
1551
|
+
- spec/lutaml/jsonld/context_spec.rb
|
|
1552
|
+
- spec/lutaml/jsonld/term_definition_spec.rb
|
|
1553
|
+
- spec/lutaml/jsonld/transform_spec.rb
|
|
1516
1554
|
- spec/lutaml/key_value/transformation/collection_serializer_spec.rb
|
|
1517
1555
|
- spec/lutaml/key_value/transformation/rule_compiler_spec.rb
|
|
1518
1556
|
- spec/lutaml/key_value/transformation/value_serializer_spec.rb
|
|
@@ -1658,6 +1696,17 @@ files:
|
|
|
1658
1696
|
- spec/lutaml/model/yamls_sequence_spec.rb
|
|
1659
1697
|
- spec/lutaml/model/yamls_spec.rb
|
|
1660
1698
|
- spec/lutaml/model_spec.rb
|
|
1699
|
+
- spec/lutaml/rdf/graph_serialization_spec.rb
|
|
1700
|
+
- spec/lutaml/rdf/iri_spec.rb
|
|
1701
|
+
- spec/lutaml/rdf/literal_spec.rb
|
|
1702
|
+
- spec/lutaml/rdf/mapping_spec.rb
|
|
1703
|
+
- spec/lutaml/rdf/member_rule_spec.rb
|
|
1704
|
+
- spec/lutaml/rdf/namespace_set_spec.rb
|
|
1705
|
+
- spec/lutaml/rdf/namespace_spec.rb
|
|
1706
|
+
- spec/lutaml/rdf/rdf_transform_spec.rb
|
|
1707
|
+
- spec/lutaml/turtle/adapter_spec.rb
|
|
1708
|
+
- spec/lutaml/turtle/mapping_spec.rb
|
|
1709
|
+
- spec/lutaml/turtle/transform_spec.rb
|
|
1661
1710
|
- spec/lutaml/xml/adapter/nokogiri_adapter_spec.rb
|
|
1662
1711
|
- spec/lutaml/xml/adapter/oga_adapter_spec.rb
|
|
1663
1712
|
- spec/lutaml/xml/adapter/ox_adapter_spec.rb
|