rdf-tabular 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/VERSION +1 -1
- data/lib/rdf/tabular/metadata.rb +8 -6
- data/spec/matchers.rb +1 -2
- data/spec/metadata_spec.rb +0 -1
- data/spec/reader_spec.rb +3 -3
- metadata +29 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4041ba9d0a1c7d571edd2aa3a93ad1b603e310a07d1725c26c93986aecdec183
|
4
|
+
data.tar.gz: c5cc2f0c5ad18e1693e82e0f25446d0208324d691668e759f330689f12120a2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fda9f00e16600e812c82a30f92628432e72038d15b948297c59e306e7e9bd5ffb7a54180a62928550f6d791c8f21398fd6fbb514ca513fef86b890499a8d76cd
|
7
|
+
data.tar.gz: 9ca1f5716105b3a6d1cfa8138a13d38fb62ebd895d70394f1f17053df3f3a7045c73f42b305029559feefe920778114f5a459a1f36186e81e82b7ccb3d31a028
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[CSV][] reader for [RDF.rb][] and fully JSON serializer.
|
4
4
|
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/rdf-tabular.
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/rdf-tabular.svg)](https://badge.fury.io/rb/rdf-tabular)
|
6
6
|
[![Build Status](https://github.com/ruby-rdf/rdf-tabular/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-tabular/actions?query=workflow%3ACI)
|
7
7
|
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-tabular/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-tabular?branch=develop)
|
8
8
|
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
|
@@ -253,8 +253,8 @@ Full documentation available on [RubyDoc](https://rubydoc.info/gems/rdf-tabular/
|
|
253
253
|
* {RDF::Tabular::Reader}
|
254
254
|
|
255
255
|
## Dependencies
|
256
|
-
* [Ruby](https://ruby-lang.org/) (>=
|
257
|
-
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.
|
256
|
+
* [Ruby](https://ruby-lang.org/) (>= 3.0)
|
257
|
+
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3)
|
258
258
|
* [JSON](https://rubygems.org/gems/json) (>= 2.6)
|
259
259
|
|
260
260
|
## Installation
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.3.0
|
data/lib/rdf/tabular/metadata.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'json'
|
4
4
|
require 'json/ld'
|
5
|
-
require '
|
5
|
+
require 'bcp47_spec'
|
6
6
|
require 'addressable/template'
|
7
7
|
require 'rdf/xsd'
|
8
8
|
require 'yaml' # used by BCP47, which should have required it.
|
@@ -146,6 +146,8 @@ module RDF::Tabular
|
|
146
146
|
RDF::Util::File.open_file(path, **options) do |file|
|
147
147
|
self.new(file, **options.merge(base: path, filenames: path))
|
148
148
|
end
|
149
|
+
rescue Errno::ENOENT => e
|
150
|
+
raise IOError, e.message
|
149
151
|
end
|
150
152
|
|
151
153
|
# Return the well-known configuration for a file, and remember using a weak-reference cache to avoid uncessary retreivles.
|
@@ -366,7 +368,7 @@ module RDF::Tabular
|
|
366
368
|
|
367
369
|
@options[:base] = @context ? @context.base : RDF::URI(opt_base)
|
368
370
|
|
369
|
-
if @context && @context.default_language && !BCP47
|
371
|
+
if @context && @context.default_language && !BCP47.valid?(@context.default_language.to_s)
|
370
372
|
log_warn "Context has invalid @language (#{@context.default_language.inspect}): expected valid BCP47 language tag"
|
371
373
|
@context.default_language = nil
|
372
374
|
end
|
@@ -437,7 +439,7 @@ module RDF::Tabular
|
|
437
439
|
when :aboutUrl, :default, :propertyUrl, :valueUrl
|
438
440
|
"string" unless value.is_a?(String)
|
439
441
|
when :lang
|
440
|
-
"valid BCP47 language tag" unless BCP47
|
442
|
+
"valid BCP47 language tag" unless BCP47.valid?(value.to_s)
|
441
443
|
when :null
|
442
444
|
# To be valid, it must be a string or array
|
443
445
|
"string or array of strings" unless !value.is_a?(Hash) && Array(value).all? {|v| v.is_a?(String)}
|
@@ -837,7 +839,7 @@ module RDF::Tabular
|
|
837
839
|
"a valid natural language property" unless value.all? {|v| v.is_a?(String)}
|
838
840
|
when Hash
|
839
841
|
"a valid natural language property" if
|
840
|
-
value.keys.any? {|k| k.to_s != "und" && !BCP47
|
842
|
+
value.keys.any? {|k| k.to_s != "und" && !BCP47.valid?(k)} ||
|
841
843
|
value.values.any? {|v| valid_natural_language_property?(v).is_a?(String)}
|
842
844
|
else
|
843
845
|
"a valid natural language property"
|
@@ -1170,7 +1172,7 @@ module RDF::Tabular
|
|
1170
1172
|
log_error "Value object may not contain keys other than @value, @type, or @language: #{value.to_json}"
|
1171
1173
|
elsif (value.keys.sort & %w(@language @type)) == %w(@language @type)
|
1172
1174
|
log_error "Value object may not contain both @type and @language: #{value.to_json}"
|
1173
|
-
elsif value['@language'] && !BCP47
|
1175
|
+
elsif value['@language'] && !BCP47.valid?(value['@language'].to_s)
|
1174
1176
|
log_error "Value object with @language must use valid language: #{value.to_json}"
|
1175
1177
|
elsif value['@type'] && (value['@type'].start_with?('_:') || !context.expand_iri(value['@type'], vocab: true).absolute?)
|
1176
1178
|
log_error "Value object with @type must defined type: #{value.to_json}"
|
@@ -1230,7 +1232,7 @@ module RDF::Tabular
|
|
1230
1232
|
when String then value
|
1231
1233
|
when Array then value.select {|v| v.is_a?(String)}
|
1232
1234
|
when Hash
|
1233
|
-
value.delete_if {|k, v| !BCP47
|
1235
|
+
value.delete_if {|k, v| !BCP47.valid?(k)}
|
1234
1236
|
value.each do |k, v|
|
1235
1237
|
value[k] = Array(v).select {|vv| vv.is_a?(String)}
|
1236
1238
|
end
|
data/spec/matchers.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rdf/isomorphic'
|
2
2
|
require 'rspec/matchers'
|
3
3
|
|
4
|
-
Info = Struct.new(:id, :
|
4
|
+
Info = Struct.new(:id, :logger, :action, :result, :metadata)
|
5
5
|
|
6
6
|
RSpec::Matchers.define :pass_query do |expected, info|
|
7
7
|
match do |actual|
|
@@ -10,7 +10,6 @@ RSpec::Matchers.define :pass_query do |expected, info|
|
|
10
10
|
elsif info.is_a?(Hash)
|
11
11
|
Info.new(info[:id], info[:logger], info[:action], info.fetch(:result, RDF::Literal::TRUE), info[:metadata])
|
12
12
|
end
|
13
|
-
@info.debug = Array(@info.debug).join("\n")
|
14
13
|
|
15
14
|
@expected = expected.respond_to?(:read) ? expected.read : expected
|
16
15
|
|
data/spec/metadata_spec.rb
CHANGED
data/spec/reader_spec.rb
CHANGED
@@ -313,7 +313,7 @@ describe RDF::Tabular::Reader do
|
|
313
313
|
prov:endedAtTime ?end;
|
314
314
|
prov:qualifiedUsage [
|
315
315
|
a prov:Usage ;
|
316
|
-
prov:entity <http://example.org/country-codes-and-names.csv> ;
|
316
|
+
# prov:entity <http://example.org/country-codes-and-names.csv> ;
|
317
317
|
prov:hadRole csvw:csvEncodedTabularData
|
318
318
|
];
|
319
319
|
]
|
@@ -336,11 +336,11 @@ describe RDF::Tabular::Reader do
|
|
336
336
|
prov:endedAtTime ?end;
|
337
337
|
prov:qualifiedUsage [
|
338
338
|
a prov:Usage ;
|
339
|
-
prov:entity <http://example.org/countries.csv>, <http://example.org/country_slice.csv>;
|
339
|
+
# prov:entity <http://example.org/countries.csv>, <http://example.org/country_slice.csv>;
|
340
340
|
prov:hadRole csvw:csvEncodedTabularData
|
341
341
|
], [
|
342
342
|
a prov:Usage ;
|
343
|
-
prov:entity <http://example.org/countries.json> ;
|
343
|
+
# prov:entity <http://example.org/countries.json> ;
|
344
344
|
prov:hadRole csvw:tabularMetadata
|
345
345
|
];
|
346
346
|
]
|
metadata
CHANGED
@@ -1,97 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-tabular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bcp47_spec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.3
|
19
|
+
version: '0.2'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.3.3
|
26
|
+
version: '0.2'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rdf
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '3.
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 3.2.7
|
33
|
+
version: '3.3'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
38
|
- - "~>"
|
48
39
|
- !ruby/object:Gem::Version
|
49
|
-
version: '3.
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 3.2.7
|
40
|
+
version: '3.3'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: rdf-vocab
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
56
44
|
requirements:
|
57
45
|
- - "~>"
|
58
46
|
- !ruby/object:Gem::Version
|
59
|
-
version: '3.
|
47
|
+
version: '3.3'
|
60
48
|
type: :runtime
|
61
49
|
prerelease: false
|
62
50
|
version_requirements: !ruby/object:Gem::Requirement
|
63
51
|
requirements:
|
64
52
|
- - "~>"
|
65
53
|
- !ruby/object:Gem::Version
|
66
|
-
version: '3.
|
54
|
+
version: '3.3'
|
67
55
|
- !ruby/object:Gem::Dependency
|
68
56
|
name: rdf-xsd
|
69
57
|
requirement: !ruby/object:Gem::Requirement
|
70
58
|
requirements:
|
71
59
|
- - "~>"
|
72
60
|
- !ruby/object:Gem::Version
|
73
|
-
version: '3.
|
61
|
+
version: '3.3'
|
74
62
|
type: :runtime
|
75
63
|
prerelease: false
|
76
64
|
version_requirements: !ruby/object:Gem::Requirement
|
77
65
|
requirements:
|
78
66
|
- - "~>"
|
79
67
|
- !ruby/object:Gem::Version
|
80
|
-
version: '3.
|
68
|
+
version: '3.3'
|
81
69
|
- !ruby/object:Gem::Dependency
|
82
70
|
name: json-ld
|
83
71
|
requirement: !ruby/object:Gem::Requirement
|
84
72
|
requirements:
|
85
73
|
- - "~>"
|
86
74
|
- !ruby/object:Gem::Version
|
87
|
-
version: '3.
|
75
|
+
version: '3.3'
|
88
76
|
type: :runtime
|
89
77
|
prerelease: false
|
90
78
|
version_requirements: !ruby/object:Gem::Requirement
|
91
79
|
requirements:
|
92
80
|
- - "~>"
|
93
81
|
- !ruby/object:Gem::Version
|
94
|
-
version: '3.
|
82
|
+
version: '3.3'
|
95
83
|
- !ruby/object:Gem::Dependency
|
96
84
|
name: addressable
|
97
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,7 +100,7 @@ dependencies:
|
|
112
100
|
requirements:
|
113
101
|
- - "~>"
|
114
102
|
- !ruby/object:Gem::Version
|
115
|
-
version: '1.
|
103
|
+
version: '1.15'
|
116
104
|
- - ">="
|
117
105
|
- !ruby/object:Gem::Version
|
118
106
|
version: 1.13.4
|
@@ -122,7 +110,7 @@ dependencies:
|
|
122
110
|
requirements:
|
123
111
|
- - "~>"
|
124
112
|
- !ruby/object:Gem::Version
|
125
|
-
version: '1.
|
113
|
+
version: '1.15'
|
126
114
|
- - ">="
|
127
115
|
- !ruby/object:Gem::Version
|
128
116
|
version: 1.13.4
|
@@ -132,14 +120,14 @@ dependencies:
|
|
132
120
|
requirements:
|
133
121
|
- - "~>"
|
134
122
|
- !ruby/object:Gem::Version
|
135
|
-
version: '3.
|
123
|
+
version: '3.12'
|
136
124
|
type: :development
|
137
125
|
prerelease: false
|
138
126
|
version_requirements: !ruby/object:Gem::Requirement
|
139
127
|
requirements:
|
140
128
|
- - "~>"
|
141
129
|
- !ruby/object:Gem::Version
|
142
|
-
version: '3.
|
130
|
+
version: '3.12'
|
143
131
|
- !ruby/object:Gem::Dependency
|
144
132
|
name: rspec-its
|
145
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,70 +148,70 @@ dependencies:
|
|
160
148
|
requirements:
|
161
149
|
- - "~>"
|
162
150
|
- !ruby/object:Gem::Version
|
163
|
-
version: '3.
|
151
|
+
version: '3.3'
|
164
152
|
type: :development
|
165
153
|
prerelease: false
|
166
154
|
version_requirements: !ruby/object:Gem::Requirement
|
167
155
|
requirements:
|
168
156
|
- - "~>"
|
169
157
|
- !ruby/object:Gem::Version
|
170
|
-
version: '3.
|
158
|
+
version: '3.3'
|
171
159
|
- !ruby/object:Gem::Dependency
|
172
160
|
name: rdf-spec
|
173
161
|
requirement: !ruby/object:Gem::Requirement
|
174
162
|
requirements:
|
175
163
|
- - "~>"
|
176
164
|
- !ruby/object:Gem::Version
|
177
|
-
version: '3.
|
165
|
+
version: '3.3'
|
178
166
|
type: :development
|
179
167
|
prerelease: false
|
180
168
|
version_requirements: !ruby/object:Gem::Requirement
|
181
169
|
requirements:
|
182
170
|
- - "~>"
|
183
171
|
- !ruby/object:Gem::Version
|
184
|
-
version: '3.
|
172
|
+
version: '3.3'
|
185
173
|
- !ruby/object:Gem::Dependency
|
186
174
|
name: rdf-turtle
|
187
175
|
requirement: !ruby/object:Gem::Requirement
|
188
176
|
requirements:
|
189
177
|
- - "~>"
|
190
178
|
- !ruby/object:Gem::Version
|
191
|
-
version: '3.
|
179
|
+
version: '3.3'
|
192
180
|
type: :development
|
193
181
|
prerelease: false
|
194
182
|
version_requirements: !ruby/object:Gem::Requirement
|
195
183
|
requirements:
|
196
184
|
- - "~>"
|
197
185
|
- !ruby/object:Gem::Version
|
198
|
-
version: '3.
|
186
|
+
version: '3.3'
|
199
187
|
- !ruby/object:Gem::Dependency
|
200
188
|
name: sparql
|
201
189
|
requirement: !ruby/object:Gem::Requirement
|
202
190
|
requirements:
|
203
191
|
- - "~>"
|
204
192
|
- !ruby/object:Gem::Version
|
205
|
-
version: '3.
|
193
|
+
version: '3.3'
|
206
194
|
type: :development
|
207
195
|
prerelease: false
|
208
196
|
version_requirements: !ruby/object:Gem::Requirement
|
209
197
|
requirements:
|
210
198
|
- - "~>"
|
211
199
|
- !ruby/object:Gem::Version
|
212
|
-
version: '3.
|
200
|
+
version: '3.3'
|
213
201
|
- !ruby/object:Gem::Dependency
|
214
202
|
name: webmock
|
215
203
|
requirement: !ruby/object:Gem::Requirement
|
216
204
|
requirements:
|
217
205
|
- - "~>"
|
218
206
|
- !ruby/object:Gem::Version
|
219
|
-
version: '3.
|
207
|
+
version: '3.19'
|
220
208
|
type: :development
|
221
209
|
prerelease: false
|
222
210
|
version_requirements: !ruby/object:Gem::Requirement
|
223
211
|
requirements:
|
224
212
|
- - "~>"
|
225
213
|
- !ruby/object:Gem::Version
|
226
|
-
version: '3.
|
214
|
+
version: '3.19'
|
227
215
|
- !ruby/object:Gem::Dependency
|
228
216
|
name: yard
|
229
217
|
requirement: !ruby/object:Gem::Requirement
|
@@ -349,14 +337,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
349
337
|
requirements:
|
350
338
|
- - ">="
|
351
339
|
- !ruby/object:Gem::Version
|
352
|
-
version: '
|
340
|
+
version: '3.0'
|
353
341
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
354
342
|
requirements:
|
355
343
|
- - ">="
|
356
344
|
- !ruby/object:Gem::Version
|
357
345
|
version: '0'
|
358
346
|
requirements: []
|
359
|
-
rubygems_version: 3.
|
347
|
+
rubygems_version: 3.2.33
|
360
348
|
signing_key:
|
361
349
|
specification_version: 4
|
362
350
|
summary: Tabular Data RDF Reader and JSON serializer.
|