bolognese 1.8.12 → 1.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +37 -0
  3. data/.github/workflows/changelog.yml +36 -0
  4. data/.github/workflows/release.yml +47 -0
  5. data/CHANGELOG.md +1716 -0
  6. data/Gemfile.lock +63 -59
  7. data/README.md +1 -1
  8. data/bolognese.gemspec +1 -1
  9. data/lib/bolognese/author_utils.rb +6 -5
  10. data/lib/bolognese/datacite_utils.rb +76 -9
  11. data/lib/bolognese/metadata.rb +10 -5
  12. data/lib/bolognese/metadata_utils.rb +3 -2
  13. data/lib/bolognese/readers/bibtex_reader.rb +5 -4
  14. data/lib/bolognese/readers/citeproc_reader.rb +1 -1
  15. data/lib/bolognese/readers/crossref_reader.rb +4 -5
  16. data/lib/bolognese/readers/datacite_reader.rb +57 -11
  17. data/lib/bolognese/readers/ris_reader.rb +3 -3
  18. data/lib/bolognese/utils.rb +163 -46
  19. data/lib/bolognese/version.rb +1 -1
  20. data/lib/bolognese/writers/bibtex_writer.rb +1 -1
  21. data/resources/kernel-4.4/include/datacite-contributorType-v4.xsd +35 -0
  22. data/resources/kernel-4.4/include/datacite-dateType-v4.xsd +25 -0
  23. data/resources/kernel-4.4/include/datacite-descriptionType-v4.xsd +19 -0
  24. data/resources/kernel-4.4/include/datacite-funderIdentifierType-v4.xsd +16 -0
  25. data/resources/kernel-4.4/include/datacite-nameType-v4.xsd +10 -0
  26. data/resources/kernel-4.4/include/datacite-numberType-v4.xsd +12 -0
  27. data/resources/kernel-4.4/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  28. data/resources/kernel-4.4/include/datacite-relationType-v4.xsd +51 -0
  29. data/resources/kernel-4.4/include/datacite-resourceType-v4.xsd +43 -0
  30. data/resources/kernel-4.4/include/datacite-titleType-v4.xsd +14 -0
  31. data/resources/kernel-4.4/include/xml.xsd +286 -0
  32. data/resources/kernel-4.4/metadata.xsd +707 -0
  33. data/resources/kernel-4/include/datacite-contributorType-v4.xsd +21 -21
  34. data/resources/kernel-4/include/datacite-dateType-v4.xsd +11 -11
  35. data/resources/kernel-4/include/datacite-descriptionType-v4.xsd +6 -6
  36. data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +5 -5
  37. data/resources/kernel-4/include/datacite-nameType-v4.xsd +2 -2
  38. data/resources/kernel-4/include/datacite-numberType-v4.xsd +12 -0
  39. data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +19 -19
  40. data/resources/kernel-4/include/datacite-relationType-v4.xsd +36 -34
  41. data/resources/kernel-4/include/datacite-resourceType-v4.xsd +32 -17
  42. data/resources/kernel-4/include/datacite-titleType-v4.xsd +4 -4
  43. data/resources/kernel-4/metadata.xsd +297 -105
  44. data/spec/fixtures/datacite-example-dissertation-v4.4.xml +56 -0
  45. data/spec/fixtures/datacite-example-full-v4.4.xml +114 -0
  46. data/spec/fixtures/datacite-example-relateditems.xml +61 -0
  47. data/spec/fixtures/datacite-example-xs-string.xml +28 -0
  48. data/spec/fixtures/datacite-geolocationpolygons-multiple.xml +56 -0
  49. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/article_id_as_page_number.yml +100 -0
  50. data/spec/metadata_spec.rb +1 -1
  51. data/spec/readers/bibtex_reader_spec.rb +2 -2
  52. data/spec/readers/crossref_reader_spec.rb +56 -38
  53. data/spec/readers/datacite_json_reader_spec.rb +1 -1
  54. data/spec/readers/datacite_reader_spec.rb +255 -4
  55. data/spec/readers/ris_reader_spec.rb +3 -3
  56. data/spec/writers/bibtex_writer_spec.rb +1 -1
  57. data/spec/writers/citation_writer_spec.rb +2 -2
  58. data/spec/writers/crosscite_writer_spec.rb +3 -3
  59. data/spec/writers/csv_writer_spec.rb +4 -4
  60. data/spec/writers/datacite_json_writer_spec.rb +3 -3
  61. data/spec/writers/datacite_writer_spec.rb +5 -5
  62. data/spec/writers/ris_writer_spec.rb +3 -2
  63. data/spec/writers/schema_org_writer_spec.rb +4 -4
  64. metadata +30 -8
  65. data/.travis.yml +0 -35
@@ -20,7 +20,7 @@ describe Bolognese::Metadata, vcr: true do
20
20
  expect(subject.valid?).to be true
21
21
  expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
22
22
  expect(subject.identifiers).to eq([{"identifier"=>"e01567", "identifierType"=>"article_number"}])
23
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
23
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
24
24
  expect(subject.url).to eq("https://elifesciences.org/articles/01567")
25
25
  expect(subject.creators.length).to eq(5)
26
26
  expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar", "affiliation" => [{"name"=>"Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland"}])
@@ -33,7 +33,7 @@ describe Bolognese::Metadata, vcr: true do
33
33
  expect(subject.dates).to eq([{"date"=>"2014-02-11", "dateType"=>"Issued"}, {"date"=>"2018-08-23T13:41:49Z", "dateType"=>"Updated"}])
34
34
  expect(subject.publication_year).to eq("2014")
35
35
  expect(subject.publisher).to eq("eLife Sciences Publications, Ltd")
36
- expect(subject.container).to eq("identifier"=>"2050-084X", "identifierType"=>"ISSN", "title"=>"eLife", "type"=>"Journal", "volume"=>"3")
36
+ expect(subject.container).to eq("firstPage" => "e01567", "identifier"=>"2050-084X", "identifierType"=>"ISSN", "title"=>"eLife", "type"=>"Journal", "volume"=>"3")
37
37
  expect(subject.related_identifiers.length).to eq(27)
38
38
  expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"2050-084X", "relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Collection")
39
39
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.1038/ncb2764", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
@@ -57,7 +57,7 @@ describe Bolognese::Metadata, vcr: true do
57
57
  expect(subject.id).to eq("https://doi.org/10.1371/journal.pone.0000030")
58
58
  expect(subject.identifiers).to eq([{"identifier"=>"10.1371/journal.pone.0000030", "identifierType"=>"Publisher ID"}])
59
59
  expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pone.0000030")
60
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
60
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
61
61
  expect(subject.creators.length).to eq(5)
62
62
  expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Ralser, Markus", "givenName"=>"Markus", "familyName"=>"Ralser")
63
63
  expect(subject.contributors).to eq([{"contributorType"=>"Editor", "familyName"=>"Janbon", "givenName"=>"Guilhem", "name"=>"Janbon, Guilhem", "nameType"=>"Personal"}])
@@ -84,7 +84,7 @@ describe Bolognese::Metadata, vcr: true do
84
84
  expect(subject.id).to eq("https://doi.org/10.3389/fpls.2019.00816")
85
85
  expect(subject.identifiers).to eq([{"identifier"=>"816", "identifierType"=>"article_number"}])
86
86
  expect(subject.url).to eq("https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full")
87
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
87
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
88
88
  expect(subject.creators.length).to eq(4)
89
89
  expect(subject.creators.first).to eq("familyName"=>"Fortes", "givenName"=>"Ana Margarida", "name"=>"Fortes, Ana Margarida", "nameType"=>"Personal")
90
90
  expect(subject.titles).to eq([{"title"=>"Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress"}])
@@ -100,7 +100,7 @@ describe Bolognese::Metadata, vcr: true do
100
100
  expect(subject.related_identifiers.length).to eq(70)
101
101
  expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"1664-462X", "relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Collection")
102
102
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.17660/actahortic.2004.632.41", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
103
- expect(subject.container).to eq("identifier"=>"1664-462X", "identifierType"=>"ISSN", "title"=>"Frontiers in Plant Science", "type"=>"Journal", "volume"=>"10")
103
+ expect(subject.container).to eq("firstPage" => "816", "identifier"=>"1664-462X", "identifierType"=>"ISSN", "title"=>"Frontiers in Plant Science", "type"=>"Journal", "volume"=>"10")
104
104
  expect(subject.agency).to eq("crossref")
105
105
  end
106
106
 
@@ -110,7 +110,7 @@ describe Bolognese::Metadata, vcr: true do
110
110
  expect(subject.valid?).to be true
111
111
  expect(subject.id).to eq("https://doi.org/10.7600/jspfsm.56.60")
112
112
  expect(subject.url).to eq("http://jlc.jst.go.jp/JST.JSTAGE/jspfsm/56.60?lang=en&from=CrossRef&type=abstract")
113
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
113
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
114
114
  expect(subject.creators).to eq([{"name"=>":(unav)", "nameType"=>"Organizational"}])
115
115
  expect(subject.titles).to eq([{"lang"=>"ja", "title"=>"自律神経・循環器応答"}])
116
116
  expect(subject.dates).to include({"date"=>"2007", "dateType"=>"Issued"})
@@ -128,7 +128,7 @@ describe Bolognese::Metadata, vcr: true do
128
128
  expect(subject.valid?).to be true
129
129
  expect(subject.id).to eq("https://doi.org/10.1163/1937240x-00002096")
130
130
  expect(subject.url).to eq("https://academic.oup.com/jcb/article-lookup/doi/10.1163/1937240X-00002096")
131
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
131
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
132
132
  expect(subject.creators.length).to eq(8)
133
133
  expect(subject.creators.first).to eq("familyName"=>"Mesquita-Joanes", "givenName"=>"Francesc", "name"=>"Mesquita-Joanes, Francesc", "nameType"=>"Personal")
134
134
  expect(subject.titles).to eq([{"title"=>"Global distribution of Fabaeformiscandona subacuta: an exotic invasive Ostracoda on the Iberian Peninsula?"}])
@@ -148,7 +148,7 @@ describe Bolognese::Metadata, vcr: true do
148
148
  expect(subject.valid?).to be true
149
149
  expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-33191-6_49")
150
150
  expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-642-33191-6_49")
151
- expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
151
+ expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"BookChapter", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
152
152
  expect(subject.creators.length).to eq(3)
153
153
  expect(subject.creators.first).to eq("familyName"=>"Chen", "givenName"=>"Lili", "name"=>"Chen, Lili", "nameType"=>"Personal")
154
154
  expect(subject.titles).to eq([{"title"=>"Human Body Orientation Estimation in Multiview Scenarios"}])
@@ -166,7 +166,7 @@ describe Bolognese::Metadata, vcr: true do
166
166
  subject = Bolognese::Metadata.new(input: input)
167
167
  expect(subject.valid?).to be true
168
168
  expect(subject.url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")
169
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"PostedContent", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
169
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"PostedContent", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
170
170
  expect(subject.creators.count).to eq(11)
171
171
  expect(subject.creators.last).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-4060-7360", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Clark, Timothy", "givenName"=>"Timothy", "familyName"=>"Clark")
172
172
  expect(subject.titles).to eq([{"title"=>"A Data Citation Roadmap for Scholarly Data Repositories"}])
@@ -184,7 +184,7 @@ describe Bolognese::Metadata, vcr: true do
184
184
  subject = Bolognese::Metadata.new(input: input)
185
185
  expect(subject.valid?).to be true
186
186
  expect(subject.url).to eq("https://elifesciences.org/articles/55167#sa2")
187
- expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceType"=>"PeerReview", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"Review")
187
+ expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceType"=>"PeerReview", "resourceTypeGeneral"=>"PeerReview", "ris"=>"JOUR", "schemaOrg"=>"Review")
188
188
  expect(subject.creators.count).to eq(8)
189
189
  expect(subject.creators.last).to eq("affiliation" => [{"name"=>"Center for Computational Mathematics, Flatiron Institute, New York, United States"}],
190
190
  "familyName" => "Barnett",
@@ -206,7 +206,7 @@ describe Bolognese::Metadata, vcr: true do
206
206
  subject = Bolognese::Metadata.new(input: input)
207
207
  expect(subject.valid?).to be true
208
208
  expect(subject.url).to eq("http://espace.library.uq.edu.au/view/UQ:23a1e74")
209
- expect(subject.types).to eq("bibtex"=>"phdthesis", "citeproc"=>"thesis", "resourceType"=>"Dissertation", "resourceTypeGeneral"=>"Text", "ris"=>"THES", "schemaOrg"=>"Thesis")
209
+ expect(subject.types).to eq("bibtex"=>"phdthesis", "citeproc"=>"thesis", "resourceType"=>"Dissertation", "resourceTypeGeneral"=>"Dissertation", "ris"=>"THES", "schemaOrg"=>"Thesis")
210
210
  expect(subject.creators).to eq([{"familyName"=>"Collingwood",
211
211
  "givenName"=>"Patricia Maree",
212
212
  "name"=>"Collingwood, Patricia Maree",
@@ -231,7 +231,7 @@ describe Bolognese::Metadata, vcr: true do
231
231
  expect(subject.valid?).to be true
232
232
  expect(subject.id).to eq("https://doi.org/10.1890/0012-9658(2006)87%255b2832:tiopma%255d2.0.co;2")
233
233
  expect(subject.url).to eq("http://doi.wiley.com/10.1890/0012-9658(2006)87[2832:TIOPMA]2.0.CO;2")
234
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
234
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
235
235
  expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Fenton, A.", "givenName"=>"A.", "familyName"=>"Fenton"}, {"nameType"=>"Personal", "name"=>"Rands, S. A.", "givenName"=>"S. A.", "familyName"=>"Rands"}])
236
236
  expect(subject.rights_list).to eq([{"rightsUri"=>"http://doi.wiley.com/10.1002/tdm_license_1.1"}])
237
237
  expect(subject.titles).to eq([{"title"=>"THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES"}])
@@ -251,7 +251,7 @@ describe Bolognese::Metadata, vcr: true do
251
251
  expect(subject.valid?).to be true
252
252
  expect(subject.id).to eq("https://doi.org/10.1155/2012/291294")
253
253
  expect(subject.url).to eq("http://www.hindawi.com/journals/pm/2012/291294/")
254
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
254
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
255
255
  expect(subject.creators.length).to eq(7)
256
256
  expect(subject.creators[2]).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-2043-4925", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Hernandez, Beatriz", "givenName"=>"Beatriz", "familyName"=>"Hernandez", "affiliation" => [{"name"=>"War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA"}, {"name"=>"Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA"}])
257
257
  expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 3.0 Unported",
@@ -277,7 +277,7 @@ describe Bolognese::Metadata, vcr: true do
277
277
  expect(subject.id).to eq("https://doi.org/10.1016/j.ejphar.2015.03.018")
278
278
  expect(subject.identifiers).to eq([{"identifier"=>"S0014299915002332", "identifierType"=>"sequence-number"}])
279
279
  expect(subject.url).to eq("https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
280
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
280
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
281
281
  expect(subject.creators.length).to eq(10)
282
282
  expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Beck, Sarah E.", "givenName"=>"Sarah E.", "familyName"=>"Beck")
283
283
  expect(subject.titles).to eq([{"title"=>"Paving the path to HIV neurotherapy: Predicting SIV CNS disease"}])
@@ -295,7 +295,7 @@ describe Bolognese::Metadata, vcr: true do
295
295
  expect(subject.valid?).to be true
296
296
  expect(subject.id).to eq("https://doi.org/10.1038/hdy.2013.26")
297
297
  expect(subject.url).to eq("http://www.nature.com/articles/hdy201326")
298
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
298
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
299
299
  expect(subject.creators.length).to eq(2)
300
300
  expect(subject.creators.first).to eq("familyName"=>"Gross", "givenName"=>"J B", "name"=>"Gross, J B", "nameType"=>"Personal")
301
301
  expect(subject.titles).to eq([{"title"=>"Albinism in phylogenetically and geographically distinct populations of Astyanax cavefish arises through the same loss-of-function Oca2 allele"}])
@@ -364,7 +364,7 @@ describe Bolognese::Metadata, vcr: true do
364
364
  expect(subject.valid?).to be true
365
365
  expect(subject.id).to eq("https://doi.org/10.1007/978-3-662-46370-3_13")
366
366
  expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-662-46370-3_13")
367
- expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
367
+ expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"BookChapter", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
368
368
  expect(subject.creators.length).to eq(2)
369
369
  expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Diercks, Ronald L.", "givenName"=>"Ronald L.", "familyName"=>"Diercks")
370
370
  expect(subject.titles).to eq([{"title"=>"Clinical Symptoms and Physical Examinations"}])
@@ -380,7 +380,7 @@ describe Bolognese::Metadata, vcr: true do
380
380
  expect(subject.valid?).to be true
381
381
  expect(subject.id).to eq("https://doi.org/10.1007/978-3-319-75889-3_1")
382
382
  expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-319-75889-3_1")
383
- expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
383
+ expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"BookChapter", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
384
384
  expect(subject.creators).to eq([{"familyName"=>"Jones", "givenName"=>"Hunter M.", "name"=>"Jones, Hunter M.", "nameType"=>"Personal"}])
385
385
  expect(subject.titles).to eq([{"title"=>"Climate Change and Increasing Risk of Extreme Heat"}])
386
386
  expect(subject.dates).to include({"date"=>"2018", "dateType"=>"Issued"})
@@ -395,7 +395,7 @@ describe Bolognese::Metadata, vcr: true do
395
395
  expect(subject.valid?).to be true
396
396
  expect(subject.id).to eq("https://doi.org/10.4018/978-1-4666-1891-6.ch004")
397
397
  expect(subject.url).to eq("http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018/978-1-4666-1891-6.ch004")
398
- expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
398
+ expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"BookChapter", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
399
399
  expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"Université de Lyon, France"}], "familyName"=>"Bichot", "givenName"=>"Charles-Edmond", "name"=>"Bichot, Charles-Edmond", "nameType"=>"Personal"}])
400
400
  expect(subject.titles).to eq([{"title"=>"Unsupervised and Supervised Image Segmentation Using Graph Partitioning"}])
401
401
  expect(subject.dates).to eq([{"date"=>"2012-08-08", "dateType"=>"Issued"}, {"date"=>"2019-07-02T17:17:21Z", "dateType"=>"Updated"}])
@@ -410,7 +410,7 @@ describe Bolognese::Metadata, vcr: true do
410
410
  expect(subject.valid?).to be true
411
411
  expect(subject.id).to eq("https://doi.org/10.3390/publications6020015")
412
412
  expect(subject.url).to eq("http://www.mdpi.com/2304-6775/6/2/15")
413
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
413
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
414
414
  expect(subject.creators).to eq([{"name"=>"Alexander Kohls", "nameType"=>"Organizational"}, {"name"=>"Salvatore Mele", "nameType"=>"Organizational"}])
415
415
  expect(subject.titles).to eq([{"title"=>"Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics"}])
416
416
  expect(subject.dates).to eq([{"date"=>"2018-04-09", "dateType"=>"Issued"}, {"date"=>"2018-04-10T17:58:05Z", "dateType"=>"Updated"}])
@@ -426,7 +426,7 @@ describe Bolognese::Metadata, vcr: true do
426
426
  expect(subject.id).to eq("https://doi.org/10.1017/9781108348843")
427
427
  expect(subject.identifiers).to eq([{"identifier"=>"9781108348843", "identifierType"=>"ISBN"}])
428
428
  expect(subject.url).to eq("https://www.cambridge.org/core/product/identifier/9781108348843/type/book")
429
- expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Text", "ris"=>"BOOK", "schemaOrg"=>"Book")
429
+ expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Book", "ris"=>"BOOK", "schemaOrg"=>"Book")
430
430
  expect(subject.creators).to eq([{"familyName"=>"Leung", "givenName"=>"Vincent S.", "name"=>"Leung, Vincent S.", "nameType"=>"Personal"}])
431
431
  expect(subject.titles).to eq([{"title"=>"The Politics of the Past in Early China"}])
432
432
  expect(subject.dates).to eq([{"date"=>"2019-07-01", "dateType"=>"Issued"}, {"date"=>"2019-12-01T18:11:11Z", "dateType"=>"Updated"}])
@@ -442,7 +442,7 @@ describe Bolognese::Metadata, vcr: true do
442
442
  expect(subject.valid?).to be true
443
443
  expect(subject.id).to eq("https://doi.org/10.2973/odp.proc.ir.180.2000")
444
444
  expect(subject.url).to eq("http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM")
445
- expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Text", "ris"=>"BOOK", "schemaOrg"=>"Book")
445
+ expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Book", "ris"=>"BOOK", "schemaOrg"=>"Book")
446
446
  expect(subject.creators).to eq([{"name"=>":(unav)", "nameType"=>"Organizational"}])
447
447
  expect(subject.contributors.size).to eq(4)
448
448
  expect(subject.contributors.first).to eq("contributorType"=>"Editor", "familyName"=>"Taylor", "givenName"=>"B.", "name"=>"Taylor, B.", "nameType"=>"Personal")
@@ -461,7 +461,7 @@ describe Bolognese::Metadata, vcr: true do
461
461
  expect(subject.id).to eq("https://doi.org/10.1029/ar035")
462
462
  expect(subject.identifiers).to eq([{"identifier"=>"0-87590-181-6", "identifierType"=>"ISBN"}])
463
463
  expect(subject.url).to eq("http://doi.wiley.com/10.1029/AR035")
464
- expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Text", "ris"=>"BOOK", "schemaOrg"=>"Book")
464
+ expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Book", "ris"=>"BOOK", "schemaOrg"=>"Book")
465
465
  expect(subject.creators).to eq([{"familyName"=>"McGinnis", "givenName"=>"Richard Frank", "name"=>"McGinnis, Richard Frank", "nameType"=>"Personal"}])
466
466
  expect(subject.titles).to eq([{"title"=>"Biogeography of Lanternfishes (Myctophidae) South of 30°S"}])
467
467
  expect(subject.dates).to eq([{"date"=>"1982", "dateType"=>"Issued"}, {"date"=>"2019-06-15T05:11:12Z", "dateType"=>"Updated"}])
@@ -481,7 +481,7 @@ describe Bolognese::Metadata, vcr: true do
481
481
  expect(subject.id).to eq("https://doi.org/10.3280/ecag2018-001005")
482
482
  expect(subject.identifiers).to eq([{"identifier"=>"5", "identifierType"=>"article_number"}])
483
483
  expect(subject.url).to eq("http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645")
484
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
484
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
485
485
  expect(subject.creators.length).to eq(2)
486
486
  expect(subject.creators.first).to eq("familyName"=>"Oh", "givenName"=>"Sohae Eve", "name"=>"Oh, Sohae Eve", "nameType"=>"Personal")
487
487
  expect(subject.titles).to eq([{"title"=>"Substitutability between organic and conventional poultry products and organic price premiums"}])
@@ -498,7 +498,7 @@ describe Bolognese::Metadata, vcr: true do
498
498
  expect(subject.id).to eq("https://doi.org/10.5012/bkcs.2013.34.10.2889")
499
499
  expect(subject.identifiers).to eq([{"identifier"=>"JCGMCS_2013_v34n10_2889", "identifierType"=>"Publisher ID"}])
500
500
  expect(subject.url).to eq("http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889")
501
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
501
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
502
502
  expect(subject.creators.length).to eq(7)
503
503
  expect(subject.creators.first).to eq("familyName"=>"Huang", "givenName"=>"Guimei", "name"=>"Huang, Guimei", "nameType"=>"Personal")
504
504
  expect(subject.titles).to eq([{"title"=>"Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline"}])
@@ -514,7 +514,7 @@ describe Bolognese::Metadata, vcr: true do
514
514
  expect(subject.valid?).to be true
515
515
  expect(subject.id).to eq("https://doi.org/10.1241/johokanri.39.979")
516
516
  expect(subject.url).to eq("http://joi.jlc.jst.go.jp/JST.JSTAGE/johokanri/39.979?from=CrossRef")
517
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
517
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
518
518
  expect(subject.creators).to eq([{"familyName"=>"KUSUMOTO", "givenName"=>"Hiroyuki", "name"=>"KUSUMOTO, Hiroyuki", "nameType"=>"Personal"}])
519
519
  expect(subject.titles).to eq([{"title"=>"Utilizing the Internet. 12 Series. Future of the Internet."}])
520
520
  expect(subject.dates).to eq([{"date"=>"1997", "dateType"=>"Issued"}, {"date"=>"2020-03-06T06:44:36Z", "dateType"=>"Updated"}])
@@ -529,7 +529,7 @@ describe Bolognese::Metadata, vcr: true do
529
529
  #expect(subject.valid?).to be true
530
530
  expect(subject.id).to eq("https://doi.org/10.2903/j.efsa.2018.5239")
531
531
  expect(subject.url).to eq("http://doi.wiley.com/10.2903/j.efsa.2018.5239")
532
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
532
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
533
533
  expect(subject.creators.length).to eq(28)
534
534
  expect(subject.creators.first).to eq("familyName"=>"Younes", "givenName"=>"Maged", "name"=>"Younes, Maged", "nameType"=>"Personal")
535
535
  expect(subject.titles).to eq([{"title"=>"Scientific opinion on the safety of green tea catechins"}])
@@ -545,7 +545,7 @@ describe Bolognese::Metadata, vcr: true do
545
545
  expect(subject.valid?).to be true
546
546
  expect(subject.id).to eq("https://doi.org/10.4000/dms.865")
547
547
  expect(subject.url).to eq("http://journals.openedition.org/dms/865")
548
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
548
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
549
549
  expect(subject.creators).to eq([{"familyName"=>"Peraya", "givenName"=>"Daniel", "name"=>"Peraya, Daniel", "nameType"=>"Personal"}])
550
550
  expect(subject.titles).to eq([{"title"=>"Distances, absence, proximités et présences : des concepts en déplacement"}, {"title"=>"Distance(s), proximity and presence(s): evolving concepts"}])
551
551
  expect(subject.dates).to include({"date"=>"2014-12-23", "dateType"=>"Issued"})
@@ -561,7 +561,7 @@ describe Bolognese::Metadata, vcr: true do
561
561
  expect(subject.valid?).to be true
562
562
  expect(subject.id).to eq("https://doi.org/10.1186/1471-2164-7-187")
563
563
  expect(subject.url).to eq("https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187")
564
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
564
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
565
565
  expect(subject.creators).to eq([{"familyName"=>"Myers",
566
566
  "givenName"=>"Chad L",
567
567
  "name"=>"Myers, Chad L",
@@ -596,7 +596,7 @@ describe Bolognese::Metadata, vcr: true do
596
596
  expect(subject.valid?).to be true
597
597
  expect(subject.id).to eq("https://doi.org/10.1098/rspb.2017.0132")
598
598
  expect(subject.url).to eq("https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132")
599
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
599
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
600
600
  expect(subject.creators.size).to eq(6)
601
601
  expect(subject.creators.first).to eq("affiliation" => [{"name"=>"School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia"}], "familyName" => "Dougherty","givenName" => "Liam R.","name" => "Dougherty, Liam R.","nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-1406-0680", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],"nameType"=>"Personal")
602
602
  expect(subject.titles).to eq([{"title"=>"Sexual conflict and correlated evolution between male persistence and female resistance traits in the seed beetle <i>Callosobruchus maculatus</i>"}])
@@ -613,7 +613,7 @@ describe Bolognese::Metadata, vcr: true do
613
613
  expect(subject.valid?).to be true
614
614
  expect(subject.id).to eq("https://doi.org/10.1111/j.1865-1682.2010.01171.x")
615
615
  expect(subject.url).to eq("http://doi.wiley.com/10.1111/j.1865-1682.2010.01171.x")
616
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
616
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
617
617
  expect(subject.creators.length).to eq(5)
618
618
  expect(subject.creators[3]).to eq("familyName"=>"Ehtisham-ul-Haq", "givenName"=>" ", "name"=>"Ehtisham-ul-Haq,  ", "nameType"=>"Personal")
619
619
  expect(subject.titles).to eq([{"title"=>"Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study"}])
@@ -630,7 +630,7 @@ describe Bolognese::Metadata, vcr: true do
630
630
  expect(subject.id).to eq("https://doi.org/10.1055/s-0039-1690894")
631
631
  expect(subject.identifiers).to eq([{"identifier"=>"s-0039-1690894", "identifierType"=>"sequence-number"}])
632
632
  expect(subject.url).to eq("http://www.thieme-connect.de/DOI/DOI?10.1055/s-0039-1690894")
633
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
633
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
634
634
  expect(subject.creators.length).to eq(4)
635
635
  expect(subject.creators[3]).to eq("affiliation" => [{"name"=>"Department of Chemistry, Tianjin Key Laboratory of Molecular Optoelectronic Sciences, and Tianjin Collaborative Innovation Centre of Chemical Science and Engineering, Tianjin University"}, {"name"=>"Joint School of National University of Singapore and Tianjin University, International Campus of Tianjin University"}],
636
636
  "familyName" => "Ma",
@@ -650,7 +650,7 @@ describe Bolognese::Metadata, vcr: true do
650
650
  expect(subject.valid?).to be true
651
651
  expect(subject.id).to eq("https://doi.org/10.1111/nph.14619")
652
652
  expect(subject.url).to eq("http://doi.wiley.com/10.1111/nph.14619")
653
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
653
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
654
654
  expect(subject.creators.length).to eq(3)
655
655
  expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0002-4156-3761", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Dissmeyer, Nico", "givenName"=>"Nico", "familyName"=>"Dissmeyer", "affiliation" => [{"name"=>"Independent Junior Research Group on Protein Recognition and Degradation; Leibniz Institute of Plant Biochemistry (IPB); Weinberg 3 Halle (Saale) D-06120 Germany"}, {"name"=>"ScienceCampus Halle - Plant-based Bioeconomy; Betty-Heimann-Strasse 3 Halle (Saale) D-06120 Germany"}])
656
656
  expect(subject.titles).to eq([{"title"=>"Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway"}])
@@ -672,7 +672,7 @@ describe Bolognese::Metadata, vcr: true do
672
672
  expect(subject.valid?).to be true
673
673
  expect(subject.id).to eq("https://doi.org/10.1038/ng.3834")
674
674
  expect(subject.url).to eq("http://www.nature.com/articles/ng.3834")
675
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
675
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
676
676
  expect(subject.creators.length).to eq(14)
677
677
  expect(subject.creators.last).to eq("name"=>"GTEx Consortium", "nameType"=>"Organizational")
678
678
  expect(subject.titles).to eq([{"title"=>"The impact of structural variation on human gene expression"}])
@@ -689,7 +689,7 @@ describe Bolognese::Metadata, vcr: true do
689
689
  expect(subject.valid?).to be true
690
690
  expect(subject.id).to eq("https://doi.org/10.1177/0042098011428175")
691
691
  expect(subject.url).to eq("http://journals.sagepub.com/doi/10.1177/0042098011428175")
692
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
692
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
693
693
  expect(subject.creators.length).to eq(1)
694
694
  expect(subject.creators.first).to eq("familyName"=>"Petrovici", "givenName"=>"Norbert", "name"=>"Petrovici, Norbert", "nameType"=>"Personal")
695
695
  expect(subject.titles).to eq([{"title"=>"Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation"}])
@@ -706,7 +706,7 @@ describe Bolognese::Metadata, vcr: true do
706
706
  expect(subject.valid?).to be true
707
707
  expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-34922-5_19")
708
708
  expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-642-34922-5_19")
709
- expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
709
+ expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"BookChapter", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
710
710
  expect(subject.creators.length).to eq(3)
711
711
  expect(subject.creators.first).to eq("familyName"=>"Razib", "givenName"=>"Ali", "name"=>"Razib, Ali", "nameType"=>"Personal")
712
712
  expect(subject.titles).to eq([{"title"=>"Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array"}])
@@ -718,12 +718,30 @@ describe Bolognese::Metadata, vcr: true do
718
718
  expect(subject.date_registered).to eq("2012-10-31T16:15:44Z")
719
719
  end
720
720
 
721
+ it "article id as page number" do
722
+ input = "https://doi.org/10.1103/physrevlett.120.117701"
723
+ subject = Bolognese::Metadata.new(input: input)
724
+ expect(subject.valid?).to be true
725
+ expect(subject.id).to eq("https://doi.org/10.1103/physrevlett.120.117701")
726
+ expect(subject.url).to eq("https://link.aps.org/doi/10.1103/PhysRevLett.120.117701")
727
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
728
+ expect(subject.creators.length).to eq(5)
729
+ expect(subject.creators.first).to eq("familyName"=>"Marrazzo", "givenName"=>"Antimo", "name"=>"Marrazzo, Antimo", "nameType"=>"Personal")
730
+ expect(subject.titles).to eq([{"title"=>"Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator"}])
731
+ expect(subject.dates).to include({"date"=>"2018-03-13", "dateType"=>"Issued"})
732
+ expect(subject.publication_year).to eq("2018")
733
+ expect(subject.publisher).to eq("American Physical Society (APS)")
734
+ expect(subject.container).to eq("firstPage" => "117701", "identifier"=>"1079-7114", "identifierType"=>"ISSN", "issue"=>"11", "title"=>"Physical Review Letters", "type"=>"Journal", "volume"=>"120")
735
+ expect(subject.agency).to eq("crossref")
736
+ expect(subject.date_registered).to eq("2018-03-13T15:18:48Z")
737
+ end
738
+
721
739
  it "posted content copernicus" do
722
740
  input = "https://doi.org/10.5194/CP-2020-95"
723
741
  subject = Bolognese::Metadata.new(input: input)
724
742
  expect(subject.valid?).to be true
725
743
  expect(subject.url).to eq("https://cp.copernicus.org/preprints/cp-2020-95/")
726
- expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"PostedContent", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
744
+ expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"PostedContent", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
727
745
  expect(subject.creators.count).to eq(6)
728
746
  expect(subject.creators.first).to eq("nameType" => "Personal", "familyName" => "Shao",
729
747
  "givenName" => "Jun",
@@ -744,7 +762,7 @@ describe Bolognese::Metadata, vcr: true do
744
762
  subject = Bolognese::Metadata.new(input: input)
745
763
  expect(subject.valid?).to be true
746
764
  expect(subject.url).to eq("http://oxfordhandbooks.com/view/10.1093/oxfordhb/9780198746140.001.0001/oxfordhb-9780198746140-e-5")
747
- expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Text", "ris"=>"BOOK", "schemaOrg"=>"Book")
765
+ expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "resourceTypeGeneral"=>"Book", "ris"=>"BOOK", "schemaOrg"=>"Book")
748
766
  expect(subject.creators.count).to eq(1)
749
767
  expect(subject.creators.first).to eq("familyName"=>"Clayton", "givenName"=>"Barbra R.", "name"=>"Clayton, Barbra R.", "nameType"=>"Personal")
750
768
  expect(subject.contributors.count).to eq(2)
@@ -764,7 +782,7 @@ describe Bolognese::Metadata, vcr: true do
764
782
  subject = Bolognese::Metadata.new(input: input)
765
783
  expect(subject.valid?).to be true
766
784
  expect(subject.url).to eq("http://www.osti.gov/servlets/purl/972169-1QXROM/")
767
- expect(subject.types).to eq("bibtex"=>"techreport", "citeproc"=>"report", "resourceType"=>"Report", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"Report")
785
+ expect(subject.types).to eq("bibtex"=>"techreport", "citeproc"=>"report", "resourceType"=>"Report", "resourceTypeGeneral"=>"Report", "ris"=>"RPRT", "schemaOrg"=>"Report")
768
786
  expect(subject.creators.count).to eq(4)
769
787
  expect(subject.creators.first).to eq("familyName"=>"Denholm", "givenName"=>"P.", "name"=>"Denholm, P.", "nameType"=>"Personal")
770
788
  expect(subject.contributors.count).to eq(0)
@@ -46,7 +46,7 @@ describe Bolognese::Metadata, vcr: true do
46
46
  input = fixture_path + "datacite_software_missing_comma.json"
47
47
  subject = Bolognese::Metadata.new(input: input, from: "datacite_json", show_errors: true)
48
48
  expect(subject.valid?).to be false
49
- expect(subject.errors).to eq(["expected comma, not a string (after doi) at line 4, column 11 [parse.c:373]"])
49
+ expect(subject.errors).to eq(["expected comma, not a string (after doi) at line 4, column 11 [parse.c:364]"])
50
50
  expect(subject.codemeta).to be_nil
51
51
  end
52
52
 
@@ -280,7 +280,7 @@ describe Bolognese::Metadata, vcr: true do
280
280
  input = "10.4225/03/5a6931f57c654"
281
281
  subject = Bolognese::Metadata.new(input: input)
282
282
  expect(subject.valid?).to be true
283
- expect(subject.subjects).to eq([{"subject"=>"90301 Biomaterials", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
283
+ expect(subject.subjects).to eq([{"subject"=>"90301 Biomaterials", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
284
284
  {"subject"=>"FOS: Medical engineering", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"}])
285
285
  end
286
286
 
@@ -289,8 +289,8 @@ describe Bolognese::Metadata, vcr: true do
289
289
  subject = Bolognese::Metadata.new(input: input)
290
290
  expect(subject.valid?).to be true
291
291
  expect(subject.subjects).to eq([{"subject"=>"130103 Higher Education", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
292
- {"subject"=>"FOS: Educational sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
293
- {"subject"=>"130313 Teacher Education and Professional Development of Educators", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
292
+ {"subject"=>"FOS: Educational sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
293
+ {"subject"=>"130313 Teacher Education and Professional Development of Educators", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
294
294
  {"subject"=>"80799 Library and Information Studies not elsewhere classified", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
295
295
  {"subject"=>"FOS: Media and communications", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"}, {"subject"=>"Library and Information Studies"}])
296
296
  end
@@ -1314,6 +1314,257 @@ describe Bolognese::Metadata, vcr: true do
1314
1314
  expect(subject.agency).to eq("datacite")
1315
1315
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1316
1316
  expect(subject.geo_locations.first["geoLocationPlace"]).to eq("Zandmotor, sand suppletion area on the Dutch coast.")
1317
- expect(subject.geo_locations.first["geoLocationPolygon"].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
1317
+ expect(subject.geo_locations.first["geoLocationPolygon"][0].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
1318
1318
  end
1319
+
1320
+ it "Schema 4.4 from string" do
1321
+ input = fixture_path + "datacite-example-full-v4.4.xml"
1322
+ subject = Bolognese::Metadata.new(input: input)
1323
+ expect(subject.valid?).to be true
1324
+ expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
1325
+ expect(subject.types["resourceType"]).to eq("XML")
1326
+ expect(subject.types["resourceTypeGeneral"]).to eq("Software")
1327
+ expect(subject.creators).to eq(
1328
+ [
1329
+ {
1330
+ "name"=>"Miller, Elizabeth", "givenName"=>"Elizabeth", "familyName"=>"Miller",
1331
+ "nameType" => "Personal",
1332
+ "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0001-5000-0007",
1333
+ "schemeUri"=>"https://orcid.org",
1334
+ "nameIdentifierScheme"=>"ORCID"}],
1335
+ "affiliation" => [{ "name" => "DataCite" }]
1336
+ }
1337
+ ]
1338
+ )
1339
+ expect(subject.titles).to eq(
1340
+ [
1341
+ {"title"=>"Full DataCite XML Example", "lang"=>"en-US"},
1342
+ {"title"=>"Demonstration of DataCite Properties.", "titleType"=>"Subtitle", "lang"=>"en-US"}
1343
+ ]
1344
+ )
1345
+ expect(subject.identifiers).to eq([{"identifier"=>"https://schema.datacite.org/meta/kernel-4.4/example/datacite-example-full-v4.4.xml", "identifierType"=>"URL"}])
1346
+ expect(subject.dates).to eq(
1347
+ [
1348
+ {"date"=>"2021-01-26", "dateInformation"=>"Updated with 4.4 properties", "dateType"=>"Updated"},
1349
+ {"date"=>"2014", "dateType"=>"Issued"}
1350
+ ]
1351
+ )
1352
+ expect(subject.publication_year).to eq("2014")
1353
+ expect(subject.subjects).to eq(
1354
+ [{
1355
+ "subject"=>"computer science",
1356
+ "subjectScheme"=>"dewey",
1357
+ "schemeUri"=>"http://dewey.info/",
1358
+ "lang"=>"en-US",
1359
+ "classificationCode"=>"000"
1360
+ }]
1361
+ )
1362
+ expect(subject.related_identifiers.length).to eq(2)
1363
+ expect(subject.related_identifiers.last).to eq(
1364
+ "relatedIdentifier"=>"arXiv:0706.0001",
1365
+ "relatedIdentifierType"=>"arXiv",
1366
+ "relationType"=>"IsReviewedBy",
1367
+ "resourceTypeGeneral"=>"Text"
1368
+ )
1369
+ expect(subject.rights_list).to eq([
1370
+ {
1371
+ "lang"=>"en-US",
1372
+ "rights"=>"Creative Commons Zero v1.0 Universal",
1373
+ "rightsIdentifier"=>"cc0-1.0",
1374
+ "rightsIdentifierScheme"=>"SPDX",
1375
+ "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
1376
+ "schemeUri"=>"https://spdx.org/licenses/"
1377
+ }
1378
+ ])
1379
+ expect(subject.publisher).to eq("DataCite")
1380
+ expect(subject.agency).to eq("datacite")
1381
+ expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1382
+ expect(subject.related_items.last).to eq(
1383
+ {
1384
+ "relatedItemType"=>"Journal",
1385
+ "relationType"=>"IsPublishedIn",
1386
+ "relatedItemIdentifier"=>
1387
+ {
1388
+ "relatedItemIdentifier"=>"10.1016/j.physletb.2017.11.044",
1389
+ "relatedItemIdentifierType"=>"DOI",
1390
+ },
1391
+ "titles"=>
1392
+ [
1393
+ {"title"=>"Physics letters / B"},
1394
+ ],
1395
+ "volume"=>"776",
1396
+ "firstPage"=>"249",
1397
+ "lastPage"=>"264",
1398
+ "publicationYear"=>"2018",
1399
+ "contributors"=>[],
1400
+ "creators"=>[],
1401
+ }
1402
+ )
1403
+ end
1404
+
1405
+ it "Schema 4.4 related items from string" do
1406
+ input = fixture_path + "datacite-example-relateditems.xml"
1407
+ subject = Bolognese::Metadata.new(input: input)
1408
+ expect(subject.valid?).to be true
1409
+
1410
+ expect(subject.related_items.last).to eq(
1411
+ {
1412
+ "relatedItemType"=>"Journal",
1413
+ "relationType"=>"IsPublishedIn",
1414
+ "relatedItemIdentifier"=>
1415
+ {
1416
+ "relatedItemIdentifier"=>"10.5072/john-smiths-1234",
1417
+ "relatedItemIdentifierType"=>"DOI",
1418
+ "relatedMetadataScheme"=>"citeproc+json",
1419
+ "schemeURI"=>"https://github.com/citation-style-language/schema/raw/master/csl-data.json",
1420
+ "schemeType"=>"URL"
1421
+ },
1422
+ "creators" =>
1423
+ [
1424
+ {"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
1425
+ ],
1426
+ "titles"=>
1427
+ [
1428
+ {"title"=>"Understanding the fictional John Smith"},
1429
+ {"title"=>"A detailed look", "titleType"=>"Subtitle"}
1430
+ ],
1431
+ "volume"=>"776",
1432
+ "issue"=>"1",
1433
+ "number"=>"1",
1434
+ "numberType"=>"Chapter",
1435
+ "firstPage"=>"50",
1436
+ "lastPage"=>"60",
1437
+ "publisher"=>"Example Inc",
1438
+ "publicationYear"=>"1776",
1439
+ "edition"=>"1",
1440
+ "contributors"=>
1441
+ [
1442
+ {"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
1443
+ ]
1444
+ }
1445
+ )
1446
+ end
1447
+
1448
+ it "Schema 4.4 dissertation from string" do
1449
+ input = fixture_path + "datacite-example-dissertation-v4.4.xml"
1450
+ subject = Bolognese::Metadata.new(input: input)
1451
+ expect(subject.valid?).to be true
1452
+ expect(subject.types["resourceType"]).to eq(nil)
1453
+ expect(subject.types["resourceTypeGeneral"]).to eq("Dissertation")
1454
+ expect(subject.types["schemaOrg"]).to eq("Thesis")
1455
+ expect(subject.types["ris"]).to eq("THES")
1456
+ expect(subject.types["citeproc"]).to eq("thesis")
1457
+ expect(subject.creators).to eq(
1458
+ [
1459
+ {
1460
+ "name"=>"Luo, R",
1461
+ "familyName"=>"Luo",
1462
+ "givenName"=>"R",
1463
+ "nameIdentifiers"=>[],
1464
+ "affiliation"=>[],
1465
+ "nameType" => "Personal"
1466
+ },
1467
+ {
1468
+ "name"=>"Liu, B",
1469
+ "familyName"=>"Liu",
1470
+ "givenName"=>"B",
1471
+ "nameIdentifiers"=>[],
1472
+ "affiliation"=>[],
1473
+ "nameType" => "Personal"
1474
+ },
1475
+ {
1476
+ "name"=>"Xie, Y",
1477
+ "familyName"=>"Xie",
1478
+ "givenName"=>"Y",
1479
+ "nameIdentifiers"=>[],
1480
+ "affiliation"=>[],
1481
+ "nameType" => "Personal"
1482
+ },
1483
+ {
1484
+ "name"=>"Li, Z",
1485
+ "familyName"=>"Li",
1486
+ "givenName"=>"Z",
1487
+ "nameIdentifiers"=>[],
1488
+ "affiliation"=>[],
1489
+ "nameType" => "Personal"
1490
+ }
1491
+ ]
1492
+ )
1493
+ expect(subject.titles).to eq(
1494
+ [
1495
+ {"title"=>"Software and supporting material for \"SOAPdenovo2: An empirically improved memory-efficient short read de novo assembly\"", "lang"=>"en"},
1496
+ ]
1497
+ )
1498
+ expect(subject.dates).to eq(
1499
+ [
1500
+ {"date"=>"2012-12-13", "dateType"=>"Available"},
1501
+ {"date"=>"2012", "dateType"=>"Issued"}
1502
+ ]
1503
+ )
1504
+ expect(subject.publication_year).to eq("2012")
1505
+ expect(subject.subjects).to eq(
1506
+ [
1507
+ {
1508
+ "subject"=>"DNA (Genetics)",
1509
+ "lang"=>"en"
1510
+ },
1511
+ {
1512
+ "subject"=>"Computer Program",
1513
+ "lang"=>"en"
1514
+ }
1515
+ ]
1516
+ )
1517
+ expect(subject.related_identifiers).to eq(
1518
+ [
1519
+ {"relatedIdentifier"=>"10.5072/2047-217x-1-1", "relatedIdentifierType"=>"DOI", "relationType"=>"IsReferencedBy"},
1520
+ {"relatedIdentifier"=>"10.5072/100038", "relatedIdentifierType"=>"DOI", "relationType"=>"Compiles"}
1521
+ ]
1522
+ )
1523
+ expect(subject.rights_list).to eq([
1524
+ {
1525
+ "lang"=>"en-US",
1526
+ "rights"=>"Creative Commons Zero v1.0 Universal",
1527
+ "rightsIdentifier"=>"cc0-1.0",
1528
+ "rightsIdentifierScheme"=>"SPDX",
1529
+ "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
1530
+ "schemeUri"=>"https://spdx.org/licenses/"
1531
+ }
1532
+ ])
1533
+ expect(subject.publisher).to eq("GigaScience Database")
1534
+ expect(subject.agency).to eq("datacite")
1535
+ expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1536
+ end
1537
+
1538
+
1539
+ it "Parsing xs-string attribute correctly" do
1540
+ input = fixture_path + "datacite-example-xs-string.xml"
1541
+ subject = Bolognese::Metadata.new(input: input)
1542
+ expect(subject.valid?).to be true
1543
+ expect(subject.id).to eq("https://doi.org/10.4225/13/511c71f8612c3")
1544
+ expect(subject.sizes.first).to eq("1.7 GB")
1545
+ expect(subject.formats.first).to eq("application/xml")
1546
+ end
1547
+
1548
+ it "Parsing multiple geolocationpolygon elements" do
1549
+ input = fixture_path + "datacite-geolocationpolygons-multiple.xml"
1550
+ subject = Bolognese::Metadata.new(input: input)
1551
+ expect(subject.valid?).to be true
1552
+ expect(subject.id).to eq("https://doi.org/10.5072/multiplegeopolygons")
1553
+ expect(subject.geo_locations).to eq([
1554
+ { "geoLocationPolygon"=> [
1555
+ [ {"polygonPoint"=>{"pointLatitude"=>"71", "pointLongitude"=>"41"}},
1556
+ {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"45"}},
1557
+ {"polygonPoint"=>{"pointLatitude"=>"85", "pointLongitude"=>"55"}},
1558
+ {"polygonPoint"=>{"pointLatitude"=>"71", "pointLongitude"=>"41"}}],
1559
+ [
1560
+ {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}},
1561
+ {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"55"}},
1562
+ {"polygonPoint"=>{"pointLatitude"=>"73", "pointLongitude"=>"45"}},
1563
+ {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}}
1564
+ ]
1565
+ ] }
1566
+ ]
1567
+ )
1568
+ end
1569
+
1319
1570
  end