bolognese 1.8.2 → 1.8.7

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
 
@@ -295,6 +295,17 @@ describe Bolognese::Metadata, vcr: true do
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
297
297
 
298
+ it "cc-by 3.0 us" do
299
+ input = "10.6084/m9.figshare.1286826.v1"
300
+ subject = Bolognese::Metadata.new(input: input)
301
+ expect(subject.valid?).to be true
302
+ expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 3.0 Unported",
303
+ + "rightsIdentifier"=>"cc-by-3.0",
304
+ + "rightsIdentifierScheme"=>"SPDX",
305
+ + "rightsUri"=>"https://creativecommons.org/licenses/by/3.0/legalcode",
306
+ + "schemeUri"=>"https://spdx.org/licenses/"}])
307
+ end
308
+
298
309
  it "funding schema version 3" do
299
310
  input = "https://doi.org/10.5281/ZENODO.1239"
300
311
  subject = Bolognese::Metadata.new(input: input)
@@ -320,7 +331,7 @@ describe Bolognese::Metadata, vcr: true do
320
331
  {"subject"=>"Data mining"},
321
332
  {"subject"=>"Statistical Computing Language R"},
322
333
  {"subject"=>"funded research publications"}])
323
- expect(subject.agency).to eq("DataCite")
334
+ expect(subject.agency).to eq("datacite")
324
335
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
325
336
  end
326
337
 
@@ -361,7 +372,7 @@ describe Bolognese::Metadata, vcr: true do
361
372
  "funderIdentifierType"=>"Crossref Funder ID",
362
373
  "funderName"=>"European Commission"}])
363
374
  expect(subject.identifiers).to eq([{"identifier"=>"123", "identifierType"=>"Repository ID"}])
364
- expect(subject.agency).to eq("DataCite")
375
+ expect(subject.agency).to eq("datacite")
365
376
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
366
377
  expect(subject.state).to eq("findable")
367
378
  end
@@ -614,7 +625,7 @@ describe Bolognese::Metadata, vcr: true do
614
625
  "http://www.rcuk.ac.uk/research/efficiency/researchadmin/harmonisation/",
615
626
  "subject"=>"Materials Characterisation",
616
627
  "subjectScheme"=>"RCUK Research Classifications"}])
617
- expect(subject.agency).to eq("DataCite")
628
+ expect(subject.agency).to eq("datacite")
618
629
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
619
630
  end
620
631
 
@@ -640,7 +651,7 @@ describe Bolognese::Metadata, vcr: true do
640
651
  "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
641
652
  "funderIdentifierType"=>"Crossref Funder ID",
642
653
  "funderName"=>"European Commission"}])
643
- expect(subject.agency).to eq("DataCite")
654
+ expect(subject.agency).to eq("datacite")
644
655
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
645
656
  end
646
657
 
@@ -660,7 +671,7 @@ describe Bolognese::Metadata, vcr: true do
660
671
  expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
661
672
  expect(subject.funding_references.length).to eq(1)
662
673
  expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
663
- expect(subject.agency).to eq("DataCite")
674
+ expect(subject.agency).to eq("datacite")
664
675
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
665
676
  end
666
677
 
@@ -681,7 +692,7 @@ describe Bolognese::Metadata, vcr: true do
681
692
  expect(subject.publication_year).to eq("2016")
682
693
  expect(subject.related_identifiers.length).to eq(3)
683
694
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
684
- expect(subject.agency).to eq("DataCite")
695
+ expect(subject.agency).to eq("datacite")
685
696
  end
686
697
 
687
698
  it "Schema 4.1 from string" do
@@ -711,7 +722,7 @@ describe Bolognese::Metadata, vcr: true do
711
722
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
712
723
  "schemeUri"=>"https://spdx.org/licenses/"}])
713
724
  expect(subject.publisher).to eq("Springer")
714
- expect(subject.agency).to eq("DataCite")
725
+ expect(subject.agency).to eq("datacite")
715
726
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
716
727
  end
717
728
 
@@ -741,7 +752,7 @@ describe Bolognese::Metadata, vcr: true do
741
752
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
742
753
  "schemeUri"=>"https://spdx.org/licenses/"}])
743
754
  expect(subject.publisher).to eq("Springer")
744
- expect(subject.agency).to eq("DataCite")
755
+ expect(subject.agency).to eq("datacite")
745
756
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4.0")
746
757
  end
747
758
 
@@ -770,7 +781,7 @@ describe Bolognese::Metadata, vcr: true do
770
781
  "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
771
782
  "schemeUri"=>"https://spdx.org/licenses/"}])
772
783
  expect(subject.publisher).to eq("Dryad Digital Repository")
773
- expect(subject.agency).to eq("DataCite")
784
+ expect(subject.agency).to eq("datacite")
774
785
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
775
786
  end
776
787
 
@@ -800,7 +811,7 @@ describe Bolognese::Metadata, vcr: true do
800
811
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
801
812
  "schemeUri"=>"https://spdx.org/licenses/"}])
802
813
  expect(subject.publisher).to eq("Springer")
803
- expect(subject.agency).to eq("DataCite")
814
+ expect(subject.agency).to eq("datacite")
804
815
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3.0")
805
816
  end
806
817
 
@@ -824,7 +835,7 @@ describe Bolognese::Metadata, vcr: true do
824
835
  expect(subject.related_identifiers.length).to eq(1)
825
836
  expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
826
837
  expect(subject.publisher).to eq("Springer")
827
- expect(subject.agency).to eq("DataCite")
838
+ expect(subject.agency).to eq("datacite")
828
839
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
829
840
  end
830
841
 
@@ -858,7 +869,7 @@ describe Bolognese::Metadata, vcr: true do
858
869
  "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
859
870
  "schemeUri"=>"https://spdx.org/licenses/"}])
860
871
  expect(subject.publisher).to eq("Springer")
861
- expect(subject.agency).to eq("DataCite")
872
+ expect(subject.agency).to eq("datacite")
862
873
  end
863
874
 
864
875
  it "namespaced xml from string" do
@@ -875,7 +886,7 @@ describe Bolognese::Metadata, vcr: true do
875
886
  expect(subject.dates).to eq([{"date"=>"2018-07-18", "dateType"=>"Valid"}, {"date"=>"2018-07-18", "dateType"=>"Accepted"}, {"date"=>"2018", "dateType"=>"Issued"}])
876
887
  expect(subject.publication_year).to eq("2018")
877
888
  expect(subject.publisher).to eq("nanoHUB")
878
- expect(subject.agency).to eq("DataCite")
889
+ expect(subject.agency).to eq("datacite")
879
890
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
880
891
  end
881
892
 
@@ -907,7 +918,7 @@ describe Bolognese::Metadata, vcr: true do
907
918
  expect(subject.titles).to eq([{"title"=>"CERES Level 3 Cloud Type Historgram Terra+Aqua HDF file - Edition4"}])
908
919
  expect(subject.publication_year).to eq("2016")
909
920
  expect(subject.publisher).to eq("NASA Langley Atmospheric Science Data Center DAAC")
910
- expect(subject.agency).to eq("DataCite")
921
+ expect(subject.agency).to eq("datacite")
911
922
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
912
923
  end
913
924
 
@@ -928,7 +939,7 @@ describe Bolognese::Metadata, vcr: true do
928
939
  expect(subject.dates).to eq([{"date"=>"1995-12", "dateType"=>"Collected"}, {"date"=>"1996", "dateType"=>"Issued"}])
929
940
  expect(subject.publication_year).to eq("1996")
930
941
  expect(subject.publisher).to eq("GESIS Data Archive")
931
- expect(subject.agency).to eq("DataCite")
942
+ expect(subject.agency).to eq("datacite")
932
943
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
933
944
  end
934
945
 
@@ -950,7 +961,7 @@ describe Bolognese::Metadata, vcr: true do
950
961
  expect(subject.descriptions[1]["description"]).to start_with("Aim of this paper is the presentation")
951
962
  expect(subject.subjects).to eq([{"subject"=>"PV Systems"}, {"subject"=>"Off-grid Applications"}])
952
963
  expect(subject.publisher).to eq("WIP-Munich")
953
- expect(subject.agency).to eq("DataCite")
964
+ expect(subject.agency).to eq("datacite")
954
965
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
955
966
  end
956
967
 
@@ -981,7 +992,7 @@ describe Bolognese::Metadata, vcr: true do
981
992
  expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
982
993
  expect(subject.publication_year).to eq("2017")
983
994
  expect(subject.publisher).to eq("Siemens AG")
984
- expect(subject.agency).to eq("DataCite")
995
+ expect(subject.agency).to eq("datacite")
985
996
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
986
997
  end
987
998
 
@@ -1021,7 +1032,7 @@ describe Bolognese::Metadata, vcr: true do
1021
1032
  expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"2015", "dateType"=>"Issued"}])
1022
1033
  expect(subject.publication_year).to eq("2015")
1023
1034
  expect(subject.publisher).to eq("Royal Netherlands Meteorological Institute (KNMI)")
1024
- expect(subject.agency).to eq("DataCite")
1035
+ expect(subject.agency).to eq("datacite")
1025
1036
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1026
1037
  end
1027
1038
 
@@ -1031,7 +1042,7 @@ describe Bolognese::Metadata, vcr: true do
1031
1042
  expect(subject.valid?).to be false
1032
1043
  expect(subject.id).to eq("https://doi.org/10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1033
1044
  expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1034
- expect(subject.agency).to eq("DataCite")
1045
+ expect(subject.agency).to eq("datacite")
1035
1046
  expect(subject.state).to eq("not_found")
1036
1047
  end
1037
1048
 
@@ -1047,7 +1058,7 @@ describe Bolognese::Metadata, vcr: true do
1047
1058
  expect(subject.dates).to eq([{"date"=>"2018-01-12", "dateType"=>"Issued"}])
1048
1059
  expect(subject.publication_year).to eq("2018")
1049
1060
  expect(subject.publisher).to eq("CaltechDATA")
1050
- expect(subject.agency).to eq("DataCite")
1061
+ expect(subject.agency).to eq("datacite")
1051
1062
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1052
1063
  expect(subject.state).to eq("findable")
1053
1064
  end
@@ -1064,7 +1075,7 @@ describe Bolognese::Metadata, vcr: true do
1064
1075
  expect(subject.dates).to eq([{"date"=>"2018", "dateType"=>"Issued"}])
1065
1076
  expect(subject.publication_year).to eq("2018")
1066
1077
  expect(subject.publisher).to eq("F1000 Research Limited")
1067
- expect(subject.agency).to eq("DataCite")
1078
+ expect(subject.agency).to eq("datacite")
1068
1079
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1069
1080
  expect(subject.state).to eq("findable")
1070
1081
  end
@@ -1083,7 +1094,7 @@ describe Bolognese::Metadata, vcr: true do
1083
1094
  expect(subject.titles).to eq([{"title"=>"Referee report. For: Gates - add article keywords to the metatags [version 2; referees: 1 approved]"}])
1084
1095
  expect(subject.publication_year).to eq("2018")
1085
1096
  expect(subject.publisher).to eq("Gates Open Research")
1086
- expect(subject.agency).to eq("DataCite")
1097
+ expect(subject.agency).to eq("datacite")
1087
1098
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1088
1099
  end
1089
1100
 
@@ -1176,7 +1187,7 @@ describe Bolognese::Metadata, vcr: true do
1176
1187
  {"date"=>"2009-10-01/2014-01-23", "dateType"=>"Created"}])
1177
1188
  expect(subject.publication_year).to eq("2014")
1178
1189
  expect(subject.publisher).to eq("Deutsches Elektronen-Synchrotron, DESY, Hamburg")
1179
- expect(subject.agency).to eq("DataCite")
1190
+ expect(subject.agency).to eq("datacite")
1180
1191
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1181
1192
  end
1182
1193
 
@@ -1203,7 +1214,7 @@ describe Bolognese::Metadata, vcr: true do
1203
1214
  expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
1204
1215
  expect(subject.funding_references.count).to eq(1)
1205
1216
  expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
1206
- expect(subject.agency).to eq("DataCite")
1217
+ expect(subject.agency).to eq("datacite")
1207
1218
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1208
1219
  end
1209
1220
 
@@ -1300,7 +1311,7 @@ describe Bolognese::Metadata, vcr: true do
1300
1311
  expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Meteo measurements at the Sand Motor"}])
1301
1312
  expect(subject.publication_year).to eq("2017")
1302
1313
  expect(subject.publisher).to eq("4TU.Centre for Research Data")
1303
- expect(subject.agency).to eq("DataCite")
1314
+ expect(subject.agency).to eq("datacite")
1304
1315
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1305
1316
  expect(subject.geo_locations.first["geoLocationPlace"]).to eq("Zandmotor, sand suppletion area on the Dutch coast.")
1306
1317
  expect(subject.geo_locations.first["geoLocationPolygon"].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
@@ -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.2
4
+ version: 1.8.7
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-24 00:00:00.000000000 Z
11
+ date: 2020-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -130,22 +130,16 @@ dependencies:
130
130
  name: thor
131
131
  requirement: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - "~>"
134
- - !ruby/object:Gem::Version
135
- version: '1.0'
136
133
  - - ">="
137
134
  - !ruby/object:Gem::Version
138
- version: 1.0.1
135
+ version: '0.19'
139
136
  type: :runtime
140
137
  prerelease: false
141
138
  version_requirements: !ruby/object:Gem::Requirement
142
139
  requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '1.0'
146
140
  - - ">="
147
141
  - !ruby/object:Gem::Version
148
- version: 1.0.1
142
+ version: '0.19'
149
143
  - !ruby/object:Gem::Dependency
150
144
  name: colorize
151
145
  requirement: !ruby/object:Gem::Requirement
@@ -908,6 +902,7 @@ files:
908
902
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml
909
903
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml
910
904
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml
905
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_oup.yml
911
906
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml
912
907
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml
913
908
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml
@@ -926,6 +921,8 @@ files:
926
921
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml
927
922
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml
928
923
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml
924
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content_copernicus.yml
925
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml
929
926
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml
930
927
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml
931
928
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml
@@ -944,6 +941,7 @@ files:
944
941
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml
945
942
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml
946
943
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml
944
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/cc-by_3_0_us.yml
947
945
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/content_url.yml
948
946
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml
949
947
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml