bolognese 1.2.20 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/bolognese.gemspec +1 -1
  4. data/lib/bolognese/author_utils.rb +26 -3
  5. data/lib/bolognese/datacite_utils.rb +2 -1
  6. data/lib/bolognese/readers/crossref_reader.rb +1 -1
  7. data/lib/bolognese/readers/datacite_reader.rb +5 -1
  8. data/lib/bolognese/utils.rb +28 -2
  9. data/lib/bolognese/version.rb +1 -1
  10. data/resources/datacite-contributorType-v4.xsd +35 -0
  11. data/resources/datacite-dateType-v4.xsd +25 -0
  12. data/resources/datacite-descriptionType-v4.xsd +19 -0
  13. data/resources/datacite-funderIdentifierType-v4.xsd +15 -0
  14. data/resources/datacite-nameType-v4.xsd +10 -0
  15. data/resources/datacite-relatedIdentifierType-v4.xsd +34 -0
  16. data/resources/datacite-relationType-v4.xsd +49 -0
  17. data/resources/datacite-resourceType-v4.xsd +28 -0
  18. data/resources/datacite-titleType-v4.xsd +14 -0
  19. data/resources/kernel-4.3/include/datacite-contributorType-v4.xsd +35 -0
  20. data/resources/kernel-4.3/include/datacite-dateType-v4.xsd +25 -0
  21. data/resources/kernel-4.3/include/datacite-descriptionType-v4.xsd +19 -0
  22. data/resources/kernel-4.3/include/datacite-funderIdentifierType-v4.xsd +16 -0
  23. data/resources/kernel-4.3/include/datacite-nameType-v4.xsd +10 -0
  24. data/resources/kernel-4.3/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  25. data/resources/kernel-4.3/include/datacite-relationType-v4.xsd +49 -0
  26. data/resources/kernel-4.3/include/datacite-resourceType-v4.xsd +28 -0
  27. data/resources/kernel-4.3/include/datacite-titleType-v4.xsd +14 -0
  28. data/resources/kernel-4.3/include/xml.xsd +286 -0
  29. data/resources/kernel-4.3/metadata.xsd +484 -0
  30. data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +1 -0
  31. data/resources/kernel-4/metadata.xsd +38 -8
  32. data/resources/xml.xsd +286 -0
  33. data/spec/author_utils_spec.rb +2 -2
  34. data/spec/fixtures/datacite-example-affiliation.xml +114 -0
  35. data/spec/readers/codemeta_reader_spec.rb +4 -4
  36. data/spec/readers/crossref_reader_spec.rb +5 -5
  37. data/spec/readers/datacite_reader_spec.rb +95 -27
  38. data/spec/readers/schema_org_reader_spec.rb +3 -3
  39. data/spec/writers/crosscite_writer_spec.rb +2 -2
  40. data/spec/writers/datacite_json_writer_spec.rb +3 -3
  41. data/spec/writers/datacite_writer_spec.rb +1 -1
  42. metadata +26 -10
@@ -21,7 +21,7 @@ describe Bolognese::Metadata, vcr: true do
21
21
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/qeg0-3gm3", "identifierType"=>"DOI"}])
22
22
  expect(subject.url).to eq("https://github.com/datacite/maremma")
23
23
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceTypeGeneral"=>"Software", "ris"=>"COMP", "schemaOrg"=>"SoftwareSourceCode")
24
- expect(subject.creators).to eq([{"affiliation"=>"DataCite",
24
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"DataCite"}],
25
25
  "familyName"=>"Fenner",
26
26
  "givenName"=>"Martin",
27
27
  "name"=>"Fenner, Martin",
@@ -44,7 +44,7 @@ describe Bolognese::Metadata, vcr: true do
44
44
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5063/f1m61h5x", "identifierType"=>"DOI"}])
45
45
  expect(subject.url).to eq("https://github.com/DataONEorg/rdataone")
46
46
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceTypeGeneral"=>"Software", "ris"=>"COMP", "schemaOrg"=>"SoftwareSourceCode")
47
- expect(subject.creators).to eq([{"affiliation"=>"NCEAS",
47
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"NCEAS"}],
48
48
  "familyName"=>"Jones",
49
49
  "givenName"=>"Matt",
50
50
  "name"=>"Jones, Matt",
@@ -53,7 +53,7 @@ describe Bolognese::Metadata, vcr: true do
53
53
  "nameIdentifierScheme"=>"ORCID",
54
54
  "schemeUri"=>"https://orcid.org"}],
55
55
  "nameType"=>"Personal"},
56
- {"affiliation"=>"NCEAS",
56
+ {"affiliation"=>[{"name"=>"NCEAS"}],
57
57
  "familyName"=>"Slaughter",
58
58
  "givenName"=>"Peter",
59
59
  "name"=>"Slaughter, Peter",
@@ -80,7 +80,7 @@ describe Bolognese::Metadata, vcr: true do
80
80
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/qeg0-3gm3", "identifierType"=>"DOI"}])
81
81
  expect(subject.url).to eq("https://github.com/datacite/maremma")
82
82
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceTypeGeneral"=>"Software", "ris"=>"COMP", "schemaOrg"=>"SoftwareSourceCode")
83
- expect(subject.creators).to eq([{"affiliation"=>"DataCite",
83
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"DataCite"}],
84
84
  "familyName"=>"Fenner",
85
85
  "givenName"=>"Martin",
86
86
  "name"=>"Fenner, Martin",
@@ -22,7 +22,7 @@ describe Bolognese::Metadata, vcr: true do
22
22
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
23
23
  expect(subject.url).to eq("https://elifesciences.org/articles/01567")
24
24
  expect(subject.creators.length).to eq(5)
25
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar", "affiliation" => "Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland")
25
+ 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"}])
26
26
  expect(subject.rights_list).to eq([{"rightsUri"=>"http://creativecommons.org/licenses/by/3.0"}])
27
27
  expect(subject.titles).to eq([{"title"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
28
28
  expect(subject.dates).to eq([{"date"=>"2014-02-11", "dateType"=>"Issued"}, {"date"=>"2018-08-23T13:41:49Z", "dateType"=>"Updated"}])
@@ -152,7 +152,7 @@ describe Bolognese::Metadata, vcr: true do
152
152
  expect(subject.url).to eq("http://www.hindawi.com/journals/pm/2012/291294/")
153
153
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
154
154
  expect(subject.creators.length).to eq(7)
155
- 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" => ["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", "Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA"])
155
+ 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"}])
156
156
  expect(subject.rights_list).to eq([{"rightsUri"=>"http://creativecommons.org/licenses/by/3.0"}])
157
157
  expect(subject.titles).to eq([{"title"=>"Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers"}])
158
158
  expect(subject.dates).to eq([{"date"=>"2012", "dateType"=>"Issued"}, {"date"=>"2016-08-02T18:42:41Z", "dateType"=>"Updated"}])
@@ -243,7 +243,7 @@ describe Bolognese::Metadata, vcr: true do
243
243
  expect(subject.url).to eq("https://www.fs.usda.gov/rds/archive/Product/RDS-2018-0001")
244
244
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceType"=>"Dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
245
245
  expect(subject.creators.length).to eq(4)
246
- expect(subject.creators.first).to eq("familyName" => "Ribic","givenName" => "Christine A.","name" => "Ribic, Christine A.","affiliation" => "U.S. Geological Survey","nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-2583-1778", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],"nameType" => "Personal")
246
+ expect(subject.creators.first).to eq("familyName" => "Ribic","givenName" => "Christine A.","name" => "Ribic, Christine A.","affiliation" => [{"name"=>"U.S. Geological Survey"}],"nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-2583-1778", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],"nameType" => "Personal")
247
247
  expect(subject.titles).to eq([{"title"=>"Fledging times of grassland birds"}])
248
248
  expect(subject.descriptions).to be_empty
249
249
  expect(subject.dates).to eq([{"date"=>"2017-08-09", "dateType"=>"Issued"}, {"date"=>"2018-07-13T19:35:20Z", "dateType"=>"Updated"}])
@@ -290,7 +290,7 @@ describe Bolognese::Metadata, vcr: true do
290
290
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.4018/978-1-4666-1891-6.ch004", "identifierType"=>"DOI"}])
291
291
  expect(subject.url).to eq("http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018/978-1-4666-1891-6.ch004")
292
292
  expect(subject.types).to eq("bibtex"=>"inbook", "citeproc"=>"chapter", "resourceType"=>"BookChapter", "resourceTypeGeneral"=>"Text", "ris"=>"CHAP", "schemaOrg"=>"Chapter")
293
- expect(subject.creators).to eq("familyName"=>"Bichot", "givenName"=>"Charles-Edmond", "name"=>"Bichot, Charles-Edmond", "affiliation" => "Université de Lyon, France", "nameType"=>"Personal")
293
+ expect(subject.creators).to eq("familyName"=>"Bichot", "givenName"=>"Charles-Edmond", "name"=>"Bichot, Charles-Edmond", "affiliation" => [{"name"=>"Université de Lyon, France"}], "nameType"=>"Personal")
294
294
  expect(subject.titles).to eq([{"title"=>"Unsupervised and Supervised Image Segmentation Using Graph Partitioning"}])
295
295
  expect(subject.dates).to eq([{"date"=>"2012-08-08", "dateType"=>"Issued"}, {"date"=>"2019-07-02T17:17:21Z", "dateType"=>"Updated"}])
296
296
  expect(subject.publication_year).to eq("2012")
@@ -465,7 +465,7 @@ describe Bolognese::Metadata, vcr: true do
465
465
  expect(subject.url).to eq("http://doi.wiley.com/10.1111/nph.14619")
466
466
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
467
467
  expect(subject.creators.length).to eq(3)
468
- 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" => ["Independent Junior Research Group on Protein Recognition and Degradation; Leibniz Institute of Plant Biochemistry (IPB); Weinberg 3 Halle (Saale) D-06120 Germany", "ScienceCampus Halle - Plant-based Bioeconomy; Betty-Heimann-Strasse 3 Halle (Saale) D-06120 Germany"])
468
+ 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"}])
469
469
  expect(subject.titles).to eq([{"title"=>"Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway"}])
470
470
  expect(subject.rights_list).to eq([{"rightsUri"=>"http://doi.wiley.com/10.1002/tdm_license_1.1"}, {"rightsUri"=>"http://onlinelibrary.wiley.com/termsAndConditions"}])
471
471
  expect(subject.dates).to eq([{"date"=>"2018-05", "dateType"=>"Issued"}, {"date"=>"2018-08-07T05:52:14Z", "dateType"=>"Updated"}])
@@ -81,23 +81,75 @@ describe Bolognese::Metadata, vcr: true do
81
81
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.1")
82
82
  end
83
83
 
84
- it "xs:string attributes" do
85
- input = "https://doi.org/10.17630/bb43e6a3-72e0-464c-9fdd-fbe5d3e56a09"
84
+ it "affiliation identifier" do
85
+ input = fixture_path + 'datacite-example-affiliation.xml'
86
86
  subject = Bolognese::Metadata.new(input: input)
87
87
  expect(subject.valid?).to be true
88
- expect(subject.types["schemaOrg"]).to eq("Dataset")
89
- expect(subject.types["resourceType"]).to eq("Dataset")
90
- expect(subject.types["resourceTypeGeneral"]).to eq("Audiovisual")
91
- expect(subject.creators.length).to eq(14)
92
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Haywood, Raphaelle Dawn", "givenName"=>"Raphaelle Dawn", "familyName"=>"Haywood", "affiliation" => "School of Physics and Astronomy")
93
- expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Data underpinning - The Sun as a planet-host star: Proxies from SDO images for HARPS radial-velocity variations"}])
94
- expect(subject.dates).to eq([{"date"=>"2016-01-20", "dateType"=>"Available"}, {"date"=>"2016", "dateType"=>"Issued"}])
95
- expect(subject.publication_year).to eq("2016")
96
- expect(subject.publisher).to eq("University of St Andrews")
88
+ expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
89
+ expect(subject.types["resourceType"]).to eq("XML")
90
+ expect(subject.types["resourceTypeGeneral"]).to eq("Software")
91
+ expect(subject.types["ris"]).to eq("COMP")
92
+ expect(subject.types["citeproc"]).to eq("article")
93
+ expect(subject.creators.length).to eq(3)
94
+ expect(subject.creators.first).to eq("nameType"=>"Personal", "affiliation" => [{"affiliationIdentifierScheme"=>"ROR", "id"=>"https://ror.org/04wxnsj81", "name"=>"DataCite"}],
95
+ "familyName" => "Miller",
96
+ "givenName" => "Elizabeth",
97
+ "name" => "Miller, Elizabeth",
98
+ "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-5000-0007", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],)
99
+ expect(subject.creators.dig(1, "affiliation")).to eq([{"affiliationIdentifierScheme"=>"ROR",
100
+ "id"=>"https://ror.org/05gq02987",
101
+ "name"=>"Brown University"},
102
+ {"affiliationIdentifierScheme"=>"GRID",
103
+ "id"=>"https://grid.ac/institutes/grid.268117.b",
104
+ "name"=>"Wesleyan University"}])
105
+ expect(subject.creators.dig(2, "affiliation")).to eq([{"affiliationIdentifierScheme"=>"ROR", "id"=>"https://ror.org/05gq02987", "name"=>"Brown University"}])
106
+ expect(subject.titles).to eq([{"lang"=>"en-US", "title"=>"Full DataCite XML Example"}, {"lang"=>"en-US", "title"=>"Demonstration of DataCite Properties.", "titleType"=>"Subtitle"}])
107
+ expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/example-full",
108
+ "identifierType"=>"DOI"},
109
+ {"identifier"=>
110
+ "https://schema.datacite.org/meta/kernel-4.2/example/datacite-example-full-v4.2.xml",
111
+ "identifierType"=>"URL"}])
112
+ expect(subject.rights_list).to eq([{"lang"=>"en-US", "rightsUri"=>"http://creativecommons.org/publicdomain/zero/1.0"}])
113
+ expect(subject.publication_year).to eq("2014")
114
+ expect(subject.contributors).to eq([{"nameType"=>"Personal", "name"=>"Starr, Joan", "givenName"=>"Joan", "familyName"=>"Starr", "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0002-7285-027X", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}], "affiliation"=>
115
+ [{"affiliationIdentifierScheme"=>"ROR",
116
+ "id"=>"https://ror.org/03yrm5c26",
117
+ "name"=>"California Digital Library"}], "contributorType"=>"ProjectLeader"}])
118
+ expect(subject.subjects).to eq([{"lang"=>"en-US", "schemeUri"=>"http://dewey.info/", "subject"=>"000 computer science", "subjectScheme"=>"dewey"}])
119
+ expect(subject.dates).to eq([{"date"=>"2017-09-13", "dateInformation"=>"Updated with 4.2 properties", "dateType"=>"Updated"}, {"date"=>"2014", "dateType"=>"Issued"}])
120
+ expect(subject.funding_references).to eq([{"awardNumber"=>"CBET-106",
121
+ "awardTitle"=>"Full DataCite XML Example",
122
+ "funderIdentifier"=>"https://doi.org/10.13039/100000001",
123
+ "funderIdentifierType"=>"Crossref Funder ID",
124
+ "funderName"=>"National Science Foundation"}])
125
+ expect(subject.related_identifiers.length).to eq(2)
126
+ expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"https://data.datacite.org/application/citeproc+json/10.5072/example-full", "relatedIdentifierType"=>"URL", "relationType"=>"HasMetadata", "relatedMetadataScheme"=>"citeproc+json", "schemeUri"=>"https://github.com/citation-style-language/schema/raw/master/csl-data.json")
127
+ expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"arXiv:0706.0001", "relatedIdentifierType"=>"arXiv", "relationType"=>"IsReviewedBy", "resourceTypeGeneral"=>"Text")
128
+ expect(subject.language).to eq("en-US")
129
+ expect(subject.sizes).to eq(["4 kB"])
130
+ expect(subject.formats).to eq(["application/xml"])
131
+ expect(subject.publisher).to eq("DataCite")
97
132
  expect(subject.agency).to eq("DataCite")
98
133
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
99
134
  end
100
135
 
136
+ # it "xs:string attributes" do
137
+ # input = "https://doi.org/10.17630/bb43e6a3-72e0-464c-9fdd-fbe5d3e56a09"
138
+ # subject = Bolognese::Metadata.new(input: input)
139
+ # expect(subject.valid?).to be true
140
+ # expect(subject.types["schemaOrg"]).to eq("Dataset")
141
+ # expect(subject.types["resourceType"]).to eq("Dataset")
142
+ # expect(subject.types["resourceTypeGeneral"]).to eq("Audiovisual")
143
+ # expect(subject.creators.length).to eq(14)
144
+ # expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Haywood, Raphaelle Dawn", "givenName"=>"Raphaelle Dawn", "familyName"=>"Haywood", "affiliation" => "School of Physics and Astronomy")
145
+ # expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Data underpinning - The Sun as a planet-host star: Proxies from SDO images for HARPS radial-velocity variations"}])
146
+ # expect(subject.dates).to eq([{"date"=>"2016-01-20", "dateType"=>"Available"}, {"date"=>"2016", "dateType"=>"Issued"}])
147
+ # expect(subject.publication_year).to eq("2016")
148
+ # expect(subject.publisher).to eq("University of St Andrews")
149
+ # expect(subject.agency).to eq("DataCite")
150
+ # expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
151
+ # end
152
+
101
153
  it "multiple licenses" do
102
154
  input = "https://doi.org/10.5281/ZENODO.48440"
103
155
  subject = Bolognese::Metadata.new(input: input)
@@ -150,7 +202,7 @@ describe Bolognese::Metadata, vcr: true do
150
202
  expect(subject.types["schemaOrg"]).to eq("Dataset")
151
203
  expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
152
204
  expect(subject.creators.length).to eq(4)
153
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Jahn, Najko", "givenName"=>"Najko", "familyName"=>"Jahn", "affiliation"=>"Bielefeld University Library")
205
+ expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Jahn, Najko", "givenName"=>"Najko", "familyName"=>"Jahn", "affiliation"=>[{"name"=>"Bielefeld University Library"}])
154
206
  expect(subject.titles).to eq([{"title"=>"Publication Fp7 Funding Acknowledgment - Plos Openaire"}])
155
207
  expect(subject.descriptions.first["description"]).to start_with("The dataset contains a sample of metadata describing papers")
156
208
  expect(subject.dates).to eq([{"date"=>"2013-04-03", "dateType"=>"Issued"}])
@@ -278,7 +330,7 @@ describe Bolognese::Metadata, vcr: true do
278
330
  expect(subject.types["resourceType"]).to eq("dataset")
279
331
  expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
280
332
  expect(subject.creators.length).to eq(6)
281
- expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation"=>"UC Merced")
333
+ expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation"=>[{"name"=>"UC Merced"}])
282
334
  end
283
335
 
284
336
  it "series_information" do
@@ -333,7 +385,7 @@ describe Bolognese::Metadata, vcr: true do
333
385
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.6071/z7wc73", "identifierType"=>"DOI"}])
334
386
  expect(subject.doi).to eq("10.6071/z7wc73")
335
387
  expect(subject.creators.length).to eq(6)
336
- expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation" => ["UC Merced", "NSF"])
388
+ expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation" => [{"name"=>"UC Merced"}, {"name"=>"NSF"}])
337
389
  expect(subject.titles).to eq([{"title"=>"Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek meteorological data, soil moisture and temperature, snow depth and air temperature"}])
338
390
  expect(subject.publisher).to eq("UC Merced")
339
391
  expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
@@ -373,7 +425,7 @@ describe Bolognese::Metadata, vcr: true do
373
425
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.18429/jacow-ipac2016-tupmy003", "identifierType"=>"DOI"}])
374
426
  expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
375
427
  expect(subject.creators.length).to eq(12)
376
- expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"http://jacow.org/JACoW-00077389", "nameIdentifierScheme"=>"JACoW-ID", "schemeUri"=>"http://jacow.org/"}], "name"=>"Otani, Masashi", "givenName"=>"Masashi", "familyName"=>"Otani", "affiliation" => "KEK, Tsukuba, Japan")
428
+ expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"http://jacow.org/JACoW-00077389", "nameIdentifierScheme"=>"JACoW-ID", "schemeUri"=>"http://jacow.org/"}], "name"=>"Otani, Masashi", "givenName"=>"Masashi", "familyName"=>"Otani", "affiliation" => [{"name"=>"KEK, Tsukuba, Japan"}])
377
429
  end
378
430
 
379
431
  it "author with wrong orcid scheme" do
@@ -429,7 +481,7 @@ describe Bolognese::Metadata, vcr: true do
429
481
  expect(subject.types["ris"]).to eq("GEN")
430
482
  expect(subject.types["citeproc"]).to eq("article")
431
483
  expect(subject.creators.length).to eq(24)
432
- expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-5331-6592", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Farquhar, Adam", "givenName"=>"Adam", "familyName"=>"Farquhar", "affiliation" => "British Library")
484
+ expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-5331-6592", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Farquhar, Adam", "givenName"=>"Adam", "familyName"=>"Farquhar", "affiliation" => [{"name"=>"British Library"}])
433
485
  expect(subject.titles).to eq([{"title"=>"Technical and Human Infrastructure for Open Research (THOR)"}])
434
486
  expect(subject.descriptions.first["description"]).to start_with("Five years ago, a global infrastructure")
435
487
  expect(subject.publication_year).to eq("2015")
@@ -453,7 +505,7 @@ describe Bolognese::Metadata, vcr: true do
453
505
  expect(subject.types["resourceType"]).to eq("Journal Article")
454
506
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
455
507
  expect(subject.creators.length).to eq(2)
456
- expect(subject.creators.first).to eq("affiliation"=>"Тверская государственная сельскохозяйственная академия", "familyName"=>"Ганичева", "givenName"=>"А.В.", "name"=>"Ганичева, А.В.", "nameType"=>"Personal")
508
+ expect(subject.creators.first).to eq("affiliation"=>[{"name"=>"Тверская государственная сельскохозяйственная академия"}], "familyName"=>"Ганичева", "givenName"=>"А.В.", "name"=>"Ганичева, А.В.", "nameType"=>"Personal")
457
509
  expect(subject.titles).to eq([{"title"=>"МОДЕЛЬ СИСТЕМНОЙ ДИНАМИКИ ПРОЦЕССА ОБУЧЕНИЯ"}, {"title"=>"MODEL OF SYSTEM DYNAMICS OF PROCESS OF TRAINING", "titleType"=>"TranslatedTitle"}])
458
510
  expect(subject.descriptions.first["description"]).to start_with("Актуальность данной работы обусловлена важностью учета в учебном процессе личностных качеств обучаем")
459
511
  expect(subject.publication_year).to eq("2019")
@@ -492,7 +544,10 @@ describe Bolognese::Metadata, vcr: true do
492
544
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
493
545
  expect(subject.types["ris"]).to eq("BOOK")
494
546
  expect(subject.types["citeproc"]).to eq("book")
495
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
547
+ expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが","nameIdentifiers"=>
548
+ [{"nameIdentifier"=>"http://isni.org/isni/0000000134596520",
549
+ "nameIdentifierScheme"=>"ISNI",
550
+ "schemeUri"=>"http://isni.org/isni/"}]}])
496
551
  expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
497
552
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/testpub", "identifierType"=>"DOI"}, {"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
498
553
  expect(subject.dates).to eq([{"date"=>"2012-12-13", "dateInformation"=>"Correction", "dateType"=>"Other"}, {"date"=>"2010", "dateType"=>"Issued"}])
@@ -514,7 +569,10 @@ describe Bolognese::Metadata, vcr: true do
514
569
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
515
570
  expect(subject.types["ris"]).to eq("BOOK")
516
571
  expect(subject.types["citeproc"]).to eq("book")
517
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
572
+ expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが","nameIdentifiers"=>
573
+ [{"nameIdentifier"=>"http://isni.org/isni/0000000134596520",
574
+ "nameIdentifierScheme"=>"ISNI",
575
+ "schemeUri"=>"http://isni.org/isni/"}]}])
518
576
  expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
519
577
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/testpub", "identifierType"=>"DOI"}, {"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
520
578
  expect(subject.publication_year).to eq("2010")
@@ -560,7 +618,10 @@ describe Bolognese::Metadata, vcr: true do
560
618
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
561
619
  expect(subject.types["ris"]).to eq("BOOK")
562
620
  expect(subject.types["citeproc"]).to eq("book")
563
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
621
+ expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが","nameIdentifiers"=>
622
+ [{"nameIdentifier"=>"http://isni.org/isni/0000000134596520",
623
+ "nameIdentifierScheme"=>"ISNI",
624
+ "schemeUri"=>"http://isni.org/isni/"}]}])
564
625
  expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
565
626
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/testpub", "identifierType"=>"DOI"}, {"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
566
627
  expect(subject.publication_year).to eq("2010")
@@ -581,7 +642,10 @@ describe Bolognese::Metadata, vcr: true do
581
642
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
582
643
  expect(subject.types["ris"]).to eq("BOOK")
583
644
  expect(subject.types["citeproc"]).to eq("book")
584
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
645
+ expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
646
+ [{"nameIdentifier"=>"abc123",
647
+ "nameIdentifierScheme"=>"ISNI",
648
+ "schemeUri"=>"Other"}]}])
585
649
  expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
586
650
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/testpub", "identifierType"=>"DOI"}, {"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
587
651
  expect(subject.dates).to eq([{"date"=>"2009-04-29", "dateType"=>"StartDate"}, {"date"=>"2010-01-05", "dateType"=>"EndDate"}, {"date"=>"2010", "dateType"=>"Issued"}])
@@ -600,7 +664,10 @@ describe Bolognese::Metadata, vcr: true do
600
664
  expect(subject.types["schemaOrg"]).to eq("Book")
601
665
  expect(subject.types["resourceType"]).to eq("Monograph")
602
666
  expect(subject.types["resourceTypeGeneral"]).to eq("Text")
603
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
667
+ expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが","nameIdentifiers"=>
668
+ [{"nameIdentifier"=>"http://isni.org/isni/0000000134596520",
669
+ "nameIdentifierScheme"=>"ISNI",
670
+ "schemeUri"=>"http://isni.org/isni/"}]}])
604
671
  expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
605
672
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5072/testpub2", "identifierType"=>"DOI"}, {"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
606
673
  expect(subject.dates).to eq([{"date"=>"2012-12-13", "dateInformation"=>"Correction", "dateType"=>"Other"}, {"date"=>"2010", "dateType"=>"Issued"}])
@@ -659,7 +726,8 @@ describe Bolognese::Metadata, vcr: true do
659
726
  expect(subject.types["schemaOrg"]).to eq("Dataset")
660
727
  expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
661
728
  expect(subject.creators).to eq([{"nameType"=>"Organizational", "name"=>"Europäische Kommission"}])
662
- expect(subject.contributors).to eq([{"nameType"=>"Personal", "name"=>"Reif, Karlheinz", "givenName"=>"Karlheinz", "familyName"=>"Reif", "affiliation"=>"Europäische Kommission, Brüssel", "contributorType"=>"Researcher"}, {"nameType"=>"Personal", "name"=>"Jamar, Nicole", "givenName"=>"Nicole", "familyName"=>"Jamar", "affiliation"=>"EOS, Gallup Europe, Chaumont-Gistoux, Belgien", "contributorType"=>"Researcher"}, {"nameType"=>"Organizational", "name"=>"DIMARSO, Bruessel"}, {"nameType"=>"Organizational", "name"=>"GALLUP, Kopenhagen"}, {"nameType"=>"Organizational", "name"=>"EMNID, Bielefeld"}, {"nameType"=>"Organizational", "name"=>"ICAP, Athen"}, {"nameType"=>"Organizational", "name"=>"DEMOSCOPIA, Madrid"}, {"nameType"=>"Organizational", "name"=>"B.V.A., Viroflay, Frankreich"}, {"nameType"=>"Organizational", "name"=>"Irish Marketing Surveys, Dublin"}, {"nameType"=>"Organizational", "name"=>"DOXA, Mailand"}, {"nameType"=>"Organizational", "name"=>"ILRES, Luxemburg"}, {"nameType"=>"Organizational", "name"=>"NIPO, Amsterdam"}, {"nameType"=>"Organizational", "name"=>"METRIS, Lissabon"}, {"nameType"=>"Organizational", "name"=>"NOP, London"}, {"nameType"=>"Organizational", "name"=>"OESTERREICHISCHES GALLUP, Wien"}, {"nameType"=>"Organizational", "name"=>"SUOMEN GALLUP, Espoo, Finnland"}, {"nameType"=>"Organizational", "name"=>"SIFO, Stockholm"}, {"nameType"=>"Organizational", "name"=>"TNS Dimarso, Brüssel TNS GALLUP DK, Kopenhagen EMNID, Bielefeld TNS ICAP, Athen TNS Demoscopia, Madrid B.V.A., Viroflay, Frankreich IRISH MKTG SURVEYS, Dublin DOXA, Mailand TNS ILReS, Luxemburg TNS NIPO, Amsterdam Österreichisches GALLUP, Wien"}])
729
+ expect(subject.contributors.length).to eq(18)
730
+ expect(subject.contributors.first).to eq("affiliation"=>[{"name"=>"Europäische Kommission, Brüssel"}], "contributorType"=>"Researcher", "familyName"=>"Reif", "givenName"=>"Karlheinz", "name"=>"Reif, Karlheinz", "nameType"=>"Personal")
663
731
  expect(subject.titles).to eq([{"lang"=>"de", "title"=>"Flash Eurobarometer 54 (Madrid Summit)"}, {"lang"=>"en", "title"=>"Flash Eurobarometer 54 (Madrid Summit)"}, {"titleType"=>"Subtitle","lang"=>"de", "title"=>"The Common European Currency"}, {"titleType"=>"Subtitle", "lang"=>"en", "title"=>"The Common European Currency"}])
664
732
  expect(subject.subjects).to eq([{"subjectScheme"=>"ZA", "lang"=>"en", "subject"=>"KAT12 International Institutions, Relations, Conditions"}])
665
733
  expect(subject.dates).to eq([{"date"=>"1995-12", "dateType"=>"Collected"}, {"date"=>"1996", "dateType"=>"Issued"}])
@@ -731,18 +799,18 @@ describe Bolognese::Metadata, vcr: true do
731
799
  "name"=>"Van Der A, Ronald",
732
800
  "givenName"=>"Ronald",
733
801
  "familyName"=>"Van Der A",
734
- "affiliation"=>"Royal Netherlands Meteorological Institute (KNMI)"},
802
+ "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]},
735
803
  {"nameType"=>"Personal",
736
804
  "name"=>"Allaart, Marc",
737
805
  "givenName"=>"Marc",
738
806
  "familyName"=>"Allaart",
739
- "affiliation"=>"Royal Netherlands Meteorological Institute (KNMI)"},
807
+ "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]},
740
808
  {"nameType"=>"Personal",
741
809
  "name"=>"Eskes, Henk",
742
810
  "givenName"=>"Henk",
743
811
  "familyName"=>"Eskes",
744
812
  "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0002-8743-4455", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
745
- "affiliation"=>"Royal Netherlands Meteorological Institute (KNMI)"}])
813
+ "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]}])
746
814
  expect(subject.titles).to eq([{"title"=>"Multi-Sensor Reanalysis (MSR) of total ozone, version 2"}])
747
815
  expect(subject.version_info).to eq("2")
748
816
  expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"1970-04-01 / (:tba)", "dateType"=>"Collected"}, {"date"=>"2015", "dateType"=>"Issued"}])
@@ -769,7 +837,7 @@ describe Bolognese::Metadata, vcr: true do
769
837
  expect(subject.identifiers).to eq([{"identifier"=>"https://handle.test.datacite.org/10.22002/d1.694", "identifierType"=>"DOI"}])
770
838
  expect(subject.types["schemaOrg"]).to eq("Dataset")
771
839
  expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
772
- expect(subject.creators).to eq([{"name"=>"Tester"}])
840
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"Caltech"}], "name"=>"Tester"}])
773
841
  expect(subject.titles).to eq([{"title"=>"Test license"}])
774
842
  expect(subject.dates).to eq([{"date"=>"2018-01-12", "dateType"=>"Issued"}])
775
843
  expect(subject.publication_year).to eq("2018")
@@ -22,7 +22,7 @@ describe Bolognese::Metadata, vcr: true do
22
22
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/4k3m-nyvg", "identifierType"=>"DOI"}])
23
23
  expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
24
24
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"post-weblog", "resourceTypeGeneral"=>"Text", "ris"=>"GEN", "schemaOrg"=>"BlogPosting")
25
- expect(subject.creators).to eq([{"affiliation"=>"DataCite","familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin", "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "nameType"=>"Personal"}])
25
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"DataCite"}],"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin", "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "nameType"=>"Personal"}])
26
26
  expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
27
27
  expect(subject.descriptions.first["description"]).to start_with("Eating your own dog food")
28
28
  expect(subject.subjects).to eq([{"subject"=>"datacite"}, {"subject"=>"doi"}, {"subject"=>"metadata"}, {"subject"=>"featured"}])
@@ -49,7 +49,7 @@ describe Bolognese::Metadata, vcr: true do
49
49
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/4k3m-nyvg", "identifierType"=>"DOI"}])
50
50
  expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
51
51
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"post-weblog", "resourceTypeGeneral"=>"Text", "ris"=>"GEN", "schemaOrg"=>"BlogPosting")
52
- expect(subject.creators).to eq([{"affiliation"=>"DataCite","familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin", "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "nameType"=>"Personal"}])
52
+ expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"DataCite"}],"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin", "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "nameType"=>"Personal"}])
53
53
  expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
54
54
  expect(subject.descriptions.first["description"]).to start_with("Eating your own dog food")
55
55
  expect(subject.subjects).to eq([{"subject"=>"datacite"}, {"subject"=>"doi"}, {"subject"=>"metadata"}, {"subject"=>"featured"}])
@@ -74,7 +74,7 @@ describe Bolognese::Metadata, vcr: true do
74
74
  expect(subject.creators.size).to eq(6)
75
75
  expect(subject.creators.first).to eq("name" => "Staib, Matthias",
76
76
  "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-9688-838X", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
77
- "nameType" => "Personal", "givenName"=>"Matthias", "familyName"=>"Staib", "affiliation" => "University of Zurich, Zurich, Switzerland")
77
+ "nameType" => "Personal", "givenName"=>"Matthias", "familyName"=>"Staib", "affiliation" => [{"name"=>"University of Zurich, Zurich, Switzerland"}])
78
78
  expect(subject.publisher).to be_nil
79
79
  expect(subject.publication_year).to eq("2018")
80
80
  end
@@ -23,7 +23,7 @@ describe Bolognese::Metadata, vcr: true do
23
23
  crosscite = JSON.parse(subject.crosscite)
24
24
  expect(crosscite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
25
25
  expect(crosscite.fetch("creators").count).to eq(7)
26
- expect(crosscite.fetch("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" => ["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", "Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA"])
26
+ expect(crosscite.fetch("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"}])
27
27
  end
28
28
 
29
29
  # it "with editor" do
@@ -94,7 +94,7 @@ describe Bolognese::Metadata, vcr: true do
94
94
  subject = Bolognese::Metadata.new(input: input, from: "codemeta")
95
95
  crosscite = JSON.parse(subject.crosscite)
96
96
  expect(crosscite.fetch("titles")).to eq( [{"title"=>"Maremma: a Ruby library for simplified network calls"}])
97
- expect(crosscite.fetch("creators")).to eq([{"affiliation"=>"DataCite",
97
+ expect(crosscite.fetch("creators")).to eq([{"affiliation"=>[{"name"=>"DataCite"}],
98
98
  "familyName"=>"Fenner",
99
99
  "givenName"=>"Martin",
100
100
  "name"=>"Fenner, Martin",
@@ -23,7 +23,7 @@ describe Bolognese::Metadata, vcr: true do
23
23
  expect(datacite.fetch("url")).to eq("http://www.hindawi.com/journals/pm/2012/291294/")
24
24
  expect(datacite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
25
25
  expect(datacite.fetch("creators").length).to eq(7)
26
- expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Thanassi, Wendy", "givenName"=>"Wendy", "familyName"=>"Thanassi", "affiliation" => ["Department of Medicine, Veterans Affairs Palo Alto Health Care System, 3801 Miranda Avenue MC-, Palo Alto, CA 94304-1207, USA", "Occupational Health Strategic Health Care Group, Office of Public Health, Veterans Health Administration, Washington, DC 20006, USA", "Division of Emergency Medicine, Stanford University School of Medicine, Stanford, CA 94304, USA", "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"])
26
+ expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Thanassi, Wendy", "givenName"=>"Wendy", "familyName"=>"Thanassi", "affiliation" => [{"name"=>"Department of Medicine, Veterans Affairs Palo Alto Health Care System, 3801 Miranda Avenue MC-, Palo Alto, CA 94304-1207, USA"}, {"name"=>"Occupational Health Strategic Health Care Group, Office of Public Health, Veterans Health Administration, Washington, DC 20006, USA"}, {"name"=>"Division of Emergency Medicine, Stanford University School of Medicine, Stanford, CA 94304, USA"}, {"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"}])
27
27
  end
28
28
 
29
29
  it "Crossref DOI" do
@@ -53,7 +53,7 @@ describe Bolognese::Metadata, vcr: true do
53
53
  datacite = JSON.parse(subject.datacite_json)
54
54
  expect(datacite.fetch("titles")).to eq([{"title"=>"R Interface to the DataONE REST API"}])
55
55
  expect(datacite.fetch("creators").length).to eq(3)
56
- expect(datacite.fetch("creators").first).to eq("affiliation"=>"NCEAS", "nameType"=>"Personal", "name" => "Jones, Matt",
56
+ expect(datacite.fetch("creators").first).to eq("affiliation"=>[{"name"=>"NCEAS"}], "nameType"=>"Personal", "name" => "Jones, Matt",
57
57
  "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "givenName"=>"Matt", "familyName"=>"Jones")
58
58
  expect(datacite.fetch("version")).to eq("2.0.0")
59
59
  end
@@ -63,7 +63,7 @@ describe Bolognese::Metadata, vcr: true do
63
63
  subject = Bolognese::Metadata.new(input: input, from: "codemeta")
64
64
  datacite = JSON.parse(subject.datacite_json)
65
65
  expect(datacite.fetch("titles")).to eq([{"title"=>"Maremma: a Ruby library for simplified network calls"}])
66
- expect(datacite.fetch("creators")).to eq([{"affiliation"=>"DataCite",
66
+ expect(datacite.fetch("creators")).to eq([{"affiliation"=>[{"name"=>"DataCite"}],
67
67
  "familyName"=>"Fenner",
68
68
  "givenName"=>"Martin",
69
69
  "name"=>"Fenner, Martin",
@@ -191,7 +191,7 @@ describe Bolognese::Metadata, vcr: true do
191
191
  expect(subject.valid?).to be true
192
192
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceType"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
193
193
  expect(subject.creators.length).to eq(6)
194
- expect(subject.creators.first).to eq("affiliation"=>["UC Merced", "NSF"], "familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal")
194
+ expect(subject.creators.first).to eq("affiliation"=>[{"name"=>"UC Merced"}, {"name"=>"NSF"}], "familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal")
195
195
  expect(subject.titles).to eq([{"title"=>"Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek meteorological data, soil moisture and temperature, snow depth and air temperature"}])
196
196
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.6071/z7wc73", "identifierType"=>"DOI"}])
197
197
  expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 4.0 International (CC BY 4.0)", "rightsUri"=>"https://creativecommons.org/licenses/by/4.0"}])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.20
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-07 00:00:00.000000000 Z
11
+ date: 2019-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -258,20 +258,14 @@ dependencies:
258
258
  name: json-ld-preloaded
259
259
  requirement: !ruby/object:Gem::Requirement
260
260
  requirements:
261
- - - "~>"
262
- - !ruby/object:Gem::Version
263
- version: '3.0'
264
- - - ">="
261
+ - - '='
265
262
  - !ruby/object:Gem::Version
266
263
  version: 3.0.2
267
264
  type: :runtime
268
265
  prerelease: false
269
266
  version_requirements: !ruby/object:Gem::Requirement
270
267
  requirements:
271
- - - "~>"
272
- - !ruby/object:Gem::Version
273
- version: '3.0'
274
- - - ">="
268
+ - - '='
275
269
  - !ruby/object:Gem::Version
276
270
  version: 3.0.2
277
271
  - !ruby/object:Gem::Dependency
@@ -592,6 +586,15 @@ files:
592
586
  - lib/bolognese/writers/schema_org_writer.rb
593
587
  - lib/bolognese/writers/turtle_writer.rb
594
588
  - resources/2008/09/xsd.xsl
589
+ - resources/datacite-contributorType-v4.xsd
590
+ - resources/datacite-dateType-v4.xsd
591
+ - resources/datacite-descriptionType-v4.xsd
592
+ - resources/datacite-funderIdentifierType-v4.xsd
593
+ - resources/datacite-nameType-v4.xsd
594
+ - resources/datacite-relatedIdentifierType-v4.xsd
595
+ - resources/datacite-relationType-v4.xsd
596
+ - resources/datacite-resourceType-v4.xsd
597
+ - resources/datacite-titleType-v4.xsd
595
598
  - resources/kernel-2.1/include/datacite-contributorType-v1.1.xsd
596
599
  - resources/kernel-2.1/include/datacite-contributorType-v2.xsd
597
600
  - resources/kernel-2.1/include/datacite-dateType-v1.1.xsd
@@ -674,6 +677,17 @@ files:
674
677
  - resources/kernel-4.2/include/datacite-titleType-v4.xsd
675
678
  - resources/kernel-4.2/include/xml.xsd
676
679
  - resources/kernel-4.2/metadata.xsd
680
+ - resources/kernel-4.3/include/datacite-contributorType-v4.xsd
681
+ - resources/kernel-4.3/include/datacite-dateType-v4.xsd
682
+ - resources/kernel-4.3/include/datacite-descriptionType-v4.xsd
683
+ - resources/kernel-4.3/include/datacite-funderIdentifierType-v4.xsd
684
+ - resources/kernel-4.3/include/datacite-nameType-v4.xsd
685
+ - resources/kernel-4.3/include/datacite-relatedIdentifierType-v4.xsd
686
+ - resources/kernel-4.3/include/datacite-relationType-v4.xsd
687
+ - resources/kernel-4.3/include/datacite-resourceType-v4.xsd
688
+ - resources/kernel-4.3/include/datacite-titleType-v4.xsd
689
+ - resources/kernel-4.3/include/xml.xsd
690
+ - resources/kernel-4.3/metadata.xsd
677
691
  - resources/kernel-4/include/datacite-contributorType-v4.xsd
678
692
  - resources/kernel-4/include/datacite-dateType-v4.xsd
679
693
  - resources/kernel-4/include/datacite-descriptionType-v4.xsd
@@ -686,6 +700,7 @@ files:
686
700
  - resources/kernel-4/include/xml.xsd
687
701
  - resources/kernel-4/metadata.xsd
688
702
  - resources/schema_org/jsonldcontext.json
703
+ - resources/xml.xsd
689
704
  - spec/array_spec.rb
690
705
  - spec/author_utils_spec.rb
691
706
  - spec/cli_spec.rb
@@ -702,6 +717,7 @@ files:
702
717
  - spec/fixtures/crossref.bib
703
718
  - spec/fixtures/crossref.ris
704
719
  - spec/fixtures/crossref.xml
720
+ - spec/fixtures/datacite-example-affiliation.xml
705
721
  - spec/fixtures/datacite-example-complicated-v3.0.xml
706
722
  - spec/fixtures/datacite-example-complicated-v4.0.xml
707
723
  - spec/fixtures/datacite-example-complicated-v4.1.xml