bolognese 1.11.4 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (604) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/.github/workflows/release.yml +2 -2
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +199 -166
  6. data/README.md +1 -1
  7. data/bolognese.gemspec +30 -36
  8. data/lib/bolognese/author_utils.rb +5 -8
  9. data/lib/bolognese/citeproc_extensions.rb +48 -0
  10. data/lib/bolognese/datacite_utils.rb +27 -9
  11. data/lib/bolognese/metadata.rb +9 -11
  12. data/lib/bolognese/metadata_utils.rb +21 -6
  13. data/lib/bolognese/readers/bibtex_reader.rb +2 -2
  14. data/lib/bolognese/readers/citeproc_reader.rb +7 -1
  15. data/lib/bolognese/readers/codemeta_reader.rb +2 -2
  16. data/lib/bolognese/readers/crosscite_reader.rb +4 -1
  17. data/lib/bolognese/readers/crossref_reader.rb +53 -8
  18. data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
  19. data/lib/bolognese/readers/datacite_reader.rb +30 -37
  20. data/lib/bolognese/readers/npm_reader.rb +1 -1
  21. data/lib/bolognese/readers/ris_reader.rb +2 -2
  22. data/lib/bolognese/readers/schema_org_reader.rb +27 -4
  23. data/lib/bolognese/utils.rb +113 -24
  24. data/lib/bolognese/version.rb +1 -1
  25. data/lib/bolognese/writers/bibtex_writer.rb +1 -1
  26. data/lib/bolognese/writers/codemeta_writer.rb +1 -1
  27. data/lib/bolognese/writers/csv_writer.rb +3 -5
  28. data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
  29. data/lib/bolognese/writers/jats_writer.rb +6 -3
  30. data/lib/bolognese/writers/ris_writer.rb +1 -1
  31. data/lib/bolognese/writers/schema_org_writer.rb +5 -1
  32. data/lib/bolognese.rb +1 -4
  33. data/resources/kernel-4/include/datacite-contributorType-v4.xsd +3 -1
  34. data/resources/kernel-4/include/datacite-dateType-v4.xsd +3 -1
  35. data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +7 -2
  36. data/resources/kernel-4/include/datacite-relationType-v4.xsd +11 -3
  37. data/resources/kernel-4/include/datacite-resourceType-v4.xsd +10 -1
  38. data/resources/kernel-4/include/datacite-titleType-v4.xsd +1 -1
  39. data/resources/kernel-4/metadata.xsd +15 -7
  40. data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
  41. data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
  42. data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
  43. data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
  44. data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
  45. data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
  46. data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  47. data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
  48. data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
  49. data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
  50. data/resources/kernel-4.5/include/xml.xsd +286 -0
  51. data/resources/kernel-4.5/metadata.xsd +711 -0
  52. data/resources/kernel-4.6/include/datacite-contributorType-v4.xsd +37 -0
  53. data/resources/kernel-4.6/include/datacite-dateType-v4.xsd +27 -0
  54. data/resources/kernel-4.6/include/datacite-descriptionType-v4.xsd +19 -0
  55. data/resources/kernel-4.6/include/datacite-funderIdentifierType-v4.xsd +16 -0
  56. data/resources/kernel-4.6/include/datacite-nameType-v4.xsd +10 -0
  57. data/resources/kernel-4.6/include/datacite-numberType-v4.xsd +12 -0
  58. data/resources/kernel-4.6/include/datacite-relatedIdentifierType-v4.xsd +37 -0
  59. data/resources/kernel-4.6/include/datacite-relationType-v4.xsd +57 -0
  60. data/resources/kernel-4.6/include/datacite-resourceType-v4.xsd +49 -0
  61. data/resources/kernel-4.6/include/datacite-titleType-v4.xsd +14 -0
  62. data/resources/kernel-4.6/include/xml.xsd +286 -0
  63. data/resources/kernel-4.6/metadata.xsd +712 -0
  64. data/resources/kernel-4.7/include/datacite-contributorType-v4.xsd +37 -0
  65. data/resources/kernel-4.7/include/datacite-dateType-v4.xsd +27 -0
  66. data/resources/kernel-4.7/include/datacite-descriptionType-v4.xsd +19 -0
  67. data/resources/kernel-4.7/include/datacite-funderIdentifierType-v4.xsd +16 -0
  68. data/resources/kernel-4.7/include/datacite-nameType-v4.xsd +10 -0
  69. data/resources/kernel-4.7/include/datacite-numberType-v4.xsd +12 -0
  70. data/resources/kernel-4.7/include/datacite-relatedIdentifierType-v4.xsd +39 -0
  71. data/resources/kernel-4.7/include/datacite-relationType-v4.xsd +59 -0
  72. data/resources/kernel-4.7/include/datacite-resourceType-v4.xsd +52 -0
  73. data/resources/kernel-4.7/include/datacite-titleType-v4.xsd +14 -0
  74. data/resources/kernel-4.7/include/xml.xsd +286 -0
  75. data/resources/kernel-4.7/metadata.xsd +715 -0
  76. metadata +159 -718
  77. data/spec/array_spec.rb +0 -22
  78. data/spec/author_utils_spec.rb +0 -253
  79. data/spec/cli_spec.rb +0 -226
  80. data/spec/datacite_utils_spec.rb +0 -207
  81. data/spec/doi_utils_spec.rb +0 -314
  82. data/spec/find_from_format_spec.rb +0 -114
  83. data/spec/fixtures/aida.json +0 -82
  84. data/spec/fixtures/cgimp_package.json +0 -18
  85. data/spec/fixtures/cit_package.json +0 -19
  86. data/spec/fixtures/citeproc-no-author.json +0 -26
  87. data/spec/fixtures/citeproc-no-categories.json +0 -21
  88. data/spec/fixtures/citeproc.json +0 -32
  89. data/spec/fixtures/codemeta.json +0 -86
  90. data/spec/fixtures/codemeta_v2.json +0 -86
  91. data/spec/fixtures/crosscite.json +0 -63
  92. data/spec/fixtures/crossref.bib +0 -14
  93. data/spec/fixtures/crossref.ris +0 -15
  94. data/spec/fixtures/crossref.xml +0 -606
  95. data/spec/fixtures/datacite-empty-sizes.xml +0 -57
  96. data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +0 -117
  97. data/spec/fixtures/datacite-example-affiliation.xml +0 -114
  98. data/spec/fixtures/datacite-example-ancientdates-v4.3.xml +0 -29
  99. data/spec/fixtures/datacite-example-complicated-tba.xml +0 -56
  100. data/spec/fixtures/datacite-example-complicated-v3.0.xml +0 -48
  101. data/spec/fixtures/datacite-example-complicated-v4.0.xml +0 -54
  102. data/spec/fixtures/datacite-example-complicated-v4.1.xml +0 -57
  103. data/spec/fixtures/datacite-example-dissertation-v4.4.xml +0 -56
  104. data/spec/fixtures/datacite-example-escaped-text.xml +0 -56
  105. data/spec/fixtures/datacite-example-full-v4.4.xml +0 -114
  106. data/spec/fixtures/datacite-example-geolocation-2.xml +0 -141
  107. data/spec/fixtures/datacite-example-geolocation.xml +0 -66
  108. data/spec/fixtures/datacite-example-nameIdentifier-with-schemeURI.xml +0 -94
  109. data/spec/fixtures/datacite-example-polygon-v4.1.xml +0 -163
  110. data/spec/fixtures/datacite-example-relateditems-with-attributes.xml +0 -61
  111. data/spec/fixtures/datacite-example-relateditems.xml +0 -61
  112. data/spec/fixtures/datacite-example-xs-string.xml +0 -28
  113. data/spec/fixtures/datacite-formats-with-xs.xml +0 -22
  114. data/spec/fixtures/datacite-funderIdentifier.xml +0 -98
  115. data/spec/fixtures/datacite-geolocation-empty.xml +0 -159
  116. data/spec/fixtures/datacite-geolocationpolygons-multiple.xml +0 -76
  117. data/spec/fixtures/datacite-metadata-sample-complicated-v2.2.xml +0 -52
  118. data/spec/fixtures/datacite-multiple-language.xml +0 -38
  119. data/spec/fixtures/datacite-multiple-rights.xml +0 -59
  120. data/spec/fixtures/datacite-schema-2.2.xml +0 -80
  121. data/spec/fixtures/datacite-seriesinformation.xml +0 -41
  122. data/spec/fixtures/datacite-space-in-sizes.xml +0 -52
  123. data/spec/fixtures/datacite-xml-lang.xml +0 -51
  124. data/spec/fixtures/datacite.json +0 -89
  125. data/spec/fixtures/datacite.xml +0 -40
  126. data/spec/fixtures/datacite_dataset.xml +0 -58
  127. data/spec/fixtures/datacite_malformed_creator.xml +0 -52
  128. data/spec/fixtures/datacite_missing_creator.xml +0 -33
  129. data/spec/fixtures/datacite_schema_3.xml +0 -58
  130. data/spec/fixtures/datacite_software.json +0 -21
  131. data/spec/fixtures/datacite_software_missing_comma.json +0 -18
  132. data/spec/fixtures/datacite_software_overlapping_keys.json +0 -18
  133. data/spec/fixtures/datacite_software_version.json +0 -74
  134. data/spec/fixtures/edam_package.json +0 -12
  135. data/spec/fixtures/funding_reference.xml +0 -53
  136. data/spec/fixtures/gtex.xml +0 -71
  137. data/spec/fixtures/maremma/codemeta.json +0 -36
  138. data/spec/fixtures/nist.xml +0 -35
  139. data/spec/fixtures/ns0.xml +0 -2
  140. data/spec/fixtures/pure.bib +0 -14
  141. data/spec/fixtures/pure.ris +0 -15
  142. data/spec/fixtures/pure.xml +0 -188
  143. data/spec/fixtures/ris_bug.ris +0 -9
  144. data/spec/fixtures/schema_4.0.xml +0 -140
  145. data/spec/fixtures/schema_org.json +0 -49
  146. data/spec/fixtures/schema_org_geolocation.json +0 -82
  147. data/spec/fixtures/schema_org_geoshape.json +0 -550
  148. data/spec/fixtures/schema_org_gtex.json +0 -75
  149. data/spec/fixtures/schema_org_list.json +0 -12623
  150. data/spec/fixtures/schema_org_tdl_iodp_invalid_authors.json +0 -25
  151. data/spec/fixtures/schema_org_topmed.json +0 -53
  152. data/spec/fixtures/schema_org_type_as_array.json +0 -41
  153. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml +0 -106
  154. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +0 -106
  155. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_citation.yml +0 -106
  156. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +0 -106
  157. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +0 -106
  158. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_jats.yml +0 -106
  159. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +0 -106
  160. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +0 -106
  161. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +0 -106
  162. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_citation.yml +0 -106
  163. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +0 -106
  164. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +0 -106
  165. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_jats.yml +0 -106
  166. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +0 -106
  167. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +0 -117
  168. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +0 -117
  169. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +0 -115
  170. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/crossref.yml +0 -54
  171. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/datacite.yml +0 -54
  172. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/jalc.yml +0 -54
  173. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/kisti.yml +0 -54
  174. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/medra.yml +0 -54
  175. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/op.yml +0 -54
  176. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/author.yml +0 -48
  177. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/no_author.yml +0 -48
  178. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +0 -48
  179. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +0 -48
  180. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_state.yml +0 -106
  181. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_title.yml +0 -106
  182. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_description.yml +0 -55
  183. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_identifiers.yml +0 -55
  184. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license.yml +0 -55
  185. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +0 -55
  186. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +0 -55
  187. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_state.yml +0 -55
  188. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +0 -55
  189. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +0 -55
  190. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi.yml +0 -48
  191. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi_with_protocol.yml +0 -48
  192. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/dx_doi_org_url.yml +0 -48
  193. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/force_test_resolver.yml +0 -48
  194. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/https_url.yml +0 -48
  195. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver.yml +0 -48
  196. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver_http.yml +0 -48
  197. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +0 -48
  198. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi_with_special_characters.yml +0 -48
  199. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +0 -48
  200. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/sandbox_url.yml +0 -48
  201. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +0 -48
  202. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +0 -99
  203. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +0 -99
  204. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/jalc.yml +0 -99
  205. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/kisti.yml +0 -99
  206. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +0 -99
  207. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +0 -48
  208. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +0 -99
  209. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/op.yml +0 -99
  210. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi.yml +0 -48
  211. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi_with_protocol.yml +0 -48
  212. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/dx_doi_org_url.yml +0 -48
  213. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/force_stage_resolver.yml +0 -48
  214. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/https_url.yml +0 -48
  215. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/stage_resolver.yml +0 -48
  216. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/stage_resolver_http.yml +0 -48
  217. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +0 -157
  218. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +0 -157
  219. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +0 -157
  220. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +0 -157
  221. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +0 -106
  222. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +0 -106
  223. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/schema_org.yml +0 -106
  224. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +0 -157
  225. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +0 -106
  226. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +0 -106
  227. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/codemeta.yml +0 -106
  228. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crosscite.yml +0 -106
  229. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +0 -106
  230. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +0 -106
  231. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +0 -106
  232. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +0 -106
  233. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +0 -106
  234. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml +0 -106
  235. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_match.yml +0 -48
  236. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_with_schemeUri_in_hash.yml +0 -48
  237. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_match.yml +0 -48
  238. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_no_match.yml +0 -48
  239. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_for_match.yml +0 -48
  240. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_match.yml +0 -48
  241. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_no_match.yml +0 -48
  242. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml +0 -48
  243. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/with_affiliation.yml +0 -48
  244. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/without_affiliation.yml +0 -48
  245. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/maremma.yml +0 -75
  246. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/metadata_reports.yml +0 -75
  247. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +0 -103
  248. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +0 -102
  249. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +0 -106
  250. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/JaLC.yml +0 -137
  251. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/KISTI.yml +0 -158
  252. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/OP.yml +0 -100
  253. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/affiliation_is_space.yml +0 -101
  254. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +0 -138
  255. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book_chapter.yml +0 -100
  256. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/article_id_as_page_number.yml +0 -101
  257. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/author_literal.yml +0 -108
  258. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml +0 -99
  259. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml +0 -170
  260. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml +0 -99
  261. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_oup.yml +0 -98
  262. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml +0 -120
  263. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml +0 -130
  264. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml +0 -143
  265. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml +0 -101
  266. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dissertation.yml +0 -129
  267. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/empty_given_name.yml +0 -101
  268. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/invalid_date.yml +0 -101
  269. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article.yml +0 -100
  270. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +0 -99
  271. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with.yml +0 -104
  272. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_RDF_for_container.yml +0 -99
  273. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_funding.yml +0 -100
  274. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_issue.yml +0 -127
  275. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/mEDRA.yml +0 -98
  276. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/markup.yml +0 -105
  277. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/missing_creator.yml +0 -100
  278. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_issn.yml +0 -99
  279. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml +0 -98
  280. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles_with_missing.yml +0 -450
  281. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +0 -97
  282. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/peer_review.yml +0 -103
  283. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +0 -99
  284. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content_copernicus.yml +0 -102
  285. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml +0 -144
  286. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml +0 -102
  287. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml +0 -99
  288. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +0 -99
  289. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_json_metadata/metadata_from_api.yml +0 -106
  290. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +0 -106
  291. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_staging_system.yml +0 -106
  292. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_staging_system_schema_3.yml +0 -106
  293. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +0 -106
  294. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_not_found.yml +0 -102
  295. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +0 -106
  296. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding.yml +0 -106
  297. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +0 -106
  298. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +0 -106
  299. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Referee_report_in_staging_system.yml +0 -106
  300. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Schema_org_type.yml +0 -106
  301. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml +0 -106
  302. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +0 -106
  303. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +0 -106
  304. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/cc-by_3_0_us.yml +0 -106
  305. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/content_url.yml +0 -106
  306. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml +0 -106
  307. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml +0 -106
  308. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml +0 -106
  309. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +0 -106
  310. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml +0 -106
  311. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_references.yml +0 -106
  312. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +0 -106
  313. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +0 -106
  314. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml +0 -106
  315. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +0 -106
  316. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml +0 -106
  317. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +0 -106
  318. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml +0 -106
  319. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/series-information.yml +0 -106
  320. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme.yml +0 -106
  321. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme_FOR.yml +0 -106
  322. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date/publication_date.yml +0 -48
  323. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml +0 -48
  324. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +0 -48
  325. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +0 -48
  326. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/date.yml +0 -48
  327. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year-month.yml +0 -48
  328. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year.yml +0 -48
  329. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +0 -48
  330. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +0 -48
  331. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +0 -48
  332. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/future.yml +0 -48
  333. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/invalid.yml +0 -48
  334. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/nil.yml +0 -48
  335. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/past.yml +0 -48
  336. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/present.yml +0 -48
  337. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_familyName.yml +0 -55
  338. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_Thai.yml +0 -55
  339. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +0 -55
  340. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +0 -55
  341. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +0 -55
  342. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +0 -55
  343. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +0 -48
  344. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +0 -55
  345. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_name_identifier.yml +0 -55
  346. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation.yml +0 -55
  347. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation_and_country.yml +0 -114
  348. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_role.yml +0 -55
  349. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/only_familyName_and_givenName.yml +0 -57
  350. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting.yml +0 -117
  351. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +0 -117
  352. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse.yml +0 -40
  353. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/pangaea.yml +0 -57
  354. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/zenodo.yml +0 -62
  355. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/only_title.yml +0 -48
  356. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_and_pages.yml +0 -48
  357. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_and_pages.yml +0 -48
  358. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_issue_and_pages.yml +0 -48
  359. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_as_codemeta_url.yml +0 -48
  360. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url.yml +0 -48
  361. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url_file.yml +0 -48
  362. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +0 -54
  363. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/unknown_DOI_prefix.yml +0 -54
  364. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +0 -55
  365. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +0 -55
  366. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml +0 -55
  367. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml +0 -55
  368. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml +0 -55
  369. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_language/insert.yml +0 -55
  370. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +0 -55
  371. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +0 -55
  372. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +0 -55
  373. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +0 -55
  374. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +0 -55
  375. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_items/insert.yml +0 -73
  376. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +0 -55
  377. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +0 -55
  378. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_sizes/insert.yml +0 -55
  379. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +0 -73
  380. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +0 -55
  381. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +0 -55
  382. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +0 -48
  383. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_family_name.yml +0 -48
  384. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +0 -48
  385. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_known_given_name.yml +0 -48
  386. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_no_info.yml +0 -48
  387. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_orcid_id.yml +0 -48
  388. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +0 -48
  389. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +0 -106
  390. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +0 -106
  391. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +0 -106
  392. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +0 -106
  393. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml +0 -48
  394. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml +0 -48
  395. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +0 -48
  396. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml +0 -48
  397. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +0 -48
  398. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +0 -48
  399. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +0 -48
  400. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +0 -48
  401. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +0 -48
  402. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +0 -48
  403. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_with_protocol.yml +0 -48
  404. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +0 -48
  405. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +0 -48
  406. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +0 -48
  407. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +0 -48
  408. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +0 -48
  409. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +0 -48
  410. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +0 -48
  411. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +0 -48
  412. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_options.yml +0 -48
  413. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_url.yml +0 -48
  414. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +0 -48
  415. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url.yml +0 -48
  416. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +0 -48
  417. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +0 -48
  418. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +0 -48
  419. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_array.yml +0 -48
  420. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml +0 -48
  421. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml +0 -48
  422. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml +0 -48
  423. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml +0 -48
  424. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml +0 -48
  425. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +0 -48
  426. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +0 -48
  427. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml +0 -48
  428. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml +0 -48
  429. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/hash.yml +0 -48
  430. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +0 -48
  431. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +0 -48
  432. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +0 -48
  433. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +0 -48
  434. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml +0 -48
  435. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml +0 -48
  436. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml +0 -48
  437. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml +0 -48
  438. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml +0 -48
  439. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +0 -48
  440. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml +0 -48
  441. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml +0 -48
  442. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_10.yml +0 -48
  443. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_11.yml +0 -48
  444. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_12.yml +0 -48
  445. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_13.yml +0 -48
  446. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_14.yml +0 -48
  447. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_4.yml +0 -48
  448. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_5.yml +0 -48
  449. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_6.yml +0 -48
  450. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_7.yml +0 -48
  451. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_8.yml +0 -48
  452. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_9.yml +0 -48
  453. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml +0 -48
  454. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +0 -48
  455. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/non-funder_doi.yml +0 -48
  456. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml +0 -48
  457. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +0 -48
  458. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml +0 -48
  459. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox.yml +0 -65
  460. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +0 -65
  461. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml +0 -48
  462. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml +0 -48
  463. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +0 -48
  464. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +0 -48
  465. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +0 -48
  466. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +0 -48
  467. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +0 -48
  468. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi.yml +0 -48
  469. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_as_url.yml +0 -48
  470. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_with_protocol.yml +0 -48
  471. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/only_prefix.yml +0 -48
  472. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +0 -48
  473. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +0 -48
  474. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +0 -48
  475. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +0 -48
  476. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/BlogPosting.yml +0 -55
  477. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/Dataset.yml +0 -55
  478. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +0 -114
  479. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/climate_data.yml +0 -55
  480. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml +0 -115
  481. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +0 -55
  482. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/maremma.yml +0 -75
  483. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/text.yml +0 -55
  484. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +0 -55
  485. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_pages.yml +0 -52
  486. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml +0 -55
  487. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml +0 -55
  488. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article_vancouver_style.yml +0 -55
  489. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml +0 -49
  490. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/interactive_resource_without_dates.yml +0 -55
  491. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml +0 -55
  492. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Another_dataset.yml +0 -55
  493. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml +0 -55
  494. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +0 -115
  495. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +0 -55
  496. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/container_title.yml +0 -55
  497. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/interactive_resource_without_dates.yml +0 -55
  498. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/journal_article.yml +0 -55
  499. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +0 -55
  500. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/maremma.yml +0 -75
  501. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/missing_creator.yml +0 -49
  502. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +0 -55
  503. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/organization_author.yml +0 -52
  504. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software.yml +0 -55
  505. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software_w/version.yml +0 -55
  506. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +0 -50
  507. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_pages.yml +0 -52
  508. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +0 -55
  509. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +0 -55
  510. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +0 -55
  511. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/maremma.yml +0 -75
  512. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +0 -52
  513. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +0 -55
  514. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml +0 -117
  515. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml +0 -55
  516. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/climate_data.yml +0 -55
  517. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/maremma.yml +0 -75
  518. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/text.yml +0 -55
  519. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_data_citation.yml +0 -55
  520. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_pages.yml +0 -52
  521. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +0 -75
  522. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +0 -52
  523. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +0 -55
  524. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +0 -117
  525. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +0 -51
  526. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +0 -55
  527. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +0 -55
  528. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +0 -55
  529. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/maremma.yml +0 -75
  530. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +0 -52
  531. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +0 -55
  532. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +0 -115
  533. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +0 -49
  534. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_version.yml +0 -55
  535. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +0 -55
  536. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +0 -55
  537. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml +0 -88
  538. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/interactive_resource_without_dates.yml +0 -55
  539. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/maremma.yml +0 -75
  540. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +0 -52
  541. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +0 -55
  542. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml +0 -117
  543. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml +0 -49
  544. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml +0 -55
  545. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml +0 -117
  546. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/journal_article.yml +0 -55
  547. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/maremma.yml +0 -75
  548. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/with_pages.yml +0 -52
  549. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml +0 -55
  550. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +0 -117
  551. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +0 -55
  552. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/alternate_name.yml +0 -55
  553. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/journal_article.yml +0 -55
  554. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +0 -55
  555. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +0 -75
  556. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/with_pages.yml +0 -52
  557. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +0 -106
  558. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +0 -106
  559. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +0 -55
  560. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml +0 -106
  561. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +0 -106
  562. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +0 -55
  563. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +0 -55
  564. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/data_catalog.yml +0 -55
  565. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/geo_location_box.yml +0 -55
  566. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/interactive_resource_without_dates.yml +0 -55
  567. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml +0 -55
  568. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +0 -75
  569. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/series_information.yml +0 -55
  570. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme.yml +0 -55
  571. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +0 -55
  572. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting.yml +0 -55
  573. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml +0 -117
  574. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml +0 -55
  575. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/journal_article.yml +0 -55
  576. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/with_pages.yml +0 -52
  577. data/spec/fixtures/vivli.xml +0 -1
  578. data/spec/metadata_spec.rb +0 -165
  579. data/spec/readers/bibtex_reader_spec.rb +0 -63
  580. data/spec/readers/citeproc_reader_spec.rb +0 -61
  581. data/spec/readers/codemeta_reader_spec.rb +0 -138
  582. data/spec/readers/crosscite_reader_spec.rb +0 -41
  583. data/spec/readers/crossref_reader_spec.rb +0 -1102
  584. data/spec/readers/datacite_json_reader_spec.rb +0 -80
  585. data/spec/readers/datacite_reader_spec.rb +0 -1731
  586. data/spec/readers/npm_reader_spec.rb +0 -66
  587. data/spec/readers/ris_reader_spec.rb +0 -75
  588. data/spec/readers/schema_org_reader_spec.rb +0 -344
  589. data/spec/spec_helper.rb +0 -95
  590. data/spec/utils_spec.rb +0 -666
  591. data/spec/writers/bibtex_writer_spec.rb +0 -195
  592. data/spec/writers/citation_writer_spec.rb +0 -52
  593. data/spec/writers/citeproc_writer_spec.rb +0 -290
  594. data/spec/writers/codemeta_writer_spec.rb +0 -45
  595. data/spec/writers/crosscite_writer_spec.rb +0 -122
  596. data/spec/writers/crossref_writer_spec.rb +0 -21
  597. data/spec/writers/csv_writer_spec.rb +0 -94
  598. data/spec/writers/datacite_json_writer_spec.rb +0 -90
  599. data/spec/writers/datacite_writer_spec.rb +0 -428
  600. data/spec/writers/jats_writer_spec.rb +0 -193
  601. data/spec/writers/rdf_xml_writer_spec.rb +0 -86
  602. data/spec/writers/ris_writer_spec.rb +0 -207
  603. data/spec/writers/schema_org_writer_spec.rb +0 -369
  604. data/spec/writers/turtle_writer_spec.rb +0 -84
@@ -1,1731 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Bolognese::Metadata, vcr: true do
6
- let(:input) { "https://doi.org/10.5061/DRYAD.8515" }
7
-
8
- subject { Bolognese::Metadata.new(input: input) }
9
-
10
- context "get datacite raw" do
11
- it "BlogPosting" do
12
- input = fixture_path + 'datacite.xml'
13
- subject = Bolognese::Metadata.new(input: input)
14
- expect(subject.raw).to eq(IO.read(input).strip)
15
- end
16
- end
17
-
18
- context "get datacite metadata" do
19
- it "Dataset" do
20
- expect(subject.valid?).to be true
21
- expect(subject.url).to eq("http://datadryad.org/stash/dataset/doi:10.5061/dryad.8515")
22
- expect(subject.types["schemaOrg"]).to eq("Dataset")
23
- expect(subject.types["resourceType"]).to eq("dataset")
24
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
25
- expect(subject.types["ris"]).to eq("DATA")
26
- expect(subject.types["citeproc"]).to eq("dataset")
27
- expect(subject.creators.length).to eq(8)
28
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Ollomo, Benjamin", "givenName"=>"Benjamin", "familyName"=>"Ollomo", "nameIdentifiers" => [], "affiliation" => [{"affiliationIdentifier"=>"https://ror.org/01wyqb997", "affiliationIdentifierScheme"=>"ROR", "name"=>"Centre International de Recherches Médicales de Franceville"}])
29
- expect(subject.titles).to eq([{"title"=>"Data from: A new malaria agent in African hominids."}])
30
- expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
31
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Zero v1.0 Universal",
32
- "rightsIdentifier"=>"cc0-1.0",
33
- "rightsIdentifierScheme"=>"SPDX",
34
- "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
35
- "schemeUri"=>"https://spdx.org/licenses/"}])
36
- expect(subject.publication_year).to eq("2011")
37
- expect(subject.related_identifiers.length).to eq(1)
38
- expect(subject.related_identifiers.last).to eq("relatedIdentifier" => "10.1371/journal.ppat.1000446",
39
- "relatedIdentifierType" => "DOI","relationType"=>"Cites")
40
- expect(subject.subjects).to eq([{"subject"=>"Plasmodium"},
41
- {"subject"=>"malaria"},
42
- {"subject"=>"taxonomy"},
43
- {"subject"=>"mitochondrial genome"},
44
- {"subject"=>"Parasites"}])
45
- expect(subject.publisher).to eq("Dryad")
46
- expect(subject.agency).to eq("datacite")
47
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
48
- end
49
-
50
- it "BlogPosting" do
51
- input = "https://doi.org/10.5438/4K3M-NYVG"
52
- subject = Bolognese::Metadata.new(input: input)
53
- expect(subject.valid?).to be true
54
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
55
- expect(subject.types["resourceType"]).to eq("BlogPosting")
56
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
57
- expect(subject.types["ris"]).to eq("RPRT")
58
- expect(subject.types["bibtex"]).to eq("article")
59
- expect(subject.types["citeproc"]).to eq("article-journal")
60
- expect(subject.creators).to eq([{"nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin", "givenName"=>"Martin", "familyName"=>"Fenner"}])
61
- expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
62
- expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
63
- expect(subject.descriptions.first["description"]).to start_with("Eating your own dog food")
64
- expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Created"}, {"date"=>"2016-12-20", "dateType"=>"Issued"}, {"date"=>"2016-12-20", "dateType"=>"Updated"}])
65
- expect(subject.publication_year).to eq("2016")
66
- expect(subject.related_identifiers.length).to eq(3)
67
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
68
- expect(subject.publisher).to eq("DataCite")
69
- expect(subject.subjects).to eq([{"subject"=>"datacite"},
70
- {"subject"=>"doi"},
71
- {"subject"=>"metadata"},
72
- {"schemeUri"=>"http://www.oecd.org/science/inno",
73
- "subject"=>"FOS: Computer and information sciences",
74
- "subjectScheme"=>"Fields of Science and Technology (FOS)",
75
- "valueUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
76
- {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
77
- "subject"=>"FOS: Computer and information sciences",
78
- "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
79
- expect(subject.agency).to eq("datacite")
80
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
81
- end
82
-
83
- it "date" do
84
- input = "https://doi.org/10.4230/lipics.tqc.2013.93"
85
- subject = Bolognese::Metadata.new(input: input)
86
- expect(subject.valid?).to be true
87
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
88
- expect(subject.types["resourceType"]).to eq("ConferencePaper")
89
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
90
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Johnston, Nathaniel", "givenName"=>"Nathaniel", "familyName"=>"Johnston", "nameIdentifiers" => [], "affiliation" => []}])
91
- expect(subject.titles).to eq([{"title"=>"The Minimum Size of Qubit Unextendible Product Bases"}])
92
- expect(subject.id).to eq("https://doi.org/10.4230/lipics.tqc.2013.93")
93
- expect(subject.descriptions.first["description"]).to start_with("We investigate the problem of constructing unextendible product bases in the qubit case")
94
- expect(subject.dates).to eq([{"date"=>"2013-11-05", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
95
- expect(subject.subjects).to eq([{"subject"=>"Computer Science"},
96
- {"subject"=>"000 Computer science, knowledge, general works",
97
- "subjectScheme"=>"DDC"}])
98
- expect(subject.publication_year).to eq("2013")
99
- expect(subject.publisher).to eq("Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik GmbH, Wadern/Saarbruecken, Germany")
100
- expect(subject.agency).to eq("datacite")
101
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.1")
102
- end
103
-
104
- it "affiliation identifier" do
105
- input = fixture_path + 'datacite-example-affiliation.xml'
106
- subject = Bolognese::Metadata.new(input: input)
107
- expect(subject.valid?).to be true
108
- expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
109
- expect(subject.types["resourceType"]).to eq("XML")
110
- expect(subject.types["resourceTypeGeneral"]).to eq("Software")
111
- expect(subject.types["ris"]).to eq("COMP")
112
- expect(subject.types["citeproc"]).to eq("article")
113
- expect(subject.creators.length).to eq(3)
114
- expect(subject.creators.first).to eq("nameType"=>"Personal", "affiliation" => [{"affiliationIdentifier"=>"https://ror.org/04wxnsj81", "affiliationIdentifierScheme"=>"ROR", "name"=>"DataCite"}],
115
- "familyName" => "Miller",
116
- "givenName" => "Elizabeth",
117
- "name" => "Miller, Elizabeth",
118
- "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-5000-0007", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],)
119
- expect(subject.creators.dig(1, "affiliation")).to eq([{"affiliationIdentifier"=>"https://ror.org/05gq02987",
120
- "affiliationIdentifierScheme"=>"ROR",
121
- "name"=>"Brown University"},
122
- {"affiliationIdentifier"=>"https://grid.ac/institutes/grid.268117.b",
123
- "affiliationIdentifierScheme"=>"GRID",
124
- "name"=>"Wesleyan University", "schemeUri"=>"https://grid.ac/institutes/"}])
125
- expect(subject.creators.dig(2, "affiliation")).to eq([{"affiliationIdentifier"=>"https://ror.org/05gq02987",
126
- "affiliationIdentifierScheme"=>"ROR", "name"=>"Brown University"}])
127
- expect(subject.titles).to eq([{"lang"=>"en-US", "title"=>"Full DataCite XML Example"}, {"lang"=>"en-US", "title"=>"Demonstration of DataCite Properties.", "titleType"=>"Subtitle"}])
128
- expect(subject.id).to eq("https://doi.org/10.5072/example-full")
129
- expect(subject.identifiers).to eq([{"identifier"=>
130
- "https://schema.datacite.org/meta/kernel-4.2/example/datacite-example-full-v4.2.xml",
131
- "identifierType"=>"URL"}])
132
- expect(subject.rights_list).to eq([{"lang"=>"en-US", "rights"=>"Creative Commons Zero v1.0 Universal", "rightsIdentifier"=>"cc0-1.0", "rightsIdentifierScheme"=>"SPDX", "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode", "schemeUri"=>"https://spdx.org/licenses/"}])
133
- expect(subject.publication_year).to eq("2014")
134
- expect(subject.contributors).to eq([{"name"=>"Starr, Joan", "givenName"=>"Joan", "familyName"=>"Starr", "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0002-7285-027X", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}], "affiliation"=>
135
- [{"affiliationIdentifier"=>"https://ror.org/03yrm5c26",
136
- "affiliationIdentifierScheme"=>"ROR",
137
- "name"=>"California Digital Library"}], "contributorType"=>"ProjectLeader"}])
138
- expect(subject.subjects).to eq([{"lang"=>"en-US", "schemeUri"=>"http://dewey.info/", "subject"=>"000 computer science", "subjectScheme"=>"dewey"}])
139
- expect(subject.dates).to eq([{"date"=>"2017-09-13", "dateInformation"=>"Updated with 4.2 properties", "dateType"=>"Updated"}, {"date"=>"2014", "dateType"=>"Issued"}])
140
- expect(subject.funding_references).to eq([{"awardNumber"=>"CBET-106",
141
- "awardTitle"=>"Full DataCite XML Example",
142
- "funderIdentifier"=>"https://doi.org/10.13039/100000001",
143
- "funderIdentifierType"=>"Crossref Funder ID",
144
- "schemeUri"=>"https://doi.org/",
145
- "funderName"=>"National Science Foundation"}])
146
- expect(subject.related_identifiers.length).to eq(2)
147
- 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")
148
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"arXiv:0706.0001", "relatedIdentifierType"=>"arXiv", "relationType"=>"IsReviewedBy", "resourceTypeGeneral"=>"Text")
149
- expect(subject.language).to eq("en-US")
150
- expect(subject.sizes).to eq(["4 kB"])
151
- expect(subject.formats).to eq(["application/xml"])
152
- expect(subject.publisher).to eq("DataCite")
153
- expect(subject.agency).to eq("datacite")
154
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
155
- end
156
-
157
- it "xs:string attributes" do
158
- input = fixture_path + 'pure.xml'
159
- subject = Bolognese::Metadata.new(input: input)
160
- expect(subject.valid?).to be true
161
- expect(subject.types["schemaOrg"]).to eq("Dataset")
162
- expect(subject.types["resourceType"]).to eq("Dataset")
163
- expect(subject.types["resourceTypeGeneral"]).to eq("Audiovisual")
164
- expect(subject.creators.length).to eq(14)
165
- expect(subject.creators.first).to eq("name"=>"Haywood, Raphaelle Dawn", "givenName"=>"Raphaelle Dawn", "familyName"=>"Haywood", "affiliation" => [{"name"=>"School of Physics and Astronomy"}])
166
- 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"}])
167
- expect(subject.dates).to eq([{"date"=>"2016-01-20", "dateType"=>"Available"}, {"date"=>"2016", "dateType"=>"Issued"}])
168
- expect(subject.publication_year).to eq("2016")
169
- expect(subject.publisher).to eq("University of St Andrews")
170
- expect(subject.agency).to eq("datacite")
171
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
172
- end
173
-
174
- it "empty sizes and dates attributes" do
175
- input = fixture_path + 'datacite-empty-sizes.xml'
176
- subject = Bolognese::Metadata.new(input: input)
177
- expect(subject.valid?).to be true
178
- expect(subject.types["schemaOrg"]).to eq("Dataset")
179
- expect(subject.types["resourceType"]).to be_nil
180
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
181
- expect(subject.creators.length).to eq(1)
182
- expect(subject.creators.first).to eq("affiliation"=>[], "name"=>"EvK2 CNR Committee", "nameIdentifiers"=>[])
183
- expect(subject.titles).to eq([{"title"=>"SHARE (Stations at High Altitude for Research on the Environment) Network"}, {"title"=>"Urdukas (Baltoro Glacier, Baltistan - Pakistan)", "titleType"=>"Subtitle"}])
184
- expect(subject.dates).to eq([{"date"=>"2011", "dateType"=>"Issued"}])
185
- expect(subject.publication_year).to eq("2011")
186
- expect(subject.sizes).to eq([])
187
- expect(subject.subjects).to eq([{"subject"=>"Environmental research"}])
188
- expect(subject.publisher).to eq("EvK2 CNR Committee")
189
- expect(subject.agency).to eq("datacite")
190
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
191
- end
192
-
193
- it "multiple licenses" do
194
- input = "https://doi.org/10.5281/ZENODO.48440"
195
- subject = Bolognese::Metadata.new(input: input)
196
- expect(subject.valid?).to be true
197
- expect(subject.id).to eq("https://doi.org/10.5281/zenodo.48440")
198
- expect(subject.identifiers).to eq([{"identifier"=>"https://zenodo.org/record/48440", "identifierType"=>"URL"}])
199
- expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
200
- expect(subject.types["resourceTypeGeneral"]).to eq("Software")
201
- expect(subject.types["ris"]).to eq("COMP")
202
- expect(subject.types["citeproc"]).to eq("article")
203
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Garza, Kristian", "givenName"=>"Kristian", "familyName"=>"Garza", "nameIdentifiers" => [], "affiliation" => []}])
204
- expect(subject.titles).to eq([{"title"=>"Analysis Tools For Crossover Experiment Of Ui Using Choice Architecture"}])
205
- expect(subject.descriptions.first["description"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
206
- expect(subject.rights_list).to eq([{"rights"=>
207
- "Creative Commons Attribution Non Commercial Share Alike 4.0 International",
208
- "rightsIdentifier"=>"cc-by-nc-sa-4.0",
209
- "rightsIdentifierScheme"=>"SPDX",
210
- "rightsUri"=>"https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode",
211
- "schemeUri"=>"https://spdx.org/licenses/"},
212
- {"rights"=>"Open Access", "rightsUri"=>"info:eu-repo/semantics/openAccess"}])
213
- expect(subject.dates).to eq([{"date"=>"2016-03-27", "dateType"=>"Issued"}])
214
- expect(subject.publication_year).to eq("2016")
215
- expect(subject.related_identifiers.length).to eq(1)
216
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"https://github.com/kjgarza/frame_experiment_analysis/tree/v1.0", "relatedIdentifierType"=>"URL", "relationType"=>"IsSupplementTo")
217
- expect(subject.subjects).to eq([{"subject"=>"choice architecture"},
218
- {"subject"=>"crossover experiment"},
219
- {"subject"=>"hci"}])
220
- expect(subject.publisher).to eq("Zenodo")
221
- expect(subject.agency).to eq("datacite")
222
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
223
- end
224
-
225
- it "is identical to" do
226
- input = "10.6084/M9.FIGSHARE.4234751.V1"
227
- subject = Bolognese::Metadata.new(input: input)
228
- expect(subject.valid?).to be true
229
- expect(subject.identifiers).to be_empty
230
- expect(subject.types["schemaOrg"]).to eq("Dataset")
231
- expect(subject.types["resourceType"]).to eq("Dataset")
232
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
233
- expect(subject.creators.count).to eq(11)
234
- expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0002-2410-9671", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Junge, Alexander", "givenName"=>"Alexander", "familyName"=>"Junge", "affiliation" => [])
235
- expect(subject.titles).to eq([{"title"=>"RAIN v1"}])
236
- expect(subject.descriptions.first["description"]).to start_with("<b>RAIN: RNA–protein Association and Interaction Networks")
237
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 4.0 International",
238
- "rightsIdentifier"=>"cc-by-4.0",
239
- "rightsIdentifierScheme"=>"SPDX",
240
- "rightsUri"=>"https://creativecommons.org/licenses/by/4.0/legalcode",
241
- "schemeUri"=>"https://spdx.org/licenses/"}])
242
- expect(subject.dates).to eq([{"date"=>"2016-11-16", "dateType"=>"Created"}, {"date"=>"2016-11-16", "dateType"=>"Updated"}, {"date"=>"2016", "dateType"=>"Issued"}])
243
- expect(subject.publication_year).to eq("2016")
244
- expect(subject.related_identifiers.length).to eq(1)
245
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.6084/m9.figshare.4234751", "relatedIdentifierType"=>"DOI", "relationType"=>"IsIdenticalTo")
246
- expect(subject.publisher).to eq("figshare")
247
- expect(subject.subjects).to eq([
248
- {"schemeUri"=>
249
- "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E",
250
- "subject"=>"60102 Bioinformatics",
251
- "subjectScheme"=>"FOR"},
252
- {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
253
- "subject"=>"FOS: Computer and information sciences",
254
- "subjectScheme"=>"Fields of Science and Technology (FOS)"},
255
- {"subject"=>"Computational Biology"},
256
- {"schemeUri"=>
257
- "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E",
258
- "subject"=>"60114 Systems Biology",
259
- "subjectScheme"=>"FOR"},
260
- {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
261
- "subject"=>"FOS: Biological sciences",
262
- "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
263
- expect(subject.agency).to eq("datacite")
264
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
265
- end
266
-
267
- it "subject scheme FOR" do
268
- input = "10.6084/m9.figshare.1449060"
269
- subject = Bolognese::Metadata.new(input: input)
270
- expect(subject.valid?).to be true
271
- expect(subject.id).to eq("https://doi.org/10.6084/m9.figshare.1449060")
272
- expect(subject.types["schemaOrg"]).to eq("Dataset")
273
- expect(subject.types["resourceType"]).to eq("Dataset")
274
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
275
- expect(subject.creators.count).to eq(4)
276
- expect(subject.creators.first).to eq("nameType"=>"Personal", "familyName" => "Dworkin",
277
- "givenName" => "Ian",
278
- "name" => "Dworkin, Ian",
279
- "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0002-2874-287X", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "affiliation" => [])
280
- expect(subject.titles).to eq([{"title"=>"Drosophila melanogaster wing images from low and high altitude populations in Ethiopia and Zambia."}])
281
- expect(subject.descriptions.first["description"]).to start_with("These are raw wing images from <i>Drosophila melanogaster</i>")
282
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 4.0 International",
283
- "rightsIdentifier"=>"cc-by-4.0",
284
- "rightsIdentifierScheme"=>"SPDX",
285
- "rightsUri"=>"https://creativecommons.org/licenses/by/4.0/legalcode",
286
- "schemeUri"=>"https://spdx.org/licenses/"}])
287
- expect(subject.dates).to eq([{"date"=>"2015-06-14", "dateType"=>"Created"}, {"date"=>"2020-06-02", "dateType"=>"Updated"}, {"date"=>"2020", "dateType"=>"Issued"}])
288
- expect(subject.publication_year).to eq("2020")
289
- expect(subject.publisher).to eq("figshare")
290
- expect(subject.subjects).to eq([{"subject"=>"Evolutionary Biology"},
291
- {"subject"=>"FOS: Biological sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
292
- {"subject"=>"60412 Quantitative Genetics (incl. Disease and Trait Mapping Genetics)", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"}])
293
- expect(subject.agency).to eq("datacite")
294
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
295
- end
296
-
297
- it "more subject scheme FOR" do
298
- input = "10.4225/03/5a6931f57c654"
299
- subject = Bolognese::Metadata.new(input: input)
300
- expect(subject.valid?).to be true
301
- expect(subject.subjects).to eq([{"subject"=>"90301 Biomaterials", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
302
- {"subject"=>"FOS: Medical engineering", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"}])
303
- end
304
-
305
- it "even more subject scheme FOR" do
306
- input = "10.4225/03/5a31ec65634ef"
307
- subject = Bolognese::Metadata.new(input: input)
308
- expect(subject.valid?).to be true
309
- expect(subject.subjects).to eq([{"subject"=>"130103 Higher Education", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
310
- {"subject"=>"FOS: Educational sciences", "subjectScheme"=>"Fields of Science and Technology (FOS)", "schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf"},
311
- {"subject"=>"130313 Teacher Education and Professional Development of Educators", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
312
- {"subject"=>"80799 Library and Information Studies not elsewhere classified", "subjectScheme"=>"FOR", "schemeUri"=>"http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E"},
313
- {"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"}])
314
- end
315
-
316
- it "cc-by 3.0 us" do
317
- input = "10.6084/m9.figshare.1286826.v1"
318
- subject = Bolognese::Metadata.new(input: input)
319
- expect(subject.valid?).to be true
320
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 4.0 International",
321
- "rightsIdentifier"=>"cc-by-4.0",
322
- "rightsIdentifierScheme"=>"SPDX",
323
- "rightsUri"=>"https://creativecommons.org/licenses/by/4.0/legalcode",
324
- "schemeUri"=>"https://spdx.org/licenses/"}])
325
- end
326
-
327
- it "funding schema version 3" do
328
- input = "https://doi.org/10.5281/ZENODO.1239"
329
- subject = Bolognese::Metadata.new(input: input)
330
- expect(subject.valid?).to be true
331
- expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1239")
332
- expect(subject.identifiers).to eq([{"identifier"=>"https://zenodo.org/record/1239", "identifierType"=>"URL"}])
333
- expect(subject.types["schemaOrg"]).to eq("Dataset")
334
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
335
- expect(subject.creators.length).to eq(4)
336
- expect(subject.creators.first).to eq("name"=>"Jahn, Najko", "givenName"=>"Najko", "familyName"=>"Jahn", "affiliation"=>[{"name"=>"Bielefeld University Library"}])
337
- expect(subject.titles).to eq([{"title"=>"Publication Fp7 Funding Acknowledgment - Plos Openaire"}])
338
- expect(subject.descriptions.first["description"]).to start_with("The dataset contains a sample of metadata describing papers")
339
- expect(subject.dates).to eq([{"date"=>"2013-04-03", "dateType"=>"Issued"}])
340
- expect(subject.publication_year).to eq("2013")
341
- expect(subject.publisher).to eq("Zenodo")
342
- expect(subject.funding_references).to eq([{"awardNumber"=>"246686",
343
- "awardTitle"=>"Open Access Infrastructure for Research in Europe",
344
- "awardUri"=>"info:eu-repo/grantAgreement/EC/FP7/246686/",
345
- "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
346
- "funderIdentifierType"=>"Crossref Funder ID",
347
- "funderName"=>"European Commission"}])
348
- expect(subject.subjects).to eq([{"subject"=>"Article-Level Metrics"},
349
- {"subject"=>"Data mining"},
350
- {"subject"=>"Statistical Computing Language R"},
351
- {"subject"=>"funded research publications"}])
352
- expect(subject.agency).to eq("datacite")
353
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
354
- end
355
-
356
- it "from attributes" do
357
- subject = Bolognese::Metadata.new(input: nil,
358
- from: "datacite",
359
- doi: "10.5281/zenodo.1239",
360
- creators: [{"nameType"=>"Personal", "name"=>"Jahn, Najko", "givenName"=>"Najko", "familyName"=>"Jahn"}],
361
- titles: [{ "title" => "Publication Fp7 Funding Acknowledgment - Plos Openaire" }],
362
- descriptions: [{ "description" => "The dataset contains a sample of metadata describing papers" }],
363
- publisher: "Zenodo",
364
- publication_year: "2013",
365
- dates: [{"date"=>"2013-04-03", "dateType"=>"Issued"}],
366
- funding_references: [{"awardNumber"=>"246686",
367
- "awardTitle"=>"Open Access Infrastructure for Research in Europe",
368
- "awardUri"=>"info:eu-repo/grantAgreement/EC/FP7/246686/",
369
- "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
370
- "funderIdentifierType"=>"Crossref Funder ID",
371
- "funderName"=>"European Commission"}],
372
- types: { "resourceTypeGeneral" => "Dataset", "schemaOrg" => "Dataset" },
373
- "identifiers" => [{ "identifierType"=>"Repository ID", "identifier"=>"123" }])
374
-
375
- expect(subject.valid?).to be true
376
- expect(subject.doi).to eq("10.5281/zenodo.1239")
377
- expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1239")
378
- expect(subject.types["schemaOrg"]).to eq("Dataset")
379
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
380
- expect(subject.creators).to eq([{"familyName"=>"Jahn", "givenName"=>"Najko", "name"=>"Jahn, Najko", "nameType"=>"Personal"}])
381
- expect(subject.titles).to eq([{"title"=>"Publication Fp7 Funding Acknowledgment - Plos Openaire"}])
382
- expect(subject.descriptions.first["description"]).to start_with("The dataset contains a sample of metadata describing papers")
383
- expect(subject.dates).to eq([{"date"=>"2013-04-03", "dateType"=>"Issued"}])
384
- expect(subject.publication_year).to eq("2013")
385
- expect(subject.publisher).to eq("Zenodo")
386
- expect(subject.funding_references).to eq([{"awardNumber"=>"246686",
387
- "awardTitle"=>"Open Access Infrastructure for Research in Europe",
388
- "awardUri"=>"info:eu-repo/grantAgreement/EC/FP7/246686/",
389
- "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
390
- "funderIdentifierType"=>"Crossref Funder ID",
391
- "funderName"=>"European Commission"}])
392
- expect(subject.identifiers).to eq([{"identifier"=>"123", "identifierType"=>"Repository ID"}])
393
- expect(subject.agency).to eq("datacite")
394
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
395
- expect(subject.state).to eq("findable")
396
- end
397
-
398
- it "missing resource_type_general" do
399
- input = fixture_path + 'vivli.xml'
400
- subject = Bolognese::Metadata.new(input: input)
401
- expect(subject.types["schemaOrg"]).to eq("CreativeWork")
402
- expect(subject.types["resourceTypeGeneral"]).to be_nil
403
- expect(subject.valid?).to be false
404
- expect(subject.errors).to eq("2:0: ERROR: Element '{http://datacite.org/schema/kernel-4}resource': Missing child element(s). Expected is one of ( {http://datacite.org/schema/kernel-4}resourceType, {http://datacite.org/schema/kernel-4}subjects, {http://datacite.org/schema/kernel-4}contributors, {http://datacite.org/schema/kernel-4}language, {http://datacite.org/schema/kernel-4}alternateIdentifiers, {http://datacite.org/schema/kernel-4}relatedIdentifiers, {http://datacite.org/schema/kernel-4}sizes, {http://datacite.org/schema/kernel-4}formats, {http://datacite.org/schema/kernel-4}rightsList, {http://datacite.org/schema/kernel-4}descriptions ).")
405
- end
406
-
407
- it "multiple languages" do
408
- input = fixture_path + 'datacite-multiple-language.xml'
409
- subject = Bolognese::Metadata.new(input: input)
410
- expect(subject.types["schemaOrg"]).to eq("Collection")
411
- expect(subject.language).to eq("de")
412
- expect(subject.publisher).to eq("Universitätsbibliothek Tübingen")
413
- expect(subject.publication_year).to eq("2015")
414
- expect(subject.valid?).to be false
415
- expect(subject.errors).to eq("13:0: ERROR: Element '{http://datacite.org/schema/kernel-2.2}publisher': This element is not expected. Expected is ( {http://datacite.org/schema/kernel-2.2}publicationYear ).")
416
- end
417
-
418
- it "funder identifier with different http scheme" do
419
- input = fixture_path + 'datacite-funderIdentifier.xml'
420
- subject = Bolognese::Metadata.new(input: input)
421
- expect(subject.funding_references.first).to eq({
422
- "funderIdentifier"=>"http://www.isni.org/isni/0000000119587073",
423
- "funderIdentifierType"=>"ISNI",
424
- "schemeUri"=>"http://www.isni.org/isni/",
425
- "funderName"=>"National Science Foundation (NSF)"})
426
- expect(subject.funding_references[2]).to eq({
427
- "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
428
- "funderIdentifierType"=>"Crossref Funder ID",
429
- "schemeUri"=>"https://doi.org/",
430
- "funderName"=>"European Commission"})
431
- expect(subject.funding_references[1]).to eq({
432
- "funderIdentifier"=>"1234",
433
- "funderIdentifierType"=>"Other",
434
- "funderName"=>"Acme Inc"})
435
- end
436
-
437
- it "funder identifier with normalized identifiers and non-normalized identifiers" do
438
- input = fixture_path + 'datacite-funderIdentifier.xml'
439
- subject = Bolognese::Metadata.new(input: input)
440
- expect(subject.funding_references[3]).to eq({
441
- "funderIdentifier"=>"0000 0001 2298 6657",
442
- "funderIdentifierType"=>"ISNI",
443
- "schemeUri"=>"http://www.isni.org/isni/",
444
- "funderName"=>"University of Washington"})
445
- expect(subject.funding_references[4]).to eq({
446
- "funderIdentifier"=>"127467345",
447
- "funderIdentifierType"=>"Other",
448
- "schemeUri"=>"http://viaf.org/viaf/",
449
- "funderName"=>"National Library of Ireland."})
450
- expect(subject.funding_references[5]).to eq({
451
- "funderIdentifier"=>"https://ror.org/04wxnsj81",
452
- "funderIdentifierType"=>"ROR",
453
- "schemeUri"=>"https://ror.org",
454
- "funderName"=>"DataCite"})
455
- expect(subject.funding_references[6]).to eq({
456
- "funderIdentifier"=>"https://ror.org/038wwg650",
457
- "funderIdentifierType"=>"ROR",
458
- "schemeUri"=>"https://ror.org",
459
- "funderName"=>"Department of Agriculture"})
460
- expect(subject.funding_references[7]).to eq({
461
- "funderIdentifier"=>"https://doi.org/10.13039/501100005695",
462
- "funderIdentifierType"=>"Crossref Funder ID",
463
- "funderName"=>"Tottori University"})
464
- end
465
-
466
- it "geo_location empty" do
467
- input = fixture_path + 'datacite-geolocation-empty.xml'
468
- subject = Bolognese::Metadata.new(input: input)
469
- expect(subject.valid?).to be true
470
- expect(subject.types["schemaOrg"]).to eq("Dataset")
471
- expect(subject.geo_locations).to eq([{"geoLocationPoint"=>{"pointLatitude"=>"-11.64583333", "pointLongitude"=>"-68.2975"}}])
472
- end
473
-
474
- it "geo_location in separate input" do
475
- input = fixture_path + 'datacite-geolocation-empty.xml'
476
- geo_locations = [{"geoLocationPoint"=>{"pointLatitude"=>"49.0850736", "pointLongitude"=>"-123.3300992"}}]
477
- subject = Bolognese::Metadata.new(input: input, geo_locations: geo_locations)
478
- expect(subject.valid?).to be true
479
- expect(subject.types["schemaOrg"]).to eq("Dataset")
480
- expect(subject.geo_locations).to eq(geo_locations)
481
-
482
- datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
483
- expect(datacite.dig("geoLocations")).to eq("geoLocation"=>{"geoLocationPoint"=>{"pointLatitude"=>"49.0850736", "pointLongitude"=>"-123.3300992"}})
484
- end
485
-
486
- it "xml:lang attribute" do
487
- input = fixture_path + 'datacite-xml-lang.xml'
488
- subject = Bolognese::Metadata.new(input: input)
489
- expect(subject.valid?).to be true
490
- expect(subject.types["schemaOrg"]).to eq("Collection")
491
- expect(subject.titles).to eq([{"lang"=>"en", "title"=>"DOI Test 2 title content"}, {"lang"=>"en", "title"=>"AAPP"}])
492
- expect(subject.descriptions).to eq([{"description"=>"This is the DOI TEST 2 product where this is the description field content.", "descriptionType"=>"Methods", "lang"=>"en"}])
493
- expect(subject.geo_locations).to eq([{"geoLocationBox"=>{"eastBoundLongitude"=>"70.0", "northBoundLatitude"=>"70.0", "southBoundLatitude"=>"-70.0", "westBoundLongitude"=>"-70.0"}}, {"geoLocationPlace"=>"Regional"}])
494
- end
495
-
496
- it "wrong attributes" do
497
- input = fixture_path + 'nist.xml'
498
- subject = Bolognese::Metadata.new(input: input)
499
- expect(subject.id).to eq("https://doi.org/10.5072/m32163")
500
- expect(subject.titles).to eq([{"title"=>"Peter Auto Dataset 501"}])
501
- expect(subject.descriptions).to eq([{"description"=>"This is to overturn Einstein's Relativity Theory.", "descriptionType"=>"Abstract"}])
502
- expect(subject.valid?).to be false
503
- expect(subject.errors.length).to eq(4)
504
- expect(subject.errors.last).to eq("32:0: ERROR: Element '{http://datacite.org/schema/kernel-3}alternateIdentifier': The attribute 'alternateIdentifierType' is required but missing.")
505
- end
506
-
507
- it "schema 4.0" do
508
- input = fixture_path + 'schema_4.0.xml'
509
- subject = Bolognese::Metadata.new(input: input)
510
- expect(subject.valid?).to be true
511
- expect(subject.id).to eq("https://doi.org/10.6071/z7wc73")
512
- expect(subject.types["schemaOrg"]).to eq("Dataset")
513
- expect(subject.types["resourceType"]).to eq("dataset")
514
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
515
- expect(subject.creators.length).to eq(6)
516
- expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation"=>[{"name"=>"UC Merced"}], "nameIdentifiers" => [])
517
- expect(subject.subjects).to eq([{"subject"=>"Earth sciences"},
518
- {"subject"=>"soil moisture"},
519
- {"subject"=>"soil temperature"},
520
- {"subject"=>"snow depth"},
521
- {"subject"=>"air temperature"},
522
- {"subject"=>"water balance"},
523
- {"subject"=>"Nevada, Sierra (mountain range)"}])
524
- end
525
-
526
- it "series_information" do
527
- input = fixture_path + 'datacite-seriesinformation.xml'
528
- subject = Bolognese::Metadata.new(input: input)
529
- expect(subject.valid?).to be true
530
- expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
531
- expect(subject.identifiers).to eq([{"identifier"=>"MS-49-3632-5083", "identifierType"=>"Local accession number"}])
532
- expect(subject.creators.length).to eq(1)
533
- expect(subject.creators.first).to eq("familyName"=>"Fenner", "givenName"=>"Martin", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin")
534
- expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
535
- expect(subject.publisher).to eq("DataCite")
536
- expect(subject.publication_year).to eq("2016")
537
- expect(subject.related_identifiers).to eq([{"relatedIdentifier"=>"10.5438/0012",
538
- "relatedIdentifierType"=>"DOI",
539
- "relationType"=>"References"},
540
- {"relatedIdentifier"=>"10.5438/55e5-t5c0",
541
- "relatedIdentifierType"=>"DOI",
542
- "relationType"=>"References"},
543
- {"relatedIdentifier"=>"10.5438/0000-00ss",
544
- "relatedIdentifierType"=>"DOI",
545
- "relationType"=>"IsPartOf"}])
546
- expect(subject.descriptions).to eq([{"description"=>"DataCite Blog, 2(9), 3-4",
547
- "descriptionType"=>"SeriesInformation",
548
- "lang"=>"en"},
549
- {"description"=>
550
- "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...",
551
- "descriptionType"=>"Abstract"}])
552
- expect(subject.container).to eq("firstPage"=>"3", "identifier"=>"10.5438/0000-00SS", "identifierType"=>"DOI", "issue"=>"9", "lastPage"=>"4", "title"=>"DataCite Blog", "type"=>"Series", "volume"=>"2")
553
- end
554
-
555
- it "geo_location" do
556
- input = fixture_path + 'datacite-example-geolocation.xml'
557
- doi = "10.5072/geoPointExample"
558
- subject = Bolognese::Metadata.new(input: input, doi: doi)
559
- expect(subject.valid?).to be true
560
- expect(subject.id).to eq("https://doi.org/10.5072/geopointexample")
561
- expect(subject.doi).to eq("10.5072/geopointexample")
562
- expect(subject.creators.length).to eq(3)
563
- expect(subject.creators.first).to eq("familyName"=>"Schumann", "givenName"=>"Kai", "name"=>"Schumann, Kai", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
564
- expect(subject.titles).to eq([{"title"=>"Gridded results of swath bathymetric mapping of Disko Bay, Western Greenland, 2007-2008"}])
565
- expect(subject.publisher).to eq("PANGAEA - Data Publisher for Earth & Environmental Science")
566
- expect(subject.publication_year).to eq("2011")
567
- expect(subject.related_identifiers).to eq([{"relatedIdentifier"=>"10.5072/timeseries", "relatedIdentifierType"=>"DOI", "relationType"=>"Continues"}])
568
- expect(subject.geo_locations).to eq([{"geoLocationPlace"=>"Disko Bay", "geoLocationPoint"=>{"pointLatitude"=>"69.000000", "pointLongitude"=>"-52.000000"}}])
569
- expect(subject.subjects).to eq([{"subject"=>"551 Geology, hydrology, meteorology", "subjectScheme"=>"DDC"}])
570
- end
571
-
572
- it "geo_location_box" do
573
- input = fixture_path + 'datacite-example-geolocation-2.xml'
574
- doi = "10.6071/Z7WC73"
575
- subject = Bolognese::Metadata.new(input: input, doi: doi)
576
- expect(subject.valid?).to be true
577
- expect(subject.id).to eq("https://doi.org/10.6071/z7wc73")
578
- expect(subject.doi).to eq("10.6071/z7wc73")
579
- expect(subject.creators.length).to eq(6)
580
- expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation" => [{"name"=>"UC Merced"}, {"name"=>"NSF"}], "nameIdentifiers" => [])
581
- 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"}])
582
- expect(subject.publisher).to eq("UC Merced")
583
- expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
584
- expect(subject.publication_year).to eq("2013")
585
- expect(subject.subjects).to eq([{"subject"=>"Earth sciences"},
586
- {"subject"=>"soil moisture"},
587
- {"subject"=>"soil temperature"},
588
- {"subject"=>"snow depth"},
589
- {"subject"=>"air temperature"},
590
- {"subject"=>"water balance"},
591
- {"subject"=>"Nevada, Sierra (mountain range)"}])
592
- expect(subject.geo_locations).to eq([{"geoLocationBox"=>
593
- {"eastBoundLongitude"=>"-119.182",
594
- "northBoundLatitude"=>"37.075",
595
- "southBoundLatitude"=>"37.046",
596
- "westBoundLongitude"=>"-119.211"},
597
- "geoLocationPlace"=>"Providence Creek (Lower, Upper and P301)",
598
- "geoLocationPoint"=> {"pointLatitude"=>"37.047756", "pointLongitude"=>"-119.221094"}}])
599
- end
600
-
601
- it "author only full name" do
602
- input = "https://doi.org/10.14457/KMITL.RES.2006.17"
603
- subject = Bolognese::Metadata.new(input: input)
604
- expect(subject.valid?).to be true
605
- expect(subject.id).to eq("https://doi.org/10.14457/kmitl.res.2006.17")
606
- expect(subject.types["schemaOrg"]).to eq("Dataset")
607
- expect(subject.creators.length).to eq(1)
608
- expect(subject.creators.first).to eq("name" => "กัญจนา แซ่เตียว", "nameIdentifiers" => [], "affiliation" => [])
609
- end
610
-
611
- it "multiple author names in one creatorsName" do
612
- input = "https://doi.org/10.7910/DVN/EQTQYO"
613
- subject = Bolognese::Metadata.new(input: input)
614
- expect(subject.valid?).to be true
615
- expect(subject.id).to eq("https://doi.org/10.7910/dvn/eqtqyo")
616
- expect(subject.types["schemaOrg"]).to eq("Dataset")
617
- expect(subject.creators).to eq([{"name" => "Enos, Ryan (Harvard University); Fowler, Anthony (University Of Chicago); Vavreck, Lynn (UCLA)", "nameIdentifiers" => [], "affiliation" => []}])
618
- end
619
-
620
- it "author with scheme" do
621
- input = "https://doi.org/10.18429/JACOW-IPAC2016-TUPMY003"
622
- subject = Bolognese::Metadata.new(input: input)
623
- expect(subject.valid?).to be true
624
- expect(subject.id).to eq("https://doi.org/10.18429/jacow-ipac2016-tupmy003")
625
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
626
- expect(subject.creators.length).to eq(12)
627
- expect(subject.creators.first).to eq("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"JACoW-00077389", "nameIdentifierScheme"=>"JACoW-ID", "schemeUri"=>"http://jacow.org/"}], "name"=>"Otani, Masashi", "givenName"=>"Masashi", "familyName"=>"Otani", "affiliation" => [{"name"=>"KEK, Tsukuba, Japan"}])
628
- end
629
-
630
- it "author with wrong orcid scheme" do
631
- input = "https://doi.org/10.2314/COSCV1"
632
- subject = Bolognese::Metadata.new(input: input)
633
- expect(subject.valid?).to be true
634
- expect(subject.id).to eq("https://doi.org/10.2314/coscv1")
635
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
636
- expect(subject.creators.length).to eq(14)
637
- expect(subject.creators.first).to include("nameType"=>"Personal", "nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-0232-7085", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Heller, Lambert", "givenName"=>"Lambert", "familyName"=>"Heller")
638
- end
639
-
640
- it "keywords with attributes" do
641
- input = "https://doi.org/10.21233/n34n5q"
642
- subject = Bolognese::Metadata.new(input: input)
643
- expect(subject.valid?).to be true
644
- expect(subject.id).to eq("https://doi.org/10.21233/n34n5q")
645
- expect(subject.subjects).to eq([{"schemeUri"=>"http://id.loc.gov/authorities/subjects", "subject"=>"Paleoecology", "subjectScheme"=>"Library of Congress"}])
646
- end
647
-
648
- it "Funding" do
649
- input = "https://doi.org/10.15125/BATH-00114"
650
- subject = Bolognese::Metadata.new(input: input)
651
- expect(subject.valid?).to be true
652
- expect(subject.id).to eq("https://doi.org/10.15125/bath-00114")
653
- expect(subject.identifiers).to eq([{"identifier"=>"http://researchdata.bath.ac.uk/114/", "identifierType"=>"URL"}])
654
- expect(subject.types["schemaOrg"]).to eq("Dataset")
655
- expect(subject.types["resourceType"]).to eq("Dataset")
656
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
657
- expect(subject.creators.length).to eq(2)
658
- expect(subject.creators.first).to eq("nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0001-8740-8284", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Bimbo, Nuno", "givenName"=>"Nuno", "familyName"=>"Bimbo")
659
- expect(subject.titles).to eq([{"title"=>"Dataset for \"Direct Evidence for Solid-Like Hydrogen in a Nanoporous Carbon Hydrogen Storage Material at Supercritical Temperatures\""}])
660
- expect(subject.descriptions.first["description"]).to start_with("Dataset for Direct Evidence for Solid-Like Hydrogen")
661
- expect(subject.publication_year).to eq("2015")
662
- expect(subject.publisher).to eq("University of Bath")
663
- expect(subject.funding_references.length).to eq(5)
664
- expect(subject.funding_references.first).to eq("awardNumber" => "EP/J016454/1",
665
- "awardTitle" => "SUPERGEN Hub Funding",
666
- "funderIdentifier" => "https://doi.org/10.13039/501100000266",
667
- "funderIdentifierType" => "Crossref Funder ID",
668
- "funderName" => "Engineering and Physical Sciences Research Council (EPSRC)")
669
- expect(subject.subjects).to eq([{"schemeUri"=>
670
- "http://www.rcuk.ac.uk/research/efficiency/researchadmin/harmonisation/",
671
- "subject"=>"Energy Storage",
672
- "subjectScheme"=>"RCUK Research Classifications"},
673
- {"schemeUri"=>
674
- "http://www.rcuk.ac.uk/research/efficiency/researchadmin/harmonisation/",
675
- "subject"=>"Materials Characterisation",
676
- "subjectScheme"=>"RCUK Research Classifications"}])
677
- expect(subject.agency).to eq("datacite")
678
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
679
- end
680
-
681
- it "Funding schema version 4" do
682
- input = "https://doi.org/10.5438/6423"
683
- subject = Bolognese::Metadata.new(input: input)
684
- expect(subject.valid?).to be true
685
- expect(subject.id).to eq("https://doi.org/10.5438/6423")
686
- expect(subject.types["schemaOrg"]).to eq("Collection")
687
- expect(subject.types["resourceType"]).to eq("Project")
688
- expect(subject.types["resourceTypeGeneral"]).to eq("Collection")
689
- expect(subject.types["ris"]).to eq("GEN")
690
- expect(subject.types["citeproc"]).to eq("article")
691
- expect(subject.creators.length).to eq(24)
692
- expect(subject.creators.first).to eq("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"}])
693
- expect(subject.titles).to eq([{"title"=>"Technical and Human Infrastructure for Open Research (THOR)"}])
694
- expect(subject.descriptions.first["description"]).to start_with("Five years ago, a global infrastructure")
695
- expect(subject.publication_year).to eq("2015")
696
- expect(subject.publisher).to eq("DataCite")
697
- expect(subject.funding_references).to eq([{"awardNumber"=>"654039",
698
- "awardTitle"=>"THOR – Technical and Human Infrastructure for Open Research",
699
- "awardUri"=>"http://cordis.europa.eu/project/rcn/194927_en.html",
700
- "funderIdentifier"=>"https://doi.org/10.13039/501100000780",
701
- "funderIdentifierType"=>"Crossref Funder ID",
702
- "funderName"=>"European Commission"}])
703
- expect(subject.agency).to eq("datacite")
704
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
705
- end
706
-
707
- it "Funding empty awardTitle" do
708
- input = "https://doi.org/10.26102/2310-6018/2019.24.1.006"
709
- subject = Bolognese::Metadata.new(input: input)
710
- expect(subject.valid?).to be true
711
- expect(subject.id).to eq("https://doi.org/10.26102/2310-6018/2019.24.1.006")
712
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
713
- expect(subject.types["resourceType"]).to eq("Journal Article")
714
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
715
- expect(subject.creators.length).to eq(2)
716
- expect(subject.creators.first).to eq("affiliation"=>[{"name"=>"Тверская государственная сельскохозяйственная академия"}], "familyName"=>"Ганичева", "givenName"=>"А.В.", "name"=>"Ганичева, А.В.", "nameType"=>"Personal", "nameIdentifiers" => [])
717
- expect(subject.titles).to eq([{"title"=>"МОДЕЛЬ СИСТЕМНОЙ ДИНАМИКИ ПРОЦЕССА ОБУЧЕНИЯ"}, {"title"=>"MODEL OF SYSTEM DYNAMICS OF PROCESS OF TRAINING", "titleType"=>"TranslatedTitle"}])
718
- expect(subject.descriptions.first["description"]).to start_with("Актуальность данной работы обусловлена важностью учета в учебном процессе личностных качеств обучаем")
719
- expect(subject.publication_year).to eq("2019")
720
- expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
721
- expect(subject.funding_references.length).to eq(1)
722
- expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
723
- expect(subject.agency).to eq("datacite")
724
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
725
- end
726
-
727
- it "BlogPosting from string" do
728
- input = fixture_path + "datacite.xml"
729
- subject = Bolognese::Metadata.new(input: input)
730
- expect(subject.valid?).to be true
731
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
732
- expect(subject.types["resourceType"]).to eq("BlogPosting")
733
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
734
- expect(subject.types["ris"]).to eq("RPRT")
735
- expect(subject.types["citeproc"]).to eq("article-journal")
736
- expect(subject.creators).to eq([{"nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin", "givenName"=>"Martin", "familyName"=>"Fenner"}])
737
- expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
738
- expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
739
- expect(subject.identifiers).to eq([{"identifier"=>"MS-49-3632-5083", "identifierType"=>"Local accession number"}])
740
- expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Created"}, {"date"=>"2016-12-20", "dateType"=>"Issued"}, {"date"=>"2016-12-20", "dateType"=>"Updated"}])
741
- expect(subject.publication_year).to eq("2016")
742
- expect(subject.related_identifiers.length).to eq(3)
743
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
744
- expect(subject.agency).to eq("datacite")
745
- end
746
-
747
- it "Schema 4.1 from string" do
748
- input = fixture_path + "datacite-example-complicated-v4.1.xml"
749
- subject = Bolognese::Metadata.new(input: input)
750
- expect(subject.valid?).to be true
751
- expect(subject.types["schemaOrg"]).to eq("Book")
752
- expect(subject.types["resourceType"]).to eq("Monograph")
753
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
754
- expect(subject.types["ris"]).to eq("BOOK")
755
- expect(subject.types["citeproc"]).to eq("book")
756
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが","nameIdentifiers"=>
757
- [{"nameIdentifier"=>"0000000134596520",
758
- "nameIdentifierScheme"=>"ISNI",
759
- "schemeUri"=>"http://isni.org/isni/"}],
760
- "affiliation" => []}])
761
- expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
762
- expect(subject.identifiers).to eq([{"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
763
- expect(subject.dates).to eq([{"date"=>"2012-12-13", "dateInformation"=>"Correction", "dateType"=>"Other"}, {"date"=>"2010", "dateType"=>"Issued"}])
764
- expect(subject.publication_year).to eq("2010")
765
- expect(subject.related_identifiers.length).to eq(1)
766
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
767
- expect(subject.rights_list).to eq([{"lang"=>"eng",
768
- "rights"=>"Creative Commons Attribution No Derivatives 2.0 Generic",
769
- "rightsIdentifier"=>"cc-by-nd-2.0",
770
- "rightsIdentifierScheme"=>"SPDX",
771
- "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
772
- "schemeUri"=>"https://spdx.org/licenses/"}])
773
- expect(subject.publisher).to eq("Springer")
774
- expect(subject.agency).to eq("datacite")
775
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
776
- end
777
-
778
- it "Schema 4.0 from string" do
779
- input = fixture_path + "datacite-example-complicated-v4.0.xml"
780
- subject = Bolognese::Metadata.new(input: input)
781
- expect(subject.valid?).to be true
782
- expect(subject.types["schemaOrg"]).to eq("Book")
783
- expect(subject.types["resourceType"]).to eq("Monograph")
784
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
785
- expect(subject.types["ris"]).to eq("BOOK")
786
- expect(subject.types["citeproc"]).to eq("book")
787
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが","nameIdentifiers"=>
788
- [{"nameIdentifier"=>"0000000134596520",
789
- "nameIdentifierScheme"=>"ISNI",
790
- "schemeUri"=>"http://isni.org/isni/"}],
791
- "affiliation" => []}])
792
- expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
793
- expect(subject.id).to eq("https://doi.org/10.5072/testpub")
794
- expect(subject.identifiers).to eq([{"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
795
- expect(subject.publication_year).to eq("2010")
796
- expect(subject.related_identifiers.length).to eq(1)
797
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
798
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution No Derivatives 2.0 Generic",
799
- "rightsIdentifier"=>"cc-by-nd-2.0",
800
- "rightsIdentifierScheme"=>"SPDX",
801
- "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
802
- "schemeUri"=>"https://spdx.org/licenses/"}])
803
- expect(subject.publisher).to eq("Springer")
804
- expect(subject.agency).to eq("datacite")
805
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4.0")
806
- end
807
-
808
- it "Schema 3 from string" do
809
- input = fixture_path + "datacite_schema_3.xml"
810
- subject = Bolognese::Metadata.new(input: input)
811
- expect(subject.valid?).to be true
812
- expect(subject.types["schemaOrg"]).to eq("Dataset")
813
- expect(subject.types["resourceType"]).to eq("DataPackage")
814
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
815
- expect(subject.types["ris"]).to eq("DATA")
816
- expect(subject.types["citeproc"]).to eq("dataset")
817
- expect(subject.creators.length).to eq(8)
818
- expect(subject.creators.last).to eq("familyName"=>"Renaud", "givenName"=>"François", "name"=>"Renaud, François", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
819
- expect(subject.titles).to eq([{"title"=>"Data from: A new malaria agent in African hominids."}])
820
- expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
821
- expect(subject.identifiers).to eq([{"identifier"=>
822
- "Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.",
823
- "identifierType"=>"citation"}])
824
- expect(subject.publication_year).to eq("2011")
825
- expect(subject.related_identifiers.length).to eq(4)
826
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"19478877", "relatedIdentifierType"=>"PMID", "relationType"=>"IsReferencedBy")
827
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Zero v1.0 Universal",
828
- "rightsIdentifier"=>"cc0-1.0",
829
- "rightsIdentifierScheme"=>"SPDX",
830
- "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
831
- "schemeUri"=>"https://spdx.org/licenses/"}])
832
- expect(subject.publisher).to eq("Dryad Digital Repository")
833
- expect(subject.agency).to eq("datacite")
834
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
835
- end
836
-
837
- it "Schema 3.0 from string" do
838
- input = fixture_path + "datacite-example-complicated-v3.0.xml"
839
- subject = Bolognese::Metadata.new(input: input)
840
- expect(subject.valid?).to be true
841
- expect(subject.types["schemaOrg"]).to eq("Book")
842
- expect(subject.types["resourceType"]).to eq("Monograph")
843
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
844
- expect(subject.types["ris"]).to eq("BOOK")
845
- expect(subject.types["citeproc"]).to eq("book")
846
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが","nameIdentifiers"=>
847
- [{"nameIdentifier"=>"0000000134596520",
848
- "nameIdentifierScheme"=>"ISNI",
849
- "schemeUri"=>"http://isni.org/isni/"}],
850
- "affiliation" => []}])
851
- expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
852
- expect(subject.id).to eq("https://doi.org/10.5072/testpub")
853
- expect(subject.identifiers).to eq([{"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
854
- expect(subject.publication_year).to eq("2010")
855
- expect(subject.related_identifiers.length).to eq(1)
856
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
857
- expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution No Derivatives 2.0 Generic",
858
- "rightsIdentifier"=>"cc-by-nd-2.0",
859
- "rightsIdentifierScheme"=>"SPDX",
860
- "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
861
- "schemeUri"=>"https://spdx.org/licenses/"}])
862
- expect(subject.publisher).to eq("Springer")
863
- expect(subject.agency).to eq("datacite")
864
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3.0")
865
- end
866
-
867
- it "Schema 2.2 from string" do
868
- input = fixture_path + "datacite-metadata-sample-complicated-v2.2.xml"
869
- subject = Bolognese::Metadata.new(input: input)
870
- expect(subject.valid?).to be true
871
- expect(subject.types["schemaOrg"]).to eq("Book")
872
- expect(subject.types["resourceType"]).to eq("Monograph")
873
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
874
- expect(subject.types["ris"]).to eq("BOOK")
875
- expect(subject.types["citeproc"]).to eq("book")
876
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが", "nameIdentifiers"=>
877
- [{"nameIdentifier"=>"abc123",
878
- "nameIdentifierScheme"=>"ISNI"}],
879
- "affiliation" => []}])
880
- expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
881
- expect(subject.identifiers).to eq([{"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
882
- expect(subject.dates).to eq([{"date"=>"2009-04-29", "dateType"=>"StartDate"}, {"date"=>"2010-01-05", "dateType"=>"EndDate"}, {"date"=>"2010", "dateType"=>"Issued"}])
883
- expect(subject.publication_year).to eq("2010")
884
- expect(subject.related_identifiers.length).to eq(1)
885
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf")
886
- expect(subject.publisher).to eq("Springer")
887
- expect(subject.agency).to eq("datacite")
888
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
889
- end
890
-
891
- it "Schema 4.1 from string with doi in options" do
892
- input = fixture_path + "datacite-example-complicated-v4.1.xml"
893
- subject = Bolognese::Metadata.new(input: input, doi: "10.5072/testpub2", content_url: "https://example.org/report.pdf")
894
- expect(subject.valid?).to be true
895
- expect(subject.types["schemaOrg"]).to eq("Book")
896
- expect(subject.types["resourceType"]).to eq("Monograph")
897
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
898
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameIdentifiers" => [], "affiliation" => []}, {"name"=>"つまらないものですが","nameIdentifiers"=>
899
- [{"nameIdentifier"=>"0000000134596520",
900
- "nameIdentifierScheme"=>"ISNI",
901
- "schemeUri"=>"http://isni.org/isni/"}],
902
- "affiliation" => []}])
903
- expect(subject.titles).to eq([{"title"=>"Właściwości rzutowań podprzestrzeniowych"}, {"title"=>"Translation of Polish titles", "titleType"=>"TranslatedTitle"}])
904
- expect(subject.id).to eq("https://doi.org/10.5072/testpub2")
905
- expect(subject.identifiers).to eq([{"identifier"=>"937-0-4523-12357-6", "identifierType"=>"ISBN"}])
906
- expect(subject.dates).to eq([{"date"=>"2012-12-13", "dateInformation"=>"Correction", "dateType"=>"Other"}, {"date"=>"2010", "dateType"=>"Issued"}])
907
- expect(subject.publication_year).to eq("2010")
908
- expect(subject.sizes).to eq(["256 pages"])
909
- expect(subject.formats).to eq(["pdf"])
910
- expect(subject.content_url).to eq("https://example.org/report.pdf")
911
- expect(subject.publication_year).to eq("2010")
912
- expect(subject.related_identifiers.length).to eq(1)
913
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5272/oldertestpub", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
914
- expect(subject.rights_list).to eq([{"lang"=>"eng",
915
- "rights"=>"Creative Commons Attribution No Derivatives 2.0 Generic",
916
- "rightsIdentifier"=>"cc-by-nd-2.0",
917
- "rightsIdentifierScheme"=>"SPDX",
918
- "rightsUri"=>"https://creativecommons.org/licenses/by-nd/2.0/legalcode",
919
- "schemeUri"=>"https://spdx.org/licenses/"}])
920
- expect(subject.publisher).to eq("Springer")
921
- expect(subject.agency).to eq("datacite")
922
- end
923
-
924
- it "namespaced xml from string" do
925
- input = fixture_path + "ns0.xml"
926
- subject = Bolognese::Metadata.new(input: input)
927
- expect(subject.valid?).to be true
928
- expect(subject.id).to eq("https://doi.org/10.4231/d38g8fk8b")
929
- expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
930
- expect(subject.types["resourceType"]).to eq("Simulation Tool")
931
- expect(subject.types["resourceTypeGeneral"]).to eq("Software")
932
- expect(subject.creators.length).to eq(5)
933
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"PatiñO, Carlos", "givenName"=>"Carlos", "familyName"=>"PatiñO", "nameIdentifiers" => [], "affiliation" => [])
934
- expect(subject.titles).to eq([{"title"=>"LAMMPS Data-File Generator"}])
935
- expect(subject.dates).to eq([{"date"=>"2018-07-18", "dateType"=>"Valid"}, {"date"=>"2018-07-18", "dateType"=>"Accepted"}, {"date"=>"2018", "dateType"=>"Issued"}])
936
- expect(subject.publication_year).to eq("2018")
937
- expect(subject.publisher).to eq("nanoHUB")
938
- expect(subject.agency).to eq("datacite")
939
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
940
- end
941
-
942
- it "Schema.org type" do
943
- input = "https://doi.org/10.25318/3410014001-fra"
944
- subject = Bolognese::Metadata.new(input: input)
945
- expect(subject.valid?).to be true
946
- expect(subject.id).to eq("https://doi.org/10.25318/3410014001-fra")
947
- expect(subject.types["schemaOrg"]).to eq("Dataset")
948
- expect(subject.types["resourceType"]).to be_nil
949
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
950
- expect(subject.types["ris"]).to eq("DATA")
951
- expect(subject.types["bibtex"]).to eq("misc")
952
- expect(subject.creators.length).to eq(1)
953
- expect(subject.creators.first).to eq("affiliation" => [{"affiliationIdentifier"=>"https://ror.org/04zt3wx35", "affiliationIdentifierScheme"=>"ROR", "name"=>"Canada Mortgage and Housing Corporation", "schemeUri"=>"https://ror.org"}],
954
- "name" => "Statistique Canada",
955
- "nameIdentifiers" => [],
956
- "nameType" => "Organizational")
957
- end
958
-
959
- it "doi with + sign" do
960
- input = "10.5067/terra+aqua/ceres/cldtyphist_l3.004"
961
- subject = Bolognese::Metadata.new(input: input)
962
- expect(subject.valid?).to be true
963
- expect(subject.id).to eq("https://doi.org/10.5067/terra+aqua/ceres/cldtyphist_l3.004")
964
- expect(subject.types["schemaOrg"]).to eq("Dataset")
965
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
966
- expect(subject.creators).to eq([{"familyName"=>"Wong", "givenName"=>"Takmeng", "name"=>"Wong, Takmeng"}])
967
- expect(subject.titles).to eq([{"title"=>"CERES Level 3 Cloud Type Historgram Terra+Aqua HDF file - Edition4"}])
968
- expect(subject.publication_year).to eq("2016")
969
- expect(subject.publisher).to eq("NASA Langley Atmospheric Science Data Center DAAC")
970
- expect(subject.agency).to eq("datacite")
971
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
972
- end
973
-
974
- it "subject scheme" do
975
- input = "https://doi.org/10.4232/1.2745"
976
- subject = Bolognese::Metadata.new(input: input)
977
- expect(subject.valid?).to be true
978
- expect(subject.id).to eq("https://doi.org/10.4232/1.2745")
979
- expect(subject.identifiers).to eq([{"identifier"=>"ZA2745", "identifierType"=>"ZA-No."},
980
- {"identifier"=>"Internationale Umfrageprogramme", "identifierType"=>"FDZ"}])
981
- expect(subject.types["schemaOrg"]).to eq("Dataset")
982
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
983
- expect(subject.creators).to eq([{"nameType"=>"Organizational", "name"=>"Europäische Kommission", "nameIdentifiers" => [], "affiliation" => []}])
984
- expect(subject.contributors.length).to eq(18)
985
- expect(subject.contributors.first).to eq("affiliation"=>[{"name"=>"Europäische Kommission, Brüssel"}], "contributorType"=>"Researcher", "familyName"=>"Reif", "givenName"=>"Karlheinz", "name"=>"Reif, Karlheinz", "nameType"=>"Personal", "nameIdentifiers" => [])
986
- 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"}])
987
- expect(subject.subjects).to eq([{"lang"=>"en",
988
- "subject"=>"KAT12 International Institutions, Relations, Conditions",
989
- "subjectScheme"=>"ZA"},
990
- {"lang"=>"de",
991
- "subject"=>"Internationale Politik und Institutionen",
992
- "subjectScheme"=>"CESSDA Topic Classification"},
993
- {"lang"=>"de",
994
- "subject"=>"Regierung, politische Systeme, Parteien und Verbände",
995
- "subjectScheme"=>"CESSDA Topic Classification"},
996
- {"lang"=>"de",
997
- "subject"=>"Wirtschaftssysteme und wirtschaftliche Entwicklung",
998
- "subjectScheme"=>"CESSDA Topic Classification"},
999
- {"lang"=>"en",
1000
- "subject"=>"International politics and organisation",
1001
- "subjectScheme"=>"CESSDA Topic Classification"},
1002
- {"lang"=>"en",
1003
- "subject"=>"Government, political systems and organisation",
1004
- "subjectScheme"=>"CESSDA Topic Classification"},
1005
- {"lang"=>"en",
1006
- "subject"=>"Economic systems and development",
1007
- "subjectScheme"=>"CESSDA Topic Classification"}])
1008
- expect(subject.dates).to eq([{"date"=>"1995-12", "dateType"=>"Collected"}, {"date"=>"1996", "dateType"=>"Issued"}])
1009
- expect(subject.publication_year).to eq("1996")
1010
- expect(subject.publisher).to eq("GESIS Data Archive")
1011
- expect(subject.agency).to eq("datacite")
1012
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1013
- end
1014
-
1015
- it "series-information" do
1016
- input = "https://doi.org/10.4229/23RDEUPVSEC2008-5CO.8.3"
1017
- subject = Bolognese::Metadata.new(input: input)
1018
- expect(subject.valid?).to be true
1019
- expect(subject.id).to eq("https://doi.org/10.4229/23rdeupvsec2008-5co.8.3")
1020
- expect(subject.identifiers).to eq([{"identifier"=>"3-936338-24-8", "identifierType"=>"ISBN"}])
1021
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
1022
- expect(subject.types["resourceType"]).to eq("Article")
1023
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
1024
- expect(subject.creators.length).to eq(3)
1025
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Llamas, P.", "givenName"=>"P.", "familyName"=>"Llamas", "nameIdentifiers" => [], "affiliation" => [])
1026
- expect(subject.titles).to eq([{"title"=>"Rural Electrification With Hybrid Power Systems Based on Renewables - Technical System Configurations From the Point of View of the European Industry"}])
1027
- expect(subject.dates).to eq([{"date"=>"2008-11-01", "dateType"=>"Valid"}, {"date"=>"2008", "dateType"=>"Issued"}])
1028
- expect(subject.publication_year).to eq("2008")
1029
- expect(subject.container).to eq("firstPage"=>"Spain; 3353", "lastPage"=>"3356", "title"=>"23rd European Photovoltaic Solar Energy Conference and Exhibition", "type"=>"Series", "volume"=>"1-5 September 2008")
1030
- expect(subject.descriptions[1]["description"]).to start_with("Aim of this paper is the presentation")
1031
- expect(subject.subjects).to eq([{"subject"=>"PV Systems"}, {"subject"=>"Off-grid Applications"}])
1032
- expect(subject.publisher).to eq("WIP-Munich")
1033
- expect(subject.agency).to eq("datacite")
1034
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-2.2")
1035
- end
1036
-
1037
- it "content url" do
1038
- input = "10.23725/8na3-9s47"
1039
- subject = Bolognese::Metadata.new(input: input)
1040
- expect(subject.valid?).to be true
1041
- expect(subject.doi).to eq("10.23725/8na3-9s47")
1042
- expect(subject.id).to eq("https://doi.org/10.23725/8na3-9s47")
1043
- expect(subject.identifiers).to eq([{"identifier"=>"ark:/99999/fk41CrU4eszeLUDe", "identifierType"=>"minid"},
1044
- {"identifier"=>"dg.4503/c3d66dc9-58da-411c-83c4-dd656aa3c4b7",
1045
- "identifierType"=>"dataguid"},
1046
- {"identifier"=>"3b33f6b9338fccab0901b7d317577ea3", "identifierType"=>"md5"}])
1047
- expect(subject.content_url).to include("s3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram", "gs://topmed-irc-share/public/NWD165827.recab.cram")
1048
- end
1049
-
1050
- it "empty subject" do
1051
- input = "https://doi.org/10.18169/PAPDEOTTX00502"
1052
- subject = Bolognese::Metadata.new(input: input)
1053
- expect(subject.valid?).to be true
1054
- expect(subject.id).to eq("https://doi.org/10.18169/papdeottx00502")
1055
- expect(subject.identifiers).to eq([{"identifier"=>"http://www.priorartregister.com/resolve.php?disclosure=OTTX00502", "identifierType"=>"URL"}])
1056
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1057
- expect(subject.types["resourceType"]).to eq("Disclosure")
1058
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
1059
- expect(subject.creators).to eq([{"name"=>"Anonymous", "nameIdentifiers" => [], "affiliation" => []}])
1060
- expect(subject.titles).to eq([{"title"=>"Messung der Bildunschaerfe in H.264-codierten Bildern und Videosequenzen"}])
1061
- expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
1062
- expect(subject.publication_year).to eq("2017")
1063
- expect(subject.publisher).to eq("Siemens AG")
1064
- expect(subject.agency).to eq("datacite")
1065
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1066
- end
1067
-
1068
- it "leading and trailing whitespace" do
1069
- input = "https://doi.org/10.21944/temis-OZONE-MSR2"
1070
- subject = Bolognese::Metadata.new(input: input)
1071
-
1072
- expect(subject.valid?).to be true
1073
- #expect(subject.errors.length).to eq(2)
1074
- #expect(subject.errors.last).to eq("33:0: ERROR: Element '{http://datacite.org/schema/kernel-4}date': '1970-04-01 / (:tba)' is not a valid value of the atomic type '{http://datacite.org/schema/kernel-4}edtf'.")
1075
- expect(subject.id).to eq("https://doi.org/10.21944/temis-ozone-msr2")
1076
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1077
- expect(subject.types["resourceType"]).to eq("Satellite data")
1078
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
1079
- expect(subject.creators).to eq([{"nameType"=>"Personal",
1080
- "nameIdentifiers"=>
1081
- [{"nameIdentifier"=>"https://orcid.org/0000-0002-0077-5338",
1082
- "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
1083
- "name"=>"Van Der A, Ronald",
1084
- "givenName"=>"Ronald",
1085
- "familyName"=>"Van Der A",
1086
- "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]},
1087
- {"nameType"=>"Personal",
1088
- "name"=>"Allaart, Marc",
1089
- "givenName"=>"Marc",
1090
- "familyName"=>"Allaart",
1091
- "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}],
1092
- "nameIdentifiers" => []},
1093
- {"nameType"=>"Personal",
1094
- "name"=>"Eskes, Henk",
1095
- "givenName"=>"Henk",
1096
- "familyName"=>"Eskes",
1097
- "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0002-8743-4455", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
1098
- "affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]}])
1099
- expect(subject.titles).to eq([{"title"=>"Multi-Sensor Reanalysis (MSR) of total ozone, version 2"}])
1100
- expect(subject.version_info).to eq("2")
1101
- expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"2015", "dateType"=>"Issued"}])
1102
- expect(subject.publication_year).to eq("2015")
1103
- expect(subject.publisher).to eq("Royal Netherlands Meteorological Institute (KNMI)")
1104
- expect(subject.agency).to eq("datacite")
1105
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1106
- end
1107
-
1108
- it "DOI not found" do
1109
- input = "https://doi.org/10.4124/05F6C379-DD68-4CDB-880D-33D3E9576D52/1"
1110
- subject = Bolognese::Metadata.new(input: input)
1111
- expect(subject.valid?).to be false
1112
- expect(subject.id).to eq("https://doi.org/10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1113
- expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
1114
- expect(subject.agency).to eq("datacite")
1115
- expect(subject.state).to eq("not_found")
1116
- end
1117
-
1118
- it "DOI in staging system" do
1119
- input = "https://handle.stage.datacite.org/10.22002/d1.694"
1120
- subject = Bolognese::Metadata.new(input: input, sandbox: true)
1121
- expect(subject.valid?).to be true
1122
- expect(subject.id).to eq("https://handle.stage.datacite.org/10.22002/d1.694")
1123
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1124
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
1125
- expect(subject.creators).to eq([{"affiliation"=>[{"name"=>"Caltech"}], "name"=>"Tester", "nameIdentifiers" => []}])
1126
- expect(subject.titles).to eq([{"title"=>"Test license"}])
1127
- expect(subject.dates).to eq([{"date"=>"2018-01-12", "dateType"=>"Issued"}])
1128
- expect(subject.publication_year).to eq("2018")
1129
- expect(subject.publisher).to eq("CaltechDATA")
1130
- expect(subject.agency).to eq("datacite")
1131
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1132
- expect(subject.state).to eq("findable")
1133
- end
1134
-
1135
- it "DOI in staging system schema 3" do
1136
- input = "10.21956/wellcomeopenres.25947.r17364"
1137
- subject = Bolognese::Metadata.new(input: input, doi: input, sandbox: true)
1138
- expect(subject.valid?).to be true
1139
- expect(subject.id).to eq("https://handle.stage.datacite.org/10.21956/wellcomeopenres.25947.r17364")
1140
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
1141
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
1142
- expect(subject.creators).to eq([{"name"=>"Fran2 Levy", "nameIdentifiers" => [], "affiliation" => []}])
1143
- expect(subject.titles).to eq([{"title"=>"Referee report. For: FL Regression Wellcome [version 1; referees: retracted]"}])
1144
- expect(subject.dates).to eq([{"date"=>"2018", "dateType"=>"Issued"}])
1145
- expect(subject.publication_year).to eq("2018")
1146
- expect(subject.publisher).to eq("F1000 Research Limited")
1147
- expect(subject.agency).to eq("datacite")
1148
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1149
- expect(subject.state).to eq("findable")
1150
- end
1151
-
1152
- it "Referee report in staging system" do
1153
- input = "10.21956/gatesopenres.530.r190"
1154
- subject = Bolognese::Metadata.new(input: input, sandbox: true)
1155
- expect(subject.valid?).to be true
1156
- expect(subject.id).to eq("https://handle.stage.datacite.org/10.21956/gatesopenres.530.r190")
1157
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
1158
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
1159
- expect(subject.types["ris"]).to eq("RPRT")
1160
- expect(subject.types["citeproc"]).to eq("article-journal")
1161
- expect(subject.creators.length).to eq(5)
1162
- expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Patel, Lina", "givenName"=>"Lina", "familyName"=>"Patel", "nameIdentifiers" => [], "affiliation" => [])
1163
- expect(subject.titles).to eq([{"title"=>"Referee report. For: Gates - add article keywords to the metatags [version 2; referees: 1 approved]"}])
1164
- expect(subject.publication_year).to eq("2018")
1165
- expect(subject.publisher).to eq("Gates Open Research")
1166
- expect(subject.agency).to eq("datacite")
1167
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1168
- end
1169
-
1170
- it "multiple rights" do
1171
- input = fixture_path + "datacite-multiple-rights.xml"
1172
- subject = Bolognese::Metadata.new(input: input)
1173
- expect(subject.valid?).to be true
1174
- expect(subject.rights_list).to eq([{"rights"=>"info:eu-repo/semantics/openAccess"}, {"rights"=>"Open Access", "rightsUri"=>"info:eu-repo/semantics/openAccess"}])
1175
- end
1176
-
1177
- it ":tba" do
1178
- input = fixture_path + "datacite-example-complicated-tba.xml"
1179
- subject = Bolognese::Metadata.new(input: input)
1180
- expect(subject.valid?).to be true
1181
- expect(subject.titles).to eq([{"title"=>":unav"}])
1182
- expect(subject.formats).to eq([":null"])
1183
- expect(subject.dates).to eq([{"date"=>":tba", "dateInformation"=>"Correction", "dateType"=>"Other"}, {"date"=>"2010", "dateType"=>"Issued"}])
1184
- end
1185
-
1186
- it "ancient-dates" do
1187
- input = fixture_path + "datacite-example-ancientdates-v4.3.xml"
1188
- subject = Bolognese::Metadata.new(input: input)
1189
- #expect(subject.valid?).to be true
1190
- expect(subject.dates).to eq([{"date"=>"-0024/-0022", "dateInformation"=>"from 25 BC to 23 BC", "dateType"=>"Created"}, {"date"=>"2010", "dateType"=>"Issued"}])
1191
- end
1192
-
1193
- # TODO properly handle escaped text
1194
- it "escaped text" do
1195
- input = fixture_path + "datacite-example-escaped-text.xml"
1196
- subject = Bolognese::Metadata.new(input: input)
1197
- expect(subject.valid?).to be true
1198
- expect(subject.titles).to eq([{"title"=>"Some initial text"}])
1199
- end
1200
-
1201
- it "missing creators" do
1202
- input = fixture_path + "datacite_missing_creator.xml"
1203
- subject = Bolognese::Metadata.new(input: input, regenerate: true)
1204
- expect(subject.creators).to be_blank
1205
- expect(subject.valid?).to be false
1206
- expect(subject.errors).to eq("4:0: ERROR: Element '{http://datacite.org/schema/kernel-4}creators': Missing child element(s). Expected is ( {http://datacite.org/schema/kernel-4}creator ).")
1207
- end
1208
-
1209
- it "malformed creators" do
1210
- input = fixture_path + "datacite_malformed_creator.xml"
1211
- subject = Bolognese::Metadata.new(input: input, regenerate: false)
1212
- expect(subject.creators).to be_blank
1213
- expect(subject.valid?).to be false
1214
- expect(subject.errors).to eq("16:0: ERROR: Element '{http://datacite.org/schema/kernel-4}creatorName': This element is not expected. Expected is ( {http://datacite.org/schema/kernel-4}affiliation ).")
1215
- end
1216
-
1217
- it "empty funding references" do
1218
- input = fixture_path + "funding_reference.xml"
1219
- subject = Bolognese::Metadata.new(input: input, regenerate: false)
1220
- expect(subject.valid?).to be false
1221
- expect(subject.funding_references).to eq([{"funderName"=>"Agency for Science, Technology and Research (Singapore)"}])
1222
- expect(subject.errors.first).to eq("31:0: ERROR: Element '{http://datacite.org/schema/kernel-4}fundingReference': Missing child element(s). Expected is one of ( {http://datacite.org/schema/kernel-4}funderName, {http://datacite.org/schema/kernel-4}funderIdentifier, {http://datacite.org/schema/kernel-4}awardNumber, {http://datacite.org/schema/kernel-4}awardTitle ).")
1223
- end
1224
-
1225
- it "space in sizes" do
1226
- input = fixture_path + "datacite-space-in-sizes.xml"
1227
- subject = Bolognese::Metadata.new(input: input, regenerate: false)
1228
- expect(subject.valid?).to be true
1229
- expect(subject.sizes).to be_empty
1230
- expect(subject.related_identifiers).to eq([{"relatedIdentifier"=>"10.1016/s0040-1951(03)00197-5",
1231
- "relatedIdentifierType"=>"DOI",
1232
- "relationType"=>"IsCitedBy"}])
1233
- end
1234
-
1235
- it "formats with xs" do
1236
- input = fixture_path + "datacite-formats-with-xs.xml"
1237
- subject = Bolognese::Metadata.new(input: input, regenerate: false)
1238
- expect(subject.valid?).to be true
1239
- expect(subject.formats).to eq(["PDF"])
1240
- end
1241
-
1242
- it "dissertation" do
1243
- input = "10.3204/desy-2014-01645"
1244
- subject = Bolognese::Metadata.new(input: input)
1245
- expect(subject.valid?).to be true
1246
- expect(subject.id).to eq("https://doi.org/10.3204/desy-2014-01645")
1247
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
1248
- expect(subject.types["resourceType"]).to eq("Dissertation")
1249
- expect(subject.types["schemaOrg"]).to eq("Thesis")
1250
- expect(subject.types["bibtex"]).to eq("phdthesis")
1251
- expect(subject.types["citeproc"]).to eq("thesis")
1252
- expect(subject.creators).to eq([{"nameType"=>"Personal", "name"=>"Conrad, Heiko", "givenName"=>"Heiko", "familyName"=>"Conrad", "nameIdentifiers" => [], "affiliation" => []}])
1253
- expect(subject.titles).to eq([{"title"=>"Dynamics of colloids in molecular glass forming liquids studied via X-ray photon correlation spectroscopy"}])
1254
- expect(subject.dates).to eq([{"date"=>"2014", "dateType"=>"Issued"},
1255
- {"date"=>"2014", "dateType"=>"Copyrighted"},
1256
- {"date"=>"2009-10-01/2014-01-23", "dateType"=>"Created"}])
1257
- expect(subject.publication_year).to eq("2014")
1258
- expect(subject.publisher).to eq("Deutsches Elektronen-Synchrotron, DESY, Hamburg")
1259
- expect(subject.agency).to eq("datacite")
1260
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
1261
- end
1262
-
1263
- it "funding references" do
1264
- input = "10.26102/2310-6018/2019.24.1.006"
1265
- subject = Bolognese::Metadata.new(input: input)
1266
- expect(subject.valid?).to be true
1267
- expect(subject.id).to eq("https://doi.org/10.26102/2310-6018/2019.24.1.006")
1268
- expect(subject.types["resourceTypeGeneral"]).to eq("Text")
1269
- expect(subject.types["resourceType"]).to eq("Journal Article")
1270
- expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
1271
- expect(subject.types["bibtex"]).to eq("article")
1272
- expect(subject.types["citeproc"]).to eq("article-journal")
1273
- expect(subject.creators.length).to eq(2)
1274
- expect(subject.creators.first).to eq("affiliation" => [{"name"=>"Тверская государственная сельскохозяйственная академия"}],
1275
- "familyName" => "Ганичева",
1276
- "givenName" => "А.В.",
1277
- "name" => "Ганичева, А.В.",
1278
- "nameIdentifiers" => [],
1279
- "nameType" => "Personal")
1280
- expect(subject.titles.last).to eq("title"=>"MODEL OF SYSTEM DYNAMICS OF PROCESS OF TRAINING", "titleType"=>"TranslatedTitle")
1281
- expect(subject.dates).to eq([{"date"=>"2019-02-09", "dateType"=>"Issued"}])
1282
- expect(subject.publication_year).to eq("2019")
1283
- expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
1284
- expect(subject.funding_references.count).to eq(1)
1285
- expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
1286
- expect(subject.agency).to eq("datacite")
1287
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1288
- end
1289
-
1290
- it "DOI in with related id system" do
1291
- input = "https://doi.org/10.4121/uuid:3926db30-f712-4394-aebc-75976070e91f"
1292
- subject = Bolognese::Metadata.new(input: input)
1293
- expect(subject.valid?).to be true
1294
- expect(subject.id).to eq("https://doi.org/10.4121/uuid:3926db30-f712-4394-aebc-75976070e91f")
1295
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1296
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
1297
- expect(subject.titles).to eq([{"title"=>"BPI Challenge 2012"}])
1298
- expect(subject.dates).to eq([{"date"=>"2012-04-23", "dateType"=>"Issued"}])
1299
- expect(subject.publication_year).to eq("2012")
1300
- expect(subject.state).to eq("findable")
1301
- end
1302
- end
1303
-
1304
- context "change datacite metadata" do
1305
- it "change title" do
1306
- subject.titles = [{"title"=> "A new malaria agent in African hominids." }]
1307
- expect(subject.valid?).to be true
1308
- expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
1309
- expect(subject.doi).to eq("10.5061/dryad.8515")
1310
- expect(subject.url).to eq("http://datadryad.org/stash/dataset/doi:10.5061/dryad.8515")
1311
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1312
- expect(subject.titles).to eq([{"title"=> "A new malaria agent in African hominids." }])
1313
- end
1314
-
1315
- it "change state" do
1316
- subject.state = "registered"
1317
- expect(subject.valid?).to be true
1318
- expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
1319
- expect(subject.doi).to eq("10.5061/dryad.8515")
1320
- expect(subject.url).to eq("http://datadryad.org/stash/dataset/doi:10.5061/dryad.8515")
1321
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1322
- expect(subject.titles).to eq([{"title"=>"Data from: A new malaria agent in African hominids."}])
1323
- expect(subject.state).to eq("registered")
1324
- end
1325
- end
1326
-
1327
- context "change datacite metadata on input" do
1328
- it "change doi" do
1329
- input = fixture_path + 'datacite.xml'
1330
- doi = "10.5061/dryad.8515"
1331
- subject = Bolognese::Metadata.new(input: input, doi: doi)
1332
- expect(subject.valid?).to be true
1333
- expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
1334
- expect(subject.identifiers).to eq([{"identifier"=>"MS-49-3632-5083", "identifierType"=>"Local accession number"}])
1335
- expect(subject.doi).to eq("10.5061/dryad.8515")
1336
- expect(subject.creators).to eq([{"nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "name"=>"Fenner, Martin", "givenName"=>"Martin", "familyName"=>"Fenner"}])
1337
- expect(subject.titles).to eq([{"title"=>"Eating your own Dog Food"}])
1338
- expect(subject.publisher).to eq("DataCite")
1339
- expect(subject.publication_year).to eq("2016")
1340
- end
1341
- end
1342
-
1343
- it "GTEx dataset" do
1344
- input = fixture_path + 'gtex.xml'
1345
- url = "https://ors.datacite.org/doi:/10.25491/9hx8-ke93"
1346
- content_url = "https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz"
1347
- subject = Bolognese::Metadata.new(input: input, from: 'datacite', url: url, content_url: content_url)
1348
-
1349
- expect(subject.valid?).to be true
1350
- expect(subject.id).to eq("https://doi.org/10.25491/9hx8-ke93")
1351
- expect(subject.url).to eq("https://ors.datacite.org/doi:/10.25491/9hx8-ke93")
1352
- expect(subject.content_url).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz")
1353
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1354
- expect(subject.types["resourceType"]).to eq("DroNc-seq data")
1355
- expect(subject.creators).to eq([{"name"=>"The GTEx Consortium", "nameType"=>"Organizational", "nameIdentifiers" => [], "affiliation" => []}])
1356
- expect(subject.titles).to eq([{"title"=>"DroNc-seq data"}])
1357
- expect(subject.subjects).to eq([{"subject"=>"gtex"}, {"subject"=>"annotation"}, {"subject"=>"phenotype"}, {"subject"=>"gene regulation"}, {"subject"=>"transcriptomics"}])
1358
- expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
1359
- expect(subject.publication_year).to eq("2017")
1360
- expect(subject.related_identifiers.length).to eq(4)
1361
- expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "relatedIdentifierType"=>"URL", "relationType"=>"IsPartOf")
1362
- expect(subject.formats).to eq(["application/tar"])
1363
- expect(subject.sizes).to eq(["15.7M"])
1364
- expect(subject.container).to eq("identifier"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "identifierType"=>"URL", "title"=>"GTEx", "type"=>"DataRepository")
1365
- expect(subject.publisher).to eq("GTEx")
1366
- expect(subject.funding_references.count).to eq(7)
1367
- expect(subject.funding_references.first).to eq("funderIdentifier"=>"https://doi.org/10.13039/100000052", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"Common Fund of the Office of the Director of the NIH")
1368
- end
1369
-
1370
- it "geo_location_polygon" do
1371
- input = fixture_path + 'datacite-example-polygon-v4.1.xml'
1372
- subject = Bolognese::Metadata.new(input: input)
1373
- expect(subject.id).to eq("https://doi.org/10.5072/example-polygon")
1374
- expect(subject.types["schemaOrg"]).to eq("Dataset")
1375
- expect(subject.types["resourceType"]).to eq("Dataset")
1376
- expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
1377
- expect(subject.types["ris"]).to eq("DATA")
1378
- expect(subject.types["citeproc"]).to eq("dataset")
1379
- expect(subject.creators.first).to eq("familyName"=>"Den Heijer", "givenName"=>"C", "name"=>"Den Heijer, C", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
1380
- expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Meteo measurements at the Sand Motor"}])
1381
- expect(subject.publication_year).to eq("2017")
1382
- expect(subject.publisher).to eq("4TU.Centre for Research Data")
1383
- expect(subject.agency).to eq("datacite")
1384
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1385
- expect(subject.geo_locations.first["geoLocationPlace"]).to eq("Zandmotor, sand suppletion area on the Dutch coast.")
1386
- expect(subject.geo_locations.first["geoLocationPolygon"].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
1387
- end
1388
-
1389
- it "Schema 4.4 from string" do
1390
- input = fixture_path + "datacite-example-full-v4.4.xml"
1391
- subject = Bolognese::Metadata.new(input: input)
1392
- expect(subject.valid?).to be true
1393
- expect(subject.types["schemaOrg"]).to eq("SoftwareSourceCode")
1394
- expect(subject.types["resourceType"]).to eq("XML")
1395
- expect(subject.types["resourceTypeGeneral"]).to eq("Software")
1396
- expect(subject.creators).to eq(
1397
- [
1398
- {
1399
- "name"=>"Miller, Elizabeth", "givenName"=>"Elizabeth", "familyName"=>"Miller",
1400
- "nameType" => "Personal",
1401
- "nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0001-5000-0007",
1402
- "schemeUri"=>"https://orcid.org",
1403
- "nameIdentifierScheme"=>"ORCID"}],
1404
- "affiliation" => [{ "name" => "DataCite" }]
1405
- }
1406
- ]
1407
- )
1408
- expect(subject.titles).to eq(
1409
- [
1410
- {"title"=>"Full DataCite XML Example", "lang"=>"en-US"},
1411
- {"title"=>"Demonstration of DataCite Properties.", "titleType"=>"Subtitle", "lang"=>"en-US"}
1412
- ]
1413
- )
1414
- expect(subject.identifiers).to eq([{"identifier"=>"https://schema.datacite.org/meta/kernel-4.4/example/datacite-example-full-v4.4.xml", "identifierType"=>"URL"}])
1415
- expect(subject.dates).to eq(
1416
- [
1417
- {"date"=>"2021-01-26", "dateInformation"=>"Updated with 4.4 properties", "dateType"=>"Updated"},
1418
- {"date"=>"2014", "dateType"=>"Issued"}
1419
- ]
1420
- )
1421
- expect(subject.publication_year).to eq("2014")
1422
- expect(subject.subjects).to eq(
1423
- [{
1424
- "subject"=>"computer science",
1425
- "subjectScheme"=>"dewey",
1426
- "schemeUri"=>"http://dewey.info/",
1427
- "lang"=>"en-US",
1428
- "classificationCode"=>"000"
1429
- }]
1430
- )
1431
- expect(subject.related_identifiers.length).to eq(2)
1432
- expect(subject.related_identifiers.last).to eq(
1433
- "relatedIdentifier"=>"arXiv:0706.0001",
1434
- "relatedIdentifierType"=>"arXiv",
1435
- "relationType"=>"IsReviewedBy",
1436
- "resourceTypeGeneral"=>"Text"
1437
- )
1438
- expect(subject.rights_list).to eq([
1439
- {
1440
- "lang"=>"en-US",
1441
- "rights"=>"Creative Commons Zero v1.0 Universal",
1442
- "rightsIdentifier"=>"cc0-1.0",
1443
- "rightsIdentifierScheme"=>"SPDX",
1444
- "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
1445
- "schemeUri"=>"https://spdx.org/licenses/"
1446
- }
1447
- ])
1448
- expect(subject.publisher).to eq("DataCite")
1449
- expect(subject.agency).to eq("datacite")
1450
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1451
- expect(subject.related_items.last).to eq(
1452
- {
1453
- "relatedItemType"=>"Journal",
1454
- "relationType"=>"IsPublishedIn",
1455
- "relatedItemIdentifier"=>
1456
- {
1457
- "relatedItemIdentifier"=>"10.1016/j.physletb.2017.11.044",
1458
- "relatedItemIdentifierType"=>"DOI",
1459
- },
1460
- "titles"=>
1461
- [
1462
- {"title"=>"Physics letters / B"},
1463
- ],
1464
- "volume"=>"776",
1465
- "firstPage"=>"249",
1466
- "lastPage"=>"264",
1467
- "publicationYear"=>"2018",
1468
- "contributors"=>[],
1469
- "creators"=>[],
1470
- }
1471
- )
1472
- end
1473
-
1474
- it "Schema 4.4 related items from string" do
1475
- input = fixture_path + "datacite-example-relateditems.xml"
1476
- subject = Bolognese::Metadata.new(input: input)
1477
- expect(subject.valid?).to be true
1478
-
1479
- expect(subject.related_items.last).to eq(
1480
- {
1481
- "relatedItemType"=>"Journal",
1482
- "relationType"=>"IsPublishedIn",
1483
- "relatedItemIdentifier"=>
1484
- {
1485
- "relatedItemIdentifier"=>"10.5072/john-smiths-1234",
1486
- "relatedItemIdentifierType"=>"DOI",
1487
- "relatedMetadataScheme"=>"citeproc+json",
1488
- "schemeURI"=>"https://github.com/citation-style-language/schema/raw/master/csl-data.json",
1489
- "schemeType"=>"URL"
1490
- },
1491
- "creators" =>
1492
- [
1493
- {"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
1494
- ],
1495
- "titles"=>
1496
- [
1497
- {"title"=>"Understanding the fictional John Smith"},
1498
- {"title"=>"A detailed look", "titleType"=>"Subtitle"}
1499
- ],
1500
- "volume"=>"776",
1501
- "issue"=>"1",
1502
- "number"=>"1",
1503
- "numberType"=>"Chapter",
1504
- "firstPage"=>"50",
1505
- "lastPage"=>"60",
1506
- "publisher"=>"Example Inc",
1507
- "publicationYear"=>"1776",
1508
- "edition"=>"1",
1509
- "contributors"=>
1510
- [
1511
- {"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
1512
- ]
1513
- }
1514
- )
1515
- end
1516
-
1517
-
1518
- it "Schema 4.4 related items from string minus relatedIdentifier" do
1519
- input = fixture_path + "datacite-example-relateditems.xml"
1520
-
1521
- # Remove relatedItemIdentifier from raw input
1522
- @doc = File.open(input) { |f| Nokogiri::XML(f) }
1523
- @doc.xpath("//xmlns:relatedItemIdentifier").each {|x| x.remove}
1524
-
1525
- subject = Bolognese::Metadata.new(input: @doc.to_s)
1526
- expect(subject.valid?).to be true
1527
-
1528
- expect(subject.related_items.last).to eq(
1529
- {
1530
- "relatedItemType"=>"Journal",
1531
- "relationType"=>"IsPublishedIn",
1532
- "creators" =>
1533
- [
1534
- {"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
1535
- ],
1536
- "titles"=>
1537
- [
1538
- {"title"=>"Understanding the fictional John Smith"},
1539
- {"title"=>"A detailed look", "titleType"=>"Subtitle"}
1540
- ],
1541
- "volume"=>"776",
1542
- "issue"=>"1",
1543
- "number"=>"1",
1544
- "numberType"=>"Chapter",
1545
- "firstPage"=>"50",
1546
- "lastPage"=>"60",
1547
- "publisher"=>"Example Inc",
1548
- "publicationYear"=>"1776",
1549
- "edition"=>"1",
1550
- "contributors"=>
1551
- [
1552
- {"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
1553
- ]
1554
- }
1555
- )
1556
- end
1557
-
1558
- it "Schema 4.4 related items from string with attributes" do
1559
- input = fixture_path + "datacite-example-relateditems-with-attributes.xml"
1560
- subject = Bolognese::Metadata.new(input: input)
1561
- expect(subject.valid?).to be true
1562
-
1563
- expect(subject.related_items.last).to eq(
1564
- {
1565
- "relatedItemType"=>"Journal",
1566
- "relationType"=>"IsPublishedIn",
1567
- "relatedItemIdentifier"=>
1568
- {
1569
- "relatedItemIdentifier"=>"10.5072/john-smiths-1234",
1570
- "relatedItemIdentifierType"=>"DOI",
1571
- "relatedMetadataScheme"=>"citeproc+json",
1572
- "schemeURI"=>"https://github.com/citation-style-language/schema/raw/master/csl-data.json",
1573
- "schemeType"=>"URL"
1574
- },
1575
- "creators" =>
1576
- [
1577
- {"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
1578
- ],
1579
- "titles"=>
1580
- [
1581
- {"title"=>"Understanding the fictional John Smith"},
1582
- {"title"=>"A detailed look", "titleType"=>"Subtitle"}
1583
- ],
1584
- "volume"=>"776",
1585
- "issue"=>"1",
1586
- "number"=>"1",
1587
- "numberType"=>"Chapter",
1588
- "firstPage"=>"50",
1589
- "lastPage"=>"60",
1590
- "publisher"=>"Example Inc",
1591
- "publicationYear"=>"1776",
1592
- "edition"=>"1",
1593
- "contributors"=>
1594
- [
1595
- {"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
1596
- ]
1597
- }
1598
- )
1599
- end
1600
-
1601
- it "Schema 4.4 dissertation from string" do
1602
- input = fixture_path + "datacite-example-dissertation-v4.4.xml"
1603
- subject = Bolognese::Metadata.new(input: input)
1604
- expect(subject.valid?).to be true
1605
- expect(subject.types["resourceType"]).to eq(nil)
1606
- expect(subject.types["resourceTypeGeneral"]).to eq("Dissertation")
1607
- expect(subject.types["schemaOrg"]).to eq("Thesis")
1608
- expect(subject.types["ris"]).to eq("THES")
1609
- expect(subject.types["citeproc"]).to eq("thesis")
1610
- expect(subject.creators).to eq(
1611
- [
1612
- {
1613
- "name"=>"Luo, R",
1614
- "familyName"=>"Luo",
1615
- "givenName"=>"R",
1616
- "nameIdentifiers"=>[],
1617
- "affiliation"=>[],
1618
- "nameType" => "Personal"
1619
- },
1620
- {
1621
- "name"=>"Liu, B",
1622
- "familyName"=>"Liu",
1623
- "givenName"=>"B",
1624
- "nameIdentifiers"=>[],
1625
- "affiliation"=>[],
1626
- "nameType" => "Personal"
1627
- },
1628
- {
1629
- "name"=>"Xie, Y",
1630
- "familyName"=>"Xie",
1631
- "givenName"=>"Y",
1632
- "nameIdentifiers"=>[],
1633
- "affiliation"=>[],
1634
- "nameType" => "Personal"
1635
- },
1636
- {
1637
- "name"=>"Li, Z",
1638
- "familyName"=>"Li",
1639
- "givenName"=>"Z",
1640
- "nameIdentifiers"=>[],
1641
- "affiliation"=>[],
1642
- "nameType" => "Personal"
1643
- }
1644
- ]
1645
- )
1646
- expect(subject.titles).to eq(
1647
- [
1648
- {"title"=>"Software and supporting material for \"SOAPdenovo2: An empirically improved memory-efficient short read de novo assembly\"", "lang"=>"en"},
1649
- ]
1650
- )
1651
- expect(subject.dates).to eq(
1652
- [
1653
- {"date"=>"2012-12-13", "dateType"=>"Available"},
1654
- {"date"=>"2012", "dateType"=>"Issued"}
1655
- ]
1656
- )
1657
- expect(subject.publication_year).to eq("2012")
1658
- expect(subject.subjects).to eq(
1659
- [
1660
- {
1661
- "subject"=>"DNA (Genetics)",
1662
- "lang"=>"en"
1663
- },
1664
- {
1665
- "subject"=>"Computer Program",
1666
- "lang"=>"en"
1667
- }
1668
- ]
1669
- )
1670
- expect(subject.related_identifiers).to eq(
1671
- [
1672
- {"relatedIdentifier"=>"10.5072/2047-217x-1-1", "relatedIdentifierType"=>"DOI", "relationType"=>"IsReferencedBy"},
1673
- {"relatedIdentifier"=>"10.5072/100038", "relatedIdentifierType"=>"DOI", "relationType"=>"Compiles"}
1674
- ]
1675
- )
1676
- expect(subject.rights_list).to eq([
1677
- {
1678
- "lang"=>"en-US",
1679
- "rights"=>"Creative Commons Zero v1.0 Universal",
1680
- "rightsIdentifier"=>"cc0-1.0",
1681
- "rightsIdentifierScheme"=>"SPDX",
1682
- "rightsUri"=>"https://creativecommons.org/publicdomain/zero/1.0/legalcode",
1683
- "schemeUri"=>"https://spdx.org/licenses/"
1684
- }
1685
- ])
1686
- expect(subject.publisher).to eq("GigaScience Database")
1687
- expect(subject.agency).to eq("datacite")
1688
- expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1689
- end
1690
-
1691
-
1692
- it "Parsing xs-string attribute correctly" do
1693
- input = fixture_path + "datacite-example-xs-string.xml"
1694
- subject = Bolognese::Metadata.new(input: input)
1695
- expect(subject.valid?).to be true
1696
- expect(subject.id).to eq("https://doi.org/10.4225/13/511c71f8612c3")
1697
- expect(subject.sizes.first).to eq("1.7 GB")
1698
- expect(subject.formats.first).to eq("application/xml")
1699
- end
1700
-
1701
- it "Parsing multiple geolocationpolygon elements" do
1702
- input = fixture_path + "datacite-geolocationpolygons-multiple.xml"
1703
- subject = Bolognese::Metadata.new(input: input)
1704
- expect(subject.valid?).to be true
1705
- expect(subject.id).to eq("https://doi.org/10.5072/multiplegeopolygons")
1706
- expect(subject.geo_locations).to eq([
1707
- { "geoLocationPolygon"=> [
1708
- [ {"polygonPoint"=>{"pointLatitude"=>"71", "pointLongitude"=>"41"}},
1709
- {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"45"}},
1710
- {"polygonPoint"=>{"pointLatitude"=>"85", "pointLongitude"=>"55"}},
1711
- {"polygonPoint"=>{"pointLatitude"=>"71", "pointLongitude"=>"41"}}],
1712
- [
1713
- {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}},
1714
- {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"55"}},
1715
- {"polygonPoint"=>{"pointLatitude"=>"73", "pointLongitude"=>"45"}},
1716
- {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}}
1717
- ]
1718
- ] },
1719
- { "geoLocationPolygon"=>
1720
- [
1721
- {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}},
1722
- {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"55"}},
1723
- {"polygonPoint"=>{"pointLatitude"=>"73", "pointLongitude"=>"45"}},
1724
- {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}}
1725
- ]
1726
- }
1727
- ]
1728
- )
1729
- end
1730
-
1731
- end