rdf-tabular 0.4.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +24 -5
- data/VERSION +1 -1
- data/etc/csvw.jsonld +135 -50
- data/lib/rdf/tabular/csvw.rb +215 -181
- data/lib/rdf/tabular/format.rb +8 -6
- data/lib/rdf/tabular/literal.rb +1 -1
- data/lib/rdf/tabular/metadata.rb +61 -80
- data/lib/rdf/tabular/reader.rb +18 -15
- data/lib/rdf/tabular/uax35.rb +143 -38
- data/spec/data/countries-minimal.json +38 -0
- data/spec/data/countries-minimal.ttl +36 -0
- data/spec/data/countries-standard.json +86 -0
- data/spec/data/countries-standard.ttl +75 -0
- data/spec/data/countries.csv +4 -0
- data/spec/data/countries.csv-minimal.json +16 -0
- data/spec/data/countries.csv-minimal.ttl +19 -0
- data/spec/data/countries.csv-standard.json +33 -0
- data/spec/data/countries.csv-standard.ttl +44 -0
- data/spec/data/countries.html +88 -0
- data/spec/data/countries.json +53 -0
- data/spec/data/countries_embed-minimal.json +38 -0
- data/spec/data/countries_embed-minimal.ttl +36 -0
- data/spec/data/countries_embed-standard.json +86 -0
- data/spec/data/countries_embed-standard.ttl +75 -0
- data/spec/data/countries_embed.html +88 -0
- data/spec/data/countries_html-minimal.json +38 -0
- data/spec/data/countries_html-minimal.ttl +36 -0
- data/spec/data/countries_html-standard.json +86 -0
- data/spec/data/countries_html-standard.ttl +75 -0
- data/spec/data/country-codes-and-names-minimal.json +19 -0
- data/spec/data/country-codes-and-names-minimal.ttl +22 -0
- data/spec/data/country-codes-and-names-standard.json +47 -0
- data/spec/data/country-codes-and-names-standard.ttl +45 -0
- data/spec/data/country-codes-and-names.csv +5 -0
- data/spec/data/country_slice.csv +4 -0
- data/spec/data/junior-roles.csv +3 -0
- data/spec/data/junior-roles.json +54 -0
- data/spec/data/roles-minimal.json +32 -0
- data/spec/data/roles-minimal.ttl +36 -0
- data/spec/data/roles-standard.json +56 -0
- data/spec/data/roles-standard.ttl +66 -0
- data/spec/data/roles.json +23 -0
- data/spec/data/senior-roles.csv +3 -0
- data/spec/data/senior-roles.json +52 -0
- data/spec/data/test232-metadata.json +10 -0
- data/spec/data/test232.csv +3 -0
- data/spec/data/tree-ops-atd.json +1 -0
- data/spec/data/tree-ops-ext-minimal.json +42 -0
- data/spec/data/tree-ops-ext-minimal.ttl +34 -0
- data/spec/data/tree-ops-ext-standard.json +93 -0
- data/spec/data/tree-ops-ext-standard.ttl +82 -0
- data/spec/data/tree-ops-ext.csv +4 -0
- data/spec/data/tree-ops-ext.json +81 -0
- data/spec/data/tree-ops-minimal.json +18 -0
- data/spec/data/tree-ops-minimal.ttl +14 -0
- data/spec/data/tree-ops-standard.json +44 -0
- data/spec/data/tree-ops-standard.ttl +44 -0
- data/spec/data/tree-ops-virtual-minimal.json +32 -0
- data/spec/data/tree-ops-virtual-minimal.ttl +25 -0
- data/spec/data/tree-ops-virtual-standard.json +49 -0
- data/spec/data/tree-ops-virtual-standard.ttl +49 -0
- data/spec/data/tree-ops-virtual.json +48 -0
- data/spec/data/tree-ops.csv +3 -0
- data/spec/data/tree-ops.csv-metadata.json +43 -0
- data/spec/data/tree-ops.html +54 -0
- data/spec/data/tree-ops.tsv +3 -0
- data/spec/format_spec.rb +5 -4
- data/spec/metadata_spec.rb +10 -16
- data/spec/suite_helper.rb +2 -2
- data/spec/suite_spec.rb +5 -6
- data/spec/uax35_spec.rb +239 -0
- metadata +149 -36
- data/lib/rdf/tabular/json.rb +0 -0
data/spec/metadata_spec.rb
CHANGED
@@ -838,12 +838,6 @@ describe RDF::Tabular::Metadata do
|
|
838
838
|
":type Schema" => [{}, {type: :Schema}, RDF::Tabular::Schema],
|
839
839
|
":type Column" => [{}, {type: :Column}, RDF::Tabular::Column],
|
840
840
|
":type Dialect" => [{}, {type: :Dialect}, RDF::Tabular::Dialect],
|
841
|
-
"@type TableGroup" => [{}, {"@type" => "TableGroup"}, RDF::Tabular::TableGroup],
|
842
|
-
"@type Table" => [{"@type" => "Table"}, RDF::Tabular::Table],
|
843
|
-
"@type Template" => [{"@type" => "Template"}, RDF::Tabular::Transformation],
|
844
|
-
"@type Schema" => [{"@type" => "Schema"}, RDF::Tabular::Schema],
|
845
|
-
"@type Column" => [{"@type" => "Column"}, RDF::Tabular::Column],
|
846
|
-
"@type Dialect" => [{"@type" => "Dialect"}, RDF::Tabular::Dialect],
|
847
841
|
"tables TableGroup" => [{"tables" => []}, RDF::Tabular::TableGroup],
|
848
842
|
"dialect Table" => [{"dialect" => {}}, RDF::Tabular::Table],
|
849
843
|
"tableSchema Table" => [{"tableSchema" => {}}, RDF::Tabular::Table],
|
@@ -874,7 +868,7 @@ describe RDF::Tabular::Metadata do
|
|
874
868
|
options ||= {}
|
875
869
|
options[:logger] = logger
|
876
870
|
options[:context] ||= 'http://www.w3.org/ns/csvw'
|
877
|
-
expect(described_class.new(input, options)).to be_a(klass)
|
871
|
+
expect(described_class.new(input, **options)).to be_a(klass)
|
878
872
|
expect(logger.to_s).not_to match(/ERROR|WARN/)
|
879
873
|
end
|
880
874
|
end
|
@@ -1136,7 +1130,7 @@ describe RDF::Tabular::Metadata do
|
|
1136
1130
|
format: {"groupChar" => ";"},
|
1137
1131
|
value: "123;;456.789",
|
1138
1132
|
result: "123;;456.789",
|
1139
|
-
errors: [/
|
1133
|
+
errors: [/does not match numeric pattern/]
|
1140
1134
|
},
|
1141
1135
|
"decimal with explicit decimalChar" => {
|
1142
1136
|
base: "decimal",
|
@@ -1184,19 +1178,19 @@ describe RDF::Tabular::Metadata do
|
|
1184
1178
|
"invalid nonPositiveInteger" => {base: "nonPositiveInteger", value: "1", errors: ["1 is not a valid nonPositiveInteger"]},
|
1185
1179
|
"valid nonNegativeInteger" => {base: "nonNegativeInteger", value: "0"},
|
1186
1180
|
"invalid nonNegativeInteger" => {base: "nonNegativeInteger", value: "-1", errors: ["-1 is not a valid nonNegativeInteger"]},
|
1187
|
-
"valid double" => {base: "double", value: "1234.
|
1181
|
+
"valid double" => {base: "double", value: "1234.456e789"},
|
1188
1182
|
"invalid double" => {base: "double", value: "1z", errors: ["1z is not a valid double"]},
|
1189
|
-
"NaN double" => {base: "double", value: "NaN"},
|
1183
|
+
"NaN double" => {base: "double", value: "NaN", result: "NaN"},
|
1190
1184
|
"INF double" => {base: "double", value: "INF"},
|
1191
1185
|
"-INF double" => {base: "double", value: "-INF"},
|
1192
|
-
"valid number" => {base: "number", value: "1234.
|
1186
|
+
"valid number" => {base: "number", value: "1234.456e789"},
|
1193
1187
|
"invalid number" => {base: "number", value: "1z", errors: ["1z is not a valid number"]},
|
1194
|
-
"NaN number" => {base: "number", value: "NaN"},
|
1188
|
+
"NaN number" => {base: "number", value: "NaN", result: "NaN"},
|
1195
1189
|
"INF number" => {base: "number", value: "INF"},
|
1196
1190
|
"-INF number" => {base: "number", value: "-INF"},
|
1197
|
-
"valid float" => {base: "float", value: "1234.
|
1191
|
+
"valid float" => {base: "float", value: "1234.456e7"},
|
1198
1192
|
"invalid float" => {base: "float", value: "1z", errors: ["1z is not a valid float"]},
|
1199
|
-
"NaN float" => {base: "float", value: "NaN"},
|
1193
|
+
"NaN float" => {base: "float", value: "NaN", result: "NaN"},
|
1200
1194
|
"INF float" => {base: "float", value: "INF"},
|
1201
1195
|
"-INF float" => {base: "float", value: "-INF"},
|
1202
1196
|
|
@@ -1327,7 +1321,7 @@ describe RDF::Tabular::Metadata do
|
|
1327
1321
|
"valid NMTOKEN" => {base: "NMTOKEN", value: "someThing", result: RDF::Literal("someThing", datatype: RDF::XSD.NMTOKEN)},
|
1328
1322
|
|
1329
1323
|
# Aliases
|
1330
|
-
"number is alias for double" => {base: "number", value: "1234.
|
1324
|
+
"number is alias for double" => {base: "number", value: "1234.456e789", result: RDF::Literal("1234.456e789", datatype: RDF::XSD.double)},
|
1331
1325
|
"binary is alias for base64Binary" => {base: "binary", value: "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g", result: RDF::Literal("Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g", datatype: RDF::XSD.base64Binary)},
|
1332
1326
|
"datetime is alias for dateTime" => {base: "dateTime", value: "15-3-2015 1502", format: "d-M-yyyy HHmm", result: RDF::Literal("2015-03-15T15:02:00", datatype: RDF::XSD.dateTime)},
|
1333
1327
|
"any is alias for anyAtomicType" => {base: "any", value: "some thing", result: RDF::Literal("some thing", datatype: RDF::XSD.anyAtomicType)},
|
@@ -1379,7 +1373,7 @@ describe RDF::Tabular::Metadata do
|
|
1379
1373
|
context "Unsupported datatypes" do
|
1380
1374
|
%w(anyType anySimpleType ENTITIES IDREFS NMTOKENS ENTITY ID IDREF NOTATAION foo).each do |base|
|
1381
1375
|
it "detects #{base} as unsupported" do
|
1382
|
-
|
1376
|
+
RDF::Tabular::Table.new({
|
1383
1377
|
url: "http://example.com/table.csv",
|
1384
1378
|
tableSchema: {
|
1385
1379
|
columns: [{
|
data/spec/suite_helper.rb
CHANGED
@@ -23,7 +23,7 @@ module RDF::Util
|
|
23
23
|
# HTTP Request headers.
|
24
24
|
# @return [IO] File stream
|
25
25
|
# @yield [IO] File stream
|
26
|
-
def self.open_file(filename_or_url, options
|
26
|
+
def self.open_file(filename_or_url, **options, &block)
|
27
27
|
case
|
28
28
|
when filename_or_url.to_s =~ /^file:/
|
29
29
|
path = filename_or_url.to_s[5..-1]
|
@@ -73,7 +73,7 @@ module RDF::Util
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
else
|
76
|
-
original_open_file(filename_or_url, options) do |remote_document|
|
76
|
+
original_open_file(filename_or_url, **options) do |remote_document|
|
77
77
|
# Add Link header, if necessary
|
78
78
|
remote_document.headers[:link] = options[:httpLink] if options[:httpLink]
|
79
79
|
|
data/spec/suite_spec.rb
CHANGED
@@ -18,18 +18,17 @@ describe RDF::Tabular::Reader do
|
|
18
18
|
m.entries.each do |t|
|
19
19
|
next if t.approval =~ /Rejected/
|
20
20
|
specify "#{t.id.split("/").last}: #{t.name} - #{t.comment}" do
|
21
|
-
pending "rdf#
|
21
|
+
pending "rdf#test283 literal normalization" if t.id.include?("rdf#test283")
|
22
22
|
t.logger = RDF::Spec.logger
|
23
23
|
t.logger.formatter = lambda {|severity, datetime, progname, msg| "#{severity}: #{msg}\n"}
|
24
24
|
t.logger.info t.inspect
|
25
25
|
t.logger.info "source:\n#{t.input}"
|
26
26
|
begin
|
27
27
|
RDF::Tabular::Reader.open(t.action,
|
28
|
-
t.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
)
|
28
|
+
base_uri: t.base,
|
29
|
+
validate: t.validation?,
|
30
|
+
logger: t.logger,
|
31
|
+
**t.reader_options
|
33
32
|
) do |reader|
|
34
33
|
expect(reader).to be_a RDF::Reader
|
35
34
|
|
data/spec/uax35_spec.rb
ADDED
@@ -0,0 +1,239 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
$:.unshift "."
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe RDF::Tabular::UAX35 do
|
6
|
+
subject {"".extend(RDF::Tabular::UAX35)}
|
7
|
+
|
8
|
+
describe "parse_uax35_date" do
|
9
|
+
{
|
10
|
+
# Dates
|
11
|
+
"valid date yyyy-MM-dd" => {value: "2015-03-22", pattern: "yyyy-MM-dd", result: "2015-03-22"},
|
12
|
+
"valid date yyyyMMdd" => {value: "20150322", pattern: "yyyyMMdd", result: "2015-03-22"},
|
13
|
+
"valid date dd-MM-yyyy" => {value: "22-03-2015", pattern: "dd-MM-yyyy", result: "2015-03-22"},
|
14
|
+
"valid date d-M-yyyy" => {value: "22-3-2015", pattern: "d-M-yyyy", result: "2015-03-22"},
|
15
|
+
"valid date d-M-yy" => {value: "22-3-15", pattern: "d-M-yy", result: "2015-03-22"},
|
16
|
+
"valid date d-M-y" => {value: "22-3-15", pattern: "d-M-y", result: "2015-03-22"},
|
17
|
+
"valid date MM-dd-yyyy" => {value: "03-22-2015", pattern: "MM-dd-yyyy", result: "2015-03-22"},
|
18
|
+
"valid date M-d-yyyy" => {value: "3-22-2015", pattern: "M-d-yyyy", result: "2015-03-22"},
|
19
|
+
"valid date M-d-yy" => {value: "3-22-70", pattern: "M-d-yy", result: "1970-03-22"},
|
20
|
+
"valid date M-d-y" => {value: "3-22-70", pattern: "M-d-y", result: "1970-03-22"},
|
21
|
+
"valid date dd/MM/yyyy" => {value: "22/03/2015", pattern: "dd/MM/yyyy", result: "2015-03-22"},
|
22
|
+
"valid date d/M/yyyy" => {value: "22/3/2015", pattern: "d/M/yyyy", result: "2015-03-22"},
|
23
|
+
"valid date d/M/yy" => {value: "22/3/15", pattern: "d/M/yy", result: "2015-03-22"},
|
24
|
+
"valid date d/M/y" => {value: "22/3/15", pattern: "d/M/y", result: "2015-03-22"},
|
25
|
+
"valid date MM/dd/yyyy" => {value: "03/22/2015", pattern: "MM/dd/yyyy", result: "2015-03-22"},
|
26
|
+
"valid date M/d/yyyy" => {value: "3/22/2015", pattern: "M/d/yyyy", result: "2015-03-22"},
|
27
|
+
"valid date M/d/yy" => {value: "3/22/15", pattern: "M/d/yy", result: "2015-03-22"},
|
28
|
+
"valid date M/d/y" => {value: "3/22/15", pattern: "M/d/y", result: "2015-03-22"},
|
29
|
+
"valid date dd.MM.yyyy" => {value: "22.03.2015", pattern: "dd.MM.yyyy", result: "2015-03-22"},
|
30
|
+
"valid date d.M.yyyy" => {value: "22.3.2015", pattern: "d.M.yyyy", result: "2015-03-22"},
|
31
|
+
"valid date d.M.yy" => {value: "22.3.15", pattern: "d.M.yy", result: "2015-03-22"},
|
32
|
+
"valid date d.M.y" => {value: "22.3.15", pattern: "d.M.y", result: "2015-03-22"},
|
33
|
+
"valid date MM.dd.yyyy" => {value: "03.22.2015", pattern: "MM.dd.yyyy", result: "2015-03-22"},
|
34
|
+
"valid date M.d.yyyy" => {value: "3.22.2015", pattern: "M.d.yyyy", result: "2015-03-22"},
|
35
|
+
"valid date M.d.yy" => {value: "3.22.15", pattern: "M.d.yy", result: "2015-03-22"},
|
36
|
+
"valid date M.d.y" => {value: "3.22.15", pattern: "M.d.y", result: "2015-03-22"},
|
37
|
+
|
38
|
+
# Times
|
39
|
+
"valid time HH:mm:ss.S" => {value: "15:02:37.1", pattern: "HH:mm:ss.S", result: "15:02:37.1"},
|
40
|
+
"valid time HH:mm:ss" => {value: "15:02:37", pattern: "HH:mm:ss", result: "15:02:37"},
|
41
|
+
"valid time HHmmss" => {value: "150237", pattern: "HHmmss", result: "15:02:37"},
|
42
|
+
"valid time HH:mm" => {value: "15:02", pattern: "HH:mm", result: "15:02:00"},
|
43
|
+
"valid time HHmm" => {value: "1502", pattern: "HHmm", result: "15:02:00"},
|
44
|
+
|
45
|
+
# DateTimes
|
46
|
+
"valid dateTime yyyy-MM-ddTHH:mm:ss" => {value: "2015-03-15T15:02:37", pattern: "yyyy-MM-ddTHH:mm:ss", result: "2015-03-15T15:02:37"},
|
47
|
+
"valid dateTime yyyy-MM-ddTHH:mm:ss.S"=> {value: "2015-03-15T15:02:37.1", pattern: "yyyy-MM-ddTHH:mm:ss.S", result: "2015-03-15T15:02:37.1"},
|
48
|
+
"valid dateTime yyyy-MM-dd HH:mm:ss" => {value: "2015-03-15 15:02:37", pattern: "yyyy-MM-dd HH:mm:ss", result: "2015-03-15T15:02:37"},
|
49
|
+
"valid dateTime yyyyMMdd HHmmss" => {value: "20150315 150237", pattern: "yyyyMMdd HHmmss", result: "2015-03-15T15:02:37"},
|
50
|
+
"valid dateTime dd-MM-yyyy HH:mm" => {value: "15-03-2015 15:02", pattern: "dd-MM-yyyy HH:mm", result: "2015-03-15T15:02:00"},
|
51
|
+
"valid dateTime d-M-yyyy HHmm" => {value: "15-3-2015 1502", pattern: "d-M-yyyy HHmm", result: "2015-03-15T15:02:00"},
|
52
|
+
"valid dateTime yyyy-MM-ddTHH:mm" => {value: "2015-03-15T15:02", pattern: "yyyy-MM-ddTHH:mm", result: "2015-03-15T15:02:00"},
|
53
|
+
"valid dateTimeStamp d-M-yyyy HHmm X" => {value: "15-3-2015 1502 Z", pattern: "d-M-yyyy HHmm X", result: "2015-03-15T15:02:00Z"},
|
54
|
+
"valid datetime yyyy-MM-ddTHH:mm:ss" => {value: "2015-03-15T15:02:37", pattern: "yyyy-MM-ddTHH:mm:ss", result: "2015-03-15T15:02:37"},
|
55
|
+
"valid datetime yyyy-MM-dd HH:mm:ss" => {value: "2015-03-15 15:02:37", pattern: "yyyy-MM-dd HH:mm:ss", result: "2015-03-15T15:02:37"},
|
56
|
+
"valid datetime yyyyMMdd HHmmss" => {value: "20150315 150237", pattern: "yyyyMMdd HHmmss", result: "2015-03-15T15:02:37"},
|
57
|
+
"valid datetime dd-MM-yyyy HH:mm" => {value: "15-03-2015 15:02", pattern: "dd-MM-yyyy HH:mm", result: "2015-03-15T15:02:00"},
|
58
|
+
"valid datetime d-M-yyyy HHmm" => {value: "15-3-2015 1502", pattern: "d-M-yyyy HHmm", result: "2015-03-15T15:02:00"},
|
59
|
+
"valid datetime yyyy-MM-ddTHH:mm" => {value: "2015-03-15T15:02", pattern: "yyyy-MM-ddTHH:mm", result: "2015-03-15T15:02:00"},
|
60
|
+
|
61
|
+
# Timezones
|
62
|
+
"valid w/TZ yyyy-MM-ddX" => {value: "2015-03-22Z", pattern: "yyyy-MM-ddX", result: "2015-03-22Z"},
|
63
|
+
"valid w/TZ HH:mm:ssX" => {value: "15:02:37-05", pattern: "HH:mm:ssX", result: "15:02:37-05:00"},
|
64
|
+
"valid w/TZ yyyy-MM-dd HH:mm:ss X" => {value: "2015-03-15 15:02:37 +0800", pattern: "yyyy-MM-dd HH:mm:ss X", result: "2015-03-15T15:02:37+08:00"},
|
65
|
+
"valid w/TZ HHmm XX" => {value: "1502 +0800", pattern: "HHmm XX", result: "15:02:00+08:00"},
|
66
|
+
"valid w/TZ yyyy-MM-dd HH:mm:ss XX" => {value: "2015-03-15 15:02:37 -0800", pattern: "yyyy-MM-dd HH:mm:ss XX", result: "2015-03-15T15:02:37-08:00"},
|
67
|
+
"valid w/TZ HHmm XXX" => {value: "1502 +08:00", pattern: "HHmm XXX", result: "15:02:00+08:00"},
|
68
|
+
"valid w/TZ yyyy-MM-ddTHH:mm:ssXXX" => {value: "2015-03-15T15:02:37-05:00", pattern: "yyyy-MM-ddTHH:mm:ssXXX", result: "2015-03-15T15:02:37-05:00"},
|
69
|
+
"invalid w/TZ HH:mm:ssX" => {value: "15:02:37-05:00", pattern: "HH:mm:ssX", error: "15:02:37-05:00 does not match pattern HH:mm:ssX"},
|
70
|
+
"invalid w/TZ HH:mm:ssXX" => {value: "15:02:37-05", pattern: "HH:mm:ssXX", error: "15:02:37-05 does not match pattern HH:mm:ssXX"},
|
71
|
+
}.each do |name, props|
|
72
|
+
context name do
|
73
|
+
let(:base) {props[:base]}
|
74
|
+
let(:pattern) {props[:pattern]}
|
75
|
+
let(:value) {props[:value]}
|
76
|
+
let(:result) {props.fetch(:result, value)}
|
77
|
+
if props[:error]
|
78
|
+
it "finds error" do
|
79
|
+
expect {subject.parse_uax35_date(pattern, value)}.to raise_error(RDF::Tabular::UAX35::ParseError, props[:error])
|
80
|
+
end
|
81
|
+
else
|
82
|
+
it "generates #{props[:result] || props[:value]}" do
|
83
|
+
expect(subject.parse_uax35_date(pattern, value)).to eql result
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "parse_uax35_number" do
|
91
|
+
{
|
92
|
+
# Numbers
|
93
|
+
"default no constraints" => {valid: %w(4)},
|
94
|
+
"default matching pattern" => {pattern: "000", valid: %w(123)},
|
95
|
+
"default explicit groupChar" => {groupChar: ";", valid: {"123;456.789" => "123456.789"}},
|
96
|
+
"default repeated groupChar" => {groupChar: ";", invalid: %w(123;;456.789)},
|
97
|
+
"default explicit decimalChar" => {decimalChar: ";", valid: {"123456;789" => "123456.789"}},
|
98
|
+
"default percent" => {groupChar: ",", valid: {"123456.789%" => "1234.56789"}},
|
99
|
+
"default per-mille" => {groupChar: ",", valid: {"123456.789‰" => "123.456789"}},
|
100
|
+
|
101
|
+
"0" => {pattern: "0", valid: %w(1 -1 12), invalid: %w(1.2)},
|
102
|
+
"00" => {pattern: "00", valid: %w(12 123), invalid: %w(1 1,2)},
|
103
|
+
"#" => {pattern: "#", valid: %w(1 12 123), invalid: %w(1.2)},
|
104
|
+
"##" => {pattern: "##", valid: %w(1 12 123), invalid: %w(1.2)},
|
105
|
+
"#0" => {pattern: "#0", valid: %w(1 12 123), invalid: %w(1.2)},
|
106
|
+
'0.0' => {pattern: "0.0", valid: %w(1.1 -1.1 12.1), invalid: %w(1.12)},
|
107
|
+
'0.00' => {pattern: '0.00', valid: %w(1.12 +1.12 12.12), invalid: %w(1.1 1.123)},
|
108
|
+
'0.#' => {pattern: '0.#', valid: %w(1 1.1 12.1), invalid: %w(1.12)},
|
109
|
+
'-0' => {pattern: '-0', valid: %w(-1 -10), invalid: %w(1 +1)},
|
110
|
+
'%000' => {pattern: '%000', valid: {"%123" => "1.23", "%+123" => "+1.23", "%1234" => "12.34"}, invalid: %w(%12 123%)},
|
111
|
+
'‰000' => {pattern: '‰000', valid: {"‰123" => "0.123", "‰+123" => "+0.123", "‰1234" => "1.234"}, invalid: %w(‰12 123‰)},
|
112
|
+
'000%' => {pattern: '000%', valid: {"123%" => "1.23", "+123%" => "+1.23", "1234%" => "12.34"}, invalid: %w(12% %123)},
|
113
|
+
'000‰' => {pattern: '000‰', valid: {"123‰" => "0.123", "+123‰" => "+0.123", "1234‰" => "1.234"}, invalid: %w(12‰ ‰123)},
|
114
|
+
'000.0%' => {pattern: '000.0%', valid: {"123.4%" => "1.234", "+123.4%" => "+1.234"}, invalid: %w(123.4‰ 123.4 1.234% 12.34% 123.45%)},
|
115
|
+
|
116
|
+
'###0.#####' => {pattern: '###0.#####', valid: %w(1 1.1 12345.12345), invalid: %w(1,234.1 1.123456)},
|
117
|
+
'###0.0000#' => {pattern: '###0.0000#', valid: %w(1.1234 1.12345 12345.12345), invalid: %w(1,234.1234 1.12)},
|
118
|
+
'00000.0000' => {pattern: '00000.0000', valid: %w(12345.1234), invalid: %w(1.2 1,234.123,4)},
|
119
|
+
|
120
|
+
'#0.0#E#0' => {pattern: '#0.0#E#0', valid: %w(1.2e3 12.34e56)},
|
121
|
+
'#0.0#E+#0' => {pattern: '#0.0#E+#0', valid: %w(1.2e+3 12.34e+56), invalid: %w(1.2e3 12.34e56)},
|
122
|
+
'#0.0#E#0%' => {pattern: '#0.0#E#0%', valid: {"1.2e3%" => "0.012e3", "12.34e56%" => "0.1234e56"}, invalid: %w(1.2e+3 12.34e+56 1.2e3 12.34e56)},
|
123
|
+
|
124
|
+
# Grouping
|
125
|
+
'#,##,##0' => {pattern: '#,##,##0', valid: {"1" => "1", "12" => "12", "123" => "123", "1,234" => "1234", "12,345" => "12345", "1,23,456" => "123456"}, invalid: %w(1,2 12,34)},
|
126
|
+
'#,##,#00' => {pattern: '#,##,#00', valid: {"12" => "12", "123" => "123", "1,234" => "1234", "12,345" => "12345"}, invalid: %w(1)},
|
127
|
+
'#,##,000' => {pattern: '#,##,000', valid: {"123" => "123", "1,234" => "1234", "12,345" => "12345"}, invalid: %w(1 12)},
|
128
|
+
'#,#0,000' => {pattern: '#,#0,000', valid: {"1,234" => "1234", "12,345" => "12345"}, invalid: %w(1 12 123)},
|
129
|
+
'#,00,000' => {pattern: '#,00,000', valid: {"12,345" => "12345"}, invalid: %w(1 12 123 1,234)},
|
130
|
+
'0,00,000' => {pattern: '0,00,000'},
|
131
|
+
|
132
|
+
'0.0##,###' => {pattern: '0.0##,###'},
|
133
|
+
'0.00#,###' => {pattern: '0.00#,###'},
|
134
|
+
'0.000,###' => {pattern: '0.000,###'},
|
135
|
+
'0.000,0##' => {pattern: '0.000,0##'},
|
136
|
+
'0.000,00#' => {pattern: '0.000,00#'},
|
137
|
+
'0.000,000' => {pattern: '0.000,000'},
|
138
|
+
|
139
|
+
# Jeni's
|
140
|
+
'##0' => {pattern: '##0', valid: %w(1 12 123 1234), invalid: %w(1,234 123.4)},
|
141
|
+
'#,#00' => {pattern: '#,#00', valid: {"12" => "12", "123" => "123", "1,234" => "1234", "1,234,567" => "1234567"}, invalid: %w(1 1234 12,34 12,34,567)},
|
142
|
+
'#0.#' => {pattern: '#0.#', valid: %w(1 1.2 1234.5), invalid: %w(12.34 1,234.5)},
|
143
|
+
'#0.0#,#' => {pattern: '#0.0#,#', valid: {"12.3" => "12.3", "12.34" => "12.34", "12.34,5" => "12.345"}, invalid: %w(1 12.345 12.34,56,7 12.34,567)},
|
144
|
+
}.each do |name, props|
|
145
|
+
context name do
|
146
|
+
let(:pattern) {props[:pattern]}
|
147
|
+
let(:groupChar) {props.fetch(:groupChar, ',')}
|
148
|
+
let(:decimalChar) {props.fetch(:decimalChar, '.')}
|
149
|
+
|
150
|
+
describe "valid" do
|
151
|
+
case props[:valid]
|
152
|
+
when Hash
|
153
|
+
props[:valid].each do |value, result|
|
154
|
+
it "with #{props[:pattern].inspect} #{value.inspect} => #{result.inspect}" do
|
155
|
+
expect(subject.parse_uax35_number(pattern, value, groupChar, decimalChar)).to eql result
|
156
|
+
end
|
157
|
+
end
|
158
|
+
when Array
|
159
|
+
props[:valid].each do |value|
|
160
|
+
it "with #{props[:pattern].inspect} #{value.inspect} => #{value.inspect}" do
|
161
|
+
expect(subject.parse_uax35_number(pattern, value, groupChar, decimalChar)).to eql value
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
describe "invalid" do
|
167
|
+
Array(props[:invalid]).each do |value|
|
168
|
+
it "with #{props[:pattern].inspect} #{value.inspect} invalid" do
|
169
|
+
expect {subject.parse_uax35_number(pattern, value, groupChar, decimalChar)}.to raise_error RDF::Tabular::UAX35::ParseError
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
it "recognizes bad pattern #{pattern.inspect}" do
|
175
|
+
expect{subject.parse_uax35_number(pattern, "", groupChar, decimalChar)}.to raise_error(ArgumentError)
|
176
|
+
end if props[:exception]
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
describe "#build_number_re" do
|
182
|
+
{
|
183
|
+
'0' => {valid: %w(1 -1 +1 12), invalid: %w(1.2), base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,})(?<suffix>)$/},
|
184
|
+
'00' => {valid: %w(12 123), invalid: %w(1 1,2), base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{2,})(?<suffix>)$/},
|
185
|
+
'#' => {valid: %w(1 12 123), invalid: %w(1.2), base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{0,})(?<suffix>)$/},
|
186
|
+
'##' => {re: /^(?<prefix>[+-]?)(?<numeric_part>\d{0,})(?<suffix>)$/},
|
187
|
+
'#0' => {re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,})(?<suffix>)$/},
|
188
|
+
|
189
|
+
'0.0' => {valid: %w(1.1 -1.1 12.1), invalid: %w(1.12), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1})(?<suffix>)$/},
|
190
|
+
'0.00' => {valid: %w(1.12 +1.12 12.12), invalid: %w(1.1 1.123), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{2})(?<suffix>)$/},
|
191
|
+
'0.#' => {valid: %w(1 1.1 12.1), invalid: %w(1.12), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}(?:\.\d{0,1})?)(?<suffix>)$/},
|
192
|
+
'-0' => {valid: %w(-1 -10), invalid: %w(1 +1), base: "decimal", re: /^(?<prefix>\-)(?<numeric_part>\d{1,})(?<suffix>)$/},
|
193
|
+
'%000' => {valid: %w(%123 %+123 %-123 %1234), invalid: %w(%12 123%), base: "decimal", re: /^(?<prefix>%[+-]?)(?<numeric_part>\d{3,})(?<suffix>)$/},
|
194
|
+
'‰000' => {valid: %w(‰123 ‰+123 ‰-123 ‰1234), invalid: %w(‰12 123‰), base: "decimal", re: /^(?<prefix>‰[+-]?)(?<numeric_part>\d{3,})(?<suffix>)$/},
|
195
|
+
'000%' => {valid: %w(123% +123% -123% 1234%), invalid: %w(12% %123), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{3,})(?<suffix>%)$/},
|
196
|
+
'000‰' => {valid: %w(123‰ +123‰ -123‰ 1234‰), invalid: %w(12‰ ‰123), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{3,})(?<suffix>‰)$/},
|
197
|
+
'000.0%' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{3,}\.\d{1})(?<suffix>%)$/},
|
198
|
+
|
199
|
+
'###0.#####' => {valid: %w(1 1.1 12345.12345), invalid: %w(1,234.1 1.123456), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}(?:\.\d{0,5})?)(?<suffix>)$/},
|
200
|
+
'###0.0000#' => {valid: %w(1.1234 1.12345 12345.12345), invalid: %w(1,234.1234 1.12), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{4,5})(?<suffix>)$/},
|
201
|
+
'00000.0000' => {valid: %w(12345.1234), invalid: %w(1.2 1,234.123,4), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{5,}\.\d{4})(?<suffix>)$/},
|
202
|
+
|
203
|
+
'#0.0#E#0' => {base: "double", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1,2}E[+-]?\d{1,2})(?<suffix>)$/},
|
204
|
+
'#0.0#E+#0' => {base: "double", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1,2}E\+\d{1,2})(?<suffix>)$/},
|
205
|
+
'#0.0#E#0%' => {base: "double", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1,2}E[+-]?\d{1,2})(?<suffix>%)$/},
|
206
|
+
|
207
|
+
# Grouping
|
208
|
+
'#,##,##0' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:(?:(?:\d{1,2},)?(?:\d{2},)*\d)?\d)?\d{1})(?<suffix>)$/},
|
209
|
+
'#,##,#00' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:(?:\d{1,2},)?(?:\d{2},)*\d)?\d{2})(?<suffix>)$/},
|
210
|
+
'#,##,000' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:\d{1,2},)?(?:\d{2},)*\d{3})(?<suffix>)$/},
|
211
|
+
'#,#0,000' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:(?:\d{1,2},)?(?:\d{2},)*\d)?\d{1},\d{3})(?<suffix>)$/},
|
212
|
+
'#,00,000' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:\d{1,2},)?(?:\d{2},)*\d{2},\d{3})(?<suffix>)$/},
|
213
|
+
'0,00,000' => {base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:(?:\d{1,2},)?(?:\d{2},)*\d)?\d{1},\d{2},\d{3})(?<suffix>)$/},
|
214
|
+
|
215
|
+
'0.0##,###' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1}(?:\d(?:\d(?:,\d(?:\d(?:\d)?)?)?)?)?)(?<suffix>)$/},
|
216
|
+
'0.00#,###' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{2}(?:\d(?:,\d(?:\d(?:\d)?)?)?)?)(?<suffix>)$/},
|
217
|
+
'0.000,###' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{3}(?:,\d(?:\d(?:\d)?)?)?)(?<suffix>)$/},
|
218
|
+
'0.000,0##' => {base: "decimal", re:/^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{3},\d{1}(?:\d(?:\d)?)?)(?<suffix>)$/},
|
219
|
+
'0.000,00#' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{3},\d{2}(?:\d)?)(?<suffix>)$/},
|
220
|
+
'0.000,000' => {base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{3},\d{3})(?<suffix>)$/},
|
221
|
+
|
222
|
+
# Jeni's
|
223
|
+
'##0' => {valid: %w(1 12 123 1234), invalid: %w(1,234 123.4), base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,})(?<suffix>)$/},
|
224
|
+
'#,#00' => {valid: %w(12 123 1,234 1,234,567), invalid: %w(1 1234 12,34 12,34,567), base: "integer", re: /^(?<prefix>[+-]?)(?<numeric_part>(?:(?:\d{1,3},)?(?:\d{3},)*\d)?\d{2})(?<suffix>)$/},
|
225
|
+
'#0.#' => {valid: %w(1 1.2 1234.5), invalid: %w(12.34 1,234.5), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}(?:\.\d{0,1})?)(?<suffix>)$/},
|
226
|
+
'#0.0#,#' => {valid: %w(12.3 12.34 12.34,5), invalid: %w(1 12.345 12.34,56,7 12.34,567), base: "decimal", re: /^(?<prefix>[+-]?)(?<numeric_part>\d{1,}\.\d{1}(?:\d(?:,\d)?)?)(?<suffix>)$/},
|
227
|
+
}.each do |pattern, props|
|
228
|
+
context pattern do
|
229
|
+
it "generates #{props[:re]} for #{pattern}" do
|
230
|
+
expect(subject.build_number_re(pattern, ",", ".")).to eql props[:re]
|
231
|
+
end if props[:re].is_a?(Regexp)
|
232
|
+
|
233
|
+
it "recognizes bad pattern #{pattern}" do
|
234
|
+
expect{subject.build_number_re(pattern, ",", ".")}.to raise_error(ArgumentError)
|
235
|
+
end if props[:re] == ArgumentError
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
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:
|
4
|
+
version: 3.1.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: 2019-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcp47
|
@@ -36,56 +36,56 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '3.1'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '3.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdf-vocab
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '3.1'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '3.1'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rdf-xsd
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '3.1'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '3.1'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: json-ld
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '3.1'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
88
|
+
version: '3.1'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: addressable
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,28 +106,28 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '1.
|
109
|
+
version: '1.8'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '1.
|
116
|
+
version: '1.8'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: rspec
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '3.
|
123
|
+
version: '3.7'
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: '3.
|
130
|
+
version: '3.7'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: rspec-its
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,84 +148,84 @@ dependencies:
|
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '
|
151
|
+
version: '3.1'
|
152
152
|
type: :development
|
153
153
|
prerelease: false
|
154
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
158
|
+
version: '3.1'
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: rdf-spec
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '
|
165
|
+
version: '3.1'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
172
|
+
version: '3.1'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: rdf-turtle
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '
|
179
|
+
version: '3.1'
|
180
180
|
type: :development
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '
|
186
|
+
version: '3.1'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: sparql
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - "~>"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: '
|
193
|
+
version: '3.1'
|
194
194
|
type: :development
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: '
|
200
|
+
version: '3.1'
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: webmock
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: '
|
207
|
+
version: '3.0'
|
208
208
|
type: :development
|
209
209
|
prerelease: false
|
210
210
|
version_requirements: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
212
|
- - "~>"
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
version: '
|
214
|
+
version: '3.0'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
216
|
name: yard
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
219
|
- - "~>"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version:
|
221
|
+
version: 0.9.12
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - "~>"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
228
|
+
version: 0.9.12
|
229
229
|
description: RDF::Tabular processes tabular data with metadata creating RDF or JSON
|
230
230
|
output.
|
231
231
|
email: public-rdf-ruby@w3.org
|
@@ -250,12 +250,68 @@ files:
|
|
250
250
|
- lib/rdf/tabular.rb
|
251
251
|
- lib/rdf/tabular/csvw.rb
|
252
252
|
- lib/rdf/tabular/format.rb
|
253
|
-
- lib/rdf/tabular/json.rb
|
254
253
|
- lib/rdf/tabular/literal.rb
|
255
254
|
- lib/rdf/tabular/metadata.rb
|
256
255
|
- lib/rdf/tabular/reader.rb
|
257
256
|
- lib/rdf/tabular/uax35.rb
|
258
257
|
- lib/rdf/tabular/version.rb
|
258
|
+
- spec/data/countries-minimal.json
|
259
|
+
- spec/data/countries-minimal.ttl
|
260
|
+
- spec/data/countries-standard.json
|
261
|
+
- spec/data/countries-standard.ttl
|
262
|
+
- spec/data/countries.csv
|
263
|
+
- spec/data/countries.csv-minimal.json
|
264
|
+
- spec/data/countries.csv-minimal.ttl
|
265
|
+
- spec/data/countries.csv-standard.json
|
266
|
+
- spec/data/countries.csv-standard.ttl
|
267
|
+
- spec/data/countries.html
|
268
|
+
- spec/data/countries.json
|
269
|
+
- spec/data/countries_embed-minimal.json
|
270
|
+
- spec/data/countries_embed-minimal.ttl
|
271
|
+
- spec/data/countries_embed-standard.json
|
272
|
+
- spec/data/countries_embed-standard.ttl
|
273
|
+
- spec/data/countries_embed.html
|
274
|
+
- spec/data/countries_html-minimal.json
|
275
|
+
- spec/data/countries_html-minimal.ttl
|
276
|
+
- spec/data/countries_html-standard.json
|
277
|
+
- spec/data/countries_html-standard.ttl
|
278
|
+
- spec/data/country-codes-and-names-minimal.json
|
279
|
+
- spec/data/country-codes-and-names-minimal.ttl
|
280
|
+
- spec/data/country-codes-and-names-standard.json
|
281
|
+
- spec/data/country-codes-and-names-standard.ttl
|
282
|
+
- spec/data/country-codes-and-names.csv
|
283
|
+
- spec/data/country_slice.csv
|
284
|
+
- spec/data/junior-roles.csv
|
285
|
+
- spec/data/junior-roles.json
|
286
|
+
- spec/data/roles-minimal.json
|
287
|
+
- spec/data/roles-minimal.ttl
|
288
|
+
- spec/data/roles-standard.json
|
289
|
+
- spec/data/roles-standard.ttl
|
290
|
+
- spec/data/roles.json
|
291
|
+
- spec/data/senior-roles.csv
|
292
|
+
- spec/data/senior-roles.json
|
293
|
+
- spec/data/test232-metadata.json
|
294
|
+
- spec/data/test232.csv
|
295
|
+
- spec/data/tree-ops-atd.json
|
296
|
+
- spec/data/tree-ops-ext-minimal.json
|
297
|
+
- spec/data/tree-ops-ext-minimal.ttl
|
298
|
+
- spec/data/tree-ops-ext-standard.json
|
299
|
+
- spec/data/tree-ops-ext-standard.ttl
|
300
|
+
- spec/data/tree-ops-ext.csv
|
301
|
+
- spec/data/tree-ops-ext.json
|
302
|
+
- spec/data/tree-ops-minimal.json
|
303
|
+
- spec/data/tree-ops-minimal.ttl
|
304
|
+
- spec/data/tree-ops-standard.json
|
305
|
+
- spec/data/tree-ops-standard.ttl
|
306
|
+
- spec/data/tree-ops-virtual-minimal.json
|
307
|
+
- spec/data/tree-ops-virtual-minimal.ttl
|
308
|
+
- spec/data/tree-ops-virtual-standard.json
|
309
|
+
- spec/data/tree-ops-virtual-standard.ttl
|
310
|
+
- spec/data/tree-ops-virtual.json
|
311
|
+
- spec/data/tree-ops.csv
|
312
|
+
- spec/data/tree-ops.csv-metadata.json
|
313
|
+
- spec/data/tree-ops.html
|
314
|
+
- spec/data/tree-ops.tsv
|
259
315
|
- spec/format_spec.rb
|
260
316
|
- spec/matchers.rb
|
261
317
|
- spec/metadata_spec.rb
|
@@ -263,6 +319,7 @@ files:
|
|
263
319
|
- spec/spec_helper.rb
|
264
320
|
- spec/suite_helper.rb
|
265
321
|
- spec/suite_spec.rb
|
322
|
+
- spec/uax35_spec.rb
|
266
323
|
homepage: http://github.com/ruby-rdf/rdf-tabular
|
267
324
|
licenses:
|
268
325
|
- Unlicense
|
@@ -275,24 +332,80 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
332
|
requirements:
|
276
333
|
- - ">="
|
277
334
|
- !ruby/object:Gem::Version
|
278
|
-
version:
|
335
|
+
version: 2.2.2
|
279
336
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
337
|
requirements:
|
281
338
|
- - ">="
|
282
339
|
- !ruby/object:Gem::Version
|
283
340
|
version: '0'
|
284
341
|
requirements: []
|
285
|
-
|
286
|
-
rubygems_version: 2.4.8
|
342
|
+
rubygems_version: 3.0.6
|
287
343
|
signing_key:
|
288
344
|
specification_version: 4
|
289
345
|
summary: Tabular Data RDF Reader and JSON serializer.
|
290
346
|
test_files:
|
291
|
-
- spec/format_spec.rb
|
292
|
-
- spec/matchers.rb
|
293
|
-
- spec/metadata_spec.rb
|
294
|
-
- spec/reader_spec.rb
|
295
347
|
- spec/spec_helper.rb
|
296
|
-
- spec/
|
348
|
+
- spec/metadata_spec.rb
|
349
|
+
- spec/matchers.rb
|
297
350
|
- spec/suite_spec.rb
|
298
|
-
|
351
|
+
- spec/suite_helper.rb
|
352
|
+
- spec/reader_spec.rb
|
353
|
+
- spec/format_spec.rb
|
354
|
+
- spec/uax35_spec.rb
|
355
|
+
- spec/data/roles.json
|
356
|
+
- spec/data/countries.csv-minimal.ttl
|
357
|
+
- spec/data/countries_embed-standard.json
|
358
|
+
- spec/data/tree-ops-standard.json
|
359
|
+
- spec/data/countries.csv
|
360
|
+
- spec/data/countries_embed-minimal.json
|
361
|
+
- spec/data/countries-standard.json
|
362
|
+
- spec/data/countries_html-minimal.json
|
363
|
+
- spec/data/countries.csv-minimal.json
|
364
|
+
- spec/data/senior-roles.csv
|
365
|
+
- spec/data/roles-standard.ttl
|
366
|
+
- spec/data/countries_embed-standard.ttl
|
367
|
+
- spec/data/senior-roles.json
|
368
|
+
- spec/data/countries_html-minimal.ttl
|
369
|
+
- spec/data/junior-roles.csv
|
370
|
+
- spec/data/countries.csv-standard.ttl
|
371
|
+
- spec/data/tree-ops-ext-standard.json
|
372
|
+
- spec/data/countries_html-standard.ttl
|
373
|
+
- spec/data/tree-ops-minimal.ttl
|
374
|
+
- spec/data/junior-roles.json
|
375
|
+
- spec/data/roles-minimal.json
|
376
|
+
- spec/data/countries_html-standard.json
|
377
|
+
- spec/data/country_slice.csv
|
378
|
+
- spec/data/countries.csv-standard.json
|
379
|
+
- spec/data/tree-ops-virtual-minimal.ttl
|
380
|
+
- spec/data/countries.json
|
381
|
+
- spec/data/tree-ops.tsv
|
382
|
+
- spec/data/tree-ops-virtual.json
|
383
|
+
- spec/data/countries-minimal.json
|
384
|
+
- spec/data/tree-ops-atd.json
|
385
|
+
- spec/data/tree-ops-ext-minimal.ttl
|
386
|
+
- spec/data/tree-ops.csv
|
387
|
+
- spec/data/tree-ops-standard.ttl
|
388
|
+
- spec/data/tree-ops-virtual-standard.ttl
|
389
|
+
- spec/data/countries-minimal.ttl
|
390
|
+
- spec/data/tree-ops-virtual-standard.json
|
391
|
+
- spec/data/countries.html
|
392
|
+
- spec/data/tree-ops-ext-standard.ttl
|
393
|
+
- spec/data/country-codes-and-names-minimal.json
|
394
|
+
- spec/data/tree-ops.html
|
395
|
+
- spec/data/test232.csv
|
396
|
+
- spec/data/tree-ops-ext.json
|
397
|
+
- spec/data/roles-minimal.ttl
|
398
|
+
- spec/data/countries_embed.html
|
399
|
+
- spec/data/country-codes-and-names-standard.json
|
400
|
+
- spec/data/country-codes-and-names-minimal.ttl
|
401
|
+
- spec/data/countries_embed-minimal.ttl
|
402
|
+
- spec/data/roles-standard.json
|
403
|
+
- spec/data/tree-ops-virtual-minimal.json
|
404
|
+
- spec/data/tree-ops-minimal.json
|
405
|
+
- spec/data/tree-ops.csv-metadata.json
|
406
|
+
- spec/data/countries-standard.ttl
|
407
|
+
- spec/data/tree-ops-ext-minimal.json
|
408
|
+
- spec/data/country-codes-and-names-standard.ttl
|
409
|
+
- spec/data/test232-metadata.json
|
410
|
+
- spec/data/tree-ops-ext.csv
|
411
|
+
- spec/data/country-codes-and-names.csv
|