bolognese 1.8 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ describe Bolognese::Metadata, vcr: true do
25
25
  expect(subject.related_identifiers.length).to eq(3)
26
26
  expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
27
27
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
28
- expect(subject.agency).to eq("DataCite")
28
+ expect(subject.agency).to eq("datacite")
29
29
  end
30
30
 
31
31
  # it "SoftwareSourceCode" do
@@ -74,7 +74,7 @@ describe Bolognese::Metadata, vcr: true do
74
74
  expect(subject.datacite).to include("<version>v0.3.2</version>")
75
75
  expect(subject.related_identifiers.length).to eq(2)
76
76
  expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"https://github.com/jakevdp/supersmoother/tree/v0.3.2", "relatedIdentifierType"=>"URL", "relationType"=>"IsSupplementTo")
77
- expect(subject.agency).to eq("DataCite")
77
+ expect(subject.agency).to eq("datacite")
78
78
  end
79
79
  end
80
80
  end
@@ -44,7 +44,7 @@ describe Bolognese::Metadata, vcr: true do
44
44
  {"subject"=>"phylogeny"},
45
45
  {"subject"=>"Parasites"}])
46
46
  expect(subject.publisher).to eq("Dryad")
47
- expect(subject.agency).to eq("DataCite")
47
+ expect(subject.agency).to eq("datacite")
48
48
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
49
49
  end
50
50
 
@@ -69,7 +69,7 @@ describe Bolognese::Metadata, vcr: true do
69
69
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
70
70
  expect(subject.publisher).to eq("DataCite")
71
71
  expect(subject.subjects).to eq([{"subject"=>"datacite"}, {"subject"=>"doi"}, {"subject"=>"metadata"}])
72
- expect(subject.agency).to eq("DataCite")
72
+ expect(subject.agency).to eq("datacite")
73
73
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
74
74
  end
75
75
 
@@ -90,7 +90,7 @@ describe Bolognese::Metadata, vcr: true do
90
90
  "subjectScheme"=>"DDC"}])
91
91
  expect(subject.publication_year).to eq("2013")
92
92
  expect(subject.publisher).to eq("Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik GmbH, Wadern/Saarbruecken, Germany")
93
- expect(subject.agency).to eq("DataCite")
93
+ expect(subject.agency).to eq("datacite")
94
94
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.1")
95
95
  end
96
96
 
@@ -142,7 +142,7 @@ describe Bolognese::Metadata, vcr: true do
142
142
  expect(subject.sizes).to eq(["4 kB"])
143
143
  expect(subject.formats).to eq(["application/xml"])
144
144
  expect(subject.publisher).to eq("DataCite")
145
- expect(subject.agency).to eq("DataCite")
145
+ expect(subject.agency).to eq("datacite")
146
146
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
147
147
  end
148
148
 
@@ -159,7 +159,7 @@ describe Bolognese::Metadata, vcr: true do
159
159
  expect(subject.dates).to eq([{"date"=>"2016-01-20", "dateType"=>"Available"}, {"date"=>"2016", "dateType"=>"Issued"}])
160
160
  expect(subject.publication_year).to eq("2016")
161
161
  expect(subject.publisher).to eq("University of St Andrews")
162
- expect(subject.agency).to eq("DataCite")
162
+ expect(subject.agency).to eq("datacite")
163
163
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
164
164
  end
165
165
 
@@ -178,7 +178,7 @@ describe Bolognese::Metadata, vcr: true do
178
178
  expect(subject.sizes).to eq([])
179
179
  expect(subject.subjects).to eq([{"subject"=>"Environmental research"}])
180
180
  expect(subject.publisher).to eq("EvK2 CNR Committee")
181
- expect(subject.agency).to eq("DataCite")
181
+ expect(subject.agency).to eq("datacite")
182
182
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
183
183
  end
184
184
 
@@ -210,7 +210,7 @@ describe Bolognese::Metadata, vcr: true do
210
210
  {"subject"=>"crossover experiment"},
211
211
  {"subject"=>"hci"}])
212
212
  expect(subject.publisher).to eq("Zenodo")
213
- expect(subject.agency).to eq("DataCite")
213
+ expect(subject.agency).to eq("datacite")
214
214
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
215
215
  end
216
216
 
@@ -242,7 +242,7 @@ describe Bolognese::Metadata, vcr: true do
242
242
  "subjectScheme"=>"Fields of Science and Technology (FOS)"},
243
243
  {"subject"=>"Computational Biology"},
244
244
  {"subject"=>"Systems Biology"}])
245
- expect(subject.agency).to eq("DataCite")
245
+ expect(subject.agency).to eq("datacite")
246
246
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
247
247
  end
248
248
 
@@ -272,7 +272,7 @@ describe Bolognese::Metadata, vcr: true do
272
272
  expect(subject.subjects).to eq([{"subject"=>"Evolutionary Biology"},
273
273
  {"subject"=>"FOS: Biological sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
274
274
  {"subject"=>"60412 Quantitative Genetics (incl. Disease and Trait Mapping Genetics)", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"}])
275
- expect(subject.agency).to eq("DataCite")
275
+ expect(subject.agency).to eq("datacite")
276
276
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
277
277
  end
278
278
 
@@ -320,7 +320,7 @@ describe Bolognese::Metadata, vcr: true do
320
320
  {"subject"=>"Data mining"},
321
321
  {"subject"=>"Statistical Computing Language R"},
322
322
  {"subject"=>"funded research publications"}])
323
- expect(subject.agency).to eq("DataCite")
323
+ expect(subject.agency).to eq("datacite")
324
324
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
325
325
  end
326
326
 
@@ -361,7 +361,7 @@ describe Bolognese::Metadata, vcr: true do
361
361
  "funderIdentifierType"=>"Crossref Funder ID",
362
362
  "funderName"=>"European Commission"}])
363
363
  expect(subject.identifiers).to eq([{"identifier"=>"123", "identifierType"=>"Repository ID"}])
364
- expect(subject.agency).to eq("DataCite")
364
+ expect(subject.agency).to eq("datacite")
365
365
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
366
366
  expect(subject.state).to eq("findable")
367
367
  end
@@ -614,7 +614,7 @@ describe Bolognese::Metadata, vcr: true do
614
614
  "http://www.rcuk.ac.uk/research/efficiency/researchadmin/harmonisation/",
615
615
  "subject"=>"Materials Characterisation",
616
616
  "subjectScheme"=>"RCUK Research Classifications"}])
617
- expect(subject.agency).to eq("DataCite")
617
+ expect(subject.agency).to eq("datacite")
618
618
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
619
619
  end
620
620
 
@@ -640,7 +640,7 @@ describe Bolognese::Metadata, vcr: true do
640
640
  "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
641
641
  "funderIdentifierType"=>"Crossref Funder ID",
642
642
  "funderName"=>"European Commission"}])
643
- expect(subject.agency).to eq("DataCite")
643
+ expect(subject.agency).to eq("datacite")
644
644
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
645
645
  end
646
646
 
@@ -660,7 +660,7 @@ describe Bolognese::Metadata, vcr: true do
660
660
  expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
661
661
  expect(subject.funding_references.length).to eq(1)
662
662
  expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
663
- expect(subject.agency).to eq("DataCite")
663
+ expect(subject.agency).to eq("datacite")
664
664
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
665
665
  end
666
666
 
@@ -681,7 +681,7 @@ describe Bolognese::Metadata, vcr: true do
681
681
  expect(subject.publication_year).to eq("2016")
682
682
  expect(subject.related_identifiers.length).to eq(3)
683
683
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
684
- expect(subject.agency).to eq("DataCite")
684
+ expect(subject.agency).to eq("datacite")
685
685
  end
686
686
 
687
687
  it "Schema 4.1 from string" do
@@ -711,7 +711,7 @@ describe Bolognese::Metadata, vcr: true do
711
711
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
712
712
  "schemeUri"=>"https://spdx.org/licenses/"}])
713
713
  expect(subject.publisher).to eq("Springer")
714
- expect(subject.agency).to eq("DataCite")
714
+ expect(subject.agency).to eq("datacite")
715
715
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
716
716
  end
717
717
 
@@ -741,7 +741,7 @@ describe Bolognese::Metadata, vcr: true do
741
741
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
742
742
  "schemeUri"=>"https://spdx.org/licenses/"}])
743
743
  expect(subject.publisher).to eq("Springer")
744
- expect(subject.agency).to eq("DataCite")
744
+ expect(subject.agency).to eq("datacite")
745
745
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4.0")
746
746
  end
747
747
 
@@ -770,7 +770,7 @@ describe Bolognese::Metadata, vcr: true do
770
770
  "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
771
771
  "schemeUri"=>"https://spdx.org/licenses/"}])
772
772
  expect(subject.publisher).to eq("Dryad Digital Repository")
773
- expect(subject.agency).to eq("DataCite")
773
+ expect(subject.agency).to eq("datacite")
774
774
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
775
775
  end
776
776
 
@@ -800,7 +800,7 @@ describe Bolognese::Metadata, vcr: true do
800
800
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
801
801
  "schemeUri"=>"https://spdx.org/licenses/"}])
802
802
  expect(subject.publisher).to eq("Springer")
803
- expect(subject.agency).to eq("DataCite")
803
+ expect(subject.agency).to eq("datacite")
804
804
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3.0")
805
805
  end
806
806
 
@@ -824,7 +824,7 @@ describe Bolognese::Metadata, vcr: true do
824
824
  expect(subject.related_identifiers.length).to eq(1)
825
825
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
826
826
  expect(subject.publisher).to eq("Springer")
827
- expect(subject.agency).to eq("DataCite")
827
+ expect(subject.agency).to eq("datacite")
828
828
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
829
829
  end
830
830
 
@@ -858,7 +858,7 @@ describe Bolognese::Metadata, vcr: true do
858
858
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
859
859
  "schemeUri"=>"https://spdx.org/licenses/"}])
860
860
  expect(subject.publisher).to eq("Springer")
861
- expect(subject.agency).to eq("DataCite")
861
+ expect(subject.agency).to eq("datacite")
862
862
  end
863
863
 
864
864
  it "namespaced xml from string" do
@@ -875,7 +875,7 @@ describe Bolognese::Metadata, vcr: true do
875
875
  expect(subject.dates).to eq([{"date"=>"2018-07-18", "dateType"=>"Valid"}, {"date"=>"2018-07-18", "dateType"=>"Accepted"}, {"date"=>"2018", "dateType"=>"Issued"}])
876
876
  expect(subject.publication_year).to eq("2018")
877
877
  expect(subject.publisher).to eq("nanoHUB")
878
- expect(subject.agency).to eq("DataCite")
878
+ expect(subject.agency).to eq("datacite")
879
879
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
880
880
  end
881
881
 
@@ -907,7 +907,7 @@ describe Bolognese::Metadata, vcr: true do
907
907
  expect(subject.titles).to eq([{"title"=>"CERES Level 3 Cloud Type Historgram Terra+Aqua HDF file - Edition4"}])
908
908
  expect(subject.publication_year).to eq("2016")
909
909
  expect(subject.publisher).to eq("NASA Langley Atmospheric Science Data Center DAAC")
910
- expect(subject.agency).to eq("DataCite")
910
+ expect(subject.agency).to eq("datacite")
911
911
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
912
912
  end
913
913
 
@@ -928,7 +928,7 @@ describe Bolognese::Metadata, vcr: true do
928
928
  expect(subject.dates).to eq([{"date"=>"1995-12", "dateType"=>"Collected"}, {"date"=>"1996", "dateType"=>"Issued"}])
929
929
  expect(subject.publication_year).to eq("1996")
930
930
  expect(subject.publisher).to eq("GESIS Data Archive")
931
- expect(subject.agency).to eq("DataCite")
931
+ expect(subject.agency).to eq("datacite")
932
932
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
933
933
  end
934
934
 
@@ -950,7 +950,7 @@ describe Bolognese::Metadata, vcr: true do
950
950
  expect(subject.descriptions[1]["description"]).to start_with("Aim of this paper is the presentation")
951
951
  expect(subject.subjects).to eq([{"subject"=>"PV Systems"}, {"subject"=>"Off-grid Applications"}])
952
952
  expect(subject.publisher).to eq("WIP-Munich")
953
- expect(subject.agency).to eq("DataCite")
953
+ expect(subject.agency).to eq("datacite")
954
954
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
955
955
  end
956
956
 
@@ -981,7 +981,7 @@ describe Bolognese::Metadata, vcr: true do
981
981
  expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
982
982
  expect(subject.publication_year).to eq("2017")
983
983
  expect(subject.publisher).to eq("Siemens AG")
984
- expect(subject.agency).to eq("DataCite")
984
+ expect(subject.agency).to eq("datacite")
985
985
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
986
986
  end
987
987
 
@@ -1021,7 +1021,7 @@ describe Bolognese::Metadata, vcr: true do
1021
1021
  expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"2015", "dateType"=>"Issued"}])
1022
1022
  expect(subject.publication_year).to eq("2015")
1023
1023
  expect(subject.publisher).to eq("Royal Netherlands Meteorological Institute (KNMI)")
1024
- expect(subject.agency).to eq("DataCite")
1024
+ expect(subject.agency).to eq("datacite")
1025
1025
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1026
1026
  end
1027
1027
 
@@ -1031,7 +1031,7 @@ describe Bolognese::Metadata, vcr: true do
1031
1031
  expect(subject.valid?).to be false
1032
1032
  expect(subject.id).to eq("https://doi.org/10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1033
1033
  expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1034
- expect(subject.agency).to eq("DataCite")
1034
+ expect(subject.agency).to eq("datacite")
1035
1035
  expect(subject.state).to eq("not_found")
1036
1036
  end
1037
1037
 
@@ -1047,7 +1047,7 @@ describe Bolognese::Metadata, vcr: true do
1047
1047
  expect(subject.dates).to eq([{"date"=>"2018-01-12", "dateType"=>"Issued"}])
1048
1048
  expect(subject.publication_year).to eq("2018")
1049
1049
  expect(subject.publisher).to eq("CaltechDATA")
1050
- expect(subject.agency).to eq("DataCite")
1050
+ expect(subject.agency).to eq("datacite")
1051
1051
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1052
1052
  expect(subject.state).to eq("findable")
1053
1053
  end
@@ -1064,7 +1064,7 @@ describe Bolognese::Metadata, vcr: true do
1064
1064
  expect(subject.dates).to eq([{"date"=>"2018", "dateType"=>"Issued"}])
1065
1065
  expect(subject.publication_year).to eq("2018")
1066
1066
  expect(subject.publisher).to eq("F1000 Research Limited")
1067
- expect(subject.agency).to eq("DataCite")
1067
+ expect(subject.agency).to eq("datacite")
1068
1068
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1069
1069
  expect(subject.state).to eq("findable")
1070
1070
  end
@@ -1083,7 +1083,7 @@ describe Bolognese::Metadata, vcr: true do
1083
1083
  expect(subject.titles).to eq([{"title"=>"Referee report. For: Gates - add article keywords to the metatags [version 2; referees: 1 approved]"}])
1084
1084
  expect(subject.publication_year).to eq("2018")
1085
1085
  expect(subject.publisher).to eq("Gates Open Research")
1086
- expect(subject.agency).to eq("DataCite")
1086
+ expect(subject.agency).to eq("datacite")
1087
1087
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1088
1088
  end
1089
1089
 
@@ -1176,7 +1176,7 @@ describe Bolognese::Metadata, vcr: true do
1176
1176
  {"date"=>"2009-10-01/2014-01-23", "dateType"=>"Created"}])
1177
1177
  expect(subject.publication_year).to eq("2014")
1178
1178
  expect(subject.publisher).to eq("Deutsches Elektronen-Synchrotron, DESY, Hamburg")
1179
- expect(subject.agency).to eq("DataCite")
1179
+ expect(subject.agency).to eq("datacite")
1180
1180
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1181
1181
  end
1182
1182
 
@@ -1203,7 +1203,7 @@ describe Bolognese::Metadata, vcr: true do
1203
1203
  expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
1204
1204
  expect(subject.funding_references.count).to eq(1)
1205
1205
  expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
1206
- expect(subject.agency).to eq("DataCite")
1206
+ expect(subject.agency).to eq("datacite")
1207
1207
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1208
1208
  end
1209
1209
 
@@ -1300,7 +1300,7 @@ describe Bolognese::Metadata, vcr: true do
1300
1300
  expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Meteo measurements at the Sand Motor"}])
1301
1301
  expect(subject.publication_year).to eq("2017")
1302
1302
  expect(subject.publisher).to eq("4TU.Centre for Research Data")
1303
- expect(subject.agency).to eq("DataCite")
1303
+ expect(subject.agency).to eq("datacite")
1304
1304
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1305
1305
  expect(subject.geo_locations.first["geoLocationPlace"]).to eq("Zandmotor, sand suppletion area on the Dutch coast.")
1306
1306
  expect(subject.geo_locations.first["geoLocationPolygon"].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
@@ -19,6 +19,18 @@ describe Bolognese::Metadata, vcr: true do
19
19
  expect(bibtex[:copyright]).to eq("Creative Commons Attribution 3.0 Unported")
20
20
  end
21
21
 
22
+ it "with schema_3" do
23
+ # input = fixture_path + "datacite_kernel_3.json"
24
+ input = fixture_path + "datacite_schema_3.xml"
25
+ json = Bolognese::Metadata.new(input: input, from: "datacite")
26
+ subject = Bolognese::Metadata.new(input: json.meta.to_json, from: "datacite_json")
27
+ bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
28
+ expect(bibtex[:bibtex_type].to_s).to eq("misc")
29
+ expect(bibtex[:bibtex_key]).to eq("https://doi.org/10.5061/dryad.8515")
30
+ expect(bibtex[:doi]).to eq("10.5061/dryad.8515")
31
+ expect(bibtex[:year]).to eq("2011")
32
+ end
33
+
22
34
  it "with pages" do
23
35
  input = "https://doi.org/10.1155/2012/291294"
24
36
  subject = Bolognese::Metadata.new(input: input, from: "crossref")
@@ -67,6 +67,19 @@ describe Bolognese::Metadata, vcr: true do
67
67
  expect(json["issued"]).to eq("date-parts" => [[2016, 12, 20]])
68
68
  end
69
69
 
70
+ it "Another dataset" do
71
+ input = "10.26301/qdpd-2250"
72
+ subject = Bolognese::Metadata.new(input: input, from: "datacite")
73
+ json = JSON.parse(subject.citeproc)
74
+ expect(json["type"]).to eq("dataset")
75
+ expect(json["id"]).to eq("https://doi.org/10.26301/qdpd-2250")
76
+ expect(json["DOI"]).to eq("10.26301/qdpd-2250")
77
+ expect(json["title"]).to eq("USS Pampanito Submarine")
78
+ expect(json["author"]).to eq([{"literal"=>"USS Pampanito"}])
79
+ expect(json["publisher"]).to eq("Open Heritage 3D")
80
+ expect(json["issued"]).to eq("date-parts"=>[[2020]])
81
+ end
82
+
70
83
  it "journal article" do
71
84
  input = "10.7554/eLife.01567"
72
85
  subject = Bolognese::Metadata.new(input: input, from: "crossref")
@@ -147,7 +147,7 @@ describe Bolognese::Metadata, vcr: true do
147
147
  expect(subject.publication_year).to eq("2015")
148
148
  expect(subject.version_info).to eq("v0.3.2")
149
149
  expect(subject.publisher).to eq("Zenodo")
150
- expect(subject.agency).to eq("DataCite")
150
+ expect(subject.agency).to eq("datacite")
151
151
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
152
152
  expect(subject.datacite).to include("<version>v0.3.2</version>")
153
153
  end
@@ -173,7 +173,7 @@ describe Bolognese::Metadata, vcr: true do
173
173
  {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
174
174
  "subject"=>"FOS: Computer and information sciences",
175
175
  "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
176
- expect(subject.agency).to eq("DataCite")
176
+ expect(subject.agency).to eq("datacite")
177
177
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
178
178
  expect(subject.datacite).to end_with("</resource>")
179
179
  end
@@ -199,7 +199,7 @@ describe Bolognese::Metadata, vcr: true do
199
199
  {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
200
200
  "subject"=>"FOS: Computer and information sciences",
201
201
  "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
202
- expect(subject.agency).to eq("DataCite")
202
+ expect(subject.agency).to eq("datacite")
203
203
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
204
204
  expect(subject.datacite).to end_with("</resource>")
205
205
  end
@@ -224,7 +224,7 @@ describe Bolognese::Metadata, vcr: true do
224
224
  expect(subject.related_identifiers.last).to eq("relatedIdentifier" => "10.1371/journal.ppat.1000446",
225
225
  "relatedIdentifierType" => "DOI","relationType"=>"IsSupplementTo")
226
226
  expect(subject.publisher).to eq("Dryad")
227
- expect(subject.agency).to eq("DataCite")
227
+ expect(subject.agency).to eq("datacite")
228
228
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
229
229
 
230
230
  datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
@@ -249,7 +249,7 @@ describe Bolognese::Metadata, vcr: true do
249
249
  expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
250
250
  expect(subject.publication_year).to eq("2013")
251
251
  expect(subject.publisher).to eq("UC Merced")
252
- expect(subject.agency).to eq("DataCite")
252
+ expect(subject.agency).to eq("datacite")
253
253
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
254
254
 
255
255
  datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
@@ -273,7 +273,7 @@ describe Bolognese::Metadata, vcr: true do
273
273
  expect(subject.valid?).to be false
274
274
  expect(subject.id).to eq("https://doi.org/10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
275
275
  expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
276
- expect(subject.agency).to eq("DataCite")
276
+ expect(subject.agency).to eq("datacite")
277
277
  expect(subject.state).to eq("not_found")
278
278
  datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
279
279
  expect(datacite["identifier"]).to eq("identifierType"=>"DOI", "__content__"=>"10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
@@ -386,11 +386,11 @@ describe Bolognese::Metadata, vcr: true do
386
386
  input = "10.7554/eLife.01567"
387
387
  subject = Bolognese::Metadata.new(input: input, from: "crossref")
388
388
  expect(subject.valid?).to be true
389
- expect(subject.identifiers).to eq( [{"identifier"=>"e01567", "identifierType"=>"Publisher ID"}])
390
- subject.identifiers = [{ "identifierType" => "Publisher ID", "identifier" => "abc" }]
389
+ expect(subject.identifiers).to eq([{"identifier"=>"e01567", "identifierType"=>"article_number"}])
390
+ subject.identifiers = [{ "identifierType" => "article_number", "identifier" => "abc" }]
391
391
  datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
392
392
  expect(datacite.dig("identifier", "__content__")).to eq("10.7554/elife.01567")
393
- expect(subject.identifiers).to eq([{"identifier"=>"abc", "identifierType"=>"Publisher ID"}])
393
+ expect(subject.identifiers).to eq([{"identifier"=>"abc", "identifierType"=>"article_number"}])
394
394
  end
395
395
 
396
396
  it "validates against schema" do
@@ -53,7 +53,7 @@ describe Bolognese::Metadata, vcr: true do
53
53
  jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
54
54
  expect(jats.dig("publication_type")).to eq("chapter")
55
55
  expect(jats.dig("chapter_title")).to eq("Physical Examinations")
56
- expect(jats.dig("source")).to eq("Jaypee Brothers Medical Publishers (P) Ltd.")
56
+ expect(jats.dig("source")).to eq("Jaypee Brothers Medical Publishing")
57
57
  expect(jats.dig("person_group", "name")).to eq("surname"=>"Saha", "given_names"=>"Ashis")
58
58
  expect(jats.dig("year")).to eq("iso_8601_date"=>"2015", "__content__"=>"2015")
59
59
  expect(jats.dig("fpage")).to eq("27")
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.8'
4
+ version: 1.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-14 00:00:00.000000000 Z
11
+ date: 2020-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -908,6 +908,7 @@ files:
908
908
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml
909
909
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml
910
910
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml
911
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_oup.yml
911
912
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml
912
913
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml
913
914
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml
@@ -926,6 +927,8 @@ files:
926
927
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml
927
928
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml
928
929
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml
930
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content_copernicus.yml
931
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml
929
932
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml
930
933
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml
931
934
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml
@@ -1117,6 +1120,7 @@ files:
1117
1120
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml
1118
1121
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/interactive_resource_without_dates.yml
1119
1122
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml
1123
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Another_dataset.yml
1120
1124
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml
1121
1125
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml
1122
1126
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml
@@ -1248,8 +1252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1248
1252
  - !ruby/object:Gem::Version
1249
1253
  version: '0'
1250
1254
  requirements: []
1251
- rubyforge_project:
1252
- rubygems_version: 2.7.7
1255
+ rubygems_version: 3.0.8
1253
1256
  signing_key:
1254
1257
  specification_version: 4
1255
1258
  summary: Ruby client library for conversion of DOI Metadata