bolognese 1.3.1 → 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 (527) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +9 -0
  3. data/.github/workflows/changelog.yml +36 -0
  4. data/.github/workflows/ci.yml +22 -0
  5. data/.github/workflows/pull-request.yml +9 -0
  6. data/.github/workflows/release.yml +32 -0
  7. data/.gitignore +3 -0
  8. data/.rubocop.yml +658 -0
  9. data/CHANGELOG.md +1864 -0
  10. data/Gemfile.lock +163 -129
  11. data/README.md +3 -2
  12. data/bolognese.gemspec +22 -20
  13. data/lib/bolognese/author_utils.rb +49 -25
  14. data/lib/bolognese/cli.rb +6 -4
  15. data/lib/bolognese/datacite_utils.rb +143 -17
  16. data/lib/bolognese/doi_utils.rb +14 -9
  17. data/lib/bolognese/metadata.rb +27 -19
  18. data/lib/bolognese/metadata_utils.rb +25 -6
  19. data/lib/bolognese/readers/bibtex_reader.rb +29 -34
  20. data/lib/bolognese/readers/citeproc_reader.rb +27 -35
  21. data/lib/bolognese/readers/codemeta_reader.rb +12 -13
  22. data/lib/bolognese/readers/crosscite_reader.rb +4 -1
  23. data/lib/bolognese/readers/crossref_reader.rb +163 -67
  24. data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
  25. data/lib/bolognese/readers/datacite_reader.rb +150 -38
  26. data/lib/bolognese/readers/npm_reader.rb +115 -0
  27. data/lib/bolognese/readers/ris_reader.rb +10 -14
  28. data/lib/bolognese/readers/schema_org_reader.rb +58 -25
  29. data/lib/bolognese/utils.rb +502 -63
  30. data/lib/bolognese/version.rb +1 -1
  31. data/lib/bolognese/writers/bibtex_writer.rb +4 -3
  32. data/lib/bolognese/writers/codemeta_writer.rb +6 -5
  33. data/lib/bolognese/writers/csv_writer.rb +1 -1
  34. data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
  35. data/lib/bolognese/writers/jats_writer.rb +9 -4
  36. data/lib/bolognese/writers/ris_writer.rb +2 -2
  37. data/lib/bolognese/writers/schema_org_writer.rb +11 -7
  38. data/lib/bolognese.rb +2 -1
  39. data/package.json +12 -0
  40. data/resources/kernel-4/include/datacite-contributorType-v4.xsd +24 -22
  41. data/resources/kernel-4/include/datacite-dateType-v4.xsd +14 -12
  42. data/resources/kernel-4/include/datacite-descriptionType-v4.xsd +6 -6
  43. data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +5 -5
  44. data/resources/kernel-4/include/datacite-nameType-v4.xsd +2 -2
  45. data/resources/kernel-4/include/datacite-numberType-v4.xsd +12 -0
  46. data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +24 -21
  47. data/resources/kernel-4/include/datacite-relationType-v4.xsd +43 -35
  48. data/resources/kernel-4/include/datacite-resourceType-v4.xsd +38 -17
  49. data/resources/kernel-4/include/datacite-titleType-v4.xsd +5 -5
  50. data/resources/kernel-4/metadata.xsd +349 -146
  51. data/resources/kernel-4.3/metadata.xsd +39 -8
  52. data/resources/kernel-4.4/include/datacite-contributorType-v4.xsd +35 -0
  53. data/resources/kernel-4.4/include/datacite-dateType-v4.xsd +25 -0
  54. data/resources/kernel-4.4/include/datacite-descriptionType-v4.xsd +19 -0
  55. data/resources/kernel-4.4/include/datacite-funderIdentifierType-v4.xsd +16 -0
  56. data/resources/kernel-4.4/include/datacite-nameType-v4.xsd +10 -0
  57. data/resources/kernel-4.4/include/datacite-numberType-v4.xsd +12 -0
  58. data/resources/kernel-4.4/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  59. data/resources/kernel-4.4/include/datacite-relationType-v4.xsd +51 -0
  60. data/resources/kernel-4.4/include/datacite-resourceType-v4.xsd +43 -0
  61. data/resources/kernel-4.4/include/datacite-titleType-v4.xsd +14 -0
  62. data/resources/kernel-4.4/include/xml.xsd +286 -0
  63. data/resources/kernel-4.4/metadata.xsd +707 -0
  64. data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
  65. data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
  66. data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
  67. data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
  68. data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
  69. data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
  70. data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  71. data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
  72. data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
  73. data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
  74. data/resources/kernel-4.5/include/xml.xsd +286 -0
  75. data/resources/kernel-4.5/metadata.xsd +711 -0
  76. data/resources/kernel-4.6/include/datacite-contributorType-v4.xsd +37 -0
  77. data/resources/kernel-4.6/include/datacite-dateType-v4.xsd +27 -0
  78. data/resources/kernel-4.6/include/datacite-descriptionType-v4.xsd +19 -0
  79. data/resources/kernel-4.6/include/datacite-funderIdentifierType-v4.xsd +16 -0
  80. data/resources/kernel-4.6/include/datacite-nameType-v4.xsd +10 -0
  81. data/resources/kernel-4.6/include/datacite-numberType-v4.xsd +12 -0
  82. data/resources/kernel-4.6/include/datacite-relatedIdentifierType-v4.xsd +37 -0
  83. data/resources/kernel-4.6/include/datacite-relationType-v4.xsd +57 -0
  84. data/resources/kernel-4.6/include/datacite-resourceType-v4.xsd +49 -0
  85. data/resources/kernel-4.6/include/datacite-titleType-v4.xsd +14 -0
  86. data/resources/kernel-4.6/include/xml.xsd +286 -0
  87. data/resources/kernel-4.6/metadata.xsd +712 -0
  88. data/resources/oecd/dfg-mappings.json +1866 -0
  89. data/resources/oecd/for-mappings.json +1101 -0
  90. data/resources/oecd/fos-mappings.json +198 -0
  91. data/resources/schema_org/jsonldcontext.json +1069 -232
  92. data/resources/spdx/licenses.json +5297 -0
  93. metadata +160 -510
  94. data/.travis.yml +0 -33
  95. data/spec/array_spec.rb +0 -22
  96. data/spec/author_utils_spec.rb +0 -188
  97. data/spec/cli_spec.rb +0 -219
  98. data/spec/datacite_utils_spec.rb +0 -148
  99. data/spec/doi_utils_spec.rb +0 -302
  100. data/spec/find_from_format_spec.rb +0 -98
  101. data/spec/fixtures/aida.json +0 -82
  102. data/spec/fixtures/citeproc-no-author.json +0 -26
  103. data/spec/fixtures/citeproc-no-categories.json +0 -21
  104. data/spec/fixtures/citeproc.json +0 -30
  105. data/spec/fixtures/codemeta.json +0 -86
  106. data/spec/fixtures/codemeta_v2.json +0 -86
  107. data/spec/fixtures/crosscite.json +0 -63
  108. data/spec/fixtures/crossref.bib +0 -14
  109. data/spec/fixtures/crossref.ris +0 -15
  110. data/spec/fixtures/crossref.xml +0 -606
  111. data/spec/fixtures/datacite-example-affiliation.xml +0 -114
  112. data/spec/fixtures/datacite-example-complicated-v3.0.xml +0 -48
  113. data/spec/fixtures/datacite-example-complicated-v4.0.xml +0 -54
  114. data/spec/fixtures/datacite-example-complicated-v4.1.xml +0 -57
  115. data/spec/fixtures/datacite-example-geolocation-2.xml +0 -141
  116. data/spec/fixtures/datacite-example-geolocation.xml +0 -66
  117. data/spec/fixtures/datacite-example-polygon-v4.1.xml +0 -163
  118. data/spec/fixtures/datacite-geolocation-empty.xml +0 -159
  119. data/spec/fixtures/datacite-metadata-sample-complicated-v2.2.xml +0 -52
  120. data/spec/fixtures/datacite-multiple-language.xml +0 -38
  121. data/spec/fixtures/datacite-multiple-rights.xml +0 -59
  122. data/spec/fixtures/datacite-seriesinformation.xml +0 -41
  123. data/spec/fixtures/datacite-xml-lang.xml +0 -51
  124. data/spec/fixtures/datacite.json +0 -83
  125. data/spec/fixtures/datacite.xml +0 -40
  126. data/spec/fixtures/datacite_dataset.xml +0 -58
  127. data/spec/fixtures/datacite_malformed_creator.xml +0 -52
  128. data/spec/fixtures/datacite_missing_creator.xml +0 -33
  129. data/spec/fixtures/datacite_schema_3.xml +0 -58
  130. data/spec/fixtures/datacite_software.json +0 -21
  131. data/spec/fixtures/datacite_software_missing_comma.json +0 -18
  132. data/spec/fixtures/datacite_software_overlapping_keys.json +0 -18
  133. data/spec/fixtures/funding_reference.xml +0 -53
  134. data/spec/fixtures/gtex.xml +0 -71
  135. data/spec/fixtures/maremma/codemeta.json +0 -36
  136. data/spec/fixtures/nist.xml +0 -35
  137. data/spec/fixtures/ns0.xml +0 -2
  138. data/spec/fixtures/pure.bib +0 -14
  139. data/spec/fixtures/pure.ris +0 -15
  140. data/spec/fixtures/ris_bug.ris +0 -9
  141. data/spec/fixtures/schema_4.0.xml +0 -140
  142. data/spec/fixtures/schema_org.json +0 -44
  143. data/spec/fixtures/schema_org_geolocation.json +0 -82
  144. data/spec/fixtures/schema_org_geoshape.json +0 -550
  145. data/spec/fixtures/schema_org_gtex.json +0 -76
  146. data/spec/fixtures/schema_org_list.json +0 -12628
  147. data/spec/fixtures/schema_org_tdl_iodp_invalid_authors.json +0 -25
  148. data/spec/fixtures/schema_org_topmed.json +0 -54
  149. data/spec/fixtures/schema_org_type_as_array.json +0 -41
  150. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml +0 -95
  151. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +0 -95
  152. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_citation.yml +0 -95
  153. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +0 -95
  154. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +0 -95
  155. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_jats.yml +0 -95
  156. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +0 -95
  157. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +0 -93
  158. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +0 -93
  159. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_citation.yml +0 -93
  160. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +0 -93
  161. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +0 -93
  162. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_jats.yml +0 -93
  163. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +0 -93
  164. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +0 -111
  165. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_bibtex.yml +0 -111
  166. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +0 -111
  167. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +0 -111
  168. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/crossref.yml +0 -47
  169. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/datacite.yml +0 -47
  170. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/jalc.yml +0 -47
  171. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/kisti.yml +0 -47
  172. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/medra.yml +0 -47
  173. data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/op.yml +0 -47
  174. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/author.yml +0 -44
  175. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/no_author.yml +0 -44
  176. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +0 -44
  177. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +0 -44
  178. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_state.yml +0 -93
  179. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_title.yml +0 -93
  180. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_description.yml +0 -51
  181. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license.yml +0 -51
  182. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +0 -51
  183. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +0 -51
  184. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_state.yml +0 -51
  185. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +0 -51
  186. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +0 -51
  187. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi.yml +0 -44
  188. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi_with_protocol.yml +0 -44
  189. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/dx_doi_org_url.yml +0 -44
  190. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/force_test_resolver.yml +0 -44
  191. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/https_url.yml +0 -44
  192. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver.yml +0 -44
  193. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver_http.yml +0 -44
  194. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +0 -44
  195. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi_with_special_characters.yml +0 -44
  196. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +0 -44
  197. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/sandbox_url.yml +0 -44
  198. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +0 -44
  199. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +0 -88
  200. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +0 -88
  201. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/jalc.yml +0 -88
  202. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/kisti.yml +0 -88
  203. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +0 -88
  204. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +0 -44
  205. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +0 -88
  206. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/op.yml +0 -88
  207. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi.yml +0 -44
  208. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi_with_protocol.yml +0 -44
  209. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/dx_doi_org_url.yml +0 -44
  210. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/force_test_resolver.yml +0 -44
  211. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/https_url.yml +0 -44
  212. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver.yml +0 -44
  213. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver_http.yml +0 -44
  214. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +0 -143
  215. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +0 -143
  216. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +0 -143
  217. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +0 -143
  218. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +0 -99
  219. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +0 -99
  220. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/schema_org.yml +0 -99
  221. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +0 -143
  222. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +0 -99
  223. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +0 -99
  224. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/codemeta.yml +0 -99
  225. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crosscite.yml +0 -99
  226. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +0 -99
  227. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +0 -99
  228. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +0 -99
  229. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +0 -99
  230. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +0 -99
  231. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml +0 -99
  232. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml +0 -44
  233. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/maremma.yml +0 -73
  234. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/metadata_reports.yml +0 -94
  235. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +0 -92
  236. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +0 -91
  237. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +0 -95
  238. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/JaLC.yml +0 -126
  239. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/KISTI.yml +0 -147
  240. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/OP.yml +0 -89
  241. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +0 -127
  242. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book_chapter.yml +0 -89
  243. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml +0 -88
  244. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml +0 -159
  245. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml +0 -109
  246. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml +0 -119
  247. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml +0 -129
  248. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml +0 -90
  249. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/error_unknown.yml +0 -88
  250. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/jj.yml +0 -87
  251. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article.yml +0 -89
  252. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +0 -87
  253. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with.yml +0 -93
  254. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_funding.yml +0 -89
  255. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_issue.yml +0 -116
  256. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/mEDRA.yml +0 -125
  257. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/markup.yml +0 -92
  258. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/missing_creator.yml +0 -89
  259. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_t.yml +0 -47
  260. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml +0 -87
  261. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +0 -86
  262. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +0 -88
  263. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml +0 -91
  264. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml +0 -87
  265. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +0 -88
  266. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +0 -99
  267. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml +0 -100
  268. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system_schema_3.yml +0 -95
  269. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +0 -110
  270. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_not_found.yml +0 -89
  271. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +0 -93
  272. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding.yml +0 -93
  273. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +0 -93
  274. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +0 -93
  275. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Referee_report_in_test_system.yml +0 -97
  276. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml +0 -93
  277. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +0 -93
  278. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +0 -93
  279. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/content_url.yml +0 -101
  280. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml +0 -106
  281. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml +0 -93
  282. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml +0 -97
  283. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +0 -95
  284. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +0 -119
  285. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +0 -93
  286. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml +0 -108
  287. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +0 -121
  288. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +0 -102
  289. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml +0 -119
  290. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/series-information.yml +0 -93
  291. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme.yml +0 -93
  292. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/xs_string_attributes.yml +0 -93
  293. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date/publication_date.yml +0 -44
  294. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml +0 -44
  295. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +0 -44
  296. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +0 -44
  297. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/date.yml +0 -44
  298. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year-month.yml +0 -44
  299. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year.yml +0 -44
  300. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +0 -44
  301. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +0 -44
  302. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +0 -44
  303. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_familyName.yml +0 -55
  304. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_Thai.yml +0 -49
  305. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +0 -75
  306. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +0 -49
  307. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +0 -49
  308. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +0 -1222
  309. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +0 -44
  310. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +0 -58
  311. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_name_identifier.yml +0 -49
  312. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation.yml +0 -49
  313. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation_and_country.yml +0 -75
  314. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_role.yml +0 -49
  315. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/only_familyName_and_givenName.yml +0 -49
  316. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting.yml +0 -111
  317. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +0 -111
  318. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse.yml +0 -37
  319. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse_via_identifiers_org.yml +0 -156
  320. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/ornl.yml +0 -704
  321. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/pangaea.yml +0 -49
  322. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/zenodo.yml +0 -580
  323. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/only_title.yml +0 -44
  324. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_and_pages.yml +0 -44
  325. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_and_pages.yml +0 -44
  326. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_issue_and_pages.yml +0 -44
  327. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_as_codemeta_url.yml +0 -44
  328. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url.yml +0 -44
  329. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url_file.yml +0 -44
  330. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +0 -47
  331. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/unknown_DOI_prefix.yml +0 -47
  332. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_alternate_identifiers/insert.yml +0 -49
  333. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +0 -49
  334. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +0 -49
  335. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml +0 -55
  336. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml +0 -49
  337. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +0 -49
  338. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +0 -49
  339. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +0 -49
  340. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +0 -49
  341. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +0 -49
  342. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +0 -49
  343. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +0 -49
  344. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +0 -49
  345. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +0 -49
  346. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +0 -49
  347. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +0 -44
  348. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_family_name.yml +0 -44
  349. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +0 -44
  350. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_known_given_name.yml +0 -44
  351. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_no_info.yml +0 -44
  352. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_orcid_id.yml +0 -44
  353. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +0 -44
  354. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +0 -99
  355. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +0 -99
  356. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +0 -99
  357. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +0 -99
  358. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml +0 -44
  359. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +0 -44
  360. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +0 -44
  361. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +0 -44
  362. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +0 -44
  363. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +0 -44
  364. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +0 -44
  365. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_with_protocol.yml +0 -44
  366. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +0 -44
  367. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +0 -44
  368. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +0 -44
  369. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +0 -44
  370. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +0 -44
  371. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +0 -44
  372. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +0 -44
  373. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +0 -44
  374. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_options.yml +0 -44
  375. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_url.yml +0 -44
  376. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +0 -44
  377. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url.yml +0 -44
  378. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +0 -44
  379. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +0 -44
  380. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +0 -44
  381. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_array.yml +0 -44
  382. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml +0 -44
  383. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml +0 -44
  384. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml +0 -44
  385. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml +0 -44
  386. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml +0 -44
  387. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +0 -44
  388. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml +0 -44
  389. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml +0 -44
  390. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/hash.yml +0 -44
  391. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +0 -44
  392. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +0 -44
  393. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +0 -44
  394. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +0 -44
  395. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +0 -44
  396. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml +0 -44
  397. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml +0 -44
  398. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml +0 -44
  399. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +0 -44
  400. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/non-funder_doi.yml +0 -44
  401. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml +0 -44
  402. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +0 -44
  403. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml +0 -44
  404. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml +0 -44
  405. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml +0 -44
  406. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +0 -44
  407. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +0 -44
  408. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +0 -44
  409. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +0 -44
  410. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +0 -44
  411. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi.yml +0 -44
  412. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_as_url.yml +0 -44
  413. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_with_protocol.yml +0 -44
  414. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/only_prefix.yml +0 -44
  415. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +0 -44
  416. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +0 -44
  417. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +0 -44
  418. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +0 -44
  419. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/BlogPosting.yml +0 -55
  420. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/Dataset.yml +0 -49
  421. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +0 -75
  422. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/climate_data.yml +0 -52
  423. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml +0 -111
  424. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +0 -119
  425. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/maremma.yml +0 -73
  426. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/text.yml +0 -49
  427. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +0 -51
  428. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_pages.yml +0 -48
  429. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml +0 -49
  430. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml +0 -51
  431. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml +0 -45
  432. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml +0 -55
  433. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +0 -109
  434. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +0 -49
  435. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/container_title.yml +0 -49
  436. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/journal_article.yml +0 -51
  437. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +0 -119
  438. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/maremma.yml +0 -73
  439. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/missing_creator.yml +0 -45
  440. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +0 -49
  441. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software.yml +0 -49
  442. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_first_page.yml +0 -46
  443. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +0 -46
  444. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_pages.yml +0 -48
  445. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +0 -54
  446. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +0 -54
  447. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +0 -49
  448. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/maremma.yml +0 -73
  449. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +0 -48
  450. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +0 -51
  451. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml +0 -111
  452. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml +0 -49
  453. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/climate_data.yml +0 -52
  454. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/maremma.yml +0 -73
  455. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/text.yml +0 -49
  456. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_data_citation.yml +0 -51
  457. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_pages.yml +0 -48
  458. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +0 -73
  459. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +0 -48
  460. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +0 -51
  461. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +0 -111
  462. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +0 -45
  463. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +0 -49
  464. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +0 -81
  465. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +0 -81
  466. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/maremma.yml +0 -73
  467. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +0 -48
  468. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +0 -51
  469. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +0 -111
  470. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +0 -45
  471. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +0 -49
  472. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +0 -81
  473. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml +0 -84
  474. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/maremma.yml +0 -73
  475. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +0 -48
  476. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +0 -51
  477. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml +0 -111
  478. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml +0 -45
  479. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml +0 -55
  480. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +0 -111
  481. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +0 -49
  482. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/alternate_name.yml +0 -49
  483. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/journal_article.yml +0 -51
  484. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +0 -119
  485. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +0 -73
  486. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/with_pages.yml +0 -48
  487. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +0 -49
  488. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +0 -75
  489. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +0 -75
  490. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +0 -49
  491. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +0 -49
  492. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +0 -57
  493. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/data_catalog.yml +0 -62
  494. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/geo_location_box.yml +0 -98
  495. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml +0 -51
  496. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +0 -73
  497. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/series_information.yml +0 -49
  498. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme.yml +0 -49
  499. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +0 -119
  500. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml +0 -49
  501. data/spec/fixtures/vivli.xml +0 -1
  502. data/spec/metadata_spec.rb +0 -165
  503. data/spec/readers/bibtex_reader_spec.rb +0 -59
  504. data/spec/readers/citeproc_reader_spec.rb +0 -61
  505. data/spec/readers/codemeta_reader_spec.rb +0 -117
  506. data/spec/readers/crosscite_reader_spec.rb +0 -41
  507. data/spec/readers/crossref_reader_spec.rb +0 -509
  508. data/spec/readers/datacite_json_reader_spec.rb +0 -61
  509. data/spec/readers/datacite_reader_spec.rb +0 -1041
  510. data/spec/readers/ris_reader_spec.rb +0 -73
  511. data/spec/readers/schema_org_reader_spec.rb +0 -325
  512. data/spec/spec_helper.rb +0 -94
  513. data/spec/utils_spec.rb +0 -417
  514. data/spec/writers/bibtex_writer_spec.rb +0 -163
  515. data/spec/writers/citation_writer_spec.rb +0 -35
  516. data/spec/writers/citeproc_writer_spec.rb +0 -223
  517. data/spec/writers/codemeta_writer_spec.rb +0 -46
  518. data/spec/writers/crosscite_writer_spec.rb +0 -118
  519. data/spec/writers/crossref_writer_spec.rb +0 -21
  520. data/spec/writers/csv_writer_spec.rb +0 -93
  521. data/spec/writers/datacite_json_writer_spec.rb +0 -86
  522. data/spec/writers/datacite_writer_spec.rb +0 -366
  523. data/spec/writers/jats_writer_spec.rb +0 -179
  524. data/spec/writers/rdf_xml_writer_spec.rb +0 -100
  525. data/spec/writers/ris_writer_spec.rb +0 -203
  526. data/spec/writers/schema_org_writer_spec.rb +0 -322
  527. data/spec/writers/turtle_writer_spec.rb +0 -84
@@ -7,7 +7,7 @@ module Bolognese
7
7
  return { "string" => nil, "state" => "not_found" } unless id.present?
8
8
 
9
9
  api_url = doi_api_url(id, options)
10
- response = Maremma.get api_url
10
+ response = Maremma.get(api_url)
11
11
  attributes = response.body.dig("data", "attributes")
12
12
  return { "string" => nil, "state" => "not_found" } unless attributes.present?
13
13
 
@@ -74,14 +74,12 @@ module Bolognese
74
74
  id = normalize_doi(meta.dig("identifier", "__content__") || options[:id], sandbox: options[:sandbox])
75
75
  end
76
76
 
77
- identifiers = [{ "identifierType" => "DOI", "identifier" => id }] + Array.wrap(meta.dig("alternateIdentifiers", "alternateIdentifier")).map do |r|
77
+ identifiers = Array.wrap(meta.dig("alternateIdentifiers", "alternateIdentifier")).map do |r|
78
78
  if r["__content__"].present?
79
79
  { "identifierType" => get_identifier_type(r["alternateIdentifierType"]), "identifier" => r["__content__"] }
80
80
  end
81
81
  end.compact
82
82
 
83
- doi = Array.wrap(identifiers).find { |r| r["identifierType"] == "DOI" }.to_h.fetch("identifier", nil)
84
-
85
83
  resource_type_general = meta.dig("resourceType", "resourceTypeGeneral")
86
84
  resource_type = meta.dig("resourceType", "__content__")
87
85
  schema_org = Bolognese::Utils::CR_TO_SO_TRANSLATIONS[resource_type.to_s.underscore.camelcase] || Bolognese::Utils::DC_TO_SO_TRANSLATIONS[resource_type_general.to_s.dasherize] || "CreativeWork"
@@ -93,75 +91,115 @@ module Bolognese
93
91
  "bibtex" => Bolognese::Utils::CR_TO_BIB_TRANSLATIONS[resource_type.to_s.underscore.camelcase] || Bolognese::Utils::SO_TO_BIB_TRANSLATIONS[schema_org] || "misc",
94
92
  "ris" => Bolognese::Utils::CR_TO_RIS_TRANSLATIONS[resource_type.to_s.underscore.camelcase] || Bolognese::Utils::DC_TO_RIS_TRANSLATIONS[resource_type_general.to_s.dasherize] || "GEN"
95
93
  }.compact
96
-
97
- titles = Array.wrap(meta.dig("titles", "title")).map do |r|
94
+
95
+ titles = get_titles(meta)
96
+
97
+ publisher = Array.wrap(meta.dig("publisher")).map do |r|
98
98
  if r.blank?
99
99
  nil
100
100
  elsif r.is_a?(String)
101
- { "title" => sanitize(r) }
102
- else
103
- { "title" => sanitize(r["__content__"]), "titleType" => r["titleType"], "lang" => r["lang"] }.compact
101
+ { "name" => r.strip }
102
+ elsif r.is_a?(Hash)
103
+ {
104
+ "name" => r["__content__"].present? ? r["__content__"].strip : nil,
105
+ "publisherIdentifier" => r["publisherIdentifierScheme"] == "ROR" ? normalize_ror(r["publisherIdentifier"]) : r["publisherIdentifier"],
106
+ "publisherIdentifierScheme" => r["publisherIdentifierScheme"],
107
+ "schemeUri" => r["schemeURI"],
108
+ "lang" => r["lang"],
109
+ }.compact
104
110
  end
105
- end.compact
111
+ end.compact.first
106
112
 
107
113
  descriptions = Array.wrap(meta.dig("descriptions", "description")).map do |r|
108
114
  if r.blank?
109
115
  nil
110
116
  elsif r.is_a?(String)
111
- { "description" => sanitize(r), "descriptionType" => "Abstract" }
117
+ { "description" => sanitize(r, new_line: true), "descriptionType" => "Abstract" }
112
118
  elsif r.is_a?(Hash)
113
- { "description" => sanitize(r["__content__"]), "descriptionType" => r["descriptionType"], "lang" => r["lang"] }.compact
119
+ { "description" => sanitize(r["__content__"], new_line: true), "descriptionType" => r["descriptionType"], "lang" => r["lang"] }.compact
114
120
  end
115
121
  end.compact
116
122
  rights_list = Array.wrap(meta.dig("rightsList", "rights")).map do |r|
117
123
  if r.blank?
118
124
  nil
119
125
  elsif r.is_a?(String)
120
- { "rights" => r }
126
+ name_to_spdx(r)
121
127
  elsif r.is_a?(Hash)
122
- { "rights" => r["__content__"], "rightsUri" => normalize_url(r["rightsURI"]), "lang" => r["lang"] }.compact
128
+ hsh_to_spdx(r)
129
+ end
130
+ end.compact
131
+
132
+ subjects = Array.wrap(meta.dig("subjects", "subject")).reduce([]) do |sum, subject|
133
+ if subject.is_a?(String)
134
+ sum += name_to_fos(subject)
135
+ elsif subject.is_a?(Hash)
136
+ sum += hsh_to_fos(subject)
137
+ end
138
+
139
+ sum
140
+ end.uniq
141
+
142
+ dates = Array.wrap(meta.dig("dates", "date")).map do |r|
143
+ if r.is_a?(Hash) && date = sanitize(r["__content__"]).presence
144
+ if Date.edtf(date).present? || Bolognese::Utils::UNKNOWN_INFORMATION.key?(date)
145
+ { "date" => date,
146
+ "dateType" => parse_attributes(r, content: "dateType"),
147
+ "dateInformation" => parse_attributes(r, content: "dateInformation")
148
+ }.compact
149
+ end
123
150
  end
124
151
  end.compact
125
- subjects = Array.wrap(meta.dig("subjects", "subject")).map do |k|
152
+ dates << { "date" => meta.fetch("publicationYear", nil), "dateType" => "Issued" } if meta.fetch("publicationYear", nil).present? && get_date(dates, "Issued").blank?
153
+ sizes = Array.wrap(meta.dig("sizes", "size")).map do |k|
126
154
  if k.blank?
127
155
  nil
128
156
  elsif k.is_a?(String)
129
- { "subject" => sanitize(k) }
130
- else
131
- { "subject" => sanitize(k["__content__"]), "subjectScheme" => k["subjectScheme"], "schemeUri" => k["schemeURI"], "valueUri" => k["valueURI"], "lang" => k["lang"] }.compact
157
+ sanitize(k).presence
158
+ elsif k.is_a?(Hash)
159
+ sanitize(k["__content__"]).presence
132
160
  end
133
161
  end.compact
134
- dates = Array.wrap(meta.dig("dates", "date")).map do |d|
135
- {
136
- "date" => parse_attributes(d),
137
- "dateType" => parse_attributes(d, content: "dateType"),
138
- "dateInformation" => parse_attributes(d, content: "dateInformation")
139
- }.compact
162
+ formats = Array.wrap(meta.dig("formats", "format")).map do |k|
163
+ if k.blank?
164
+ nil
165
+ elsif k.is_a?(String)
166
+ sanitize(k).presence
167
+ elsif k.is_a?(Hash)
168
+ sanitize(k["__content__"]).presence
169
+ end
140
170
  end.compact
141
- dates << { "date" => meta.fetch("publicationYear", nil), "dateType" => "Issued" } if meta.fetch("publicationYear", nil).present? && get_date(dates, "Issued").blank?
142
- sizes = Array.wrap(meta.dig("sizes", "size"))
143
- formats = Array.wrap(meta.dig("formats", "format"))
171
+ .map { |s| s.to_s.squish.presence }.compact
144
172
  funding_references = Array.wrap(meta.dig("fundingReferences", "fundingReference")).compact.map do |fr|
145
173
  scheme_uri = parse_attributes(fr["funderIdentifier"], content: "schemeURI")
146
174
  funder_identifier = parse_attributes(fr["funderIdentifier"])
147
- funder_identifier = !funder_identifier.to_s.start_with?("https://") && scheme_uri.present? ? normalize_id(scheme_uri + funder_identifier) : normalize_id(funder_identifier)
148
-
175
+ funder_identifier_type = parse_attributes(fr["funderIdentifier"], content: "funderIdentifierType")
176
+
177
+ if funder_identifier_type == "Crossref Funder ID"
178
+ funder_identifier = validate_funder_doi(funder_identifier)
179
+ elsif funder_identifier_type == "ROR"
180
+ funder_identifier = normalize_ror(funder_identifier)
181
+ scheme_uri = "https://ror.org"
182
+ else
183
+ funder_identifier = normalize_id(funder_identifier) ? normalize_id(funder_identifier) : funder_identifier
184
+ end
185
+
149
186
  {
150
187
  "funderName" => fr["funderName"],
151
188
  "funderIdentifier" => funder_identifier,
152
- "funderIdentifierType" => parse_attributes(fr["funderIdentifier"], content: "funderIdentifierType"),
189
+ "funderIdentifierType" => funder_identifier_type,
190
+ "schemeUri" => scheme_uri,
153
191
  "awardNumber" => parse_attributes(fr["awardNumber"]),
154
192
  "awardUri" => parse_attributes(fr["awardNumber"], content: "awardURI"),
155
193
  "awardTitle" => fr["awardTitle"] }.compact
156
194
  end
157
195
  related_identifiers = Array.wrap(meta.dig("relatedIdentifiers", "relatedIdentifier")).map do |ri|
158
196
  if ri["relatedIdentifierType"] == "DOI"
159
- rid = ri["__content__"].to_s.downcase
197
+ rid = validate_doi(ri["__content__"].to_s.downcase)
160
198
  else
161
199
  rid = ri["__content__"]
162
200
  end
163
201
 
164
- {
202
+ {
165
203
  "relatedIdentifier" => rid,
166
204
  "relatedIdentifierType" => ri["relatedIdentifierType"],
167
205
  "relationType" => ri["relationType"],
@@ -171,10 +209,68 @@ module Bolognese
171
209
  "schemeType" => ri["schemeType"]
172
210
  }.compact
173
211
  end
212
+
213
+ related_items = Array.wrap(meta.dig("relatedItems", "relatedItem")).map do |ri|
214
+
215
+ rii = ri["relatedItemIdentifier"]
216
+ relatedItemIdentifier = nil
217
+ if rii
218
+ if rii["relatedItemIdentifierType"] == "DOI"
219
+ rid = validate_doi(rii["__content__"].to_s.downcase)
220
+ else
221
+ rid = rii["__content__"]
222
+ end
223
+
224
+ relatedItemIdentifier = {
225
+ "relatedItemIdentifier" => rid,
226
+ "relatedItemIdentifierType" => rii["relatedItemIdentifierType"],
227
+ "relatedMetadataScheme" => rii["relatedMetadataScheme"],
228
+ "schemeURI" => rii["schemeURI"],
229
+ "schemeType" => rii["schemeType"]
230
+ }.compact
231
+ end
232
+
233
+ number = ri["number"]
234
+ if number.is_a?(String)
235
+ number = number
236
+ numberType = nil
237
+ else
238
+ number = ri.dig("number", "__content__")
239
+ numberType = ri.dig("number", "numberType")
240
+ end
241
+
242
+ a = {
243
+ "relationType" => ri["relationType"],
244
+ "relatedItemType" => ri["relatedItemType"],
245
+ "relatedItemIdentifier" => relatedItemIdentifier,
246
+ "creators" => get_authors(Array.wrap(ri.dig("creators", "creator"))),
247
+ "titles" => get_titles(ri),
248
+ "publicationYear" => ri["publicationYear"],
249
+ "volume" => parse_attributes(ri["volume"]),
250
+ "issue" => parse_attributes(ri["issue"]),
251
+ "number" => number,
252
+ "numberType" => numberType,
253
+ "firstPage" => parse_attributes(ri["firstPage"]),
254
+ "lastPage" => parse_attributes(ri["lastPage"]),
255
+ "publisher" => parse_attributes(ri["publisher"]),
256
+ "edition" => parse_attributes(ri["edition"]),
257
+ "contributors" => get_authors(Array.wrap(ri.dig("contributors", "contributor"))),
258
+ }.compact
259
+ end
260
+
174
261
  geo_locations = Array.wrap(meta.dig("geoLocations", "geoLocation")).map do |gl|
175
262
  if !gl.is_a?(Hash) || gl["geoLocationPoint"].is_a?(String) || gl["geoLocationBox"].is_a?(String) || gl["geoLocationPolygon"].is_a?(String)
176
263
  nil
177
264
  else
265
+ ## Array of geoLocationPolygons within a geoLocation is Unsupported in JSON.
266
+ if gl.dig("geoLocationPolygon").kind_of?(Array)
267
+ geoLocationPolygon = nil
268
+ else
269
+ geoLocationPolygon = Array.wrap(gl.dig("geoLocationPolygon", "polygonPoint")).map { |glp| { "polygonPoint" => glp } }
270
+ .push(Array.wrap(gl.dig("geoLocationPolygon", "inPolygonPoint")).map { |glp| { "inPolygonPoint" => glp } }.first)
271
+ .compact.presence
272
+ end
273
+
178
274
  {
179
275
  "geoLocationPoint" => {
180
276
  "pointLatitude" => gl.dig("geoLocationPoint", "pointLatitude"),
@@ -186,35 +282,36 @@ module Bolognese
186
282
  "southBoundLatitude" => gl.dig("geoLocationBox", "southBoundLatitude"),
187
283
  "northBoundLatitude" => gl.dig("geoLocationBox", "northBoundLatitude")
188
284
  }.compact.presence,
189
- "geoLocationPolygon" => Array.wrap(gl.dig("geoLocationPolygon", "polygonPoint")).map { |glp| { "polygonPoint" => glp } }.compact.presence,
285
+ "geoLocationPolygon" => geoLocationPolygon,
190
286
  "geoLocationPlace" => parse_attributes(gl["geoLocationPlace"], first: true).to_s.strip.presence
191
287
  }.compact
192
288
  end
193
289
  end.compact
194
290
 
195
- state = doi.present? || read_options.present? ? "findable" : "not_found"
291
+ state = id.present? || read_options.present? ? "findable" : "not_found"
196
292
 
197
293
  { "id" => id,
198
294
  "types" => types,
199
- "doi" => doi_from_url(doi),
295
+ "doi" => doi_from_url(id),
200
296
  "identifiers" => identifiers,
201
297
  "url" => options.fetch(:url, nil).to_s.strip.presence,
202
298
  "titles" => titles,
203
299
  "creators" => get_authors(Array.wrap(meta.dig("creators", "creator"))),
204
300
  "contributors" => get_authors(Array.wrap(meta.dig("contributors", "contributor"))),
205
301
  "container" => set_container(meta),
206
- "publisher" => parse_attributes(meta.fetch("publisher", nil), first: true).to_s.strip.presence,
207
- "agency" => "DataCite",
302
+ "publisher" => publisher,
303
+ "agency" => "datacite",
208
304
  "funding_references" => funding_references,
209
305
  "dates" => dates,
210
306
  "publication_year" => parse_attributes(meta.fetch("publicationYear", nil), first: true).to_s.strip.presence,
211
307
  "descriptions" => descriptions,
212
- "rights_list" => rights_list,
308
+ "rights_list" => Array.wrap(rights_list),
213
309
  "version_info" => meta.fetch("version", nil).to_s.presence,
214
310
  "subjects" => subjects,
215
311
  "language" => parse_attributes(meta.fetch("language", nil), first: true).to_s.strip.presence,
216
312
  "geo_locations" => geo_locations,
217
313
  "related_identifiers" => related_identifiers,
314
+ "related_items" => related_items,
218
315
  "formats" => formats,
219
316
  "sizes" => sizes,
220
317
  "schema_version" => schema_version,
@@ -243,6 +340,21 @@ module Bolognese
243
340
  {}
244
341
  end
245
342
  end
343
+
344
+ def get_titles(meta)
345
+ titles = Array.wrap(meta.dig("titles", "title")).map do |r|
346
+ if r.blank?
347
+ nil
348
+ elsif r.is_a?(String)
349
+ { "title" => sanitize(r) }
350
+ else
351
+ { "title" => sanitize(r["__content__"]), "titleType" => r["titleType"], "lang" => r["lang"] }.compact
352
+ end
353
+ end.compact
354
+
355
+ titles
356
+ end
357
+
246
358
  end
247
359
  end
248
360
  end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bolognese
4
+ module Readers
5
+ module NpmReader
6
+ def get_npm(id: nil, **options)
7
+ return { "string" => nil, "state" => "not_found" } unless id.present?
8
+ id = normalize_id(id)
9
+ response = Maremma.get(id, accept: "json", raw: true)
10
+ string = response.body.fetch("data", nil)
11
+
12
+ { "string" => string }
13
+ end
14
+
15
+ def read_npm(string: nil, **options)
16
+ if string.present?
17
+ errors = jsonlint(string)
18
+ return { "errors" => errors } if errors.present?
19
+ end
20
+
21
+ read_options = ActiveSupport::HashWithIndifferentAccess.new(options.except(:doi, :id, :url, :sandbox, :validate, :ra))
22
+
23
+ meta = string.present? ? Maremma.from_json(string) : {}
24
+
25
+ types = {
26
+ "resourceTypeGeneral" => "Software",
27
+ "reourceType" => "NPM Package",
28
+ "schemaOrg" => "SoftwareSourceCode",
29
+ "citeproc" => "article",
30
+ "bibtex" => "misc",
31
+ "ris" => "GEN"
32
+ }.compact
33
+
34
+ creators = if meta.fetch("author", nil).present?
35
+ get_authors(Array.wrap(meta.fetch("author", nil)))
36
+ else
37
+ [{ "nameType" => "Organizational", "name" => ":(unav)" }]
38
+ end
39
+ # contributors = get_authors(from_citeproc(Array.wrap(meta.fetch("editor", nil))))
40
+ # dates = if date = get_date_from_date_parts(meta.fetch("issued", nil))
41
+ # if Date.edtf(date).present?
42
+ # [{ "date" => date,
43
+ # "dateType" => "Issued" }]
44
+ # end
45
+ # end
46
+ # publication_year = get_date_from_date_parts(meta.fetch("issued", nil)).to_s[0..3]
47
+ rights_list = if meta.fetch("license", nil)
48
+ [{ "rights" => meta.fetch("license") }.compact]
49
+ end
50
+ # related_identifiers = if meta.fetch("container-title", nil).present? && meta.fetch("ISSN", nil).present?
51
+ # [{ "type" => "Periodical",
52
+ # "relationType" => "IsPartOf",
53
+ # "relatedIdentifierType" => "ISSN",
54
+ # "title" => meta.fetch("container-title", nil),
55
+ # "relatedIdentifier" => meta.fetch("ISSN", nil) }.compact]
56
+ # end
57
+ # container = if meta.fetch("container-title", nil).present?
58
+ # first_page = meta.fetch("page", nil).present? ? meta.fetch("page").split("-").map(&:strip)[0] : nil
59
+ # last_page = meta.fetch("page", nil).present? ? meta.fetch("page").split("-").map(&:strip)[1] : nil
60
+
61
+ # { "type" => "Periodical",
62
+ # "title" => meta.fetch("container-title", nil),
63
+ # "identifier" => meta.fetch("ISSN", nil),
64
+ # "identifierType" => meta.fetch("ISSN", nil).present? ? "ISSN" : nil,
65
+ # "volume" => meta.fetch("volume", nil),
66
+ # "issue" => meta.fetch("issue", nil),
67
+ # "firstPage" => first_page,
68
+ # "lastPage" => last_page
69
+ # }.compact
70
+ # else
71
+ # nil
72
+ # end
73
+
74
+ # identifiers = [normalize_id(meta.fetch("id", nil)), normalize_doi(meta.fetch("DOI", nil))].compact.map do |r|
75
+ # r = normalize_id(r)
76
+
77
+ # if r.start_with?("https://doi.org")
78
+ # { "identifierType" => "DOI", "identifier" => r }
79
+ # else
80
+ # { "identifierType" => "URL", "identifier" => r }
81
+ # end
82
+ # end.uniq
83
+
84
+ # id = Array.wrap(identifiers).first.to_h.fetch("identifier", nil)
85
+ # doi = Array.wrap(identifiers).find { |r| r["identifierType"] == "DOI" }.to_h.fetch("identifier", nil)
86
+
87
+ # state = id.present? || read_options.present? ? "findable" : "not_found"
88
+ subjects = Array.wrap(meta.fetch("keywords", nil)).map do |s|
89
+ { "subject" => s }
90
+ end
91
+
92
+ {
93
+ #"id" => id,
94
+ #"identifiers" => identifiers,
95
+ "types" => types,
96
+ #"doi" => doi_from_url(doi),
97
+ #"url" => normalize_id(meta.fetch("URL", nil)),
98
+ "titles" => [{ "title" => meta.fetch("name", nil) }],
99
+ "creators" => creators,
100
+ #"contributors" => contributors,
101
+ #"container" => container,
102
+ #"publisher" => meta.fetch("publisher", nil),
103
+ #"related_identifiers" => related_identifiers,
104
+ #"dates" => dates,
105
+ #"publication_year" => publication_year,
106
+ "descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description"), new_line: true), "descriptionType" => "Abstract" }] : [],
107
+ "rights_list" => rights_list,
108
+ "version_info" => meta.fetch("version", nil),
109
+ "subjects" => subjects
110
+ #"state" => state
111
+ }.merge(read_options)
112
+ end
113
+ end
114
+ end
115
+ end
@@ -41,18 +41,13 @@ module Bolognese
41
41
  ris_type = meta.fetch("TY", nil) || "GEN"
42
42
  schema_org = RIS_TO_SO_TRANSLATIONS[ris_type] || "CreativeWork"
43
43
  types = {
44
- "resourceTypeGeneral" => Metadata::SO_TO_DC_TRANSLATIONS[schema_org],
44
+ "resourceTypeGeneral" => Metadata::RIS_TO_DC_TRANSLATIONS[ris_type],
45
45
  "schemaOrg" => schema_org,
46
46
  "citeproc" => RIS_TO_CP_TRANSLATIONS[schema_org] || "misc",
47
47
  "ris" => ris_type
48
48
  }.compact
49
49
 
50
- identifiers = [normalize_doi(options[:doi]) || normalize_doi(meta.fetch("DO", nil))].map do |r|
51
- { "identifierType" => "DOI", "identifier" => normalize_id(r) }
52
- end.compact
53
-
54
- id = Array.wrap(identifiers).first.to_h.fetch("identifier", nil)
55
- doi = Array.wrap(identifiers).find { |r| r["identifierType"] == "DOI" }.to_h.fetch("identifier", nil)
50
+ id = normalize_doi(options[:doi] || meta.fetch("DO", nil))
56
51
 
57
52
  author = Array.wrap(meta.fetch("AU", nil)).map { |a| { "creatorName" => a } }
58
53
  date_parts = meta.fetch("PY", nil).to_s.split("/")
@@ -72,7 +67,7 @@ module Bolognese
72
67
  end
73
68
  container = if meta.fetch("T2", nil).present?
74
69
  { "type" => "Journal",
75
- "title" => meta.fetch("T2", nil),
70
+ "title" => meta.fetch("T2", nil),
76
71
  "identifier" => meta.fetch("SN", nil),
77
72
  "volume" => meta.fetch("VL", nil),
78
73
  "issue" => meta.fetch("IS", nil),
@@ -82,23 +77,24 @@ module Bolognese
82
77
  nil
83
78
  end
84
79
  state = meta.fetch("DO", nil).present? || read_options.present? ? "findable" : "not_found"
85
- subjects = Array.wrap(meta.fetch("KW", nil)).map do |s|
86
- { "subject" => s }
80
+ subjects = Array.wrap(meta.fetch("KW", nil)).reduce([]) do |sum, subject|
81
+ sum += name_to_fos(subject)
82
+
83
+ sum
87
84
  end
88
85
 
89
86
  { "id" => id,
90
87
  "types" => types,
91
- "identifiers" => identifiers,
92
- "doi" => doi_from_url(doi),
88
+ "doi" => doi_from_url(id),
93
89
  "url" => meta.fetch("UR", nil),
94
90
  "titles" => meta.fetch("T1", nil).present? ? [{ "title" => meta.fetch("T1", nil) }] : nil,
95
91
  "creators" => get_authors(author),
96
- "publisher" => meta.fetch("PB", "(:unav)"),
92
+ "publisher" => { "name" => meta.fetch("PB", "(:unav)") },
97
93
  "container" => container,
98
94
  "related_identifiers" => related_identifiers,
99
95
  "dates" => dates,
100
96
  "publication_year" => publication_year,
101
- "descriptions" => meta.fetch("AB", nil).present? ? [{ "description" => sanitize(meta.fetch("AB")), "descriptionType" => "Abstract" }] : nil,
97
+ "descriptions" => meta.fetch("AB", nil).present? ? [{ "description" => sanitize(meta.fetch("AB"), new_line: true), "descriptionType" => "Abstract" }] : nil,
102
98
  "subjects" => subjects,
103
99
  "language" => meta.fetch("LA", nil),
104
100
  "state" => state
@@ -10,7 +10,9 @@ module Bolognese
10
10
  "isPartOf" => "IsPartOf",
11
11
  "hasPart" => "HasPart",
12
12
  "isPredecessor" => "IsPreviousVersionOf",
13
- "isSuccessor" => "IsNewVersionOf"
13
+ "isSuccessor" => "IsNewVersionOf",
14
+ "workTranslation" => "HasTranslation",
15
+ "translationOfWork" => "IsTranslationOf"
14
16
  }
15
17
 
16
18
  SO_TO_DC_REVERSE_RELATION_TYPES = {
@@ -26,13 +28,12 @@ module Bolognese
26
28
  def get_schema_org(id: nil, **options)
27
29
  return { "string" => nil, "state" => "not_found" } unless id.present?
28
30
 
29
- id = normalize_id(id)
30
- response = Maremma.get(id)
31
- doc = Nokogiri::XML(response.body.fetch("data", nil), nil, 'UTF-8')
31
+ url = normalize_id(id)
32
+ response = Maremma.get(url)
32
33
 
33
- # workaround for xhtml documents
34
- nodeset = doc.css("script")
35
- string = nodeset.find { |element| element["type"] == "application/ld+json" }
34
+ # Find the schema.org json from the html body
35
+ doc = Nokogiri::HTML(response.body.fetch("data", nil))
36
+ string = doc.at('script[type="application/ld+json"]')
36
37
  string = string.text if string.present?
37
38
 
38
39
  { "string" => string }
@@ -48,18 +49,16 @@ module Bolognese
48
49
 
49
50
  meta = string.present? ? Maremma.from_json(string) : {}
50
51
 
51
- identifiers = ([options[:doi] || meta.fetch("@id", nil)] + Array.wrap(meta.fetch("identifier", nil))).map do |r|
52
+ identifiers = Array.wrap(meta.fetch("identifier", nil)).map do |r|
52
53
  r = normalize_id(r) if r.is_a?(String)
53
- if r.is_a?(String) && r.start_with?("https://doi.org")
54
- { "identifierType" => "DOI", "identifier" => r }
55
- elsif r.is_a?(String)
54
+ if r.is_a?(String) && !r.start_with?("https://doi.org")
56
55
  { "identifierType" => "URL", "identifier" => r }
57
56
  elsif r.is_a?(Hash)
58
57
  { "identifierType" => get_identifier_type(r["propertyID"]), "identifier" => r["value"] }
59
58
  end
60
59
  end.compact.uniq
61
60
 
62
- id = Array.wrap(identifiers).first.to_h.fetch("identifier", nil)
61
+ id = normalize_id(options[:doi] || meta.fetch("@id", nil) || meta.fetch("identifier", nil))
63
62
 
64
63
  schema_org = meta.fetch("@type", nil) && meta.fetch("@type").camelcase
65
64
  resource_type_general = Bolognese::Utils::SO_TO_DC_TRANSLATIONS[schema_org]
@@ -77,7 +76,17 @@ module Bolognese
77
76
  creators = get_authors(from_schema_org_creators(Array.wrap(authors)))
78
77
  end
79
78
  contributors = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("editor", nil))))
80
- publisher = parse_attributes(meta.fetch("publisher", nil), content: "name", first: true)
79
+ translators = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("translator", nil))))
80
+ translators.map! do |translator|
81
+ translator["contributorType"] = "Translator"
82
+ translator
83
+ end
84
+ contributors += translators
85
+
86
+ publisher = {
87
+ "name" => parse_attributes(meta.fetch("publisher", nil), content: "name", first: true),
88
+ "publisherIdentifier" => parse_attributes(meta.fetch("publisher", nil), content: "@id", first: true),
89
+ }.compact if meta.fetch("publisher", nil).present?
81
90
 
82
91
  ct = (schema_org == "Dataset") ? "includedInDataCatalog" : "Periodical"
83
92
  container = if meta.fetch(ct, nil).present?
@@ -105,12 +114,13 @@ module Bolognese
105
114
  Array.wrap(schema_org_references(meta)) +
106
115
  Array.wrap(schema_org_is_referenced_by(meta)) +
107
116
  Array.wrap(schema_org_is_supplement_to(meta)) +
108
- Array.wrap(schema_org_is_supplemented_by(meta))
117
+ Array.wrap(schema_org_is_supplemented_by(meta)) +
118
+ Array.wrap(schema_org_has_translation(meta)) +
119
+ Array.wrap(schema_org_is_translation_of(meta))
109
120
 
110
- rights_list = {
111
- "rightsUri" => parse_attributes(meta.fetch("license", nil), content: "id", first: true),
112
- "rights" => parse_attributes(meta.fetch("license", nil), content: "name", first: true)
113
- }
121
+ rights_list = Array.wrap(meta.fetch("license", nil)).compact.map do |rl|
122
+ hsh_to_spdx("__content__" => rl["name"], "rightsURI" => rl["id"])
123
+ end
114
124
 
115
125
  funding_references = Array.wrap(meta.fetch("funder", nil)).compact.map do |fr|
116
126
  if fr["@id"].present?
@@ -124,11 +134,20 @@ module Bolognese
124
134
  end
125
135
  end
126
136
  dates = []
127
- dates << { "date" => meta.fetch("datePublished"), "dateType" => "Issued" } if meta.fetch("datePublished", nil).present?
128
- dates << { "date" => meta.fetch("dateCreated"), "dateType" => "Created" } if meta.fetch("dateCreated", nil).present?
129
- dates << { "date" => meta.fetch("dateModified"), "dateType" => "Updated" } if meta.fetch("dateModified", nil).present?
137
+ dates << { "date" => meta.fetch("datePublished"), "dateType" => "Issued" } if Date.edtf(meta.fetch("datePublished", nil)).present?
138
+ dates << { "date" => meta.fetch("dateCreated"), "dateType" => "Created" } if Date.edtf(meta.fetch("dateCreated", nil)).present?
139
+ dates << { "date" => meta.fetch("dateModified"), "dateType" => "Updated" } if Date.edtf(meta.fetch("dateModified", nil)).present?
140
+ dates << { "date" => meta.fetch("temporalCoverage"), "dateType" => "Coverage" } if Date.edtf(meta.fetch("temporalCoverage", nil)).present?
130
141
  publication_year = meta.fetch("datePublished")[0..3] if meta.fetch("datePublished", nil).present?
131
142
 
143
+ if meta.fetch("inLanguage", nil).is_a?(String)
144
+ language = meta.fetch("inLanguage")
145
+ elsif meta.fetch("inLanguage", nil).is_a?(Object)
146
+ language = meta.dig("inLanguage", 'alternateName') || meta.dig("inLanguage", 'name')
147
+ else
148
+ language = nil
149
+ end
150
+
132
151
  state = meta.present? || read_options.present? ? "findable" : "not_found"
133
152
  geo_locations = Array.wrap(meta.fetch("spatialCoverage", nil)).map do |gl|
134
153
  if gl.dig("geo", "box")
@@ -137,7 +156,7 @@ module Bolognese
137
156
  "westBoundLongitude" => w,
138
157
  "eastBoundLongitude" => e,
139
158
  "southBoundLatitude" => s,
140
- "northBoundLatitude" => n
159
+ "northBoundLatitude" => n,
141
160
  }.compact.presence
142
161
  else
143
162
  geo_location_box = nil
@@ -150,8 +169,13 @@ module Bolognese
150
169
  "geoLocationBox" => geo_location_box
151
170
  }.compact
152
171
  end
153
- subjects = Array.wrap(meta.fetch("keywords", nil).to_s.split(", ")).map do |s|
154
- { "subject" => s }
172
+
173
+ # handle keywords as array and as comma-separated string
174
+ subjects = meta.fetch("keywords", nil)
175
+ subjects = subjects.to_s.split(", ") if subjects.is_a?(String)
176
+ subjects = Array.wrap(subjects).reduce([]) do |sum, subject|
177
+ sum += name_to_fos(subject)
178
+ sum
155
179
  end
156
180
 
157
181
  { "id" => id,
@@ -171,10 +195,11 @@ module Bolognese
171
195
  "related_identifiers" => related_identifiers,
172
196
  "publication_year" => publication_year,
173
197
  "dates" => dates,
174
- "descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
198
+ "descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description"), new_line: true), "descriptionType" => "Abstract" }] : nil,
175
199
  "rights_list" => rights_list,
176
200
  "version_info" => meta.fetch("version", nil).to_s.presence,
177
201
  "subjects" => subjects,
202
+ "language" => language,
178
203
  "state" => state,
179
204
  "schema_version" => meta.fetch("schemaVersion", nil).to_s.presence,
180
205
  "funding_references" => funding_references,
@@ -226,6 +251,14 @@ module Bolognese
226
251
  schema_org_related_identifier(meta, relation_type: "isBasedOn")
227
252
  end
228
253
 
254
+ def schema_org_has_translation(meta)
255
+ schema_org_related_identifier(meta, relation_type: "workTranslation", )
256
+ end
257
+
258
+ def schema_org_is_translation_of(meta)
259
+ schema_org_related_identifier(meta, relation_type: "translationOfWork")
260
+ end
261
+
229
262
  end
230
263
  end
231
264
  end