rdf-tabular 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4e457313b8f645df00990e6e91ce73a71601f6b5
4
- data.tar.gz: c264774c640137fdc1d0357af8c9d54b389a4254
2
+ SHA256:
3
+ metadata.gz: 991a83da465e15379b8493093b925b1263cabe124ba3c2c55bc446de633e4c61
4
+ data.tar.gz: 60e841e78b08b10359fe0ccb1dc56de230ea5bb01b5e3a194a4f506b8edbf1ba
5
5
  SHA512:
6
- metadata.gz: 40a1bb1c68f32caf150891736f3625ecee817dd88034e711fb167add2ec76adaf908987c2ec5aa1af7fc38e764ed828d9ff4d096fc5eeb4fa76f93ca229bb9dd
7
- data.tar.gz: 894041166faff32d64042a67915cd7ea0e3dfb3911e5122d277cefa60da179f92a73404cf48d1c2b1d10330b6ff4c6a86dd9e51e37a44d0d1657e90ac425a2ca
6
+ metadata.gz: 72cdd6adb1aa52c65130a800233cf460a73638df5d9db8892c22a17351ea72513493b42291616e3ed224c9a59c35788f0376362ea59ce3682758698f34cdc91b
7
+ data.tar.gz: a49059f0de84ec21b955e755fb67f67380b30fb216a3f9508fb071b714e85602c4baa94a28e38c224ae4e85a0670962c5a0c6276fb1b67c3076b2bbefe11d7f1
data/README.md CHANGED
@@ -247,7 +247,9 @@ Example usage:
247
247
  rdf serialize https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv \
248
248
  --output-format ttl
249
249
  rdf tabular-json --input-format tabular https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv
250
- rdf validate https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv
250
+ rdf validate https://raw.githubusercontent.com/ruby-rdf/rdf-tabular/develop/etc/doap.csv --validate
251
+
252
+ Note that the `--validate` option must be used with the `validate` (or other) command to detect parse-time errors in addition to validating any resulting RDF triples.
251
253
 
252
254
  ## RDF Reader
253
255
  RDF::Tabular also acts as a normal RDF reader, using the standard RDF.rb Reader interface:
@@ -266,8 +268,8 @@ Full documentation available on [RubyDoc](http://rubydoc.info/gems/rdf-tabular/f
266
268
 
267
269
  ## Dependencies
268
270
  * [Ruby](http://ruby-lang.org/) (>= 2.2.2)
269
- * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
270
- * [JSON](https://rubygems.org/gems/json) (>= 1.5)
271
+ * [RDF.rb](http://rubygems.org/gems/rdf) (~> 3.0)
272
+ * [JSON](https://rubygems.org/gems/json) (>= 2.0)
271
273
 
272
274
  ## Installation
273
275
  The recommended installation method is via [RubyGems](http://rubygems.org/).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.2
@@ -564,7 +564,7 @@ module RDF::Tabular
564
564
  end
565
565
 
566
566
  ##
567
- # Validate metadata, raising an error containing all errors detected during validation
567
+ # Validate metadata and content, raising an error containing all errors detected during validation
568
568
  # @raise [Error] Raise error if metadata has any unexpected properties
569
569
  # @return [self]
570
570
  def validate
@@ -1042,7 +1042,7 @@ module RDF::Tabular
1042
1042
  if !ca.object.has_key?(:name) && !cb.object.has_key?(:name) && ta.empty? && tb.empty?
1043
1043
  true
1044
1044
  elsif ca.object.has_key?(:name) && cb.object.has_key?(:name)
1045
- raise Error, "Columns don't match on name: #{ca.name}, #{cb.name}" unless ca.name == cb.name
1045
+ raise Error, "Column #{index + 1} doesn't match on name: #{ca.name || 'no name'}, #{cb.name || 'no name'}" unless ca.name == cb.name
1046
1046
  elsif @options[:validate] || !ta.empty? && !tb.empty?
1047
1047
  # If validating, column compatibility requires strict match between titles
1048
1048
  titles_match = case
@@ -1066,10 +1066,10 @@ module RDF::Tabular
1066
1066
  true
1067
1067
  elsif !@options[:validate]
1068
1068
  # If not validating, columns don't match, but processing continues
1069
- log_warn "Columns don't match on titles: #{ca.titles.inspect} vs #{cb.titles.inspect}"
1069
+ log_warn "Column #{index + 1} doesn't match on titles: #{Array(ta['und']).join(',').inspect} vs #{Array(tb['und']).join(',').inspect}"
1070
1070
  true
1071
1071
  else
1072
- raise Error, "Columns don't match on titles: #{ca.titles.inspect} vs #{cb.titles.inspect}"
1072
+ raise Error, "Column #{index + 1} doesn't match on titles: #{Array(ta['und']).join(',').inspect} vs #{Array(tb['und']).join(',').inspect}"
1073
1073
  end
1074
1074
  end
1075
1075
  index += 1
@@ -1826,7 +1826,7 @@ module RDF::Tabular
1826
1826
  row.xpath('th').map(&:content).each_with_index do |value, index|
1827
1827
  # Skip columns
1828
1828
  skipCols = skipColumns.to_i
1829
- next if index < skipCols
1829
+ next if index < skipCols || value.to_s.empty?
1830
1830
 
1831
1831
  # Trim value
1832
1832
  value.lstrip! if %w(true start).include?(trim.to_s)
@@ -1837,7 +1837,7 @@ module RDF::Tabular
1837
1837
  column = columns[index - skipCols] ||= {
1838
1838
  "titles" => {lang => []},
1839
1839
  }
1840
- column["titles"][lang] << value
1840
+ column["titles"][lang] << value if value
1841
1841
  end
1842
1842
  end
1843
1843
  else
@@ -1858,7 +1858,7 @@ module RDF::Tabular
1858
1858
  Array(row_data).each_with_index do |value, index|
1859
1859
  # Skip columns
1860
1860
  skipCols = skipColumns.to_i
1861
- next if index < skipCols
1861
+ next if index < skipCols || value.to_s.empty?
1862
1862
 
1863
1863
  # Trim value
1864
1864
  value.lstrip! if %w(true start).include?(trim.to_s)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-tabular
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-14 00:00:00.000000000 Z
11
+ date: 2019-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcp47
@@ -34,62 +34,44 @@ dependencies:
34
34
  name: rdf
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '2.2'
40
- - - "<"
37
+ - - "~>"
41
38
  - !ruby/object:Gem::Version
42
- version: '4.0'
39
+ version: '3.0'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '2.2'
50
- - - "<"
44
+ - - "~>"
51
45
  - !ruby/object:Gem::Version
52
- version: '4.0'
46
+ version: '3.0'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: rdf-vocab
55
49
  requirement: !ruby/object:Gem::Requirement
56
50
  requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: '2.2'
60
- - - "<"
51
+ - - "~>"
61
52
  - !ruby/object:Gem::Version
62
- version: '4.0'
53
+ version: '3.0'
63
54
  type: :runtime
64
55
  prerelease: false
65
56
  version_requirements: !ruby/object:Gem::Requirement
66
57
  requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: '2.2'
70
- - - "<"
58
+ - - "~>"
71
59
  - !ruby/object:Gem::Version
72
- version: '4.0'
60
+ version: '3.0'
73
61
  - !ruby/object:Gem::Dependency
74
62
  name: rdf-xsd
75
63
  requirement: !ruby/object:Gem::Requirement
76
64
  requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: '2.2'
80
- - - "<"
65
+ - - "~>"
81
66
  - !ruby/object:Gem::Version
82
- version: '4.0'
67
+ version: '3.0'
83
68
  type: :runtime
84
69
  prerelease: false
85
70
  version_requirements: !ruby/object:Gem::Requirement
86
71
  requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '2.2'
90
- - - "<"
72
+ - - "~>"
91
73
  - !ruby/object:Gem::Version
92
- version: '4.0'
74
+ version: '3.0'
93
75
  - !ruby/object:Gem::Dependency
94
76
  name: json-ld
95
77
  requirement: !ruby/object:Gem::Requirement
@@ -130,14 +112,14 @@ dependencies:
130
112
  requirements:
131
113
  - - "~>"
132
114
  - !ruby/object:Gem::Version
133
- version: '1.6'
115
+ version: '1.8'
134
116
  type: :development
135
117
  prerelease: false
136
118
  version_requirements: !ruby/object:Gem::Requirement
137
119
  requirements:
138
120
  - - "~>"
139
121
  - !ruby/object:Gem::Version
140
- version: '1.6'
122
+ version: '1.8'
141
123
  - !ruby/object:Gem::Dependency
142
124
  name: rspec
143
125
  requirement: !ruby/object:Gem::Requirement
@@ -170,82 +152,58 @@ dependencies:
170
152
  name: rdf-isomorphic
171
153
  requirement: !ruby/object:Gem::Requirement
172
154
  requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: '2.2'
176
- - - "<"
155
+ - - "~>"
177
156
  - !ruby/object:Gem::Version
178
- version: '4.0'
157
+ version: '3.0'
179
158
  type: :development
180
159
  prerelease: false
181
160
  version_requirements: !ruby/object:Gem::Requirement
182
161
  requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- version: '2.2'
186
- - - "<"
162
+ - - "~>"
187
163
  - !ruby/object:Gem::Version
188
- version: '4.0'
164
+ version: '3.0'
189
165
  - !ruby/object:Gem::Dependency
190
166
  name: rdf-spec
191
167
  requirement: !ruby/object:Gem::Requirement
192
168
  requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- version: '2.2'
196
- - - "<"
169
+ - - "~>"
197
170
  - !ruby/object:Gem::Version
198
- version: '4.0'
171
+ version: '3.0'
199
172
  type: :development
200
173
  prerelease: false
201
174
  version_requirements: !ruby/object:Gem::Requirement
202
175
  requirements:
203
- - - ">="
204
- - !ruby/object:Gem::Version
205
- version: '2.2'
206
- - - "<"
176
+ - - "~>"
207
177
  - !ruby/object:Gem::Version
208
- version: '4.0'
178
+ version: '3.0'
209
179
  - !ruby/object:Gem::Dependency
210
180
  name: rdf-turtle
211
181
  requirement: !ruby/object:Gem::Requirement
212
182
  requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '2.2'
216
- - - "<"
183
+ - - "~>"
217
184
  - !ruby/object:Gem::Version
218
- version: '4.0'
185
+ version: '3.0'
219
186
  type: :development
220
187
  prerelease: false
221
188
  version_requirements: !ruby/object:Gem::Requirement
222
189
  requirements:
223
- - - ">="
224
- - !ruby/object:Gem::Version
225
- version: '2.2'
226
- - - "<"
190
+ - - "~>"
227
191
  - !ruby/object:Gem::Version
228
- version: '4.0'
192
+ version: '3.0'
229
193
  - !ruby/object:Gem::Dependency
230
194
  name: sparql
231
195
  requirement: !ruby/object:Gem::Requirement
232
196
  requirements:
233
- - - ">="
234
- - !ruby/object:Gem::Version
235
- version: '2.2'
236
- - - "<"
197
+ - - "~>"
237
198
  - !ruby/object:Gem::Version
238
- version: '4.0'
199
+ version: '3.0'
239
200
  type: :development
240
201
  prerelease: false
241
202
  version_requirements: !ruby/object:Gem::Requirement
242
203
  requirements:
243
- - - ">="
244
- - !ruby/object:Gem::Version
245
- version: '2.2'
246
- - - "<"
204
+ - - "~>"
247
205
  - !ruby/object:Gem::Version
248
- version: '4.0'
206
+ version: '3.0'
249
207
  - !ruby/object:Gem::Dependency
250
208
  name: webmock
251
209
  requirement: !ruby/object:Gem::Requirement
@@ -266,14 +224,14 @@ dependencies:
266
224
  requirements:
267
225
  - - "~>"
268
226
  - !ruby/object:Gem::Version
269
- version: '0.9'
227
+ version: 0.9.12
270
228
  type: :development
271
229
  prerelease: false
272
230
  version_requirements: !ruby/object:Gem::Requirement
273
231
  requirements:
274
232
  - - "~>"
275
233
  - !ruby/object:Gem::Version
276
- version: '0.9'
234
+ version: 0.9.12
277
235
  description: RDF::Tabular processes tabular data with metadata creating RDF or JSON
278
236
  output.
279
237
  email: public-rdf-ruby@w3.org
@@ -388,8 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
388
346
  - !ruby/object:Gem::Version
389
347
  version: '0'
390
348
  requirements: []
391
- rubyforge_project:
392
- rubygems_version: 2.6.14
349
+ rubygems_version: 3.0.3
393
350
  signing_key:
394
351
  specification_version: 4
395
352
  summary: Tabular Data RDF Reader and JSON serializer.