bolognese 2.3.7 → 2.3.9

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