rof 1.0.7 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -7
  3. data/LICENSE +201 -16
  4. data/Rakefile +46 -0
  5. data/bin/csv_to_rof +1 -2
  6. data/bin/fedora_to_rof +7 -1
  7. data/bin/jsonld_to_rof +26 -0
  8. data/bin/osf_to_rof +6 -2
  9. data/bin/rof +5 -19
  10. data/lib/rof.rb +2 -6
  11. data/lib/rof/access.rb +1 -1
  12. data/lib/rof/cli.rb +104 -67
  13. data/lib/rof/compare_rof.rb +68 -39
  14. data/lib/rof/filter.rb +21 -0
  15. data/lib/rof/filters.rb +38 -0
  16. data/lib/rof/filters/bendo.rb +15 -17
  17. data/lib/rof/filters/date_stamp.rb +5 -4
  18. data/lib/rof/filters/file_to_url.rb +5 -3
  19. data/lib/rof/filters/label.rb +9 -7
  20. data/lib/rof/filters/work.rb +7 -5
  21. data/lib/rof/ingest.rb +5 -0
  22. data/lib/rof/osf_context.rb +2 -2
  23. data/lib/rof/rdf_context.rb +2 -0
  24. data/lib/rof/translator.rb +18 -0
  25. data/lib/rof/translators.rb +23 -0
  26. data/lib/rof/{translate_csv.rb → translators/csv_to_rof.rb} +4 -3
  27. data/lib/rof/translators/fedora_to_rof.rb +244 -0
  28. data/lib/rof/translators/jsonld_to_rof.rb +112 -0
  29. data/lib/rof/translators/jsonld_to_rof/accumulator.rb +175 -0
  30. data/lib/rof/translators/jsonld_to_rof/predicate_handler.rb +223 -0
  31. data/lib/rof/translators/jsonld_to_rof/predicate_object_handler.rb +125 -0
  32. data/lib/rof/translators/jsonld_to_rof/statement_handler.rb +91 -0
  33. data/lib/rof/translators/osf_to_rof.rb +191 -0
  34. data/lib/rof/utility.rb +44 -1
  35. data/lib/rof/version.rb +1 -1
  36. data/rof.gemspec +10 -2
  37. data/spec/coverage_helper.rb +17 -0
  38. data/spec/fixtures/for_utility_load_items_from_json_file/multiple_items.json +8 -0
  39. data/spec/fixtures/for_utility_load_items_from_json_file/parse_error.json +3 -0
  40. data/spec/fixtures/for_utility_load_items_from_json_file/single_item.json +3 -0
  41. data/spec/fixtures/jsonld_to_rof/0g354f18610.jsonld +113 -0
  42. data/spec/fixtures/jsonld_to_rof/0g354f18610.rof +96 -0
  43. data/spec/fixtures/jsonld_to_rof/2j62s467216.jsonld +113 -0
  44. data/spec/fixtures/jsonld_to_rof/2j62s467216.rof +93 -0
  45. data/spec/fixtures/jsonld_to_rof/2v23vt16z2z.jsonld +70 -0
  46. data/spec/fixtures/jsonld_to_rof/2v23vt16z2z.rof +87 -0
  47. data/spec/fixtures/jsonld_to_rof/cr56n01253w.jsonld +84 -0
  48. data/spec/fixtures/jsonld_to_rof/cr56n01253w.rof +95 -0
  49. data/spec/fixtures/jsonld_to_rof/h989r21069m.jsonld +84 -0
  50. data/spec/fixtures/jsonld_to_rof/h989r21069m.rof +98 -0
  51. data/spec/fixtures/jsonld_to_rof/js956d59913.jsonld +79 -0
  52. data/spec/fixtures/jsonld_to_rof/js956d59913.rof +89 -0
  53. data/spec/fixtures/jsonld_to_rof/m039k358q5c.jsonld +80 -0
  54. data/spec/fixtures/jsonld_to_rof/m039k358q5c.rof +64 -0
  55. data/spec/fixtures/jsonld_to_rof/nk322b9161g.jsonld +89 -0
  56. data/spec/fixtures/jsonld_to_rof/nk322b9161g.rof +69 -0
  57. data/spec/fixtures/jsonld_to_rof/p8418k7430d.jsonld +84 -0
  58. data/spec/fixtures/jsonld_to_rof/p8418k7430d.rof +67 -0
  59. data/spec/fixtures/jsonld_to_rof/xg94hm53h0c.jsonld +98 -0
  60. data/spec/fixtures/jsonld_to_rof/xg94hm53h0c.rof +110 -0
  61. data/spec/fixtures/jsonld_to_rof/zk51vd69n1r.jsonld +94 -0
  62. data/spec/fixtures/jsonld_to_rof/zk51vd69n1r.rof +121 -0
  63. data/spec/fixtures/osf/phz6b.tar.gz +0 -0
  64. data/spec/lib/rof/access_spec.rb +30 -23
  65. data/spec/lib/rof/cli_spec.rb +83 -60
  66. data/spec/lib/rof/compare_rof_spec.rb +35 -24
  67. data/spec/lib/rof/filter_spec.rb +10 -0
  68. data/spec/lib/rof/filters/bendo_spec.rb +42 -0
  69. data/spec/lib/rof/filters/date_stamp_spec.rb +9 -5
  70. data/spec/lib/rof/filters/file_to_url_spec.rb +7 -3
  71. data/spec/lib/rof/filters/label_spec.rb +121 -77
  72. data/spec/lib/rof/filters/work_spec.rb +7 -4
  73. data/spec/lib/rof/filters_spec.rb +14 -0
  74. data/spec/lib/rof/translator_spec.rb +15 -0
  75. data/spec/lib/rof/{translate_csv_spec.rb → translators/csv_to_rof_spec.rb} +14 -14
  76. data/spec/lib/rof/translators/fedora_to_rof_spec.rb +64 -0
  77. data/spec/lib/rof/translators/jsonld_to_rof/accumulator_spec.rb +121 -0
  78. data/spec/lib/rof/translators/jsonld_to_rof/predicate_handler_spec.rb +73 -0
  79. data/spec/lib/rof/translators/jsonld_to_rof/predicate_object_handler_spec.rb +48 -0
  80. data/spec/lib/rof/translators/jsonld_to_rof/statement_handler_spec.rb +40 -0
  81. data/spec/lib/rof/translators/jsonld_to_rof_spec.rb +120 -0
  82. data/spec/lib/rof/{osf_to_rof_spec.rb → translators/osf_to_rof_spec.rb} +55 -25
  83. data/spec/lib/rof/translators_spec.rb +14 -0
  84. data/spec/lib/rof/utility_spec.rb +47 -1
  85. data/spec/spec_helper.rb +1 -1
  86. data/spec/support/an_rof_filter.rb +10 -0
  87. metadata +186 -15
  88. data/lib/rof/get_from_fedora.rb +0 -211
  89. data/lib/rof/osf_to_rof.rb +0 -123
  90. data/spec/lib/rof/get_from_fedora_spec.rb +0 -22
@@ -1,30 +1,42 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe ROF::OsfToRof do
4
- it "converts an OSF Archive tar,gz to an ROF", memfs: true do
5
- #Test file dirs
6
- test_dir = Dir.mktmpdir('FROM_OSF')
7
- ttl_dir = FileUtils.mkdir_p(File.join(test_dir, 'b6psa/data/obj/root'))
3
+ RSpec.describe ROF::Translators::OsfToRof do
4
+ #Test file dirs
5
+ let(:test_dir) { Dir.mktmpdir('FROM_OSF') }
6
+ let(:ttl_dir) { FileUtils.mkdir_p(File.join(test_dir, 'b6psa/data/obj/root')) }
8
7
 
9
- # tar and ttl files
10
- tar_file = File.join(test_dir, 'b6psa.tar.gz')
11
- proj_ttl_file = File.join(ttl_dir, 'b6psa.ttl')
12
- user_ttl_file = File.join(ttl_dir, 'qpru8.ttl')
8
+ # tar and ttl files
9
+ let(:tar_file) { File.join(test_dir, 'b6psa.tar.gz') }
10
+ let(:proj_ttl_file) { File.join(ttl_dir, 'b6psa.ttl') }
11
+ let(:user_ttl_file) { File.join(ttl_dir, 'qpru8.ttl') }
13
12
 
14
- config = { 'package_dir' => "#{test_dir}" }
15
- osf_project = {
13
+ let(:config) { { 'package_dir' => "#{test_dir}" } }
14
+ let(:osf_project) do
15
+ {
16
16
  "project_identifier" => "b6psa",
17
+ "package_type" => "OSF Registration",
17
18
  "administrative_unit" => "Library",
18
19
  "owner" => "msuhovec",
19
20
  "affiliation" => "OddFellows Local 151",
20
21
  "status" => "submitted",
21
22
  }
23
+ end
24
+ around do |the_example|
25
+ FileUtils.cp('spec/fixtures/osf/b6psa.tar.gz', tar_file)
26
+ begin
27
+ the_example.call
28
+ ensure
29
+ FileUtils.remove_entry test_dir
30
+ end
31
+ end
22
32
 
33
+ it "converts an OSF Registration tar,gz to an ROF", memfs: true do
23
34
  expected_rof = [{"owner"=>"msuhovec",
24
35
  "type"=>"OsfArchive",
25
36
  "rights"=>{"read-groups"=>["public"]},
26
37
  "rels-ext"=> {"@context"=> {"@vocab"=>"info:fedora/fedora-system:def/relations-external#",
27
38
  "fedora-model"=>"info:fedora/fedora-system:def/model#",
39
+ "pav"=>"http://purl.org/pav/",
28
40
  "hydra"=>"http://projecthydra.org/ns/relations#",
29
41
  "hasModel"=>{"@id"=>"fedora-model:hasModel", "@type"=>"@id"},
30
42
  "hasEditor"=>{"@id"=>"hydra:hasEditor", "@type"=>"@id"},
@@ -45,6 +57,7 @@ RSpec.describe ROF::OsfToRof do
45
57
  "rdfs"=>"http://www.w3.org/2000/01/rdf-schema#",
46
58
  'ths' => 'http://id.loc.gov/vocabulary/relators/',
47
59
  "vracore"=>"http://purl.org/vra/",
60
+ "pav"=>"http://purl.org/pav/",
48
61
  "dc:dateSubmitted"=>{"@type"=>"http://www.w3.org/2001/XMLSchema#date"},
49
62
  "dc:created"=>{"@type"=>"http://www.w3.org/2001/XMLSchema#date"},
50
63
  "dc:modified"=>{"@type"=>"http://www.w3.org/2001/XMLSchema#date"}},
@@ -53,27 +66,44 @@ RSpec.describe ROF::OsfToRof do
53
66
  "dc:description"=>"",
54
67
  "dc:subject"=>"",
55
68
  "dc:source"=>"https://osf.io/b6psa",
69
+ "dc:type"=>"OSF Registration",
56
70
  "dc:creator#adminstrative_unit"=>"Library",
57
71
  "dc:creator#affiliation"=>"OddFellows Local 151",
58
- "dc:creator"=>["Mark Suhovecky"]},
72
+ "dc:creator"=>["Mark Suhovecky"],
73
+ "nd:osfProjectIdentifier"=>"ymt9w"},
59
74
  "files"=>["b6psa.tar.gz"]}]
75
+ expect(File.exists?(proj_ttl_file)).to be false
76
+ expect(File.exists?(user_ttl_file)).to be false
60
77
 
61
- FileUtils.cp('spec/fixtures/osf/b6psa.tar.gz', tar_file)
62
-
63
- begin
64
- expect(File.exists?(proj_ttl_file)).to be false
65
- expect(File.exists?(user_ttl_file)).to be false
78
+ rof = ROF::Translators::OsfToRof.call(osf_project, config)
66
79
 
67
- rof = ROF::OsfToRof.osf_to_rof(config, osf_project)
80
+ expect(rof).to eq( expected_rof )
68
81
 
69
- expect(rof).to eq( expected_rof )
82
+ # ingested history should be created
83
+ expect(File.exists?(proj_ttl_file)).to be true
84
+ expect(File.exists?(user_ttl_file)).to be true
85
+ end
70
86
 
71
- # ingested history should be created
72
- expect(File.exists?(proj_ttl_file)).to be true
73
- expect(File.exists?(user_ttl_file)).to be true
74
- ensure
75
- # remove the directory.
76
- FileUtils.remove_entry test_dir
87
+ describe 'RELS-EXT["pav:previousVersion"]' do
88
+ let(:converter) { ROF::Translators::OsfToRof.new(osf_project, config, previous_pid_finder) }
89
+ let(:pid_of_previous_version) { '1234' }
90
+ describe 'when previous pid is found' do
91
+ let(:previous_pid_finder) { double(call: pid_of_previous_version) }
92
+ it 'will set rels-ext pav:previousVersion to the previous pid' do
93
+ rof = converter.call
94
+ rels_ext = rof[0].fetch('rels-ext')
95
+ expect(rels_ext.fetch('pav:previousVersion')).to eq(pid_of_previous_version)
96
+ expect(previous_pid_finder).to have_received(:call).with(converter.archive_type, converter.osf_project_identifier)
97
+ end
98
+ end
99
+ describe 'when previous pid is NOT found' do
100
+ let(:previous_pid_finder) { double(call: nil) }
101
+ it 'will not set rels-ext pav:previousVersion to the previous pid' do
102
+ rof = converter.call
103
+ rels_ext = rof[0].fetch('rels-ext')
104
+ expect { rels_ext.fetch('pav:previousVersion') }.to raise_error(KeyError)
105
+ expect(previous_pid_finder).to have_received(:call).with(converter.archive_type, converter.osf_project_identifier)
106
+ end
77
107
  end
78
108
  end
79
109
  end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ module ROF
4
+ RSpec.describe Translators do
5
+ describe '.csv_to_rof' do
6
+ it 'delegates to CsvToRof.call' do
7
+ contents = double
8
+ config = double
9
+ expect(described_class::CsvToRof).to receive(:call).with(contents, config)
10
+ described_class.csv_to_rof(contents, config)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -23,6 +23,52 @@ module ROF
23
23
  end
24
24
  end
25
25
 
26
+ describe '.load_items_from_json_file' do
27
+ let(:logger) { double(puts: true) }
28
+ subject { described_class.load_items_from_json_file(filename, logger) }
29
+ context 'with a parse error' do
30
+ let(:filename) { File.join(GEM_ROOT, 'spec/fixtures/for_utility_load_items_from_json_file/parse_error.json') }
31
+ it 'will log the error and abort' do
32
+ expect(described_class).to receive(:exit!)
33
+ subject
34
+ expect(logger).to have_received(:puts).with(kind_of(String))
35
+ end
36
+ end
37
+ context 'with a single item' do
38
+ let(:filename) { File.join(GEM_ROOT, 'spec/fixtures/for_utility_load_items_from_json_file/single_item.json') }
39
+ it 'will return an Array' do
40
+ expect(described_class).not_to receive(:exit!)
41
+ expect(subject).to eq([{ "hello" => "world" }])
42
+ expect(logger).not_to have_received(:puts).with(kind_of(String))
43
+ end
44
+ end
45
+ context 'with a multiple items' do
46
+ let(:filename) { File.join(GEM_ROOT, 'spec/fixtures/for_utility_load_items_from_json_file/multiple_items.json') }
47
+ it 'will return an Array' do
48
+ expect(described_class).not_to receive(:exit!)
49
+ expect(subject).to eq([{ "hello" => "world" }, { "good" => "bye" }])
50
+ expect(logger).not_to have_received(:puts).with(kind_of(String))
51
+ end
52
+ end
53
+ end
54
+
55
+ describe '.has_embargo_date?' do
56
+ it 'handles embargo presence or absence' do
57
+ rights_tests = [
58
+ ['<embargo> <human/> <machine> <date>2017-08-01</date> </machine> </embargo>', true],
59
+ ['<embargo> <human/> <machine> <date></date> </machine> </embargo>', false],
60
+ ['<embargo> <human/> <machine/> </embargo>', false]
61
+ ]
62
+
63
+ rights_tests.each do |this_test|
64
+ xml_doc = REXML::Document.new(this_test[0])
65
+ root = xml_doc.root
66
+ rights = described_class.has_embargo_date?(root)
67
+ expect(rights).to eq(this_test[1])
68
+ end
69
+ end
70
+ end
71
+
26
72
  describe 'decode_work_type' do
27
73
 
28
74
  context 'decode article' do
@@ -59,6 +105,6 @@ module ROF
59
105
  subject { util.decode_work_type({'type' => 'image'}) }
60
106
  it { is_expected.to eq('Image')}
61
107
  end
62
- end
108
+ end
63
109
  end
64
110
  end
@@ -1,6 +1,7 @@
1
1
  GEM_ROOT = File.expand_path("../../", __FILE__)
2
2
  $:.unshift File.join(GEM_ROOT, "lib")
3
3
 
4
+ require 'coverage_helper'
4
5
  require 'rspec/its'
5
6
  require 'rspec/matchers'
6
7
  require 'equivalent-xml'
@@ -30,4 +31,3 @@ RSpec.configure do |config|
30
31
  # --seed 1234
31
32
  config.order = 'random'
32
33
  end
33
-
@@ -0,0 +1,10 @@
1
+ RSpec.shared_examples 'an ROF::Filter' do
2
+ before do
3
+ raise 'valid_options must be set with `let(:valid_options)`' unless
4
+ defined? valid_options
5
+ end
6
+
7
+ subject { described_class.new(valid_options) }
8
+
9
+ it { is_expected.to respond_to(:process).with(1).arguments }
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rof
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Friesen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-07 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdf
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: rdf-turtle
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 2.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 2.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdf-isomorphic
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rsolr
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: deprecation
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +150,20 @@ dependencies:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: nokogiri
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 1.6.8.1
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 1.6.8.1
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: activesupport
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -164,6 +192,20 @@ dependencies:
164
192
  - - "<"
165
193
  - !ruby/object:Gem::Version
166
194
  version: 1.0.2
195
+ - !ruby/object:Gem::Dependency
196
+ name: rdf-xsd
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: 2.0.0
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: 2.0.0
167
209
  - !ruby/object:Gem::Dependency
168
210
  name: bundler
169
211
  requirement: !ruby/object:Gem::Requirement
@@ -178,6 +220,34 @@ dependencies:
178
220
  - - "~>"
179
221
  - !ruby/object:Gem::Version
180
222
  version: '1.3'
223
+ - !ruby/object:Gem::Dependency
224
+ name: codeclimate-test-reporter
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: fasterer
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
181
251
  - !ruby/object:Gem::Dependency
182
252
  name: rake
183
253
  requirement: !ruby/object:Gem::Requirement
@@ -220,6 +290,20 @@ dependencies:
220
290
  - - ">="
221
291
  - !ruby/object:Gem::Version
222
292
  version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: simplecov
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :development
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
223
307
  - !ruby/object:Gem::Dependency
224
308
  name: vcr
225
309
  requirement: !ruby/object:Gem::Requirement
@@ -269,6 +353,7 @@ executables:
269
353
  - ".ruby-version"
270
354
  - csv_to_rof
271
355
  - fedora_to_rof
356
+ - jsonld_to_rof
272
357
  - osf_to_rof
273
358
  - rof
274
359
  extensions: []
@@ -285,6 +370,7 @@ files:
285
370
  - bin/.ruby-version
286
371
  - bin/csv_to_rof
287
372
  - bin/fedora_to_rof
373
+ - bin/jsonld_to_rof
288
374
  - bin/osf_to_rof
289
375
  - bin/rof
290
376
  - bulk-ingest.md
@@ -294,25 +380,61 @@ files:
294
380
  - lib/rof/cli.rb
295
381
  - lib/rof/collection.rb
296
382
  - lib/rof/compare_rof.rb
383
+ - lib/rof/filter.rb
384
+ - lib/rof/filters.rb
297
385
  - lib/rof/filters/bendo.rb
298
386
  - lib/rof/filters/date_stamp.rb
299
387
  - lib/rof/filters/file_to_url.rb
300
388
  - lib/rof/filters/label.rb
301
389
  - lib/rof/filters/work.rb
302
- - lib/rof/get_from_fedora.rb
303
390
  - lib/rof/ingest.rb
304
391
  - lib/rof/ingesters/rels_ext_ingester.rb
305
392
  - lib/rof/ingesters/rights_metadata_ingester.rb
306
393
  - lib/rof/osf_context.rb
307
- - lib/rof/osf_to_rof.rb
308
394
  - lib/rof/rdf_context.rb
309
- - lib/rof/translate_csv.rb
395
+ - lib/rof/translator.rb
396
+ - lib/rof/translators.rb
397
+ - lib/rof/translators/csv_to_rof.rb
398
+ - lib/rof/translators/fedora_to_rof.rb
399
+ - lib/rof/translators/jsonld_to_rof.rb
400
+ - lib/rof/translators/jsonld_to_rof/accumulator.rb
401
+ - lib/rof/translators/jsonld_to_rof/predicate_handler.rb
402
+ - lib/rof/translators/jsonld_to_rof/predicate_object_handler.rb
403
+ - lib/rof/translators/jsonld_to_rof/statement_handler.rb
404
+ - lib/rof/translators/osf_to_rof.rb
310
405
  - lib/rof/utility.rb
311
406
  - lib/rof/version.rb
312
407
  - rof.gemspec
408
+ - spec/coverage_helper.rb
313
409
  - spec/fixtures/a.json
410
+ - spec/fixtures/for_utility_load_items_from_json_file/multiple_items.json
411
+ - spec/fixtures/for_utility_load_items_from_json_file/parse_error.json
412
+ - spec/fixtures/for_utility_load_items_from_json_file/single_item.json
413
+ - spec/fixtures/jsonld_to_rof/0g354f18610.jsonld
414
+ - spec/fixtures/jsonld_to_rof/0g354f18610.rof
415
+ - spec/fixtures/jsonld_to_rof/2j62s467216.jsonld
416
+ - spec/fixtures/jsonld_to_rof/2j62s467216.rof
417
+ - spec/fixtures/jsonld_to_rof/2v23vt16z2z.jsonld
418
+ - spec/fixtures/jsonld_to_rof/2v23vt16z2z.rof
419
+ - spec/fixtures/jsonld_to_rof/cr56n01253w.jsonld
420
+ - spec/fixtures/jsonld_to_rof/cr56n01253w.rof
421
+ - spec/fixtures/jsonld_to_rof/h989r21069m.jsonld
422
+ - spec/fixtures/jsonld_to_rof/h989r21069m.rof
423
+ - spec/fixtures/jsonld_to_rof/js956d59913.jsonld
424
+ - spec/fixtures/jsonld_to_rof/js956d59913.rof
425
+ - spec/fixtures/jsonld_to_rof/m039k358q5c.jsonld
426
+ - spec/fixtures/jsonld_to_rof/m039k358q5c.rof
427
+ - spec/fixtures/jsonld_to_rof/nk322b9161g.jsonld
428
+ - spec/fixtures/jsonld_to_rof/nk322b9161g.rof
429
+ - spec/fixtures/jsonld_to_rof/p8418k7430d.jsonld
430
+ - spec/fixtures/jsonld_to_rof/p8418k7430d.rof
431
+ - spec/fixtures/jsonld_to_rof/xg94hm53h0c.jsonld
432
+ - spec/fixtures/jsonld_to_rof/xg94hm53h0c.rof
433
+ - spec/fixtures/jsonld_to_rof/zk51vd69n1r.jsonld
434
+ - spec/fixtures/jsonld_to_rof/zk51vd69n1r.rof
314
435
  - spec/fixtures/label.json
315
436
  - spec/fixtures/osf/b6psa.tar.gz
437
+ - spec/fixtures/osf/phz6b.tar.gz
316
438
  - spec/fixtures/rof/dev0012829m.rof
317
439
  - spec/fixtures/vcr_tests/fedora_to_rof1.yml
318
440
  - spec/fixtures/vecnet-citation.json
@@ -320,19 +442,30 @@ files:
320
442
  - spec/lib/rof/cli_spec.rb
321
443
  - spec/lib/rof/collection_spec.rb
322
444
  - spec/lib/rof/compare_rof_spec.rb
445
+ - spec/lib/rof/filter_spec.rb
446
+ - spec/lib/rof/filters/bendo_spec.rb
323
447
  - spec/lib/rof/filters/date_stamp_spec.rb
324
448
  - spec/lib/rof/filters/file_to_url_spec.rb
325
449
  - spec/lib/rof/filters/label_spec.rb
326
450
  - spec/lib/rof/filters/work_spec.rb
327
- - spec/lib/rof/get_from_fedora_spec.rb
451
+ - spec/lib/rof/filters_spec.rb
328
452
  - spec/lib/rof/ingest_spec.rb
329
453
  - spec/lib/rof/ingesters/rels_ext_ingester_spec.rb
330
454
  - spec/lib/rof/ingesters/rights_metadata_ingester_spec.rb
331
- - spec/lib/rof/osf_to_rof_spec.rb
332
- - spec/lib/rof/translate_csv_spec.rb
455
+ - spec/lib/rof/translator_spec.rb
456
+ - spec/lib/rof/translators/csv_to_rof_spec.rb
457
+ - spec/lib/rof/translators/fedora_to_rof_spec.rb
458
+ - spec/lib/rof/translators/jsonld_to_rof/accumulator_spec.rb
459
+ - spec/lib/rof/translators/jsonld_to_rof/predicate_handler_spec.rb
460
+ - spec/lib/rof/translators/jsonld_to_rof/predicate_object_handler_spec.rb
461
+ - spec/lib/rof/translators/jsonld_to_rof/statement_handler_spec.rb
462
+ - spec/lib/rof/translators/jsonld_to_rof_spec.rb
463
+ - spec/lib/rof/translators/osf_to_rof_spec.rb
464
+ - spec/lib/rof/translators_spec.rb
333
465
  - spec/lib/rof/utility_spec.rb
334
466
  - spec/lib/rof_spec.rb
335
467
  - spec/spec_helper.rb
468
+ - spec/support/an_rof_filter.rb
336
469
  homepage: https://github.com/ndlib/rof
337
470
  licenses:
338
471
  - APACHE2
@@ -358,9 +491,36 @@ signing_key:
358
491
  specification_version: 4
359
492
  summary: Raw Object Format
360
493
  test_files:
494
+ - spec/coverage_helper.rb
361
495
  - spec/fixtures/a.json
496
+ - spec/fixtures/for_utility_load_items_from_json_file/multiple_items.json
497
+ - spec/fixtures/for_utility_load_items_from_json_file/parse_error.json
498
+ - spec/fixtures/for_utility_load_items_from_json_file/single_item.json
499
+ - spec/fixtures/jsonld_to_rof/0g354f18610.jsonld
500
+ - spec/fixtures/jsonld_to_rof/0g354f18610.rof
501
+ - spec/fixtures/jsonld_to_rof/2j62s467216.jsonld
502
+ - spec/fixtures/jsonld_to_rof/2j62s467216.rof
503
+ - spec/fixtures/jsonld_to_rof/2v23vt16z2z.jsonld
504
+ - spec/fixtures/jsonld_to_rof/2v23vt16z2z.rof
505
+ - spec/fixtures/jsonld_to_rof/cr56n01253w.jsonld
506
+ - spec/fixtures/jsonld_to_rof/cr56n01253w.rof
507
+ - spec/fixtures/jsonld_to_rof/h989r21069m.jsonld
508
+ - spec/fixtures/jsonld_to_rof/h989r21069m.rof
509
+ - spec/fixtures/jsonld_to_rof/js956d59913.jsonld
510
+ - spec/fixtures/jsonld_to_rof/js956d59913.rof
511
+ - spec/fixtures/jsonld_to_rof/m039k358q5c.jsonld
512
+ - spec/fixtures/jsonld_to_rof/m039k358q5c.rof
513
+ - spec/fixtures/jsonld_to_rof/nk322b9161g.jsonld
514
+ - spec/fixtures/jsonld_to_rof/nk322b9161g.rof
515
+ - spec/fixtures/jsonld_to_rof/p8418k7430d.jsonld
516
+ - spec/fixtures/jsonld_to_rof/p8418k7430d.rof
517
+ - spec/fixtures/jsonld_to_rof/xg94hm53h0c.jsonld
518
+ - spec/fixtures/jsonld_to_rof/xg94hm53h0c.rof
519
+ - spec/fixtures/jsonld_to_rof/zk51vd69n1r.jsonld
520
+ - spec/fixtures/jsonld_to_rof/zk51vd69n1r.rof
362
521
  - spec/fixtures/label.json
363
522
  - spec/fixtures/osf/b6psa.tar.gz
523
+ - spec/fixtures/osf/phz6b.tar.gz
364
524
  - spec/fixtures/rof/dev0012829m.rof
365
525
  - spec/fixtures/vcr_tests/fedora_to_rof1.yml
366
526
  - spec/fixtures/vecnet-citation.json
@@ -368,16 +528,27 @@ test_files:
368
528
  - spec/lib/rof/cli_spec.rb
369
529
  - spec/lib/rof/collection_spec.rb
370
530
  - spec/lib/rof/compare_rof_spec.rb
531
+ - spec/lib/rof/filter_spec.rb
532
+ - spec/lib/rof/filters/bendo_spec.rb
371
533
  - spec/lib/rof/filters/date_stamp_spec.rb
372
534
  - spec/lib/rof/filters/file_to_url_spec.rb
373
535
  - spec/lib/rof/filters/label_spec.rb
374
536
  - spec/lib/rof/filters/work_spec.rb
375
- - spec/lib/rof/get_from_fedora_spec.rb
537
+ - spec/lib/rof/filters_spec.rb
376
538
  - spec/lib/rof/ingest_spec.rb
377
539
  - spec/lib/rof/ingesters/rels_ext_ingester_spec.rb
378
540
  - spec/lib/rof/ingesters/rights_metadata_ingester_spec.rb
379
- - spec/lib/rof/osf_to_rof_spec.rb
380
- - spec/lib/rof/translate_csv_spec.rb
541
+ - spec/lib/rof/translator_spec.rb
542
+ - spec/lib/rof/translators/csv_to_rof_spec.rb
543
+ - spec/lib/rof/translators/fedora_to_rof_spec.rb
544
+ - spec/lib/rof/translators/jsonld_to_rof/accumulator_spec.rb
545
+ - spec/lib/rof/translators/jsonld_to_rof/predicate_handler_spec.rb
546
+ - spec/lib/rof/translators/jsonld_to_rof/predicate_object_handler_spec.rb
547
+ - spec/lib/rof/translators/jsonld_to_rof/statement_handler_spec.rb
548
+ - spec/lib/rof/translators/jsonld_to_rof_spec.rb
549
+ - spec/lib/rof/translators/osf_to_rof_spec.rb
550
+ - spec/lib/rof/translators_spec.rb
381
551
  - spec/lib/rof/utility_spec.rb
382
552
  - spec/lib/rof_spec.rb
383
553
  - spec/spec_helper.rb
554
+ - spec/support/an_rof_filter.rb