rdf-tabular 1.0.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +62 -44
  3. data/UNLICENSE +1 -1
  4. data/VERSION +1 -1
  5. data/etc/csvw.jsonld +135 -50
  6. data/etc/doap.csv +1 -1
  7. data/etc/doap.csv-metadata.json +1 -1
  8. data/etc/doap.ttl +14 -13
  9. data/etc/earl.html +648 -648
  10. data/etc/earl.jsonld +691 -691
  11. data/etc/earl.ttl +846 -846
  12. data/lib/rdf/tabular.rb +3 -3
  13. data/lib/rdf/tabular/csvw.rb +626 -182
  14. data/lib/rdf/tabular/format.rb +8 -6
  15. data/lib/rdf/tabular/literal.rb +1 -1
  16. data/lib/rdf/tabular/metadata.rb +63 -58
  17. data/lib/rdf/tabular/reader.rb +32 -20
  18. data/lib/rdf/tabular/uax35.rb +1 -1
  19. data/spec/data/countries-minimal.json +38 -0
  20. data/spec/data/countries-minimal.ttl +36 -0
  21. data/spec/data/countries-standard.json +86 -0
  22. data/spec/data/countries-standard.ttl +75 -0
  23. data/spec/data/countries.csv +4 -0
  24. data/spec/data/countries.csv-minimal.json +16 -0
  25. data/spec/data/countries.csv-minimal.ttl +19 -0
  26. data/spec/data/countries.csv-standard.json +33 -0
  27. data/spec/data/countries.csv-standard.ttl +44 -0
  28. data/spec/data/countries.html +88 -0
  29. data/spec/data/countries.json +53 -0
  30. data/spec/data/countries_embed-minimal.json +38 -0
  31. data/spec/data/countries_embed-minimal.ttl +36 -0
  32. data/spec/data/countries_embed-standard.json +86 -0
  33. data/spec/data/countries_embed-standard.ttl +75 -0
  34. data/spec/data/countries_embed.html +88 -0
  35. data/spec/data/countries_html-minimal.json +38 -0
  36. data/spec/data/countries_html-minimal.ttl +36 -0
  37. data/spec/data/countries_html-standard.json +86 -0
  38. data/spec/data/countries_html-standard.ttl +75 -0
  39. data/spec/data/country-codes-and-names-minimal.json +19 -0
  40. data/spec/data/country-codes-and-names-minimal.ttl +22 -0
  41. data/spec/data/country-codes-and-names-standard.json +47 -0
  42. data/spec/data/country-codes-and-names-standard.ttl +45 -0
  43. data/spec/data/country-codes-and-names.csv +5 -0
  44. data/spec/data/country_slice.csv +4 -0
  45. data/spec/data/junior-roles.csv +3 -0
  46. data/spec/data/junior-roles.json +54 -0
  47. data/spec/data/roles-minimal.json +32 -0
  48. data/spec/data/roles-minimal.ttl +36 -0
  49. data/spec/data/roles-standard.json +56 -0
  50. data/spec/data/roles-standard.ttl +66 -0
  51. data/spec/data/roles.json +23 -0
  52. data/spec/data/senior-roles.csv +3 -0
  53. data/spec/data/senior-roles.json +52 -0
  54. data/spec/data/test232-metadata.json +10 -0
  55. data/spec/data/test232.csv +3 -0
  56. data/spec/data/tree-ops-atd.json +1 -0
  57. data/spec/data/tree-ops-ext-minimal.json +42 -0
  58. data/spec/data/tree-ops-ext-minimal.ttl +34 -0
  59. data/spec/data/tree-ops-ext-standard.json +93 -0
  60. data/spec/data/tree-ops-ext-standard.ttl +82 -0
  61. data/spec/data/tree-ops-ext.csv +4 -0
  62. data/spec/data/tree-ops-ext.json +81 -0
  63. data/spec/data/tree-ops-minimal.json +18 -0
  64. data/spec/data/tree-ops-minimal.ttl +14 -0
  65. data/spec/data/tree-ops-standard.json +44 -0
  66. data/spec/data/tree-ops-standard.ttl +44 -0
  67. data/spec/data/tree-ops-virtual-minimal.json +32 -0
  68. data/spec/data/tree-ops-virtual-minimal.ttl +25 -0
  69. data/spec/data/tree-ops-virtual-standard.json +49 -0
  70. data/spec/data/tree-ops-virtual-standard.ttl +49 -0
  71. data/spec/data/tree-ops-virtual.json +48 -0
  72. data/spec/data/tree-ops.csv +3 -0
  73. data/spec/data/tree-ops.csv-metadata.json +43 -0
  74. data/spec/data/tree-ops.html +54 -0
  75. data/spec/data/tree-ops.tsv +3 -0
  76. data/spec/format_spec.rb +1 -1
  77. data/spec/metadata_spec.rb +85 -8
  78. data/spec/reader_spec.rb +2 -2
  79. data/spec/suite_helper.rb +2 -2
  80. data/spec/suite_spec.rb +4 -5
  81. metadata +147 -37
  82. data/lib/rdf/tabular/json.rb +0 -0
  83. data/spec/w3c-csvw +0 -1
@@ -0,0 +1,49 @@
1
+ {
2
+ "tables": [{
3
+ "url": "http://example.org/tree-ops.csv",
4
+ "row": [
5
+ {
6
+ "url": "http://example.org/tree-ops.csv#row=2",
7
+ "rownum": 1,
8
+ "describes": [
9
+ {
10
+ "@id": "http://example.org/tree-ops.csv#gid-1",
11
+ "schema:url": "http://example.org/tree-ops.csv#gid-1",
12
+ "schema:name": "Celtis australis",
13
+ "trim_cycle": "Large Tree Routine Prune",
14
+ "schema:event": {
15
+ "@id": "http://example.org/tree-ops.csv#event-2010-10-18",
16
+ "schema:startDate": "2010-10-18"
17
+ },
18
+ "schema:location": {
19
+ "@id": "http://example.org/tree-ops.csv#location-1",
20
+ "schema:streetAddress": "ADDISON AV",
21
+ "@type": "schema:PostalAddress"
22
+ }
23
+ }
24
+ ]
25
+ },
26
+ {
27
+ "url": "http://example.org/tree-ops.csv#row=3",
28
+ "rownum": 2,
29
+ "describes": [
30
+ {
31
+ "@id": "http://example.org/tree-ops.csv#gid-2",
32
+ "schema:url": "http://example.org/tree-ops.csv#gid-2",
33
+ "schema:name": "Liquidambar styraciflua",
34
+ "trim_cycle": "Large Tree Routine Prune",
35
+ "schema:event": {
36
+ "@id": "http://example.org/tree-ops.csv#event-2010-06-02",
37
+ "schema:startDate": "2010-06-02"
38
+ },
39
+ "schema:location": {
40
+ "@id": "http://example.org/tree-ops.csv#location-2",
41
+ "schema:streetAddress": "EMERSON ST",
42
+ "@type": "schema:PostalAddress"
43
+ }
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ }]
49
+ }
@@ -0,0 +1,49 @@
1
+ @prefix csvw: <http://www.w3.org/ns/csvw#> .
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix schema: <http://schema.org/> .
4
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5
+
6
+ [
7
+ a csvw:TableGroup;
8
+ csvw:table [
9
+ a csvw:Table;
10
+ csvw:row [
11
+ a csvw:Row;
12
+ csvw:describes <http://example.org/tree-ops.csv#gid-1>,
13
+ <http://example.org/tree-ops.csv#location-1>,
14
+ <http://example.org/tree-ops.csv#event-2010-10-18>;
15
+ csvw:rownum 1;
16
+ csvw:url <http://example.org/tree-ops.csv#row=2>
17
+ ], [
18
+ a csvw:Row;
19
+ csvw:describes <http://example.org/tree-ops.csv#gid-2>,
20
+ <http://example.org/tree-ops.csv#location-2>,
21
+ <http://example.org/tree-ops.csv#event-2010-06-02>;
22
+ csvw:rownum 2;
23
+ csvw:url <http://example.org/tree-ops.csv#row=3>
24
+ ];
25
+ csvw:url <http://example.org/tree-ops.csv>
26
+ ]
27
+ ] .
28
+
29
+ <http://example.org/tree-ops.csv#gid-1> <http://example.org/tree-ops.csv#trim_cycle> "Large Tree Routine Prune";
30
+ schema:event <http://example.org/tree-ops.csv#event-2010-10-18>;
31
+ schema:location <http://example.org/tree-ops.csv#location-1>;
32
+ schema:name "Celtis australis";
33
+ schema:url <http://example.org/tree-ops.csv#gid-1> .
34
+
35
+ <http://example.org/tree-ops.csv#location-1> rdf:type schema:PostalAddress;
36
+ schema:streetAddress "ADDISON AV" .
37
+
38
+ <http://example.org/tree-ops.csv#event-2010-10-18> schema:startDate "2010-10-18"^^xsd:date .
39
+
40
+ <http://example.org/tree-ops.csv#gid-2> <http://example.org/tree-ops.csv#trim_cycle> "Large Tree Routine Prune";
41
+ schema:event <http://example.org/tree-ops.csv#event-2010-06-02>;
42
+ schema:location <http://example.org/tree-ops.csv#location-2>;
43
+ schema:name "Liquidambar styraciflua";
44
+ schema:url <http://example.org/tree-ops.csv#gid-2> .
45
+
46
+ <http://example.org/tree-ops.csv#location-2> rdf:type schema:PostalAddress;
47
+ schema:streetAddress "EMERSON ST" .
48
+
49
+ <http://example.org/tree-ops.csv#event-2010-06-02> schema:startDate "2010-06-02"^^xsd:date .
@@ -0,0 +1,48 @@
1
+ {
2
+ "url": "tree-ops.csv",
3
+ "@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}],
4
+ "tableSchema": {
5
+ "columns": [{
6
+ "name": "GID",
7
+ "titles": "GID",
8
+ "datatype": "string",
9
+ "propertyUrl": "schema:url",
10
+ "valueUrl": "#gid-{GID}"
11
+ }, {
12
+ "name": "on_street",
13
+ "titles": "On Street",
14
+ "datatype": "string",
15
+ "aboutUrl": "#location-{GID}",
16
+ "propertyUrl": "schema:streetAddress"
17
+ }, {
18
+ "name": "species",
19
+ "titles": "Species",
20
+ "datatype": "string",
21
+ "propertyUrl": "schema:name"
22
+ }, {
23
+ "name": "trim_cycle",
24
+ "titles": "Trim Cycle",
25
+ "datatype": "string"
26
+ }, {
27
+ "name": "inventory_date",
28
+ "titles": "Inventory Date",
29
+ "datatype": {"base": "date", "format": "M/d/yyyy"},
30
+ "aboutUrl": "#event-{inventory_date}",
31
+ "propertyUrl": "schema:startDate"
32
+ }, {
33
+ "propertyUrl": "schema:event",
34
+ "valueUrl": "#event-{inventory_date}",
35
+ "virtual": true
36
+ }, {
37
+ "propertyUrl": "schema:location",
38
+ "valueUrl": "#location-{GID}",
39
+ "virtual": true
40
+ }, {
41
+ "aboutUrl": "#location-{GID}",
42
+ "propertyUrl": "rdf:type",
43
+ "valueUrl": "schema:PostalAddress",
44
+ "virtual": true
45
+ }],
46
+ "aboutUrl": "#gid-{GID}"
47
+ }
48
+ }
@@ -0,0 +1,3 @@
1
+ GID,On Street,Species,Trim Cycle,Inventory Date
2
+ 1,ADDISON AV,Celtis australis,Large Tree Routine Prune,10/18/2010
3
+ 2,EMERSON ST,Liquidambar styraciflua,Large Tree Routine Prune,6/2/2010
@@ -0,0 +1,43 @@
1
+ {
2
+ "url": "tree-ops.csv",
3
+ "@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}],
4
+ "dc:title": "Tree Operations",
5
+ "dcat:keyword": ["tree", "street", "maintenance"],
6
+ "dc:publisher": "Example Municipality",
7
+ "dc:license": {"@id": "http://opendefinition.org/licenses/cc-by/"},
8
+ "dc:modified": {"@value": "2010-12-31", "@type": "xsd:date"},
9
+ "tableSchema": {
10
+ "columns": [{
11
+ "name": "GID",
12
+ "titles": [
13
+ "GID",
14
+ "Generic Identifier"
15
+ ],
16
+ "dc:description": "An identifier for the operation on a tree.",
17
+ "datatype": "string",
18
+ "required": true
19
+ }, {
20
+ "name": "on_street",
21
+ "titles": "On Street",
22
+ "dc:description": "The street that the tree is on.",
23
+ "datatype": "string"
24
+ }, {
25
+ "name": "species",
26
+ "titles": "Species",
27
+ "dc:description": "The species of the tree.",
28
+ "datatype": "string"
29
+ }, {
30
+ "name": "trim_cycle",
31
+ "titles": "Trim Cycle",
32
+ "dc:description": "The operation performed on the tree.",
33
+ "datatype": "string"
34
+ }, {
35
+ "name": "inventory_date",
36
+ "titles": "Inventory Date",
37
+ "dc:description": "The date of the operation that was performed.",
38
+ "datatype": {"base": "date", "format": "M/d/yyyy"}
39
+ }],
40
+ "primaryKey": "GID",
41
+ "aboutUrl": "#gid-{GID}"
42
+ }
43
+ }
@@ -0,0 +1,54 @@
1
+ <html>
2
+ <head>
3
+ <title>Embedding Metadata in HTML</title>
4
+ <script type="application/csvm+json">
5
+ {
6
+ "url": "tree-ops.csv",
7
+ "@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}],
8
+ "dc:title": "Tree Operations",
9
+ "dcat:keyword": ["tree", "street", "maintenance"],
10
+ "dc:publisher": "Example Municipality",
11
+ "dc:license": {"@id": "http://opendefinition.org/licenses/cc-by/"},
12
+ "dc:modified": {"@value": "2010-12-31", "@type": "xsd:date"},
13
+ "tableSchema": {
14
+ "columns": [{
15
+ "name": "GID",
16
+ "titles": [
17
+ "GID",
18
+ "Generic Identifier"
19
+ ],
20
+ "dc:description": "An identifier for the operation on a tree.",
21
+ "datatype": "string",
22
+ "required": true
23
+ }, {
24
+ "name": "on_street",
25
+ "titles": "On Street",
26
+ "dc:description": "The street that the tree is on.",
27
+ "datatype": "string"
28
+ }, {
29
+ "name": "species",
30
+ "titles": "Species",
31
+ "dc:description": "The species of the tree.",
32
+ "datatype": "string"
33
+ }, {
34
+ "name": "trim_cycle",
35
+ "titles": "Trim Cycle",
36
+ "dc:description": "The operation performed on the tree.",
37
+ "datatype": "string"
38
+ }, {
39
+ "name": "inventory_date",
40
+ "titles": "Inventory Date",
41
+ "dc:description": "The date of the operation that was performed.",
42
+ "datatype": {"base": "date", "format": "M/d/yyyy"}
43
+ }],
44
+ "primaryKey": "GID",
45
+ "aboutUrl": "#gid-{GID}"
46
+ }
47
+ }
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <p>This is an example of embedding metadata in a <code>script</code> element.</p>
52
+ </body>
53
+ </html>
54
+
@@ -0,0 +1,3 @@
1
+ GID On Street Species Trim Cycle Inventory Date
2
+ 1 ADDISON AV Celtis australis Large Tree Routine Prune 10/18/2010
3
+ 2 EMERSON ST Liquidambar styraciflua Large Tree Routine Prune 6/2/2010
@@ -31,7 +31,7 @@ describe RDF::Tabular::Format do
31
31
  specify {expect(described_class.to_sym).to eq :tabular}
32
32
  end
33
33
 
34
- describe ".cli_commands" do
34
+ describe ".cli_commands", skip: ("TextMate OptionParser issues" if ENV['TM_SELECTED_FILE']) do
35
35
  before(:each) do
36
36
  WebMock.stub_request(:any, %r(.*example.org.*)).
37
37
  to_return(lambda {|request|
@@ -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
@@ -1088,6 +1082,89 @@ describe RDF::Tabular::Metadata do
1088
1082
  end
1089
1083
  end
1090
1084
  end
1085
+
1086
+ context "virtual columns" do
1087
+ subject {
1088
+ described_class.new(JSON.parse(%({
1089
+ "@context": "http://www.w3.org/ns/csvw",
1090
+ "url": "https://example.org/countries.csv",
1091
+ "aboutUrl": "https://example.org/countries",
1092
+ "@type": "Table",
1093
+ "tableSchema": {
1094
+ "@type": "Schema",
1095
+ "columns": [{
1096
+ "name": "countryCode",
1097
+ "titles": "countryCode",
1098
+ "propertyUrl": "https://example.org/countries.csv#countryCode"
1099
+ }, {
1100
+ "name": "latitude",
1101
+ "titles": "latitude",
1102
+ "propertyUrl": "https://example.org/countries.csv#latitude"
1103
+ }, {
1104
+ "name": "longitude",
1105
+ "titles": "longitude",
1106
+ "propertyUrl": "https://example.org/countries.csv#longitude"
1107
+ }, {
1108
+ "name": "name",
1109
+ "titles": "name",
1110
+ "propertyUrl": "https://example.org/countries.csv#name"
1111
+ }, {
1112
+ "virtual": true,
1113
+ "propertyUrl": "https://example.org/countries.csv#virt1",
1114
+ "valueUrl": "https://example.org/countries.csv#virt1"
1115
+ }, {
1116
+ "virtual": true,
1117
+ "propertyUrl": "https://example.org/countries.csv#virt2",
1118
+ "default": "default",
1119
+ "datatype": "string"
1120
+ }]
1121
+ }
1122
+ })), base: RDF::URI("http://example.org/base"), logger: logger)
1123
+ }
1124
+ let(:input) {RDF::Util::File.open_file("https://example.org/countries.csv")}
1125
+ let(:rows) {subject.to_enum(:each_row, input).to_a}
1126
+
1127
+ it "has expected aboutUrls" do
1128
+ subject.each_row(input) do |row|
1129
+ expect(row.values[0].aboutUrl).to eq "https://example.org/countries"
1130
+ expect(row.values[1].aboutUrl).to eq "https://example.org/countries"
1131
+ expect(row.values[2].aboutUrl).to eq "https://example.org/countries"
1132
+ expect(row.values[3].aboutUrl).to eq "https://example.org/countries"
1133
+ expect(row.values[4].aboutUrl).to eq "https://example.org/countries"
1134
+ expect(row.values[5].aboutUrl).to eq "https://example.org/countries"
1135
+ end
1136
+ end
1137
+
1138
+ it "has expected propertyUrls" do
1139
+ subject.each_row(input) do |row|
1140
+ expect(row.values[0].propertyUrl).to eq "https://example.org/countries.csv#countryCode"
1141
+ expect(row.values[1].propertyUrl).to eq "https://example.org/countries.csv#latitude"
1142
+ expect(row.values[2].propertyUrl).to eq "https://example.org/countries.csv#longitude"
1143
+ expect(row.values[3].propertyUrl).to eq "https://example.org/countries.csv#name"
1144
+ expect(row.values[4].propertyUrl).to eq "https://example.org/countries.csv#virt1"
1145
+ expect(row.values[5].propertyUrl).to eq "https://example.org/countries.csv#virt2"
1146
+ end
1147
+ end
1148
+
1149
+ it "has expected valueUrls" do
1150
+ subject.each_row(input) do |row|
1151
+ expect(row.values[0].valueUrl).to be_nil
1152
+ expect(row.values[1].valueUrl).to be_nil
1153
+ expect(row.values[2].valueUrl).to be_nil
1154
+ expect(row.values[3].valueUrl).to be_nil
1155
+ expect(row.values[4].valueUrl).to eq "https://example.org/countries.csv#virt1"
1156
+ expect(row.values[5].valueUrl).to be_nil
1157
+ end
1158
+ end
1159
+
1160
+ it "has expected values" do
1161
+ rows = subject.to_enum(:each_row, input).to_a
1162
+ expect(rows[0].values.map(&:to_s)).to produce(%w(AD 42.546245 1.601554 Andorra).push("", "default"), logger)
1163
+ expect(rows[1].values.map(&:to_s)).to produce((%w(AE 23.424076 53.847818).push("United Arab Emirates", "", "default")), logger)
1164
+ expect(rows[2].values.map(&:to_s)).to produce(%w(AF 33.93911 67.709953 Afghanistan).push("", "default"), logger)
1165
+ end
1166
+ end
1167
+
1091
1168
  end
1092
1169
 
1093
1170
  context "datatypes" do
@@ -1379,7 +1456,7 @@ describe RDF::Tabular::Metadata do
1379
1456
  context "Unsupported datatypes" do
1380
1457
  %w(anyType anySimpleType ENTITIES IDREFS NMTOKENS ENTITY ID IDREF NOTATAION foo).each do |base|
1381
1458
  it "detects #{base} as unsupported" do
1382
- md = RDF::Tabular::Table.new({
1459
+ RDF::Tabular::Table.new({
1383
1460
  url: "http://example.com/table.csv",
1384
1461
  tableSchema: {
1385
1462
  columns: [{
@@ -308,7 +308,7 @@ describe RDF::Tabular::Reader do
308
308
  ASK WHERE {
309
309
  [ prov:wasGeneratedBy [
310
310
  a prov:Activity;
311
- prov:wasAssociatedWith <http://rubygems.org/gems/rdf-tabular>;
311
+ prov:wasAssociatedWith <https://rubygems.org/gems/rdf-tabular>;
312
312
  prov:startedAtTime ?start;
313
313
  prov:endedAtTime ?end;
314
314
  prov:qualifiedUsage [
@@ -331,7 +331,7 @@ describe RDF::Tabular::Reader do
331
331
  ASK WHERE {
332
332
  [ prov:wasGeneratedBy [
333
333
  a prov:Activity;
334
- prov:wasAssociatedWith <http://rubygems.org/gems/rdf-tabular>;
334
+ prov:wasAssociatedWith <https://rubygems.org/gems/rdf-tabular>;
335
335
  prov:startedAtTime ?start;
336
336
  prov:endedAtTime ?end;
337
337
  prov:qualifiedUsage [
@@ -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 = {}, &block)
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
 
@@ -25,11 +25,10 @@ describe RDF::Tabular::Reader do
25
25
  t.logger.info "source:\n#{t.input}"
26
26
  begin
27
27
  RDF::Tabular::Reader.open(t.action,
28
- t.reader_options.merge(
29
- base_uri: t.base,
30
- validate: t.validation?,
31
- logger: t.logger,
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
 
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: 1.0.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2020-08-08 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: '2.1'
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: '2.1'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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.6'
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.6'
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.4'
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.4'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.0'
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: '2.3'
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: '2.3'
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: '0.8'
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: '0.8'
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
@@ -264,8 +320,7 @@ files:
264
320
  - spec/suite_helper.rb
265
321
  - spec/suite_spec.rb
266
322
  - spec/uax35_spec.rb
267
- - spec/w3c-csvw
268
- homepage: http://github.com/ruby-rdf/rdf-tabular
323
+ homepage: https://github.com/ruby-rdf/rdf-tabular
269
324
  licenses:
270
325
  - Unlicense
271
326
  metadata: {}
@@ -284,18 +339,73 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
339
  - !ruby/object:Gem::Version
285
340
  version: '0'
286
341
  requirements: []
287
- rubyforge_project:
288
- rubygems_version: 2.6.8
342
+ rubygems_version: 3.1.3
289
343
  signing_key:
290
344
  specification_version: 4
291
345
  summary: Tabular Data RDF Reader and JSON serializer.
292
346
  test_files:
293
- - spec/format_spec.rb
294
- - spec/matchers.rb
295
- - spec/metadata_spec.rb
296
- - spec/reader_spec.rb
297
347
  - spec/spec_helper.rb
298
- - spec/suite_helper.rb
348
+ - spec/metadata_spec.rb
349
+ - spec/matchers.rb
299
350
  - spec/suite_spec.rb
351
+ - spec/suite_helper.rb
352
+ - spec/reader_spec.rb
353
+ - spec/format_spec.rb
300
354
  - spec/uax35_spec.rb
301
- - spec/w3c-csvw
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