hydra-works 0.16.0 → 2.0.0

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 (62) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +59 -0
  3. data/.gitignore +3 -1
  4. data/.rubocop.yml +2 -6
  5. data/.rubocop_todo.yml +5 -0
  6. data/.solr_wrapper +1 -0
  7. data/CHANGELOG.md +621 -0
  8. data/CODE_OF_CONDUCT.md +36 -0
  9. data/CONTRIBUTING.md +23 -21
  10. data/Gemfile +11 -3
  11. data/LICENSE +14 -16
  12. data/README.md +54 -12
  13. data/SUPPORT.md +5 -0
  14. data/hydra-works.gemspec +15 -13
  15. data/lib/hydra/works/characterization.rb +5 -4
  16. data/lib/hydra/works/characterization/fits_document.rb +348 -144
  17. data/lib/hydra/works/characterization/schema/audio_schema.rb +2 -0
  18. data/lib/hydra/works/characterization/schema/video_schema.rb +2 -0
  19. data/lib/hydra/works/models/concerns/collection_behavior.rb +44 -0
  20. data/lib/hydra/works/models/concerns/file_set_behavior.rb +20 -0
  21. data/lib/hydra/works/models/concerns/work_behavior.rb +54 -0
  22. data/lib/hydra/works/services/add_external_file_to_file_set.rb +1 -1
  23. data/lib/hydra/works/services/add_file_to_file_set.rb +1 -1
  24. data/lib/hydra/works/services/characterization_service.rb +5 -0
  25. data/lib/hydra/works/services/determine_original_name.rb +1 -1
  26. data/lib/hydra/works/version.rb +1 -1
  27. data/lib/hydra/works/virus_scanner.rb +18 -2
  28. data/spec/fixtures/fits_0.8.5_tiff.xml +78 -0
  29. data/spec/fixtures/fits_1.2.0_avi.xml +83 -0
  30. data/spec/fixtures/fits_1.2.0_jpg.xml +76 -0
  31. data/spec/fixtures/fits_1.2.0_mp3.xml +51 -0
  32. data/spec/fixtures/fits_1.2.0_mp4.xml +88 -0
  33. data/spec/fixtures/fits_netcdf_two_mimetypes.xml +35 -0
  34. data/spec/hydra/works/characterization_spec.rb +12 -5
  35. data/spec/hydra/works/models/collection_spec.rb +162 -0
  36. data/spec/hydra/works/models/concerns/file_set/contained_files_spec.rb +3 -16
  37. data/spec/hydra/works/models/file_set_spec.rb +47 -0
  38. data/spec/hydra/works/models/work_spec.rb +213 -7
  39. data/spec/hydra/works/services/characterization_service_spec.rb +90 -27
  40. data/spec/hydra/works/services/persist_derivatives_spec.rb +6 -6
  41. data/spec/hydra/works/virus_scanner_spec.rb +31 -0
  42. data/use-cases/princeton_book_use_case.md +1 -1
  43. metadata +77 -67
  44. data/.travis.yml +0 -15
  45. data/lib/hydra/works/characterization/fits_mapper.rb +0 -0
  46. data/solr/config/_rest_managed.json +0 -3
  47. data/solr/config/admin-extra.html +0 -31
  48. data/solr/config/elevate.xml +0 -36
  49. data/solr/config/mapping-ISOLatin1Accent.txt +0 -246
  50. data/solr/config/protwords.txt +0 -21
  51. data/solr/config/schema.xml +0 -372
  52. data/solr/config/scripts.conf +0 -24
  53. data/solr/config/solrconfig.xml +0 -419
  54. data/solr/config/spellings.txt +0 -2
  55. data/solr/config/stopwords.txt +0 -58
  56. data/solr/config/stopwords_en.txt +0 -58
  57. data/solr/config/synonyms.txt +0 -31
  58. data/solr/config/xslt/example.xsl +0 -132
  59. data/solr/config/xslt/example_atom.xsl +0 -67
  60. data/solr/config/xslt/example_rss.xsl +0 -66
  61. data/solr/config/xslt/luke.xsl +0 -337
  62. data/spec/fixtures/eicar.txt +0 -1
@@ -0,0 +1,76 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="12/28/17 2:57 PM">
3
+ <identification>
4
+ <identity format="JPEG EXIF" mimetype="image/jpeg" toolname="FITS" toolversion="1.2.0">
5
+ <tool toolname="Exiftool" toolversion="10.00" />
6
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" />
7
+ <version toolname="Exiftool" toolversion="10.00">1.02</version>
8
+ </identity>
9
+ </identification>
10
+ <fileinfo>
11
+ <size toolname="Jhove" toolversion="1.16">2510223</size>
12
+ <creatingApplicationName toolname="Exiftool" toolversion="10.00" status="CONFLICT">Canon EOS-1D Mark III</creatingApplicationName>
13
+ <creatingApplicationName toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">Adobe Photoshop CS3 Macintosh</creatingApplicationName>
14
+ <lastmodified toolname="Exiftool" toolversion="10.00" status="CONFLICT">2009:02:04 16:10:47</lastmodified>
15
+ <lastmodified toolname="Tika" toolversion="1.10" status="CONFLICT">2009-02-04T16:10:47</lastmodified>
16
+ <created toolname="Exiftool" toolversion="10.00" status="CONFLICT">2009:02:04 11:05:25.36-06:00</created>
17
+ <created toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">2009:02:04 16:10:47</created>
18
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/kefo/Work/fits/samples/image/127783_717918.jpg</filepath>
19
+ <filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">127783_717918.jpg</filename>
20
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">ece070706671c92a27386e8f3aeae346</md5checksum>
21
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1514490121000</fslastmodified>
22
+ </fileinfo>
23
+ <filestatus />
24
+ <metadata>
25
+ <image>
26
+ <compressionScheme toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">LZW</compressionScheme>
27
+ <imageWidth toolname="Exiftool" toolversion="10.00">3000</imageWidth>
28
+ <imageHeight toolname="Exiftool" toolversion="10.00">2153</imageHeight>
29
+ <colorSpace toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">RGB</colorSpace>
30
+ <iccProfileName toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">Adobe RGB (1998)</iccProfileName>
31
+ <iccProfileVersion toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">2.1.0</iccProfileVersion>
32
+ <YCbCrSubSampling toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">1 1</YCbCrSubSampling>
33
+ <orientation toolname="Exiftool" toolversion="10.00">normal*</orientation>
34
+ <samplingFrequencyUnit toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="SINGLE_RESULT">in.</samplingFrequencyUnit>
35
+ <xSamplingFrequency toolname="Exiftool" toolversion="10.00">240</xSamplingFrequency>
36
+ <ySamplingFrequency toolname="Exiftool" toolversion="10.00">240</ySamplingFrequency>
37
+ <bitsPerSample toolname="Exiftool" toolversion="10.00">8 8 8</bitsPerSample>
38
+ <samplesPerPixel toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">3</samplesPerPixel>
39
+ <digitalCameraManufacturer toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">Canon</digitalCameraManufacturer>
40
+ <digitalCameraModelName toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">Canon EOS-1D Mark III</digitalCameraModelName>
41
+ <scanningSoftwareName toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">Adobe Photoshop CS3 Macintosh</scanningSoftwareName>
42
+ <fNumber toolname="Exiftool" toolversion="10.00">11.0</fNumber>
43
+ <exposureTime toolname="Exiftool" toolversion="10.00">0.125</exposureTime>
44
+ <exposureProgram toolname="Exiftool" toolversion="10.00">Manual</exposureProgram>
45
+ <isoSpeedRating toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">100</isoSpeedRating>
46
+ <exifVersion toolname="Exiftool" toolversion="10.00" status="CONFLICT">0221</exifVersion>
47
+ <exifVersion toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">1220</exifVersion>
48
+ <shutterSpeedValue toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">1/8</shutterSpeedValue>
49
+ <apertureValue toolname="Exiftool" toolversion="10.00" status="CONFLICT">11.0</apertureValue>
50
+ <apertureValue toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">6.918863</apertureValue>
51
+ <exposureBiasValue toolname="Exiftool" toolversion="10.00" status="SINGLE_RESULT">0</exposureBiasValue>
52
+ <maxApertureValue toolname="Exiftool" toolversion="10.00" status="CONFLICT">2.5</maxApertureValue>
53
+ <maxApertureValue toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">2.625</maxApertureValue>
54
+ <meteringMode toolname="Exiftool" toolversion="10.00">Pattern</meteringMode>
55
+ <lightSource toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="SINGLE_RESULT">unknown</lightSource>
56
+ <flash toolname="Exiftool" toolversion="10.00">Flash did not fire</flash>
57
+ <focalLength toolname="Exiftool" toolversion="10.00">50.0</focalLength>
58
+ </image>
59
+ </metadata>
60
+ <statistics fitsExecutionTime="255">
61
+ <tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
62
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
63
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
64
+ <tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
65
+ <tool toolname="Droid" toolversion="6.3" executionTime="5" />
66
+ <tool toolname="Jhove" toolversion="1.16" executionTime="68" />
67
+ <tool toolname="file utility" toolversion="5.29" executionTime="61" />
68
+ <tool toolname="Exiftool" toolversion="10.00" executionTime="240" />
69
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" executionTime="63" />
70
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="10" />
71
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
72
+ <tool toolname="ffident" toolversion="0.2" executionTime="4" />
73
+ <tool toolname="Tika" toolversion="1.10" executionTime="127" />
74
+ </statistics>
75
+ </fits>
76
+
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="4/4/18 4:13 PM">
3
+ <identification>
4
+ <identity format="MPEG 1/2 Audio Layer 3" mimetype="audio/mpeg" toolname="FITS" toolversion="1.2.0">
5
+ <tool toolname="Droid" toolversion="6.3" />
6
+ <tool toolname="Exiftool" toolversion="10.00" />
7
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" />
8
+ <tool toolname="ffident" toolversion="0.2" />
9
+ <tool toolname="Tika" toolversion="1.10" />
10
+ <version toolname="NLNZ Metadata Extractor" toolversion="3.6GA">1</version>
11
+ <externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/134</externalIdentifier>
12
+ </identity>
13
+ </identification>
14
+ <fileinfo>
15
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/Users/cjcolvar/Documents/Code/samvera/hydra-works/spec/fixtures/test5.mp3</filepath>
16
+ <filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">test5.mp3</filename>
17
+ <size toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">366464</size>
18
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">d98da8d92c397294164b02a0382eb0e6</md5checksum>
19
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1522855873000</fslastmodified>
20
+ </fileinfo>
21
+ <filestatus />
22
+ <metadata>
23
+ <audio>
24
+ <duration toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="SINGLE_RESULT">0:0:15:261</duration>
25
+ <bitRate toolname="Exiftool" toolversion="10.00" status="CONFLICT">192 kbps</bitRate>
26
+ <bitRate toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="CONFLICT">192000</bitRate>
27
+ <sampleRate toolname="Exiftool" toolversion="10.00">44100</sampleRate>
28
+ <channels toolname="Exiftool" toolversion="10.00">2</channels>
29
+ <milliseconds toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="SINGLE_RESULT">15261</milliseconds>
30
+ <author toolname="Tika" toolversion="1.10" status="SINGLE_RESULT">Hendrik Broekman</author>
31
+ <title toolname="Tika" toolversion="1.10" status="SINGLE_RESULT">BachGavotteShort</title>
32
+ <sampleRate toolname="Tika" toolversion="1.10" status="SINGLE_RESULT">44100</sampleRate>
33
+ </audio>
34
+ </metadata>
35
+ <statistics fitsExecutionTime="2609">
36
+ <tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
37
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
38
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
39
+ <tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
40
+ <tool toolname="Droid" toolversion="6.3" executionTime="1557" />
41
+ <tool toolname="Jhove" toolversion="1.16" executionTime="2561" />
42
+ <tool toolname="file utility" toolversion="5.31" executionTime="1513" />
43
+ <tool toolname="Exiftool" toolversion="10.00" executionTime="1568" />
44
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" executionTime="1251" />
45
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="463" />
46
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
47
+ <tool toolname="ffident" toolversion="0.2" executionTime="1315" />
48
+ <tool toolname="Tika" toolversion="1.10" executionTime="640" />
49
+ </statistics>
50
+ </fits>
51
+
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="4/4/18 3:02 PM">
3
+ <identification status="CONFLICT">
4
+ <identity format="Quicktime" mimetype="video/quicktime" toolname="FITS" toolversion="1.2.0">
5
+ <tool toolname="MediaInfo" toolversion="0.7.75" />
6
+ </identity>
7
+ <identity format="MPEG-4 Media File" mimetype="application/mp4, video/mp4" toolname="FITS" toolversion="1.2.0">
8
+ <tool toolname="Droid" toolversion="6.3" />
9
+ <externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/199</externalIdentifier>
10
+ </identity>
11
+ <identity format="ISO Media, MP4 v2 [ISO 14496-14]" mimetype="video/mp4" toolname="FITS" toolversion="1.2.0">
12
+ <tool toolname="file utility" toolversion="5.22" />
13
+ </identity>
14
+ </identification>
15
+ <fileinfo>
16
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/home/app/avalon/tmp/original_file.mp4</filepath>
17
+ <filename toolname="MediaInfo" toolversion="0.7.75">original_file.mp4</filename>
18
+ <size toolname="MediaInfo" toolversion="0.7.75">199160</size>
19
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">7ae24368ccb7a6c6422a14ff73f33c9a</md5checksum>
20
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1522853877000</fslastmodified>
21
+ </fileinfo>
22
+ <filestatus />
23
+ <metadata>
24
+ <video>
25
+ <location toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">/home/app/avalon/tmp/original_file.mp4</location>
26
+ <mimeType toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">video/quicktime</mimeType>
27
+ <format toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">Quicktime</format>
28
+ <formatProfile toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">Base Media / Version 2</formatProfile>
29
+ <duration toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">6315</duration>
30
+ <bitRate toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">252301</bitRate>
31
+ <dateCreated toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">UTC 2010-09-23 00:37:25</dateCreated>
32
+ <dateModified toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">UTC 2018-04-04 14:57:57</dateModified>
33
+ <track type="video" id="1" toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">
34
+ <videoDataEncoding>avc1</videoDataEncoding>
35
+ <codecId>avc1</codecId>
36
+ <codecCC>avc1</codecCC>
37
+ <codecVersion>Main@L1.1</codecVersion>
38
+ <codecName>AVC</codecName>
39
+ <codecFamily>H.264</codecFamily>
40
+ <codecInfo>Advanced Video Codec</codecInfo>
41
+ <compression>Unknown</compression>
42
+ <byteOrder>Unknown</byteOrder>
43
+ <bitDepth>8 bits</bitDepth>
44
+ <bitRate>74477</bitRate>
45
+ <duration>6282</duration>
46
+ <trackSize>58482</trackSize>
47
+ <width>200 pixels</width>
48
+ <height>110 pixels</height>
49
+ <frameRate>24.390</frameRate>
50
+ <frameRateMode>Variable</frameRateMode>
51
+ <frameCount>149</frameCount>
52
+ <aspectRatio>16:9</aspectRatio>
53
+ <scanningFormat>Progressive</scanningFormat>
54
+ <chromaSubsampling>4:2:0</chromaSubsampling>
55
+ <colorspace>YUV</colorspace>
56
+ </track>
57
+ <track type="audio" id="2" toolname="MediaInfo" toolversion="0.7.75" status="SINGLE_RESULT">
58
+ <audioDataEncoding>AAC</audioDataEncoding>
59
+ <codecId>40</codecId>
60
+ <codecFamily>AAC</codecFamily>
61
+ <compression>Lossy</compression>
62
+ <bitRate>201736</bitRate>
63
+ <bitRateMode>Variable</bitRateMode>
64
+ <duration>6315</duration>
65
+ <trackSize>134999</trackSize>
66
+ <soundField>Front: C</soundField>
67
+ <samplingRate>48000</samplingRate>
68
+ <numSamples>303120</numSamples>
69
+ <channels>1</channels>
70
+ </track>
71
+ </video>
72
+ </metadata>
73
+ <statistics fitsExecutionTime="266">
74
+ <tool toolname="MediaInfo" toolversion="0.7.75" executionTime="252" />
75
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
76
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
77
+ <tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
78
+ <tool toolname="Droid" toolversion="6.3" executionTime="103" />
79
+ <tool toolname="Jhove" toolversion="1.16" status="did not run" />
80
+ <tool toolname="file utility" toolversion="5.22" executionTime="227" />
81
+ <tool toolname="Exiftool" toolversion="10.00" status="did not run" />
82
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
83
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="95" />
84
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
85
+ <tool toolname="ffident" toolversion="0.2" executionTime="198" />
86
+ <tool toolname="Tika" toolversion="1.10" status="did not run" />
87
+ </statistics>
88
+ </fits>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- The netCDF file analzyed to produce this output was madis-raob.nc from https://www.unidata.ucar.edu/software/netcdf/examples/files.html -->
3
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="2/7/18 10:03 PM">
4
+ <identification status="SINGLE_RESULT">
5
+ <identity format="netCDF-3 Classic" mimetype="application/netcdf, application/x-netcdf" toolname="FITS" toolversion="1.2.0">
6
+ <tool toolname="Droid" toolversion="6.3" />
7
+ <externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/282</externalIdentifier>
8
+ </identity>
9
+ </identification>
10
+ <fileinfo>
11
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/madis-raob.nc</filepath>
12
+ <filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">madis-raob.nc</filename>
13
+ <size toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">150612</size>
14
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">47b926e988723c65f0cdaf4117f4ef4d</md5checksum>
15
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1347484346000</fslastmodified>
16
+ </fileinfo>
17
+ <filestatus />
18
+ <metadata />
19
+ <statistics fitsExecutionTime="1000">
20
+ <tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
21
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
22
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
23
+ <tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
24
+ <tool toolname="Droid" toolversion="6.3" executionTime="192" />
25
+ <tool toolname="Jhove" toolversion="1.16" executionTime="993" />
26
+ <tool toolname="file utility" toolversion="5.25" executionTime="532" />
27
+ <tool toolname="Exiftool" toolversion="10.00" executionTime="532" />
28
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
29
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="188" />
30
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
31
+ <tool toolname="ffident" toolversion="0.2" executionTime="506" />
32
+ <tool toolname="Tika" toolversion="1.10" executionTime="284" />
33
+ </statistics>
34
+ </fits>
35
+
@@ -60,14 +60,17 @@ describe Hydra::Works::Characterization do
60
60
  it { is_expected.to respond_to(:height) }
61
61
  it { is_expected.to respond_to(:width) }
62
62
  it { is_expected.to respond_to(:frame_rate) }
63
+ it { is_expected.to respond_to(:bit_rate) }
63
64
  it { is_expected.to respond_to(:duration) }
64
65
  it { is_expected.to respond_to(:sample_rate) }
66
+ it { is_expected.to respond_to(:aspect_ratio) }
65
67
  end
66
68
  context "with Audio schema" do
67
69
  it { is_expected.to respond_to(:bit_depth) }
68
70
  it { is_expected.to respond_to(:channels) }
69
71
  it { is_expected.to respond_to(:data_format) }
70
72
  it { is_expected.to respond_to(:frame_rate) }
73
+ it { is_expected.to respond_to(:bit_rate) }
71
74
  it { is_expected.to respond_to(:duration) }
72
75
  it { is_expected.to respond_to(:sample_rate) }
73
76
  it { is_expected.to respond_to(:offset) }
@@ -77,17 +80,21 @@ describe Hydra::Works::Characterization do
77
80
  describe "::mapper" do
78
81
  let(:mapper_keys) do
79
82
  [
80
- :audio_duration,
81
- :audio_sample_rate,
82
- :exif_tool_version,
83
83
  :file_author,
84
84
  :file_language,
85
85
  :file_mime_type,
86
+ :audio_duration,
87
+ :audio_sample_rate,
88
+ :audio_bit_rate,
86
89
  :video_audio_sample_rate,
90
+ :track_frame_rate,
87
91
  :video_duration,
88
- :video_height,
89
92
  :video_sample_rate,
90
- :video_width
93
+ :video_bit_rate,
94
+ :video_width,
95
+ :video_track_width,
96
+ :video_height,
97
+ :video_track_height
91
98
  ]
92
99
  end
93
100
  subject { described_class.mapper.keys }
@@ -118,6 +118,18 @@ describe Hydra::Works::Collection do
118
118
  it { is_expected.to eq [collection1] }
119
119
  end
120
120
 
121
+ describe 'member_of_collections' do
122
+ let(:collection1) { described_class.create }
123
+ before do
124
+ collection.member_of_collections = [collection1]
125
+ end
126
+
127
+ it 'is a member of the collection' do
128
+ expect(collection.member_of_collections).to eq [collection1]
129
+ expect(collection.member_of_collection_ids).to eq [collection1.id]
130
+ end
131
+ end
132
+
121
133
  describe 'adding file_sets to collections' do
122
134
  let(:file_set) { Hydra::Works::FileSet.new }
123
135
  let(:exception) { ActiveFedora::AssociationTypeMismatch }
@@ -136,4 +148,154 @@ describe Hydra::Works::Collection do
136
148
  end
137
149
  end
138
150
  end
151
+
152
+ context 'relationships' do
153
+ context '#parent_collections and #parent_collection_ids' do
154
+ let(:parent_col1) { described_class.new(id: 'parent_col1') }
155
+ let(:parent_col2) { described_class.new(id: 'parent_col2') }
156
+ let(:collection) { described_class.new(id: 'collection') }
157
+
158
+ context 'when parents collection knows about child collections' do
159
+ before do
160
+ parent_col1.members = [collection]
161
+ parent_col2.members = [collection]
162
+ collection.save
163
+ parent_col1.save
164
+ parent_col2.save
165
+ end
166
+
167
+ it 'gets both parent collections' do
168
+ expect(collection.parent_collections).to match_array [parent_col1, parent_col2]
169
+ expect(collection.parent_collection_ids).to match_array [parent_col1.id, parent_col2.id]
170
+ end
171
+ end
172
+
173
+ context 'when child collection knows about parent collections' do
174
+ before do
175
+ collection.member_of_collections = [parent_col1, parent_col2]
176
+ end
177
+
178
+ it 'gets both parent collections' do
179
+ expect(collection.parent_collections).to match_array [parent_col1, parent_col2]
180
+ expect(collection.parent_collection_ids).to match_array [parent_col1.id, parent_col2.id]
181
+ end
182
+ end
183
+
184
+ context 'when some children know about parent and some parents know about child' do
185
+ before do
186
+ parent_col1.members = [collection]
187
+ collection.member_of_collections = [parent_col2]
188
+ collection.save
189
+ parent_col1.save
190
+ end
191
+
192
+ it 'gets both parent collections' do
193
+ expect(collection.parent_collections).to match_array [parent_col1, parent_col2]
194
+ expect(collection.parent_collection_ids).to match_array [parent_col1.id, parent_col2.id]
195
+ end
196
+ end
197
+ end
198
+
199
+ context '#child_collections and #child_collection_ids' do
200
+ let(:child_col1) { described_class.new(id: 'child_col1') }
201
+ let(:child_col2) { described_class.new(id: 'child_col2') }
202
+ let(:child_work) { Hydra::Works::Work.new(id: 'child_work') }
203
+ let(:collection) { described_class.new(id: 'collection') }
204
+
205
+ context 'when child collections knows about parent collections' do
206
+ before do
207
+ child_col1.member_of_collections = [collection]
208
+ child_col2.member_of_collections = [collection]
209
+ child_work.member_of_collections = [collection]
210
+ child_col1.save
211
+ child_col2.save
212
+ child_work.save
213
+ collection.save
214
+ end
215
+
216
+ it 'gets both child collections' do
217
+ expect(collection.child_collections).to match_array [child_col1, child_col2]
218
+ expect(collection.child_collection_ids).to match_array [child_col1.id, child_col2.id]
219
+ end
220
+ end
221
+
222
+ context 'when parent collection knows about child collections' do
223
+ before do
224
+ collection.members = [child_col1, child_col2, child_work]
225
+ end
226
+
227
+ it 'gets both child collections' do
228
+ expect(collection.child_collections).to match_array [child_col1, child_col2]
229
+ expect(collection.child_collection_ids).to match_array [child_col1.id, child_col2.id]
230
+ end
231
+ end
232
+
233
+ context 'when some children know about parent and some parents know about children' do
234
+ before do
235
+ collection.members = [child_col1]
236
+ child_col2.member_of_collections = [collection]
237
+ child_work.member_of_collections = [collection]
238
+ child_col2.save
239
+ child_work.save
240
+ collection.save
241
+ end
242
+
243
+ it 'gets both child collections' do
244
+ expect(collection.child_collections).to match_array [child_col1, child_col2]
245
+ expect(collection.child_collection_ids).to match_array [child_col1.id, child_col2.id]
246
+ end
247
+ end
248
+ end
249
+
250
+ context '#child_works and #child_work_ids' do
251
+ let(:work1) { Hydra::Works::Work.new(id: 'work1') }
252
+ let(:work2) { Hydra::Works::Work.new(id: 'work2') }
253
+ let(:child_collection) { described_class.new(id: 'child_collection') }
254
+ let(:collection) { described_class.new(id: 'collection') }
255
+
256
+ context 'when child works knows about parent collections' do
257
+ before do
258
+ work1.member_of_collections = [collection]
259
+ work2.member_of_collections = [collection]
260
+ child_collection.member_of_collections = [collection]
261
+ work1.save
262
+ work2.save
263
+ child_collection.save
264
+ collection.save
265
+ end
266
+
267
+ it 'gets both child works' do
268
+ expect(collection.child_works).to match_array [work1, work2]
269
+ expect(collection.child_work_ids).to match_array [work1.id, work2.id]
270
+ end
271
+ end
272
+
273
+ context 'when parent collection knows about child works' do
274
+ before do
275
+ collection.members = [work1, work2, child_collection]
276
+ end
277
+
278
+ it 'gets both child works' do
279
+ expect(collection.child_works).to match_array [work1, work2]
280
+ expect(collection.child_work_ids).to match_array [work1.id, work2.id]
281
+ end
282
+ end
283
+
284
+ context 'when some children know about parent and some parents know about children' do
285
+ before do
286
+ collection.members = [work1]
287
+ work2.member_of_collections = [collection]
288
+ child_collection.member_of_collections = [collection]
289
+ work2.save
290
+ child_collection.save
291
+ collection.save
292
+ end
293
+
294
+ it 'gets both child works' do
295
+ expect(collection.child_works).to match_array [work1, work2]
296
+ expect(collection.child_work_ids).to match_array [work1.id, work2.id]
297
+ end
298
+ end
299
+ end
300
+ end
139
301
  end