rdf-tabular 1.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -5,7 +5,7 @@ module RDF::Tabular
5
5
  ##
6
6
  # A Tabular Data to RDF parser in Ruby.
7
7
  #
8
- # @author [Gregg Kellogg](http://greggkellogg.net/)
8
+ # @author [Gregg Kellogg](https://greggkellogg.net/)
9
9
  class Reader < RDF::Reader
10
10
  format Format
11
11
  include RDF::Util::Logger
@@ -22,24 +22,34 @@ module RDF::Tabular
22
22
 
23
23
  ##
24
24
  # Writer options
25
- # @see http://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Writer#options-class_method
25
+ # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Writer#options-class_method
26
26
  def self.options
27
27
  super + [
28
28
  RDF::CLI::Option.new(
29
29
  symbol: :metadata,
30
30
  datatype: RDF::URI,
31
+ control: :url2,
31
32
  on: ["--metadata URI"],
32
33
  description: "user supplied metadata, merged on top of extracted metadata. If provided as a URL, Metadata is loade from that location.") {|arg| RDF::URI(arg)},
33
34
  RDF::CLI::Option.new(
34
35
  symbol: :minimal,
36
+ control: :checkbox,
35
37
  datatype: TrueClass,
36
38
  on: ["--minimal"],
37
39
  description: "Includes only the information gleaned from the cells of the tabular data.") {true},
38
40
  RDF::CLI::Option.new(
39
41
  symbol: :noProv,
40
42
  datatype: TrueClass,
43
+ control: :checkbox,
41
44
  on: ["--no-prov"],
42
45
  description: "do not output optional provenance information.") {true},
46
+ RDF::CLI::Option.new(
47
+ symbol: :decode_uri,
48
+ datatype: TrueClass,
49
+ control: :checkbox,
50
+ on: ["--decode-uri"],
51
+ description: "decode %-encodings in the result of a URI Template operation."
52
+ )
43
53
  ]
44
54
  end
45
55
 
@@ -51,16 +61,18 @@ module RDF::Tabular
51
61
  # or an Array used as an internalized array of arrays
52
62
  # @param [Hash{Symbol => Object}] options
53
63
  # any additional options (see `RDF::Reader#initialize`)
64
+ # @option options [Boolean] :decode_uri
65
+ # Decode %-encodings in the result of a URI Template operation.
66
+ # @option options [Array<Hash>] :fks_referencing_table
67
+ # When called with Table metadata, a list of the foreign keys referencing this table
54
68
  # @option options [Metadata, Hash, String, RDF::URI] :metadata user supplied metadata, merged on top of extracted metadata. If provided as a URL, Metadata is loade from that location
55
69
  # @option options [Boolean] :minimal includes only the information gleaned from the cells of the tabular data
56
70
  # @option options [Boolean] :noProv do not output optional provenance information
57
- # @option optinons [Array<Hash>] :fks_referencing_table
58
- # When called with Table metadata, a list of the foreign keys referencing this table
59
71
  # @yield [reader] `self`
60
72
  # @yieldparam [RDF::Reader] reader
61
73
  # @yieldreturn [void] ignored
62
74
  # @raise [RDF::ReaderError] if the CSV document cannot be loaded
63
- def initialize(input = $stdin, options = {}, &block)
75
+ def initialize(input = $stdin, **options, &block)
64
76
  super do
65
77
  # Base would be how we are to take this
66
78
  @options[:base] ||= base_uri.to_s if base_uri
@@ -86,7 +98,7 @@ module RDF::Tabular
86
98
  # If input is JSON, then the input is the metadata
87
99
  content_type = @input.respond_to?(:content_type) ? @input.content_type : ""
88
100
  if @options[:base] =~ /\.json(?:ld)?$/ || content_type =~ %r(application/(csvm\+|ld\+)?json)
89
- @metadata = Metadata.new(@input, @options.merge(filenames: @options[:base]))
101
+ @metadata = Metadata.new(@input, filenames: @options[:base], **@options)
90
102
  # If @metadata is for a Table, turn it into a TableGroup
91
103
  @metadata = @metadata.to_table_group if @metadata.is_a?(Table)
92
104
  @metadata.normalize!
@@ -99,7 +111,7 @@ module RDF::Tabular
99
111
  def script.content_type; "application/csvm+json"; end
100
112
  log_debug("Reader#initialize") {"Process HTML script block"}
101
113
  @input = script
102
- @metadata = Metadata.new(@input, @options.merge(filenames: @options[:base]))
114
+ @metadata = Metadata.new(@input, filenames: @options[:base], **@options)
103
115
  # If @metadata is for a Table, turn it into a TableGroup
104
116
  @metadata = @metadata.to_table_group if @metadata.is_a?(Table)
105
117
  @metadata.normalize!
@@ -116,7 +128,7 @@ module RDF::Tabular
116
128
  dialect.separator = "\t" if (input.content_type == "text/tsv" rescue nil)
117
129
  embed_options = @options.dup
118
130
  embed_options[:lang] = dialect_metadata.lang if dialect_metadata.lang
119
- embedded_metadata = dialect.embedded_metadata(input, @options[:metadata], embed_options)
131
+ embedded_metadata = dialect.embedded_metadata(input, @options[:metadata], **embed_options)
120
132
 
121
133
  if (@metadata = @options[:metadata]) && @metadata.tableSchema
122
134
  @metadata.verify_compatible!(embedded_metadata)
@@ -133,7 +145,7 @@ module RDF::Tabular
133
145
  else
134
146
  # It's tabluar data. Find metadata and proceed as if it was specified in the first place
135
147
  @options[:original_input] = @input unless @options[:metadata]
136
- @input = @metadata = Metadata.for_input(@input, @options).normalize!
148
+ @input = @metadata = Metadata.for_input(@input, **@options).normalize!
137
149
  end
138
150
 
139
151
  log_debug("Reader#initialize") {"input: #{input}, metadata: #{metadata.inspect}"}
@@ -183,7 +195,7 @@ module RDF::Tabular
183
195
  if options[:original_input] && !input.describes_file?(options[:base_uri])
184
196
  table_resource = RDF::Node.new
185
197
  add_statement(0, table_group, CSVW.table, table_resource) unless minimal?
186
- Reader.new(options[:original_input], options.merge(
198
+ Reader.new(options[:original_input], **options.merge(
187
199
  metadata: input.tables.first,
188
200
  base: input.tables.first.url,
189
201
  no_found_metadata: true,
@@ -202,7 +214,7 @@ module RDF::Tabular
202
214
  end.flatten.compact
203
215
  table_resource = table.id || RDF::Node.new
204
216
  add_statement(0, table_group, CSVW.table, table_resource) unless minimal?
205
- Reader.open(table.url, options.merge(
217
+ Reader.open(table.url, **options.merge(
206
218
  metadata: table,
207
219
  base: table.url,
208
220
  no_found_metadata: true,
@@ -222,7 +234,7 @@ module RDF::Tabular
222
234
  activity = RDF::Node.new
223
235
  add_statement(0, table_group, RDF::Vocab::PROV.wasGeneratedBy, activity)
224
236
  add_statement(0, activity, RDF.type, RDF::Vocab::PROV.Activity)
225
- add_statement(0, activity, RDF::Vocab::PROV.wasAssociatedWith, RDF::URI("http://rubygems.org/gems/rdf-tabular"))
237
+ add_statement(0, activity, RDF::Vocab::PROV.wasAssociatedWith, RDF::URI("https://rubygems.org/gems/rdf-tabular"))
226
238
  add_statement(0, activity, RDF::Vocab::PROV.startedAtTime, RDF::Literal::DateTime.new(start_time))
227
239
  add_statement(0, activity, RDF::Vocab::PROV.endedAtTime, RDF::Literal::DateTime.new(Time.now))
228
240
 
@@ -418,9 +430,9 @@ module RDF::Tabular
418
430
 
419
431
  res = if io
420
432
  ::JSON::dump_default_options = json_state
421
- ::JSON.dump(self.send(hash_fn, options), io)
433
+ ::JSON.dump(self.send(hash_fn, **options), io)
422
434
  else
423
- hash = self.send(hash_fn, options)
435
+ hash = self.send(hash_fn, **options)
424
436
  ::JSON.generate(hash, json_state)
425
437
  end
426
438
 
@@ -440,7 +452,7 @@ module RDF::Tabular
440
452
  #
441
453
  # @param [Hash{Symbol => Object}] options
442
454
  # @return [Hash, Array]
443
- def to_hash(options = {})
455
+ def to_hash(**options)
444
456
  # Construct metadata from that passed from file open, along with information from the file.
445
457
  if input.is_a?(Metadata)
446
458
  log_debug("each_statement: metadata") {input.inspect}
@@ -464,13 +476,13 @@ module RDF::Tabular
464
476
  table_group['tables'] = tables
465
477
 
466
478
  if options[:original_input] && !input.describes_file?(options[:base_uri])
467
- Reader.new(options[:original_input], options.merge(
479
+ Reader.new(options[:original_input], **options.merge(
468
480
  metadata: input.tables.first,
469
481
  base: input.tables.first.url,
470
482
  minimal: minimal?,
471
483
  no_found_metadata: true,
472
484
  )) do |r|
473
- case t = r.to_hash(options)
485
+ case t = r.to_hash(**options)
474
486
  when Array then tables += t unless input.tables.first.suppressOutput
475
487
  when Hash then tables << t unless input.tables.first.suppressOutput
476
488
  end
@@ -478,13 +490,13 @@ module RDF::Tabular
478
490
  else
479
491
  input.each_table do |table|
480
492
  next if table.suppressOutput && !validate?
481
- Reader.open(table.url, options.merge(
493
+ Reader.open(table.url, **options.merge(
482
494
  metadata: table,
483
495
  base: table.url,
484
496
  minimal: minimal?,
485
497
  no_found_metadata: true,
486
498
  )) do |r|
487
- case t = r.to_hash(options)
499
+ case t = r.to_hash(**options)
488
500
  when Array then tables += t unless table.suppressOutput
489
501
  when Hash then tables << t unless table.suppressOutput
490
502
  end
@@ -557,7 +569,7 @@ module RDF::Tabular
557
569
  co['@id'] = subject.to_s unless subject == 'null'
558
570
  prop = case cell.propertyUrl
559
571
  when RDF.type then '@type'
560
- when nil then URI.decode(column.name) # Use URI-decoded name
572
+ when nil then CGI.unescape(column.name) # Use URI-decoded name
561
573
  else
562
574
  # Compact the property to a term or prefixed name
563
575
  metadata.context.compact_iri(cell.propertyUrl, vocab: true)
@@ -3,7 +3,7 @@ module RDF::Tabular
3
3
  ##
4
4
  # Utilities for parsing UAX35 dates and numbers.
5
5
  #
6
- # @see http://www.unicode.org/reports/tr35
6
+ # @see https://www.unicode.org/reports/tr35
7
7
  module UAX35
8
8
 
9
9
  ##
@@ -0,0 +1,38 @@
1
+ [
2
+ {
3
+ "@id": "http://example.org/countries.csv#AD",
4
+ "http://www.geonames.org/ontology#countryCode": "AD",
5
+ "schema:latitude": 42.546245,
6
+ "schema:longitude": 1.601554,
7
+ "schema:name": "Andorra"
8
+ },
9
+ {
10
+ "@id": "http://example.org/countries.csv#AE",
11
+ "http://www.geonames.org/ontology#countryCode": "AE",
12
+ "schema:latitude": 23.424076,
13
+ "schema:longitude": 53.847818,
14
+ "schema:name": "United Arab Emirates"
15
+ },
16
+ {
17
+ "@id": "http://example.org/countries.csv#AF",
18
+ "http://www.geonames.org/ontology#countryCode": "AF",
19
+ "schema:latitude": 33.93911,
20
+ "schema:longitude": 67.709953,
21
+ "schema:name": "Afghanistan"
22
+ },
23
+ {
24
+ "countryRef": "http://example.org/countries.csv#AF",
25
+ "year": "1960",
26
+ "population": 9616353
27
+ },
28
+ {
29
+ "countryRef": "http://example.org/countries.csv#AF",
30
+ "year": "1961",
31
+ "population": 9799379
32
+ },
33
+ {
34
+ "countryRef": "http://example.org/countries.csv#AF",
35
+ "year": "1962",
36
+ "population": 9989846
37
+ }
38
+ ]
@@ -0,0 +1,36 @@
1
+ @prefix geo: <http://www.geonames.org/ontology#> .
2
+ @prefix schema: <http://schema.org/> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+
5
+ <http://example.org/countries.csv#AD> schema:latitude "42.546245"^^xsd:double;
6
+ schema:longitude "1.601554"^^xsd:double;
7
+ schema:name "Andorra";
8
+ geo:countryCode "AD" .
9
+
10
+ <http://example.org/countries.csv#AE> schema:latitude "23.424076"^^xsd:double;
11
+ schema:longitude "53.847818"^^xsd:double;
12
+ schema:name "United Arab Emirates";
13
+ geo:countryCode "AE" .
14
+
15
+ <http://example.org/countries.csv#AF> schema:latitude "33.93911"^^xsd:double;
16
+ schema:longitude "67.709953"^^xsd:double;
17
+ schema:name "Afghanistan";
18
+ geo:countryCode "AF" .
19
+
20
+ [
21
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
22
+ <http://example.org/country_slice.csv#population> 9616353;
23
+ <http://example.org/country_slice.csv#year> "1960"^^xsd:gYear
24
+ ] .
25
+
26
+ [
27
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
28
+ <http://example.org/country_slice.csv#population> 9799379;
29
+ <http://example.org/country_slice.csv#year> "1961"^^xsd:gYear
30
+ ] .
31
+
32
+ [
33
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
34
+ <http://example.org/country_slice.csv#population> 9989846;
35
+ <http://example.org/country_slice.csv#year> "1962"^^xsd:gYear
36
+ ] .
@@ -0,0 +1,86 @@
1
+ {
2
+ "tables": [
3
+ {
4
+ "url": "http://example.org/countries.csv",
5
+ "row": [
6
+ {
7
+ "url": "http://example.org/countries.csv#row=2",
8
+ "rownum": 1,
9
+ "describes": [
10
+ {
11
+ "@id": "http://example.org/countries.csv#AD",
12
+ "http://www.geonames.org/ontology#countryCode": "AD",
13
+ "schema:latitude": 42.546245,
14
+ "schema:longitude": 1.601554,
15
+ "schema:name": "Andorra"
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ "url": "http://example.org/countries.csv#row=3",
21
+ "rownum": 2,
22
+ "describes": [
23
+ {
24
+ "@id": "http://example.org/countries.csv#AE",
25
+ "http://www.geonames.org/ontology#countryCode": "AE",
26
+ "schema:latitude": 23.424076,
27
+ "schema:longitude": 53.847818,
28
+ "schema:name": "United Arab Emirates"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "url": "http://example.org/countries.csv#row=4",
34
+ "rownum": 3,
35
+ "describes": [
36
+ {
37
+ "@id": "http://example.org/countries.csv#AF",
38
+ "http://www.geonames.org/ontology#countryCode": "AF",
39
+ "schema:latitude": 33.93911,
40
+ "schema:longitude": 67.709953,
41
+ "schema:name": "Afghanistan"
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "url": "http://example.org/country_slice.csv",
49
+ "row": [
50
+ {
51
+ "url": "http://example.org/country_slice.csv#row=2",
52
+ "rownum": 1,
53
+ "describes": [
54
+ {
55
+ "countryRef": "http://example.org/countries.csv#AF",
56
+ "year": "1960",
57
+ "population": 9616353
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ "url": "http://example.org/country_slice.csv#row=3",
63
+ "rownum": 2,
64
+ "describes": [
65
+ {
66
+ "countryRef": "http://example.org/countries.csv#AF",
67
+ "year": "1961",
68
+ "population": 9799379
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "url": "http://example.org/country_slice.csv#row=4",
74
+ "rownum": 3,
75
+ "describes": [
76
+ {
77
+ "countryRef": "http://example.org/countries.csv#AF",
78
+ "year": "1962",
79
+ "population": 9989846
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ }
85
+ ]
86
+ }
@@ -0,0 +1,75 @@
1
+ @prefix csvw: <http://www.w3.org/ns/csvw#> .
2
+ @prefix geo: <http://www.geonames.org/ontology#> .
3
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
4
+ @prefix schema: <http://schema.org/> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+
7
+ <http://example.org/countries.csv#AD> schema:latitude "42.546245"^^xsd:double;
8
+ schema:longitude "1.601554"^^xsd:double;
9
+ schema:name "Andorra";
10
+ geo:countryCode "AD" .
11
+
12
+ <http://example.org/countries.csv#AE> schema:latitude "23.424076"^^xsd:double;
13
+ schema:longitude "53.847818"^^xsd:double;
14
+ schema:name "United Arab Emirates";
15
+ geo:countryCode "AE" .
16
+
17
+ <http://example.org/countries.csv#AF> schema:latitude "33.93911"^^xsd:double;
18
+ schema:longitude "67.709953"^^xsd:double;
19
+ schema:name "Afghanistan";
20
+ geo:countryCode "AF" .
21
+
22
+ [
23
+ a csvw:TableGroup;
24
+ csvw:table [
25
+ a csvw:Table;
26
+ csvw:row [
27
+ a csvw:Row;
28
+ csvw:describes <http://example.org/countries.csv#AD>;
29
+ csvw:rownum 1;
30
+ csvw:url <http://example.org/countries.csv#row=2>
31
+ ], [
32
+ a csvw:Row;
33
+ csvw:describes <http://example.org/countries.csv#AE>;
34
+ csvw:rownum 2;
35
+ csvw:url <http://example.org/countries.csv#row=3>
36
+ ], [
37
+ a csvw:Row;
38
+ csvw:describes <http://example.org/countries.csv#AF>;
39
+ csvw:rownum 3;
40
+ csvw:url <http://example.org/countries.csv#row=4>
41
+ ];
42
+ csvw:url <http://example.org/countries.csv>
43
+ ], [
44
+ a csvw:Table;
45
+ csvw:row [
46
+ a csvw:Row;
47
+ csvw:describes [
48
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
49
+ <http://example.org/country_slice.csv#population> 9616353;
50
+ <http://example.org/country_slice.csv#year> "1960"^^xsd:gYear
51
+ ];
52
+ csvw:rownum 1;
53
+ csvw:url <http://example.org/country_slice.csv#row=2>
54
+ ], [
55
+ a csvw:Row;
56
+ csvw:describes [
57
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
58
+ <http://example.org/country_slice.csv#population> 9799379;
59
+ <http://example.org/country_slice.csv#year> "1961"^^xsd:gYear
60
+ ];
61
+ csvw:rownum 2;
62
+ csvw:url <http://example.org/country_slice.csv#row=3>
63
+ ], [
64
+ a csvw:Row;
65
+ csvw:describes [
66
+ <http://example.org/country_slice.csv#countryRef> <http://example.org/countries.csv#AF>;
67
+ <http://example.org/country_slice.csv#population> 9989846;
68
+ <http://example.org/country_slice.csv#year> "1962"^^xsd:gYear
69
+ ];
70
+ csvw:rownum 3;
71
+ csvw:url <http://example.org/country_slice.csv#row=4>
72
+ ];
73
+ csvw:url <http://example.org/country_slice.csv>
74
+ ]
75
+ ] .
@@ -0,0 +1,4 @@
1
+ countryCode,latitude,longitude,name
2
+ AD,42.546245,1.601554,Andorra
3
+ AE,23.424076,53.847818,"United Arab Emirates"
4
+ AF,33.93911,67.709953,Afghanistan
@@ -0,0 +1,16 @@
1
+ [{
2
+ "countryCode": "AD",
3
+ "latitude": "42.546245",
4
+ "longitude": "1.601554",
5
+ "name": "Andorra"
6
+ }, {
7
+ "countryCode": "AE",
8
+ "latitude": "23.424076",
9
+ "longitude": "53.847818",
10
+ "name": "United Arab Emirates"
11
+ }, {
12
+ "countryCode": "AF",
13
+ "latitude": "33.93911",
14
+ "longitude": "67.709953",
15
+ "name": "Afghanistan"
16
+ }]