briard 2.7.1 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (520) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +6 -6
  3. data/Gemfile.lock +2 -2
  4. data/README.md +7 -0
  5. data/briard.gemspec +1 -1
  6. data/lib/briard/author_utils.rb +50 -33
  7. data/lib/briard/doi_utils.rb +5 -1
  8. data/lib/briard/metadata.rb +1 -1
  9. data/lib/briard/metadata_utils.rb +2 -0
  10. data/lib/briard/readers/crossref_json_reader.rb +167 -0
  11. data/lib/briard/readers/crossref_reader.rb +3 -3
  12. data/lib/briard/readers/datacite_reader.rb +1 -1
  13. data/lib/briard/utils.rb +13 -3
  14. data/lib/briard/version.rb +1 -1
  15. data/spec/author_utils_spec.rb +36 -32
  16. data/spec/cli_spec.rb +1 -1
  17. data/spec/doi_utils_spec.rb +8 -8
  18. data/spec/fixtures/crossref.json +572 -0
  19. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/default.yml +9 -9
  20. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_bibtex.yml +9 -9
  21. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_citation.yml +9 -9
  22. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_crossref.yml +9 -9
  23. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_datacite.yml +9 -9
  24. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_jats.yml +9 -9
  25. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_schema_org.yml +9 -9
  26. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/default.yml +10 -10
  27. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_bibtex.yml +10 -10
  28. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_citation.yml +10 -10
  29. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_datacite.yml +10 -10
  30. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_datacite_json.yml +10 -10
  31. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_jats.yml +10 -10
  32. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_schema_org.yml +10 -10
  33. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/default.yml +7 -9
  34. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/to_datacite.yml +5 -5
  35. data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/to_schema_org.yml +9 -7
  36. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/crossref.yml +4 -4
  37. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/datacite.yml +4 -4
  38. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/jalc.yml +4 -4
  39. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/kisti.yml +4 -4
  40. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/medra.yml +4 -4
  41. data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/op.yml +4 -4
  42. data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/author.yml +5 -5
  43. data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/no_author.yml +6 -6
  44. data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/single_author.yml +6 -6
  45. data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/with_organization.yml +5 -5
  46. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_datacite_metadata/change_state.yml +10 -10
  47. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_datacite_metadata/change_title.yml +10 -10
  48. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_description.yml +5 -5
  49. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_identifiers.yml +5 -5
  50. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license.yml +5 -5
  51. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +5 -5
  52. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +5 -5
  53. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_state.yml +5 -5
  54. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +5 -5
  55. data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +5 -5
  56. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/doi.yml +5 -5
  57. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/test_resolver.yml → datacite_api_url/doi_with_protocol.yml} +5 -5
  58. data/spec/fixtures/vcr_cassettes/Briard_Metadata/datacite_api_url/dx_doi_org_url.yml +65 -0
  59. data/spec/fixtures/vcr_cassettes/Briard_Metadata/datacite_api_url/force_test_resolver.yml +65 -0
  60. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/https_url.yml +5 -5
  61. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/doi_with_protocol.yml → datacite_api_url/test_resolver.yml} +5 -5
  62. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/test_resolver_http.yml +5 -5
  63. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/dx_doi_org_url.yml → doi_from_url/crossref_api_url.yml} +5 -5
  64. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/doi.yml +6 -6
  65. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/doi_with_special_characters.yml +5 -5
  66. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/not_a_doi.yml +5 -5
  67. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/sandbox_url.yml +6 -6
  68. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/url.yml +6 -6
  69. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/crossref.yml +9 -9
  70. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/datacite.yml +9 -9
  71. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/jalc.yml +9 -9
  72. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/kisti.yml +10 -10
  73. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/medra.yml +10 -10
  74. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/not_a_valid_prefix.yml +6 -6
  75. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/not_found.yml +9 -9
  76. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/op.yml +9 -9
  77. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/doi.yml +6 -6
  78. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/doi_with_protocol.yml +5 -5
  79. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/dx_doi_org_url.yml +5 -5
  80. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/force_stage_resolver.yml +6 -6
  81. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/https_url.yml +5 -5
  82. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/stage_resolver.yml +5 -5
  83. data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/stage_resolver_http.yml +5 -5
  84. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/crossref.yml +14 -14
  85. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +14 -14
  86. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/datacite.yml +14 -14
  87. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/datacite_doi_http.yml +14 -14
  88. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/github.yml +10 -10
  89. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/orcid.yml +10 -10
  90. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/schema_org.yml +10 -10
  91. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +14 -14
  92. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/bibtex.yml +10 -10
  93. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/citeproc.yml +10 -10
  94. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/codemeta.yml +10 -10
  95. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/crosscite.yml +10 -10
  96. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/crossref.yml +10 -10
  97. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/datacite.yml +10 -10
  98. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/datacite_json.yml +10 -10
  99. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/ris.yml +10 -10
  100. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/schema_org.yml +10 -10
  101. data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_string/crosscite.yml +10 -10
  102. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_for_match.yml +5 -5
  103. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_for_with_schemeUri_in_hash.yml +6 -6
  104. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_match.yml +5 -5
  105. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_no_match.yml +5 -5
  106. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_for_match.yml +6 -6
  107. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_match.yml +6 -6
  108. data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_no_match.yml +6 -6
  109. data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org/with_id.yml +6 -6
  110. data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org_creators/with_affiliation.yml +6 -6
  111. data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org_creators/without_affiliation.yml +5 -5
  112. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/cff-converter-python.yml +7 -7
  113. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/ruby-cff.yml +7 -7
  114. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/ruby-cff_repository_url.yml +8 -8
  115. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_codemeta_metadata/maremma.yml +10 -10
  116. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_codemeta_metadata/metadata_reports.yml +7 -7
  117. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_ORCID_ID.yml +112 -0
  118. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_SICI_DOI.yml +112 -0
  119. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_data_citation.yml +112 -0
  120. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/JaLC.yml +112 -0
  121. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/KISTI.yml +112 -0
  122. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/OP.yml +112 -0
  123. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/affiliation_is_space.yml +112 -0
  124. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/another_book.yml +112 -0
  125. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/another_book_chapter.yml +112 -0
  126. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/article_id_as_page_number.yml +112 -0
  127. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/author_literal.yml +112 -0
  128. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book.yml +112 -0
  129. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_chapter.yml +112 -0
  130. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_chapter_with_RDF_for_container.yml +112 -0
  131. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_oup.yml +112 -0
  132. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/component.yml +112 -0
  133. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dataset.yml +112 -0
  134. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dataset_usda.yml +112 -0
  135. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/date_in_future.yml +112 -0
  136. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dissertation.yml +112 -0
  137. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/empty_given_name.yml +112 -0
  138. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/invalid_date.yml +112 -0
  139. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article.yml +112 -0
  140. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_original_language_title.yml +112 -0
  141. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with.yml +112 -0
  142. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with_RDF_for_container.yml +112 -0
  143. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with_funding.yml +112 -0
  144. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_issue.yml +112 -0
  145. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/mEDRA.yml +112 -0
  146. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/markup.yml +112 -0
  147. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/missing_creator.yml +112 -0
  148. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_issn.yml +112 -0
  149. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_titles.yml +112 -0
  150. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_titles_with_missing.yml +112 -0
  151. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/not_found_error.yml +105 -0
  152. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/peer_review.yml +112 -0
  153. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/posted_content.yml +112 -0
  154. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/posted_content_copernicus.yml +112 -0
  155. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/report_osti.yml +112 -0
  156. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/vor_with_url.yml +112 -0
  157. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/yet_another_book.yml +112 -0
  158. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/yet_another_book_chapter.yml +112 -0
  159. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +11 -11
  160. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +10 -10
  161. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +9 -9
  162. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/JaLC.yml +9 -9
  163. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/KISTI.yml +11 -11
  164. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/OP.yml +9 -9
  165. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/affiliation_is_space.yml +9 -9
  166. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/another_book.yml +9 -9
  167. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/another_book_chapter.yml +9 -9
  168. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/article_id_as_page_number.yml +10 -10
  169. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/author_literal.yml +10 -10
  170. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book.yml +9 -9
  171. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_chapter.yml +10 -10
  172. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml +9 -9
  173. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_oup.yml +9 -9
  174. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/component.yml +11 -11
  175. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dataset.yml +9 -9
  176. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dataset_usda.yml +9 -9
  177. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/date_in_future.yml +9 -9
  178. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dissertation.yml +9 -9
  179. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/empty_given_name.yml +9 -9
  180. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/invalid_date.yml +9 -9
  181. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article.yml +57 -59
  182. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +57 -58
  183. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with.yml +9 -9
  184. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with_RDF_for_container.yml +10 -10
  185. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with_funding.yml +57 -59
  186. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_issue.yml +11 -11
  187. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/mEDRA.yml +9 -9
  188. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/markup.yml +9 -9
  189. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/missing_creator.yml +9 -9
  190. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_issn.yml +9 -9
  191. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_titles.yml +9 -9
  192. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_titles_with_missing.yml +10 -10
  193. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/not_found_error.yml +9 -9
  194. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/peer_review.yml +9 -9
  195. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/posted_content.yml +10 -10
  196. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/posted_content_copernicus.yml +9 -9
  197. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/report_osti.yml +9 -9
  198. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/vor_with_url.yml +9 -9
  199. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/yet_another_book.yml +9 -9
  200. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +11 -11
  201. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_json_metadata/metadata_from_api.yml +10 -10
  202. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/BlogPosting.yml +10 -10
  203. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_staging_system.yml +10 -10
  204. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_staging_system_schema_3.yml +10 -10
  205. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +10 -10
  206. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_not_found.yml +9 -9
  207. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Dataset.yml +10 -10
  208. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding.yml +10 -10
  209. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +10 -10
  210. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +10 -10
  211. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Referee_report_in_staging_system.yml +10 -10
  212. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Schema_org_type.yml +10 -10
  213. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_only_full_name.yml +10 -10
  214. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_with_scheme.yml +10 -10
  215. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +10 -10
  216. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/cc-by_3_0_us.yml +10 -10
  217. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/content_url.yml +10 -10
  218. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/date.yml +10 -10
  219. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/dissertation.yml +10 -10
  220. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/doi_with_sign.yml +10 -10
  221. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/empty_subject.yml +10 -10
  222. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml +10 -10
  223. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/funding_references.yml +10 -10
  224. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/funding_schema_version_3.yml +10 -10
  225. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/is_identical_to.yml +10 -10
  226. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/keywords_with_attributes.yml +10 -10
  227. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +10 -10
  228. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml +10 -10
  229. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +10 -10
  230. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/multiple_licenses.yml +10 -10
  231. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/series-information.yml +10 -10
  232. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/subject_scheme.yml +10 -10
  233. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/subject_scheme_FOR.yml +10 -10
  234. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date/publication_date.yml +6 -6
  235. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/date.yml +5 -5
  236. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/year-month.yml +6 -6
  237. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/year.yml +5 -5
  238. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/date.yml +6 -6
  239. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/year-month.yml +5 -5
  240. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/year.yml +6 -6
  241. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/date.yml +5 -5
  242. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/year-month.yml +5 -5
  243. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/year.yml +6 -6
  244. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/future.yml +6 -6
  245. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/invalid.yml +5 -5
  246. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/nil.yml +6 -6
  247. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/past.yml +5 -5
  248. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/present.yml +5 -5
  249. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_familyName.yml +6 -6
  250. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_Thai.yml +6 -6
  251. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_display-order.yml +6 -6
  252. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +6 -6
  253. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_sort-order.yml +6 -6
  254. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/hyper-authorship.yml +6 -6
  255. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/is_organization.yml +5 -5
  256. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/multiple_author_names_in_one_field.yml +6 -6
  257. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/multiple_name_identifier.yml +6 -6
  258. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation.yml +6 -6
  259. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation_and_country.yml +7 -7
  260. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation_crossref.yml +112 -0
  261. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_role.yml +6 -6
  262. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/only_familyName_and_givenName.yml +6 -6
  263. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/BlogPosting.yml +15 -15
  264. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +15 -15
  265. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/get_schema_org_metadata_front_matter/BlogPosting.yml +18 -18
  266. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/harvard_dataverse.yml +6 -6
  267. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/pangaea.yml +6 -6
  268. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/zenodo.yml +8 -8
  269. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/only_title.yml +5 -5
  270. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_and_pages.yml +6 -6
  271. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_volume_and_pages.yml +5 -5
  272. data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_volume_issue_and_pages.yml +6 -6
  273. data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_as_cff_url.yml +6 -6
  274. data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_as_codemeta_url.yml +5 -5
  275. data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url.yml +5 -5
  276. data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url_cff_file.yml +5 -5
  277. data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url_file.yml +5 -5
  278. data/spec/fixtures/vcr_cassettes/Briard_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +4 -4
  279. data/spec/fixtures/vcr_cassettes/Briard_Metadata/handle_input/unknown_DOI_prefix.yml +4 -4
  280. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_contributors/none.yml +6 -6
  281. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_creators/insert.yml +6 -6
  282. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_dates/insert.yml +6 -6
  283. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_descriptions/insert.yml +6 -6
  284. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_identifier/doi.yml +6 -6
  285. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_language/insert.yml +6 -6
  286. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_person/creator_only_name.yml +6 -6
  287. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_publication_year/insert.yml +6 -6
  288. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_publisher/insert.yml +6 -6
  289. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_related_identifiers/insert.yml +6 -6
  290. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_related_identifiers/related_identifier.yml +6 -6
  291. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_resource_type/insert.yml +6 -6
  292. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_rights_list/insert.yml +6 -6
  293. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_sizes/insert.yml +6 -6
  294. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_subjects/insert.yml +6 -6
  295. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_titles/insert.yml +6 -6
  296. data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_version/insert.yml +6 -6
  297. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_comma.yml +6 -6
  298. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_family_name.yml +6 -6
  299. data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/force_test_resolver.yml → is_personal_name_/has_family_name_crossref.yml} +5 -5
  300. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_id.yml +6 -6
  301. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_known_given_name.yml +6 -6
  302. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_no_info.yml +5 -5
  303. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_orcid_id.yml +5 -5
  304. data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_type_organization.yml +5 -5
  305. data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/missing_comma.yml +10 -10
  306. data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/nil.yml +10 -10
  307. data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/overlapping_keys.yml +10 -10
  308. data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/valid.yml +10 -10
  309. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/not_found.yml +5 -5
  310. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/with_trailing_slash.yml +5 -5
  311. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +6 -6
  312. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/SICI_doi.yml +6 -6
  313. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi.yml +5 -5
  314. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +6 -6
  315. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +6 -6
  316. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +6 -6
  317. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_prefix_too_long.yml +5 -5
  318. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_prefix_with_string.yml +5 -5
  319. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_with_protocol.yml +5 -5
  320. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/dx_doi_org_url.yml +6 -6
  321. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/https_url.yml +6 -6
  322. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/not_valid_doi_prefix.yml +5 -5
  323. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/url_with_one_slash.yml +6 -6
  324. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/doi.yml +6 -6
  325. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/doi_as_url.yml +5 -5
  326. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/ftp.yml +6 -6
  327. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/invalid_url.yml +6 -6
  328. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/sandbox_via_options.yml +6 -6
  329. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/sandbox_via_url.yml +6 -6
  330. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/string.yml +5 -5
  331. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/url.yml +6 -6
  332. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/url_with_utf-8.yml +6 -6
  333. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_ids/doi.yml +6 -6
  334. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_ids/url.yml +5 -5
  335. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_array.yml +5 -5
  336. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_empty_array.yml +5 -5
  337. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_hash.yml +5 -5
  338. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_string.yml +5 -5
  339. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/uri.yml +5 -5
  340. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/with_trailing_slash.yml +6 -6
  341. data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +5 -5
  342. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/array.yml +5 -5
  343. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/array_of_strings.yml +6 -6
  344. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/first.yml +6 -6
  345. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/hash.yml +6 -6
  346. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/nil.yml +5 -5
  347. data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/string.yml +5 -5
  348. data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/decode_anothe_doi.yml +5 -5
  349. data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/decode_doi.yml +5 -5
  350. data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/encode_doi.yml +5 -5
  351. data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/onlies_keep_specific_tags.yml +6 -6
  352. data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/removes_a_tags.yml +5 -5
  353. data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_id.yml +6 -6
  354. data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_not_found.yml +5 -5
  355. data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_url.yml +5 -5
  356. data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/name_to_spdx_exists.yml +5 -5
  357. data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/name_to_spdx_id.yml +5 -5
  358. data/spec/fixtures/vcr_cassettes/Briard_Metadata/to_schema_org/with_id.yml +6 -6
  359. data/spec/fixtures/vcr_cassettes/Briard_Metadata/to_schema_org_identifiers/with_identifiers.yml +5 -5
  360. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_doi/doi.yml +6 -6
  361. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_10.yml +6 -6
  362. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_11.yml +6 -6
  363. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_12.yml +6 -6
  364. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_13.yml +5 -5
  365. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_14.yml +6 -6
  366. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_4.yml +6 -6
  367. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_5.yml +5 -5
  368. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_6.yml +5 -5
  369. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_7.yml +5 -5
  370. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_8.yml +6 -6
  371. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_9.yml +6 -6
  372. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/funder_doi.yml +5 -5
  373. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +5 -5
  374. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/non-funder_doi.yml +5 -5
  375. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid.yml +6 -6
  376. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_https.yml +6 -6
  377. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_id.yml +5 -5
  378. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_sandbox.yml +5 -5
  379. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +5 -5
  380. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_with_spaces.yml +5 -5
  381. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_wrong_id.yml +5 -5
  382. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_www.yml +5 -5
  383. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +5 -5
  384. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +5 -5
  385. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +6 -6
  386. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +5 -5
  387. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi.yml +5 -5
  388. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi_as_url.yml +5 -5
  389. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi_with_protocol.yml +5 -5
  390. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/only_prefix.yml +6 -6
  391. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/DOI.yml +5 -5
  392. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/ISSN.yml +6 -6
  393. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/URL.yml +6 -6
  394. data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/string.yml +5 -5
  395. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/BlogPosting.yml +6 -6
  396. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/Dataset.yml +6 -6
  397. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +5 -5
  398. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/climate_data.yml +6 -6
  399. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/from_schema_org.yml +15 -15
  400. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +6 -6
  401. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/maremma.yml +8 -8
  402. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/text.yml +6 -6
  403. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/with_data_citation.yml +5 -5
  404. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/with_pages.yml +5 -5
  405. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/Collection_of_Jupyter_notebooks.yml +6 -6
  406. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/SoftwareSourceCode_Zenodo.yml +6 -6
  407. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/SoftwareSourceCode_also_Zenodo.yml +6 -6
  408. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/ruby-cff.yml +8 -8
  409. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Dataset.yml +6 -6
  410. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Journal_article.yml +5 -5
  411. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Journal_article_vancouver_style.yml +5 -5
  412. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Missing_author.yml +5 -5
  413. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/interactive_resource_without_dates.yml +6 -6
  414. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/software_w/version.yml +6 -6
  415. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/Another_dataset.yml +6 -6
  416. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/BlogPosting.yml +6 -6
  417. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +15 -15
  418. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/Dataset.yml +6 -6
  419. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/container_title.yml +6 -6
  420. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/interactive_resource_without_dates.yml +6 -6
  421. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/journal_article.yml +5 -5
  422. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +6 -6
  423. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/maremma.yml +8 -8
  424. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/missing_creator.yml +5 -5
  425. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +6 -6
  426. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/organization_author.yml +7 -7
  427. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/software.yml +6 -6
  428. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/software_w/version.yml +6 -6
  429. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +5 -5
  430. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/with_pages.yml +5 -5
  431. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +6 -6
  432. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +6 -6
  433. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +6 -6
  434. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/maremma.yml +10 -10
  435. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +5 -5
  436. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/with_data_citation.yml +5 -5
  437. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/another_schema_org_from_front-matter.yml +18 -18
  438. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/journal_article_from_datacite.yml +6 -6
  439. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/posted_content.yml +9 -9
  440. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/schema_org_from_another_science_blog.yml +6 -6
  441. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/schema_org_from_front_matter.yml +18 -18
  442. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/climate_data.yml +6 -6
  443. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/maremma.yml +8 -8
  444. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/text.yml +6 -6
  445. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/with_data_citation.yml +5 -5
  446. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/with_pages.yml +7 -7
  447. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/from_schema_org.yml +15 -15
  448. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/maremma.yml +8 -8
  449. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +7 -7
  450. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +5 -5
  451. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +5 -5
  452. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +6 -6
  453. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +6 -6
  454. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +6 -6
  455. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/maremma.yml +8 -8
  456. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +5 -5
  457. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +5 -5
  458. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_editor.yml +5 -5
  459. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_version.yml +6 -6
  460. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +6 -6
  461. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +6 -6
  462. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/book_chapter.yml +5 -5
  463. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/from_schema_org.yml +17 -17
  464. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/interactive_resource_without_dates.yml +6 -6
  465. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/maremma.yml +8 -8
  466. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +5 -5
  467. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +5 -5
  468. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_editor.yml +5 -5
  469. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml +6 -6
  470. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml +15 -15
  471. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/journal_article.yml +5 -5
  472. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/maremma.yml +8 -8
  473. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/with_pages.yml +5 -5
  474. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/BlogPosting.yml +6 -6
  475. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +15 -15
  476. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/Dataset.yml +6 -6
  477. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/alternate_name.yml +6 -6
  478. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/journal_article.yml +5 -5
  479. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +6 -6
  480. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/maremma.yml +10 -10
  481. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/with_pages.yml +5 -5
  482. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Another_Schema_org_JSON.yml +6 -6
  483. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Funding.yml +10 -10
  484. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +10 -10
  485. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +6 -6
  486. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml +10 -10
  487. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +10 -10
  488. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +6 -6
  489. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/data_catalog.yml +6 -6
  490. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/geo_location_box.yml +6 -6
  491. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/interactive_resource_without_dates.yml +6 -6
  492. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/journal_article.yml +5 -5
  493. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +8 -8
  494. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/series_information.yml +6 -6
  495. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/subject_scheme.yml +6 -6
  496. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +6 -6
  497. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/BlogPosting.yml +6 -6
  498. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml +15 -15
  499. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/Dataset.yml +6 -6
  500. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/journal_article.yml +5 -5
  501. data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/with_pages.yml +5 -5
  502. data/spec/readers/citeproc_reader_spec.rb +2 -2
  503. data/spec/readers/codemeta_reader_spec.rb +3 -4
  504. data/spec/readers/crossref_json_reader_spec.rb +1237 -0
  505. data/spec/readers/crossref_reader_spec.rb +57 -64
  506. data/spec/readers/datacite_json_reader_spec.rb +1 -1
  507. data/spec/readers/datacite_reader_spec.rb +53 -82
  508. data/spec/readers/npm_reader_spec.rb +2 -2
  509. data/spec/readers/ris_reader_spec.rb +2 -5
  510. data/spec/readers/schema_org_reader_spec.rb +7 -12
  511. data/spec/writers/bibtex_writer_spec.rb +2 -2
  512. data/spec/writers/citation_writer_spec.rb +2 -2
  513. data/spec/writers/citeproc_writer_spec.rb +1 -1
  514. data/spec/writers/codemeta_writer_spec.rb +1 -1
  515. data/spec/writers/crosscite_writer_spec.rb +4 -5
  516. data/spec/writers/crossref_writer_spec.rb +3 -6
  517. data/spec/writers/datacite_json_writer_spec.rb +2 -4
  518. data/spec/writers/datacite_writer_spec.rb +7 -9
  519. data/spec/writers/schema_org_writer_spec.rb +8 -9
  520. metadata +59 -17
@@ -0,0 +1,1237 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Briard::Metadata, vcr: true do
6
+ subject { described_class.new(input: input, from: 'crossref_json') }
7
+
8
+ let(:input) { '10.7554/eLife.01567' }
9
+
10
+ context 'get crossref_json raw' do
11
+ it 'journal article' do
12
+ input = "#{fixture_path}crossref.json"
13
+ subject = described_class.new(input: input, from: 'crossref_json')
14
+ expect(subject.raw).to eq(File.read(input).strip)
15
+ end
16
+ end
17
+
18
+ context 'get crossref_json metadata' do
19
+ it 'DOI with data citation' do
20
+ expect(subject.valid?).to be true
21
+ expect(subject.id).to eq('https://doi.org/10.7554/elife.01567')
22
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
23
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
24
+ expect(subject.url).to eq('https://elifesciences.org/articles/01567')
25
+ expect(subject.creators.length).to eq(5)
26
+ expect(subject.creators.first).to eq('nameType' => 'Personal', 'name' => 'Sankar, Martial',
27
+ 'givenName' => 'Martial', 'familyName' => 'Sankar', 'affiliation' => [{ 'name' => 'Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland' }])
28
+ expect(subject.rights_list).to eq([{ 'rights' => 'Creative Commons Attribution 3.0 Unported',
29
+ 'rightsIdentifier' => 'cc-by-3.0',
30
+ 'rightsIdentifierScheme' => 'SPDX',
31
+ 'rightsUri' => 'https://creativecommons.org/licenses/by/3.0/legalcode',
32
+ 'schemeUri' => 'https://spdx.org/licenses/' }])
33
+ expect(subject.titles).to eq([{ 'title' => 'Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth' }])
34
+ expect(subject.dates).to eq([{ 'date' => '2014-02-11', 'dateType' => 'Issued' },
35
+ { 'date' => '2022-03-26', 'dateType' => 'Updated' }])
36
+ expect(subject.publication_year).to eq('2014')
37
+ expect(subject.publisher).to eq('eLife Sciences Publications, Ltd')
38
+ expect(subject.container).to eq('identifier' => '2050-084X',
39
+ 'identifierType' => 'ISSN', 'title' => 'eLife', 'type' => 'Journal', 'volume' => '3')
40
+ expect(subject.related_identifiers.length).to eq(28)
41
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '2050-084X',
42
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
43
+ expect(subject.related_identifiers.last).to eq('relatedIdentifier' => '10.1038/ncb2764',
44
+ 'relatedIdentifierType' => 'DOI', 'relationType' => 'References')
45
+ expect(subject.funding_references).to eq([{ 'funderName' => 'SystemsX' },
46
+ { "funderName"=>"EMBO longterm post-doctoral fellowships"},
47
+ { "funderName"=>"Marie Heim-Voegtlin"},
48
+ { "funderIdentifier"=>"https://doi.org/10.13039/501100006390",
49
+ "funderIdentifierType"=>"Crossref Funder ID",
50
+ "funderName"=>"University of Lausanne"},
51
+ { 'funderName' => 'SystemsX' },
52
+ { 'funderIdentifier' => 'https://doi.org/10.13039/501100003043',
53
+ 'funderIdentifierType' => 'Crossref Funder ID',
54
+ 'funderName' => 'EMBO' },
55
+ { 'funderIdentifier' => 'https://doi.org/10.13039/501100001711',
56
+ 'funderIdentifierType' => 'Crossref Funder ID',
57
+ 'funderName' => 'Swiss National Science Foundation' },
58
+ { 'funderIdentifier' => 'https://doi.org/10.13039/501100006390',
59
+ 'funderIdentifierType' => 'Crossref Funder ID',
60
+ 'funderName' => 'University of Lausanne' }])
61
+ expect(subject.agency).to eq('Crossref')
62
+ end
63
+
64
+ it 'journal article' do
65
+ input = 'https://doi.org/10.1371/journal.pone.0000030'
66
+ subject = described_class.new(input: input, from: 'crossref_json')
67
+ expect(subject.valid?).to be true
68
+ expect(subject.id).to eq('https://doi.org/10.1371/journal.pone.0000030')
69
+ expect(subject.url).to eq('https://dx.plos.org/10.1371/journal.pone.0000030')
70
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
71
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
72
+ expect(subject.creators.length).to eq(5)
73
+ expect(subject.creators.first).to eq("nameType" => "Personal", 'name' => 'Ralser, Markus',
74
+ 'givenName' => 'Markus', 'familyName' => 'Ralser')
75
+ expect(subject.contributors).to eq([{ 'contributorType' => 'Editor', 'familyName' => 'Janbon',
76
+ 'givenName' => 'Guilhem', 'name' => 'Janbon, Guilhem', "nameType"=>"Personal" }])
77
+ expect(subject.titles).to eq([{"title"=>"Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes"}])
78
+ expect(subject.rights_list).to eq([{ 'rights' => 'Creative Commons Attribution 4.0 International',
79
+ 'rightsIdentifier' => 'cc-by-4.0',
80
+ 'rightsIdentifierScheme' => 'SPDX',
81
+ 'rightsUri' => 'https://creativecommons.org/licenses/by/4.0/legalcode',
82
+ 'schemeUri' => 'https://spdx.org/licenses/' }])
83
+ expect(subject.dates).to eq([{ 'date' => '2006-12-20', 'dateType' => 'Issued' },
84
+ { 'date' => '2021-08-06', 'dateType' => 'Updated' }])
85
+ expect(subject.publication_year).to eq('2006')
86
+ expect(subject.publisher).to eq('Public Library of Science (PLoS)')
87
+ expect(subject.related_identifiers.length).to eq(68)
88
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '1932-6203',
89
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
90
+ expect(subject.related_identifiers.last).to eq(
91
+ 'relatedIdentifier' => '10.1056/nejm199109123251104', 'relatedIdentifierType' => 'DOI', 'relationType' => 'References'
92
+ )
93
+ expect(subject.container).to eq('firstPage' => 'e30', 'identifier' => '1932-6203',
94
+ 'identifierType' => 'ISSN', 'issue' => '1', 'title' => 'PLoS ONE', 'type' => 'Journal', 'volume' => '1')
95
+ expect(subject.agency).to eq('Crossref')
96
+ end
97
+
98
+ it 'journal article with funding' do
99
+ input = '10.3389/fpls.2019.00816'
100
+ subject = described_class.new(input: input, from: 'crossref_json')
101
+ # expect(subject.errors).to be true
102
+ expect(subject.id).to eq('https://doi.org/10.3389/fpls.2019.00816')
103
+ expect(subject.url).to eq('https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full')
104
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
105
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
106
+ expect(subject.creators.length).to eq(4)
107
+ expect(subject.creators.first).to eq('familyName' => 'Fortes', 'givenName' => 'Ana Margarida',
108
+ 'name' => 'Fortes, Ana Margarida')
109
+ expect(subject.titles).to eq([{ 'title' => 'Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress' }])
110
+ expect(subject.rights_list).to eq([{ 'rights' => 'Creative Commons Attribution 4.0 International',
111
+ 'rightsIdentifier' => 'cc-by-4.0',
112
+ 'rightsIdentifierScheme' => 'SPDX',
113
+ 'rightsUri' => 'https://creativecommons.org/licenses/by/4.0/legalcode',
114
+ 'schemeUri' => 'https://spdx.org/licenses/' }])
115
+ expect(subject.dates).to eq([{ 'date' => '2019-07-02', 'dateType' => 'Issued' },
116
+ { 'date' => '2019-09-22', 'dateType' => 'Updated' }])
117
+ expect(subject.publication_year).to eq('2019')
118
+ expect(subject.publisher).to eq('Frontiers Media SA')
119
+ expect(subject.funding_references).to eq([{ 'awardNumber' => 'CA17111',
120
+ 'funderIdentifier' => 'https://doi.org/10.13039/501100000921', 'funderIdentifierType' => 'Crossref Funder ID', 'funderName' => 'COST (European Cooperation in Science and Technology)' }])
121
+ expect(subject.related_identifiers.length).to eq(70)
122
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '1664-462X',
123
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
124
+ expect(subject.related_identifiers.last).to eq(
125
+ 'relatedIdentifier' => '10.17660/actahortic.2004.632.41', 'relatedIdentifierType' => 'DOI', 'relationType' => 'References'
126
+ )
127
+ expect(subject.container).to eq('identifier' => '1664-462X',
128
+ 'identifierType' => 'ISSN', 'title' => 'Frontiers in Plant Science', 'type' => 'Journal', 'volume' => '10')
129
+ expect(subject.agency).to eq('Crossref')
130
+ end
131
+
132
+ it 'journal article original language title' do
133
+ input = 'https://doi.org/10.7600/jspfsm.56.60'
134
+ subject = described_class.new(input: input, from: 'crossref_json')
135
+ expect(subject.valid?).to be true
136
+ expect(subject.id).to eq('https://doi.org/10.7600/jspfsm.56.60')
137
+ expect(subject.url).to eq('https://www.jstage.jst.go.jp/article/jspfsm/56/1/56_1_60/_article/-char/ja')
138
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
139
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
140
+ expect(subject.creators).to eq([{ 'name' => ':(unav)', 'nameType' => 'Organizational' }])
141
+ expect(subject.titles).to eq([{"title"=>":(unav)"}])
142
+ expect(subject.dates).to include({ 'date' => '2007', 'dateType' => 'Issued' })
143
+ expect(subject.publication_year).to eq('2007')
144
+ expect(subject.publisher).to eq('The Japanese Society of Physical Fitness and Sports Medicine')
145
+ expect(subject.related_identifiers.length).to eq(8)
146
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '1881-4751',
147
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
148
+ expect(subject.container).to eq('firstPage' => '60', 'identifier' => '1881-4751',
149
+ 'identifierType' => 'ISSN', 'issue' => '1', 'lastPage' => '60', 'title' => 'Japanese Journal of Physical Fitness and Sports Medicine', 'type' => 'Journal', 'volume' => '56')
150
+ expect(subject.agency).to eq('Crossref')
151
+ end
152
+
153
+ it 'journal article with RDF for container' do
154
+ input = 'https://doi.org/10.1163/1937240X-00002096'
155
+ subject = described_class.new(input: input, from: 'crossref_json')
156
+ expect(subject.valid?).to be true
157
+ expect(subject.id).to eq('https://doi.org/10.1163/1937240x-00002096')
158
+ expect(subject.url).to eq('https://academic.oup.com/jcb/article-lookup/doi/10.1163/1937240X-00002096')
159
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
160
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
161
+ expect(subject.creators.length).to eq(8)
162
+ expect(subject.creators.first).to eq("familyName" => "Escrivà",
163
+ "givenName" => "Andreu",
164
+ "name" => "Escrivà, Andreu", "nameType" => "Personal")
165
+ expect(subject.titles).to eq([{ 'title' => "Global distribution of Fabaeformiscandona subacuta: an exotic invasive Ostracoda on the Iberian Peninsula?"}])
166
+ expect(subject.dates).to include({ 'date' => '2012-01-01', 'dateType' => 'Issued' })
167
+ expect(subject.publication_year).to eq('2012')
168
+ expect(subject.publisher).to eq('Oxford University Press (OUP)')
169
+ expect(subject.related_identifiers.length).to eq(44)
170
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '1937-240X',
171
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
172
+ expect(subject.related_identifiers.last).to eq('relatedIdentifier' => '10.1002/aqc.1122',
173
+ 'relatedIdentifierType' => 'DOI', 'relationType' => 'References')
174
+ expect(subject.container).to eq('firstPage' => '949', 'identifier' => '1937-240X',
175
+ 'identifierType' => 'ISSN', 'issue' => '6', 'lastPage' => '961', 'title' => 'Journal of Crustacean Biology', 'type' => 'Journal', 'volume' => '32')
176
+ expect(subject.agency).to eq('Crossref')
177
+ end
178
+
179
+ it 'book chapter with RDF for container' do
180
+ input = 'https://doi.org/10.1007/978-3-642-33191-6_49'
181
+ subject = described_class.new(input: input, from: 'crossref_json')
182
+ expect(subject.valid?).to be true
183
+ expect(subject.id).to eq('https://doi.org/10.1007/978-3-642-33191-6_49')
184
+ expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-642-33191-6_49')
185
+ expect(subject.types).to eq('bibtex' => 'inbook', 'citeproc' => 'chapter',
186
+ 'resourceType' => 'BookChapter', 'resourceTypeGeneral' => 'BookChapter', 'ris' => 'CHAP', 'schemaOrg' => 'Chapter')
187
+ expect(subject.creators.length).to eq(3)
188
+ expect(subject.creators.first).to eq('familyName' => 'Chen', 'givenName' => 'Lili', 'name' => 'Chen, Lili', "nameType" => "Personal")
189
+ expect(subject.titles).to eq([{ 'title' => 'Human Body Orientation Estimation in Multiview Scenarios' }])
190
+ expect(subject.dates).to eq([{ 'date' => '2012', 'dateType' => 'Issued' },
191
+ { 'date' => '2020-11-24', 'dateType' => 'Updated' }])
192
+ expect(subject.publication_year).to eq('2012')
193
+ expect(subject.publisher).to eq('Springer Berlin Heidelberg')
194
+ expect(subject.related_identifiers.length).to eq(8)
195
+ expect(subject.related_identifiers.first).to eq(
196
+ "relatedIdentifier"=>"1611-3349", "relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Collection"
197
+ )
198
+ expect(subject.container).to eq('identifier' => '1611-3349', 'identifierType' => 'ISSN',
199
+ 'title' => 'Advances in Visual Computing', 'type' => 'Book', 'firstPage' => '499', 'lastPage' => '508')
200
+ expect(subject.agency).to eq('Crossref')
201
+ end
202
+
203
+ it 'posted_content' do
204
+ input = 'https://doi.org/10.1101/097196'
205
+ subject = described_class.new(input: input, from: 'crossref_json')
206
+ expect(subject.valid?).to be true
207
+ expect(subject.url).to eq('http://biorxiv.org/lookup/doi/10.1101/097196')
208
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
209
+ 'resourceType' => 'PostedContent', 'resourceTypeGeneral' => 'Preprint', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
210
+ expect(subject.creators.count).to eq(11)
211
+ expect(subject.creators.last).to eq('nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-4060-7360', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }], 'name' => 'Clark, Timothy', 'givenName' => 'Timothy', 'familyName' => 'Clark', "nameType" => "Personal")
212
+ expect(subject.titles).to eq([{ 'title' => 'A Data Citation Roadmap for Scholarly Data Repositories' }])
213
+ expect(subject.id).to eq('https://doi.org/10.1101/097196')
214
+ expect(subject.descriptions.first['description']).to start_with('AbstractThis article presents a practical roadmap')
215
+ expect(subject.dates).to eq([{"date"=>"2016-12-28", "dateType"=>"Issued"},
216
+ {"date"=>"2020-01-18", "dateType"=>"Updated"}])
217
+ expect(subject.publication_year).to eq('2016')
218
+ expect(subject.publisher).to eq('Cold Spring Harbor Laboratory')
219
+ expect(subject.agency).to eq('Crossref')
220
+ end
221
+
222
+ it 'peer review' do
223
+ input = '10.7554/elife.55167.sa2'
224
+ subject = described_class.new(input: input, from: 'crossref_json')
225
+ expect(subject.valid?).to be true
226
+ expect(subject.url).to eq('https://elifesciences.org/articles/55167')
227
+ expect(subject.types).to eq('bibtex' => 'misc', 'citeproc' => 'article-journal',
228
+ 'resourceType' => 'PeerReview', 'resourceTypeGeneral' => 'PeerReview', 'ris' => 'GEN', 'schemaOrg' => 'Review')
229
+ expect(subject.creators.count).to eq(8)
230
+ expect(subject.creators.last).to eq('affiliation' => [{ 'name' => 'Center for Computational Mathematics, Flatiron Institute, New York, United States' }],
231
+ 'familyName' => 'Barnett',
232
+ 'givenName' => 'Alex H',
233
+ 'name' => 'Barnett, Alex H')
234
+ expect(subject.titles).to eq([{ 'title' => 'Author response: SpikeForest, reproducible web-facing ground-truth validation of automated neural spike sorters' }])
235
+ expect(subject.id).to eq('https://doi.org/10.7554/elife.55167.sa2')
236
+ expect(subject.identifiers.empty?).to be(true)
237
+ expect(subject.descriptions.empty?).to be(true)
238
+ expect(subject.dates).to eq([{"date"=>"2020-04-29", "dateType"=>"Issued"},
239
+ {"date"=>"2020-05-19", "dateType"=>"Updated"}])
240
+ expect(subject.publication_year).to eq('2020')
241
+ expect(subject.publisher).to eq('eLife Sciences Publications, Ltd')
242
+ expect(subject.agency).to eq('Crossref')
243
+ end
244
+
245
+ it 'dissertation' do
246
+ input = '10.14264/uql.2020.791'
247
+ subject = described_class.new(input: input, from: 'crossref_json')
248
+ expect(subject.valid?).to be true
249
+ expect(subject.url).to eq('http://espace.library.uq.edu.au/view/UQ:23a1e74')
250
+ expect(subject.types).to eq('bibtex' => 'phdthesis', 'citeproc' => 'thesis',
251
+ 'resourceType' => 'Dissertation', 'resourceTypeGeneral' => 'Dissertation', 'ris' => 'THES', 'schemaOrg' => 'Thesis')
252
+ expect(subject.creators).to eq([{ 'familyName' => 'Collingwood',
253
+ 'givenName' => 'Patricia Maree',
254
+ 'name' => 'Collingwood, Patricia Maree',
255
+ 'nameIdentifiers' =>
256
+ [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-3086-4443',
257
+ 'nameIdentifierScheme' => 'ORCID',
258
+ 'schemeUri' => 'https://orcid.org' }],
259
+ 'nameType' => 'Personal' }])
260
+ expect(subject.titles).to eq([{ 'title' => 'School truancy and financial independence during emerging adulthood: a longitudinal analysis of receipt of and reliance on cash transfers' }])
261
+ expect(subject.id).to eq('https://doi.org/10.14264/uql.2020.791')
262
+ expect(subject.identifiers.empty?).to be(true)
263
+ expect(subject.descriptions.empty?).to be(true)
264
+ expect(subject.dates).to eq([{"date"=>"2020-06-08", "dateType"=>"Issued"},
265
+ {"date"=>"2020-06-08", "dateType"=>"Updated"}])
266
+ expect(subject.publication_year).to eq('2020')
267
+ expect(subject.publisher).to eq('University of Queensland Library')
268
+ expect(subject.agency).to eq('Crossref')
269
+ end
270
+
271
+ it 'DOI with SICI DOI' do
272
+ input = '10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2'
273
+ subject = described_class.new(input: input, from: 'crossref_json')
274
+ expect(subject.valid?).to be true
275
+ expect(subject.id).to eq('https://doi.org/10.1890/0012-9658(2006)87%255b2832:tiopma%255d2.0.co;2')
276
+ expect(subject.url).to eq('http://doi.wiley.com/10.1890/0012-9658(2006)87%5B2832:TIOPMA%5D2.0.CO;2')
277
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
278
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
279
+ expect(subject.creators).to eq([
280
+ { 'name' => 'Fenton, A.', 'givenName' => 'A.',
281
+ 'familyName' => 'Fenton' }, { 'name' => 'Rands, S. A.', 'givenName' => 'S. A.', 'familyName' => 'Rands' }
282
+ ])
283
+ expect(subject.rights_list).to eq([{ 'rightsUri' => 'http://doi.wiley.com/10.1002/tdm_license_1.1' }])
284
+ expect(subject.titles).to eq([{ 'title' => "THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES"}])
285
+ expect(subject.dates).to eq([{ 'date' => '2006-11', 'dateType' => 'Issued' },
286
+ { 'date' => '2019-04-28', 'dateType' => 'Updated' }])
287
+ expect(subject.publication_year).to eq('2006')
288
+ expect(subject.publisher).to eq('Wiley')
289
+ expect(subject.related_identifiers.length).to eq(35)
290
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '0012-9658',
291
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
292
+ expect(subject.related_identifiers.last).to eq('relatedIdentifier' => '10.1098/rspb.2002.2213',
293
+ 'relatedIdentifierType' => 'DOI', 'relationType' => 'References')
294
+ expect(subject.container).to eq('firstPage' => '2832', 'identifier' => '0012-9658',
295
+ 'identifierType' => 'ISSN', 'issue' => '11', 'lastPage' => '2841', 'title' => 'Ecology', 'type' => 'Journal', 'volume' => '87')
296
+ expect(subject.agency).to eq('Crossref')
297
+ end
298
+
299
+ it 'DOI with ORCID ID' do
300
+ input = 'https://doi.org/10.1155/2012/291294'
301
+ subject = described_class.new(input: input, from: 'crossref_json')
302
+ expect(subject.valid?).to be true
303
+ expect(subject.id).to eq('https://doi.org/10.1155/2012/291294')
304
+ expect(subject.url).to eq('http://www.hindawi.com/journals/pm/2012/291294')
305
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
306
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
307
+ expect(subject.creators.length).to eq(7)
308
+ expect(subject.creators[2]).to eq('nameType' => 'Personal',
309
+ 'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-2043-4925', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }], 'name' => 'Hernandez, Beatriz', 'givenName' => 'Beatriz', 'familyName' => 'Hernandez', 'affiliation' => [{ 'name' => 'War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA' }, { 'name' => 'Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA' }])
310
+ expect(subject.rights_list).to eq([{ 'rights' => 'Creative Commons Attribution 3.0 Unported',
311
+ 'rightsIdentifier' => 'cc-by-3.0',
312
+ 'rightsIdentifierScheme' => 'SPDX',
313
+ 'rightsUri' => 'https://creativecommons.org/licenses/by/3.0/legalcode',
314
+ 'schemeUri' => 'https://spdx.org/licenses/' }])
315
+ expect(subject.titles).to eq([{ 'title' => 'Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers' }])
316
+ expect(subject.dates).to include({ 'date' => '2012', 'dateType' => 'Issued' })
317
+ expect(subject.publication_year).to eq('2012')
318
+ expect(subject.publisher).to eq('Hindawi Limited')
319
+ expect(subject.related_identifiers.length).to eq(18)
320
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '2090-1844',
321
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
322
+ expect(subject.related_identifiers.last).to eq('relatedIdentifier' => '10.1378/chest.12-0045',
323
+ 'relatedIdentifierType' => 'DOI', 'relationType' => 'References')
324
+ expect(subject.container).to eq('firstPage' => '1', 'identifier' => '2090-1844',
325
+ 'identifierType' => 'ISSN', 'lastPage' => '7', 'title' => 'Pulmonary Medicine', 'type' => 'Journal', 'volume' => '2012')
326
+ expect(subject.agency).to eq('Crossref')
327
+ end
328
+
329
+ it 'date in future' do
330
+ input = 'https://doi.org/10.1016/j.ejphar.2015.03.018'
331
+ subject = described_class.new(input: input, from: 'crossref_json')
332
+ expect(subject.valid?).to be true
333
+ expect(subject.id).to eq('https://doi.org/10.1016/j.ejphar.2015.03.018')
334
+ expect(subject.url).to eq('https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332')
335
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
336
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
337
+ expect(subject.creators.length).to eq(10)
338
+ expect(subject.creators.first).to eq('name' => 'Beck, Sarah E.',
339
+ 'givenName' => 'Sarah E.', 'familyName' => 'Beck')
340
+ expect(subject.titles).to eq([{ 'title' => 'Paving the path to HIV neurotherapy: Predicting SIV CNS disease' }])
341
+ expect(subject.dates).to include({ 'date' => '2015-07', 'dateType' => 'Issued' })
342
+ expect(subject.publication_year).to eq('2015')
343
+ expect(subject.publisher).to eq('Elsevier BV')
344
+ expect(subject.related_identifiers).to eq([{ 'relatedIdentifier' => '0014-2999', 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection' },
345
+ { 'relatedIdentifier' => '10.1212/01.wnl.0000287431.88658.8b',
346
+ 'relatedIdentifierType' => 'DOI',
347
+ 'relationType' => 'References' },
348
+ { 'relatedIdentifier' => '10.1182/blood-2010-09-308684',
349
+ 'relatedIdentifierType' => 'DOI',
350
+ 'relationType' => 'References' },
351
+ { 'relatedIdentifier' => '10.1007/s13365-015-0313-7',
352
+ 'relatedIdentifierType' => 'DOI',
353
+ 'relationType' => 'References' },
354
+ { 'relatedIdentifier' => '10.1016/j.jneuroim.2006.04.017',
355
+ 'relatedIdentifierType' => 'DOI',
356
+ 'relationType' => 'References' },
357
+ { 'relatedIdentifier' => '10.1086/514001',
358
+ 'relatedIdentifierType' => 'DOI',
359
+ 'relationType' => 'References' },
360
+ { 'relatedIdentifier' => '10.1002/ana.410310403',
361
+ 'relatedIdentifierType' => 'DOI',
362
+ 'relationType' => 'References' },
363
+ { 'relatedIdentifier' => '10.1093/infdis/jir214',
364
+ 'relatedIdentifierType' => 'DOI',
365
+ 'relationType' => 'References' },
366
+ { 'relatedIdentifier' => '10.1097/qad.0b013e32836010bd',
367
+ 'relatedIdentifierType' => 'DOI',
368
+ 'relationType' => 'References' },
369
+ { 'relatedIdentifier' => '10.1261/rna.036863.112',
370
+ 'relatedIdentifierType' => 'DOI',
371
+ 'relationType' => 'References' },
372
+ { 'relatedIdentifier' => '10.4103/0019-5359.107389',
373
+ 'relatedIdentifierType' => 'DOI',
374
+ 'relationType' => 'References' },
375
+ { 'relatedIdentifier' => '10.3233/jad-2008-14103',
376
+ 'relatedIdentifierType' => 'DOI',
377
+ 'relationType' => 'References' },
378
+ { 'relatedIdentifier' => '10.1126/science.287.5455.959',
379
+ 'relatedIdentifierType' => 'DOI',
380
+ 'relationType' => 'References' },
381
+ { 'relatedIdentifier' => '10.1097/01.qai.0000165799.59322.f5',
382
+ 'relatedIdentifierType' => 'DOI',
383
+ 'relationType' => 'References' },
384
+ { 'relatedIdentifier' => '10.1002/ana.410420503',
385
+ 'relatedIdentifierType' => 'DOI',
386
+ 'relationType' => 'References' },
387
+ { 'relatedIdentifier' => '10.1089/ars.2012.4834',
388
+ 'relatedIdentifierType' => 'DOI',
389
+ 'relationType' => 'References' },
390
+ { 'relatedIdentifier' => '10.1111/j.1600-0404.1987.tb05458.x',
391
+ 'relatedIdentifierType' => 'DOI',
392
+ 'relationType' => 'References' },
393
+ { 'relatedIdentifier' => '10.1097/00002030-198905000-00006',
394
+ 'relatedIdentifierType' => 'DOI',
395
+ 'relationType' => 'References' },
396
+ { 'relatedIdentifier' => '10.1002/ana.410200304',
397
+ 'relatedIdentifierType' => 'DOI',
398
+ 'relationType' => 'References' },
399
+ { 'relatedIdentifier' => '10.1186/1742-6405-2-6',
400
+ 'relatedIdentifierType' => 'DOI',
401
+ 'relationType' => 'References' },
402
+ { 'relatedIdentifier' => '10.1111/j.1600-0684.1993.tb00649.x',
403
+ 'relatedIdentifierType' => 'DOI',
404
+ 'relationType' => 'References' },
405
+ { 'relatedIdentifier' => '10.1186/1742-6405-7-15',
406
+ 'relatedIdentifierType' => 'DOI',
407
+ 'relationType' => 'References' },
408
+ { 'relatedIdentifier' => '10.1212/wnl.0b013e318200d727',
409
+ 'relatedIdentifierType' => 'DOI',
410
+ 'relationType' => 'References' },
411
+ { 'relatedIdentifier' => '10.1089/aid.2006.0292',
412
+ 'relatedIdentifierType' => 'DOI',
413
+ 'relationType' => 'References' },
414
+ { 'relatedIdentifier' => '10.1126/science.3646751',
415
+ 'relatedIdentifierType' => 'DOI',
416
+ 'relationType' => 'References' },
417
+ { 'relatedIdentifier' => '10.1002/ajmg.b.32071',
418
+ 'relatedIdentifierType' => 'DOI',
419
+ 'relationType' => 'References' },
420
+ { 'relatedIdentifier' => '10.1186/1756-6606-6-40',
421
+ 'relatedIdentifierType' => 'DOI',
422
+ 'relationType' => 'References' },
423
+ { 'relatedIdentifier' => '10.1086/344938',
424
+ 'relatedIdentifierType' => 'DOI',
425
+ 'relationType' => 'References' },
426
+ { 'relatedIdentifier' => '10.1128/jvi.71.8.6055-6060.1997',
427
+ 'relatedIdentifierType' => 'DOI',
428
+ 'relationType' => 'References' },
429
+ { 'relatedIdentifier' => '10.1016/j.jneuroim.2004.08.031',
430
+ 'relatedIdentifierType' => 'DOI',
431
+ 'relationType' => 'References' },
432
+ { 'relatedIdentifier' => '10.1371/journal.pone.0003603',
433
+ 'relatedIdentifierType' => 'DOI',
434
+ 'relationType' => 'References' },
435
+ { 'relatedIdentifier' => '10.1093/jnen/61.1.85',
436
+ 'relatedIdentifierType' => 'DOI',
437
+ 'relationType' => 'References' },
438
+ { 'relatedIdentifier' => '10.1097/qad.0b013e32832c4af0',
439
+ 'relatedIdentifierType' => 'DOI',
440
+ 'relationType' => 'References' },
441
+ { 'relatedIdentifier' => '10.3389/fgene.2013.00083',
442
+ 'relatedIdentifierType' => 'DOI',
443
+ 'relationType' => 'References' },
444
+ { 'relatedIdentifier' => '10.1080/13550280390194109',
445
+ 'relatedIdentifierType' => 'DOI',
446
+ 'relationType' => 'References' },
447
+ { 'relatedIdentifier' => '10.1002/ana.410420504',
448
+ 'relatedIdentifierType' => 'DOI',
449
+ 'relationType' => 'References' },
450
+ { 'relatedIdentifier' => '10.1001/archneur.61.11.1687',
451
+ 'relatedIdentifierType' => 'DOI',
452
+ 'relationType' => 'References' },
453
+ { 'relatedIdentifier' => '10.1212/01.wnl.0000277635.05973.55',
454
+ 'relatedIdentifierType' => 'DOI',
455
+ 'relationType' => 'References' },
456
+ { 'relatedIdentifier' => '10.1038/nmeth.3014',
457
+ 'relatedIdentifierType' => 'DOI',
458
+ 'relationType' => 'References' },
459
+ { 'relatedIdentifier' => '10.1097/qai.0000000000000048',
460
+ 'relatedIdentifierType' => 'DOI',
461
+ 'relationType' => 'References' },
462
+ { 'relatedIdentifier' => '10.1093/infdis/jit278',
463
+ 'relatedIdentifierType' => 'DOI',
464
+ 'relationType' => 'References' },
465
+ { 'relatedIdentifier' => '10.1007/s13365-014-0283-1',
466
+ 'relatedIdentifierType' => 'DOI',
467
+ 'relationType' => 'References' },
468
+ { 'relatedIdentifier' => '10.1097/00002030-199905280-00010',
469
+ 'relatedIdentifierType' => 'DOI',
470
+ 'relationType' => 'References' },
471
+ { 'relatedIdentifier' => '10.1097/qco.0b013e32834ef586',
472
+ 'relatedIdentifierType' => 'DOI',
473
+ 'relationType' => 'References' },
474
+ { 'relatedIdentifier' => '10.4049/jimmunol.169.6.3438',
475
+ 'relatedIdentifierType' => 'DOI',
476
+ 'relationType' => 'References' },
477
+ { 'relatedIdentifier' => '10.2174/1389200024605082',
478
+ 'relatedIdentifierType' => 'DOI',
479
+ 'relationType' => 'References' },
480
+ { 'relatedIdentifier' => '10.1126/science.1546323',
481
+ 'relatedIdentifierType' => 'DOI',
482
+ 'relationType' => 'References' },
483
+ { 'relatedIdentifier' => '10.1016/s1474-4422(14)70137-1',
484
+ 'relatedIdentifierType' => 'DOI',
485
+ 'relationType' => 'References' },
486
+ { 'relatedIdentifier' => '10.1016/j.jns.2009.06.043',
487
+ 'relatedIdentifierType' => 'DOI',
488
+ 'relationType' => 'References' },
489
+ { 'relatedIdentifier' => '10.1128/jvi.77.16.9029-9040.2003',
490
+ 'relatedIdentifierType' => 'DOI',
491
+ 'relationType' => 'References' },
492
+ { 'relatedIdentifier' => '10.1002/jcp.24254',
493
+ 'relatedIdentifierType' => 'DOI',
494
+ 'relationType' => 'References' },
495
+ { 'relatedIdentifier' => '10.1128/jvi.76.1.292-302.2002',
496
+ 'relatedIdentifierType' => 'DOI',
497
+ 'relationType' => 'References' },
498
+ { 'relatedIdentifier' => '10.1182/blood-2012-03-414706',
499
+ 'relatedIdentifierType' => 'DOI',
500
+ 'relationType' => 'References' },
501
+ { 'relatedIdentifier' => '10.1016/j.jneuroim.2013.11.004',
502
+ 'relatedIdentifierType' => 'DOI',
503
+ 'relationType' => 'References' },
504
+ { 'relatedIdentifier' => '10.1038/nrg3198',
505
+ 'relatedIdentifierType' => 'DOI',
506
+ 'relationType' => 'References' },
507
+ { 'relatedIdentifier' => '10.1016/s0140-6736(96)10178-1',
508
+ 'relatedIdentifierType' => 'DOI',
509
+ 'relationType' => 'References' },
510
+ { 'relatedIdentifier' => '10.1128/jvi.00366-11',
511
+ 'relatedIdentifierType' => 'DOI',
512
+ 'relationType' => 'References' },
513
+ { 'relatedIdentifier' => '10.1007/s13365-011-0053-2',
514
+ 'relatedIdentifierType' => 'DOI',
515
+ 'relationType' => 'References' },
516
+ { 'relatedIdentifier' => '10.1083/jcb.201211138',
517
+ 'relatedIdentifierType' => 'DOI',
518
+ 'relationType' => 'References' },
519
+ { 'relatedIdentifier' => '10.1111/j.1600-0684.2011.00475.x',
520
+ 'relatedIdentifierType' => 'DOI',
521
+ 'relationType' => 'References' },
522
+ { 'relatedIdentifier' => '10.1038/srep05915',
523
+ 'relatedIdentifierType' => 'DOI',
524
+ 'relationType' => 'References' },
525
+ { 'relatedIdentifier' => '10.1096/fj.09-143503',
526
+ 'relatedIdentifierType' => 'DOI',
527
+ 'relationType' => 'References' },
528
+ { 'relatedIdentifier' => '10.1542/peds.111.2.e168',
529
+ 'relatedIdentifierType' => 'DOI',
530
+ 'relationType' => 'References' },
531
+ { 'relatedIdentifier' => '10.2174/1566524013363555',
532
+ 'relatedIdentifierType' => 'DOI',
533
+ 'relationType' => 'References' },
534
+ { 'relatedIdentifier' => '10.1126/science.283.5403.857',
535
+ 'relatedIdentifierType' => 'DOI',
536
+ 'relationType' => 'References' },
537
+ { 'relatedIdentifier' => '10.1212/01.wnl.0000145763.68284.15',
538
+ 'relatedIdentifierType' => 'DOI',
539
+ 'relationType' => 'References' },
540
+ { 'relatedIdentifier' => '10.1002/ana.410230727',
541
+ 'relatedIdentifierType' => 'DOI',
542
+ 'relationType' => 'References' },
543
+ { 'relatedIdentifier' => '10.1186/1742-4690-10-95',
544
+ 'relatedIdentifierType' => 'DOI',
545
+ 'relationType' => 'References' },
546
+ { 'relatedIdentifier' => '10.1128/jvi.79.2.684-695.2005',
547
+ 'relatedIdentifierType' => 'DOI',
548
+ 'relationType' => 'References' },
549
+ { 'relatedIdentifier' => '10.1111/j.1600-0684.2005.00126.x',
550
+ 'relatedIdentifierType' => 'DOI',
551
+ 'relationType' => 'References' },
552
+ { 'relatedIdentifier' => '10.1186/1756-8722-6-6',
553
+ 'relatedIdentifierType' => 'DOI',
554
+ 'relationType' => 'References' },
555
+ { 'relatedIdentifier' => '10.1016/j.jmb.2013.12.017',
556
+ 'relatedIdentifierType' => 'DOI',
557
+ 'relationType' => 'References' },
558
+ { 'relatedIdentifier' => '10.1590/s0037-86822012000600002',
559
+ 'relatedIdentifierType' => 'DOI',
560
+ 'relationType' => 'References' },
561
+ { 'relatedIdentifier' => '10.1080/13550280390218715',
562
+ 'relatedIdentifierType' => 'DOI',
563
+ 'relationType' => 'References' },
564
+ { 'relatedIdentifier' => '10.1111/j.1468-1331.2012.03777.x',
565
+ 'relatedIdentifierType' => 'DOI',
566
+ 'relationType' => 'References' },
567
+ { 'relatedIdentifier' => '10.3233/jad-2010-090649',
568
+ 'relatedIdentifierType' => 'DOI',
569
+ 'relationType' => 'References' },
570
+ { 'relatedIdentifier' => '10.1080/13550280500516484',
571
+ 'relatedIdentifierType' => 'DOI',
572
+ 'relationType' => 'References' },
573
+ { 'relatedIdentifier' => '10.1080/13550280390218751',
574
+ 'relatedIdentifierType' => 'DOI',
575
+ 'relationType' => 'References' },
576
+ { 'relatedIdentifier' => '10.1189/jlb.0811394',
577
+ 'relatedIdentifierType' => 'DOI',
578
+ 'relationType' => 'References' },
579
+ { 'relatedIdentifier' => '10.1007/s11481-011-9330-3',
580
+ 'relatedIdentifierType' => 'DOI',
581
+ 'relationType' => 'References' },
582
+ { 'relatedIdentifier' => '10.1080/13550280802074539',
583
+ 'relatedIdentifierType' => 'DOI',
584
+ 'relationType' => 'References' },
585
+ { 'relatedIdentifier' => '10.1086/650743',
586
+ 'relatedIdentifierType' => 'DOI',
587
+ 'relationType' => 'References' },
588
+ { 'relatedIdentifier' => '10.1371/journal.pone.0008129',
589
+ 'relatedIdentifierType' => 'DOI',
590
+ 'relationType' => 'References' },
591
+ { 'relatedIdentifier' => '10.1128/jvi.80.10.5074-5077.2006',
592
+ 'relatedIdentifierType' => 'DOI',
593
+ 'relationType' => 'References' },
594
+ { 'relatedIdentifier' => '10.1186/1742-2094-10-62',
595
+ 'relatedIdentifierType' => 'DOI',
596
+ 'relationType' => 'References' },
597
+ { 'relatedIdentifier' => '10.1086/323478',
598
+ 'relatedIdentifierType' => 'DOI',
599
+ 'relationType' => 'References' },
600
+ { 'relatedIdentifier' => '10.1128/jvi.73.12.10480-10488.1999',
601
+ 'relatedIdentifierType' => 'DOI',
602
+ 'relationType' => 'References' },
603
+ { 'relatedIdentifier' => '10.1111/hiv.12134',
604
+ 'relatedIdentifierType' => 'DOI',
605
+ 'relationType' => 'References' }])
606
+ expect(subject.container).to eq('firstPage' => '303', 'identifier' => '0014-2999',
607
+ 'identifierType' => 'ISSN', 'lastPage' => '312', 'title' => 'European Journal of Pharmacology', 'type' => 'Journal', 'volume' => '759')
608
+ expect(subject.agency).to eq('Crossref')
609
+ end
610
+
611
+ it 'vor with url' do
612
+ input = 'https://doi.org/10.1038/hdy.2013.26'
613
+ subject = described_class.new(input: input, from: 'crossref_json')
614
+ expect(subject.valid?).to be true
615
+ expect(subject.id).to eq('https://doi.org/10.1038/hdy.2013.26')
616
+ expect(subject.url).to eq('http://www.nature.com/articles/hdy201326')
617
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
618
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
619
+ expect(subject.creators.length).to eq(2)
620
+ expect(subject.creators.first).to eq('familyName' => 'Gross', 'givenName' => 'J B', 'name' => 'Gross, J B')
621
+ expect(subject.titles).to eq([{ 'title' => 'Albinism in phylogenetically and geographically distinct populations of Astyanax cavefish arises through the same loss-of-function Oca2 allele' }])
622
+ expect(subject.dates).to include({ 'date' => '2013-04-10', 'dateType' => 'Issued' })
623
+ expect(subject.publication_year).to eq('2013')
624
+ expect(subject.publisher).to eq('Springer Science and Business Media LLC')
625
+ expect(subject.related_identifiers.size).to eq(35)
626
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '1365-2540',
627
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
628
+ expect(subject.container).to eq('firstPage' => '122', 'identifier' => '1365-2540',
629
+ 'identifierType' => 'ISSN', 'issue' => '2', 'lastPage' => '130', 'title' => 'Heredity', 'type' => 'Journal', 'volume' => '111')
630
+ expect(subject.agency).to eq('Crossref')
631
+ end
632
+
633
+ it 'dataset' do
634
+ input = 'https://doi.org/10.2210/pdb4hhb/pdb'
635
+ subject = described_class.new(input: input, from: 'crossref_json')
636
+ expect(subject.valid?).to be true
637
+ expect(subject.id).to eq('https://doi.org/10.2210/pdb4hhb/pdb')
638
+ expect(subject.url).to eq('https://www.wwpdb.org/pdb?id=pdb_00004hhb')
639
+ expect(subject.types).to eq('bibtex' => 'misc', 'citeproc' => 'article-journal',
640
+ 'resourceType' => 'Component', 'resourceTypeGeneral' => 'Text', 'ris' => 'GEN', 'schemaOrg' => 'CreativeWork')
641
+ expect(subject.creators.length).to eq(2)
642
+ expect(subject.creators.first).to eq('name' => 'Fermi, G.', 'givenName' => 'G.', 'familyName' => 'Fermi')
643
+ expect(subject.titles).to eq([{ 'title' => 'THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION' }])
644
+ expect(subject.descriptions).to eq([])
645
+ expect(subject.dates).to include({ 'date' => '1984-07-17', 'dateType' => 'Issued' })
646
+ expect(subject.publication_year).to eq('1984')
647
+ expect(subject.publisher).to eq('Worldwide Protein Data Bank')
648
+ expect(subject.agency).to eq('Crossref')
649
+ end
650
+
651
+ it 'component' do
652
+ input = 'https://doi.org/10.1371/journal.pmed.0030277.g001'
653
+ subject = described_class.new(input: input, from: 'crossref_json')
654
+ expect(subject.valid?).to be true
655
+ expect(subject.id).to eq('https://doi.org/10.1371/journal.pmed.0030277.g001')
656
+ expect(subject.url).to eq('https://dx.plos.org/10.1371/journal.pmed.0030277.g001')
657
+ expect(subject.types).to eq('bibtex' => 'misc', 'citeproc' => 'article-journal',
658
+ 'resourceType' => 'Component', 'resourceTypeGeneral' => 'Text', 'ris' => 'GEN', 'schemaOrg' => 'CreativeWork')
659
+ expect(subject.creators).to eq([{ 'name' => ':(unav)', 'nameType' => 'Organizational' }])
660
+ expect(subject.titles).to eq([{ 'title' => ':(unav)' }])
661
+ expect(subject.descriptions.empty?).to be(true)
662
+ expect(subject.dates).to eq([{ 'date' => '2015-10-20', 'dateType' => 'Issued' },
663
+ { 'date' => '2018-10-19', 'dateType' => 'Updated' }])
664
+ expect(subject.publication_year).to eq('2015')
665
+ expect(subject.publisher).to eq('Public Library of Science (PLoS)')
666
+ expect(subject.agency).to eq('Crossref')
667
+ end
668
+
669
+ it 'dataset usda' do
670
+ input = 'https://doi.org/10.2737/RDS-2018-0001'
671
+ subject = described_class.new(input: input, from: 'crossref_json')
672
+ expect(subject.valid?).to be true
673
+ expect(subject.id).to eq('https://doi.org/10.2737/rds-2018-0001')
674
+ expect(subject.url).to eq('https://www.fs.usda.gov/rds/archive/Catalog/RDS-2018-0001')
675
+ expect(subject.types).to eq('bibtex' => 'misc', 'citeproc' => 'dataset',
676
+ 'resourceType' => 'Dataset', 'resourceTypeGeneral' => 'Dataset', 'ris' => 'DATA', 'schemaOrg' => 'Dataset')
677
+ expect(subject.creators.length).to eq(4)
678
+ expect(subject.creators.first).to eq('familyName' => 'Ribic', 'givenName' => 'Christine A.',
679
+ 'name' => 'Ribic, Christine A.', 'affiliation' => [{ 'name' => 'U.S. Geological Survey' }], 'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-2583-1778', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }], 'nameType' => 'Personal')
680
+ expect(subject.titles).to eq([{ 'title' => 'Fledging times of grassland birds' }])
681
+ expect(subject.descriptions.empty?).to be(true)
682
+ expect(subject.dates).to eq([{ 'date' => '2017-08-09', 'dateType' => 'Issued' },
683
+ { 'date' => '2021-07-01', 'dateType' => 'Updated' }])
684
+ expect(subject.publication_year).to eq('2017')
685
+ expect(subject.publisher).to eq('Forest Service Research Data Archive')
686
+ expect(subject.agency).to eq('Crossref')
687
+ end
688
+
689
+ it 'book chapter' do
690
+ input = 'https://doi.org/10.1007/978-3-662-46370-3_13'
691
+ subject = described_class.new(input: input, from: 'crossref_json')
692
+ expect(subject.valid?).to be true
693
+ expect(subject.id).to eq('https://doi.org/10.1007/978-3-662-46370-3_13')
694
+ expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-662-46370-3_13')
695
+ expect(subject.types).to eq('bibtex' => 'inbook', 'citeproc' => 'chapter',
696
+ 'resourceType' => 'BookChapter', 'resourceTypeGeneral' => 'BookChapter', 'ris' => 'CHAP', 'schemaOrg' => 'Chapter')
697
+ expect(subject.creators.length).to eq(2)
698
+ expect(subject.creators.first).to eq('name' => 'Diercks, Ronald L.',
699
+ 'givenName' => 'Ronald L.', 'familyName' => 'Diercks')
700
+ expect(subject.titles).to eq([{ 'title' => 'Clinical Symptoms and Physical Examinations' }])
701
+ expect(subject.dates).to eq([{ 'date' => '2015', 'dateType' => 'Issued' },
702
+ { 'date' => '2015-04-13', 'dateType' => 'Updated' }])
703
+ expect(subject.publication_year).to eq('2015')
704
+ expect(subject.publisher).to eq('Springer Berlin Heidelberg')
705
+ expect(subject.agency).to eq('Crossref')
706
+ expect(subject.container['type']).to eq('Book')
707
+ expect(subject.container['title']).to eq('Shoulder Stiffness')
708
+ expect(subject.container['firstPage']).to eq('155')
709
+ expect(subject.container['lastPage']).to eq('158')
710
+ end
711
+
712
+ it 'another book chapter' do
713
+ input = 'https://doi.org/10.1007/978-3-319-75889-3_1'
714
+ subject = described_class.new(input: input, from: 'crossref_json')
715
+ expect(subject.valid?).to be true
716
+ expect(subject.id).to eq('https://doi.org/10.1007/978-3-319-75889-3_1')
717
+ expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-319-75889-3_1')
718
+ expect(subject.types).to eq('bibtex' => 'inbook', 'citeproc' => 'chapter',
719
+ 'resourceType' => 'BookChapter', 'resourceTypeGeneral' => 'BookChapter', 'ris' => 'CHAP', 'schemaOrg' => 'Chapter')
720
+ expect(subject.creators).to eq([{ 'familyName' => 'Jones', 'givenName' => 'Hunter M.',
721
+ 'name' => 'Jones, Hunter M.' }])
722
+ expect(subject.titles).to eq([{ 'title' => 'Climate Change and Increasing Risk of Extreme Heat' }])
723
+ expect(subject.dates).to include({ 'date' => '2018', 'dateType' => 'Issued' })
724
+ expect(subject.publication_year).to eq('2018')
725
+ expect(subject.publisher).to eq('Springer International Publishing')
726
+ expect(subject.agency).to eq('Crossref')
727
+ expect(subject.container['type']).to eq('Book')
728
+ expect(subject.container['title']).to eq('SpringerBriefs in Medical Earth Sciences')
729
+ expect(subject.container['identifier']).to eq('2523-3629')
730
+ expect(subject.container['identifierType']).to eq('ISSN')
731
+ end
732
+
733
+ it 'yet another book chapter' do
734
+ input = 'https://doi.org/10.4018/978-1-4666-1891-6.ch004'
735
+ subject = described_class.new(input: input, from: 'crossref_json')
736
+ expect(subject.valid?).to be true
737
+ expect(subject.id).to eq('https://doi.org/10.4018/978-1-4666-1891-6.ch004')
738
+ expect(subject.url).to eq('http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018%2F978-1-4666-1891-6.ch004')
739
+ expect(subject.types).to eq('bibtex' => 'inbook', 'citeproc' => 'chapter',
740
+ 'resourceType' => 'BookChapter', 'resourceTypeGeneral' => 'BookChapter', 'ris' => 'CHAP', 'schemaOrg' => 'Chapter')
741
+ expect(subject.creators).to eq([{ 'affiliation' => [{"name"=>"Université de Lyon, France"}],
742
+ 'familyName' => 'Bichot', 'givenName' => 'Charles-Edmond', 'name' => 'Bichot, Charles-Edmond' }])
743
+ expect(subject.titles).to eq([{ 'title' => 'Unsupervised and Supervised Image Segmentation Using Graph Partitioning' }])
744
+ expect(subject.dates).to eq([{ 'date' => '2012-08-08', 'dateType' => 'Issued' },
745
+ { 'date' => '2019-07-02', 'dateType' => 'Updated' }])
746
+ expect(subject.publication_year).to eq('2012')
747
+ expect(subject.publisher).to eq('IGI Global')
748
+ expect(subject.agency).to eq('Crossref')
749
+ expect(subject.container['type']).to eq('Book')
750
+ expect(subject.container['title']).to eq('Graph-Based Methods in Computer Vision')
751
+ expect(subject.container['firstPage']).to eq('72')
752
+ expect(subject.container['lastPage']).to eq('94')
753
+ end
754
+
755
+ it 'missing creator' do
756
+ input = 'https://doi.org/10.3390/publications6020015'
757
+ subject = described_class.new(input: input, from: 'crossref_json')
758
+ expect(subject.valid?).to be true
759
+ expect(subject.id).to eq('https://doi.org/10.3390/publications6020015')
760
+ expect(subject.url).to eq('https://www.mdpi.com/2304-6775/6/2/15')
761
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
762
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
763
+ expect(subject.creators).to eq([{ 'familyName' => 'Kohls',
764
+ 'givenName' => 'Alexander',
765
+ 'name' => 'Kohls, Alexander',
766
+ 'nameIdentifiers' =>
767
+ [{ 'nameIdentifier' => 'https://orcid.org/0000-0002-3836-8885',
768
+ 'nameIdentifierScheme' => 'ORCID',
769
+ 'schemeUri' => 'https://orcid.org' }],
770
+ 'nameType' => 'Personal' },
771
+ { 'familyName' => 'Mele',
772
+ 'givenName' => 'Salvatore',
773
+ 'name' => 'Mele, Salvatore',
774
+ 'nameIdentifiers' =>
775
+ [{ 'nameIdentifier' => 'https://orcid.org/0000-0003-0762-2235',
776
+ 'nameIdentifierScheme' => 'ORCID',
777
+ 'schemeUri' => 'https://orcid.org' }],
778
+ 'nameType' => 'Personal' }])
779
+ expect(subject.titles).to eq([{ 'title' => 'Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics' }])
780
+ expect(subject.dates).to eq([{ 'date' => '2018-04-09', 'dateType' => 'Issued' },
781
+ { 'date' => '2021-07-22', 'dateType' => 'Updated' }])
782
+ expect(subject.publication_year).to eq('2018')
783
+ expect(subject.publisher).to eq('MDPI AG')
784
+ expect(subject.agency).to eq('Crossref')
785
+ end
786
+
787
+ it 'book' do
788
+ input = 'https://doi.org/10.1017/9781108348843'
789
+ subject = described_class.new(input: input, from: 'crossref_json')
790
+ expect(subject.valid?).to be true
791
+ expect(subject.id).to eq('https://doi.org/10.1017/9781108348843')
792
+ expect(subject.url).to eq('https://www.cambridge.org/core/product/identifier/9781108348843/type/book')
793
+ expect(subject.types).to eq('bibtex' => 'book', 'citeproc' => 'book', 'resourceType' => 'Monograph',
794
+ 'resourceTypeGeneral' => 'Book', 'ris' => 'BOOK', 'schemaOrg' => 'Book')
795
+ expect(subject.creators).to eq([{ 'familyName' => 'Leung', 'givenName' => 'Vincent S.', 'name' => 'Leung, Vincent S.' }])
796
+ expect(subject.titles).to eq([{ 'title' => 'The Politics of the Past in Early China' }])
797
+ expect(subject.dates).to eq([{ 'date' => '2019-07-01', 'dateType' => 'Issued' },
798
+ { 'date' => '2022-09-22', 'dateType' => 'Updated' }])
799
+ expect(subject.publication_year).to eq('2019')
800
+ expect(subject.publisher).to eq('Cambridge University Press')
801
+ expect(subject.agency).to eq('Crossref')
802
+ end
803
+
804
+ it 'another book' do
805
+ input = 'https://doi.org/10.2973/odp.proc.ir.180.2000'
806
+ subject = described_class.new(input: input, from: 'crossref_json')
807
+ expect(subject.valid?).to be true
808
+ expect(subject.id).to eq('https://doi.org/10.2973/odp.proc.ir.180.2000')
809
+ expect(subject.url).to eq('http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM')
810
+ expect(subject.types).to eq('bibtex' => 'book', 'citeproc' => 'book', 'resourceType' => 'Monograph',
811
+ 'resourceTypeGeneral' => 'Book', 'ris' => 'BOOK', 'schemaOrg' => 'Book')
812
+ expect(subject.creators).to eq([{ 'name' => ':(unav)', 'nameType' => 'Organizational' }])
813
+ expect(subject.contributors.size).to eq(4)
814
+ expect(subject.contributors.first).to eq('contributorType' => 'Editor', 'familyName' => 'Taylor',
815
+ 'givenName' => 'B.', 'name' => 'Taylor, B.')
816
+ expect(subject.titles).to eq([{ 'title' => 'Proceedings of the Ocean Drilling Program, 180 Initial Reports' }])
817
+ expect(subject.dates).to eq([{ 'date' => '2000-02-04', 'dateType' => 'Issued' },
818
+ { 'date' => '2009-02-02', 'dateType' => 'Updated' }])
819
+ expect(subject.publication_year).to eq('2000')
820
+ expect(subject.publisher).to eq('Ocean Drilling Program')
821
+ expect(subject.agency).to eq('Crossref')
822
+ end
823
+
824
+ it 'yet another book' do
825
+ input = 'https://doi.org/10.1029/ar035'
826
+ subject = described_class.new(input: input, from: 'crossref_json')
827
+ expect(subject.valid?).to be true
828
+ expect(subject.id).to eq('https://doi.org/10.1029/ar035')
829
+ expect(subject.url).to eq('http://doi.wiley.com/10.1029/AR035')
830
+ expect(subject.types).to eq('bibtex' => 'book', 'citeproc' => 'book', 'resourceType' => 'Monograph',
831
+ 'resourceTypeGeneral' => 'Book', 'ris' => 'BOOK', 'schemaOrg' => 'Book')
832
+ expect(subject.creators).to eq([{ 'familyName' => 'McGinnis', 'givenName' => 'Richard Frank', 'name' => 'McGinnis, Richard Frank' }])
833
+ expect(subject.titles).to eq([{"title"=>"Biogeography of Lanternfishes (Myctophidae) South of 30°S"}])
834
+ expect(subject.dates).to eq([{ 'date' => '1982', 'dateType' => 'Issued' },
835
+ { 'date' => '2021-12-04', 'dateType' => 'Updated' }])
836
+ expect(subject.publication_year).to eq('1982')
837
+ expect(subject.publisher).to eq('American Geophysical Union')
838
+ expect(subject.related_identifiers.length).to eq(47)
839
+ expect(subject.related_identifiers.first).to eq(
840
+ "relatedIdentifier" => "0066-4634",
841
+ "relatedIdentifierType" => "ISSN",
842
+ "relationType" => "IsPartOf",
843
+ "resourceTypeGeneral" => "Collection",
844
+ )
845
+ expect(subject.container).to eq('identifier' => '0066-4634', 'identifierType' => 'ISSN',
846
+ 'title' => 'Antarctic Research Series', 'type' => 'BookSeries')
847
+ expect(subject.agency).to eq('Crossref')
848
+ expect(subject.date_registered).to eq("2011-09-08")
849
+ end
850
+
851
+ it 'mEDRA' do
852
+ input = 'https://doi.org/10.3280/ecag2018-001005'
853
+ subject = described_class.new(input: input, from: 'crossref_json')
854
+ expect(subject.valid?).to be true
855
+ expect(subject.id).to eq('https://doi.org/10.3280/ecag2018-001005')
856
+ expect(subject.url).to eq('http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645')
857
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
858
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
859
+ expect(subject.creators.length).to eq(2)
860
+ expect(subject.creators.first).to eq('familyName' => 'Oh', 'givenName' => 'Sohae Eve',
861
+ 'name' => 'Oh, Sohae Eve')
862
+ expect(subject.titles).to eq([{ 'title' => 'Substitutability between organic and conventional poultry products and organic price premiums' }])
863
+ expect(subject.dates).to include({ 'date' => '2018-05', 'dateType' => 'Issued' })
864
+ expect(subject.publication_year).to eq('2018')
865
+ expect(subject.publisher).to eq('Franco Angeli')
866
+ expect(subject.agency).to eq('Crossref')
867
+ end
868
+
869
+ it 'KISTI' do
870
+ input = 'https://doi.org/10.5012/bkcs.2013.34.10.2889'
871
+ subject = described_class.new(input: input, from: 'crossref_json')
872
+ expect(subject.valid?).to be true
873
+ expect(subject.id).to eq('https://doi.org/10.5012/bkcs.2013.34.10.2889')
874
+ expect(subject.url).to eq('http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889')
875
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
876
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
877
+ expect(subject.creators.length).to eq(7)
878
+ expect(subject.creators.first).to eq('familyName' => 'Huang', 'givenName' => 'Guimei', 'name' => 'Huang, Guimei')
879
+ expect(subject.titles).to eq([{ 'title' => 'Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline' }])
880
+ expect(subject.dates).to eq([{ 'date' => '2013-10-20', 'dateType' => 'Issued' },
881
+ { 'date' => '2016-12-15', 'dateType' => 'Updated' }])
882
+ expect(subject.publication_year).to eq('2013')
883
+ expect(subject.publisher).to eq('Korean Chemical Society')
884
+ expect(subject.agency).to eq('KISTI')
885
+ end
886
+
887
+ it 'JaLC' do
888
+ input = 'https://doi.org/10.1241/johokanri.39.979'
889
+ subject = described_class.new(input: input, from: 'crossref_json')
890
+ expect(subject.valid?).to be true
891
+ expect(subject.id).to eq('https://doi.org/10.1241/johokanri.39.979')
892
+ expect(subject.url).to eq('http://joi.jlc.jst.go.jp/JST.JSTAGE/johokanri/39.979?from=CrossRef')
893
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
894
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
895
+ expect(subject.creators).to eq([{ 'familyName' => 'KUSUMOTO', 'givenName' => 'Hiroyuki', 'name' => 'KUSUMOTO, Hiroyuki', "nameType"=>"Personal"
896
+ }])
897
+ expect(subject.titles).to eq([{ 'title' => 'Utilizing the Internet. 12 Series. Future of the Internet.' }])
898
+ expect(subject.dates).to eq([{ 'date' => '1997', 'dateType' => 'Issued' },
899
+ { 'date' => '2020-03-06', 'dateType' => 'Updated' }])
900
+ expect(subject.publication_year).to eq('1997')
901
+ expect(subject.publisher).to eq('Japan Science and Technology Agency (JST)')
902
+ expect(subject.agency).to eq('JaLC')
903
+ end
904
+
905
+ it 'OP' do
906
+ input = 'https://doi.org/10.2903/j.efsa.2018.5239'
907
+ subject = described_class.new(input: input, from: 'crossref_json')
908
+ expect(subject.valid?).to be true
909
+ expect(subject.id).to eq('https://doi.org/10.2903/j.efsa.2018.5239')
910
+ expect(subject.url).to eq('http://doi.wiley.com/10.2903/j.efsa.2018.5239')
911
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
912
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
913
+ expect(subject.creators.length).to eq(28)
914
+ expect(subject.creators.first).to eq('name' => 'EFSA Panel on Food Additives and Nutrient Sources added to Food (ANS)')
915
+ expect(subject.titles).to eq([{ 'title' => 'Scientific opinion on the safety of green tea catechins' }])
916
+ expect(subject.dates).to include({ 'date' => '2018-04', 'dateType' => 'Issued' })
917
+ expect(subject.publication_year).to eq('2018')
918
+ expect(subject.publisher).to eq('Wiley')
919
+ expect(subject.agency).to eq('OP')
920
+ end
921
+
922
+ it 'multiple titles' do
923
+ input = 'https://doi.org/10.4000/dms.865'
924
+ subject = described_class.new(input: input, from: 'crossref_json')
925
+ expect(subject.valid?).to be true
926
+ expect(subject.id).to eq('https://doi.org/10.4000/dms.865')
927
+ expect(subject.url).to eq('http://journals.openedition.org/dms/865')
928
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
929
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
930
+ expect(subject.creators).to eq([{ 'familyName' => 'Peraya', 'givenName' => 'Daniel',
931
+ 'name' => 'Peraya, Daniel', "nameType"=>"Personal" }])
932
+ expect(subject.titles).to eq([{ 'title' => "Distances, absence, proximités et présences : des concepts en déplacement"}])
933
+ expect(subject.dates).to include({ 'date' => '2014-12-14', 'dateType' => 'Issued' })
934
+ expect(subject.publication_year).to eq('2014')
935
+ expect(subject.publisher).to eq('OpenEdition')
936
+ expect(subject.agency).to eq('Crossref')
937
+ expect(subject.date_registered).to eq("2015-02-01")
938
+ end
939
+
940
+ it 'multiple titles with missing' do
941
+ input = 'https://doi.org/10.1186/1471-2164-7-187'
942
+ subject = described_class.new(input: input, from: 'crossref_json')
943
+ expect(subject.valid?).to be true
944
+ expect(subject.id).to eq('https://doi.org/10.1186/1471-2164-7-187')
945
+ expect(subject.url).to eq('https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187')
946
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
947
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
948
+ expect(subject.creators).to eq([{ 'familyName' => 'Myers',
949
+ 'givenName' => 'Chad L',
950
+ 'name' => 'Myers, Chad L' },
951
+ { 'familyName' => 'Barrett',
952
+ 'givenName' => 'Daniel R',
953
+ 'name' => 'Barrett, Daniel R' },
954
+ { 'familyName' => 'Hibbs',
955
+ 'givenName' => 'Matthew A',
956
+ 'name' => 'Hibbs, Matthew A' },
957
+ { 'familyName' => 'Huttenhower',
958
+ 'givenName' => 'Curtis',
959
+ 'name' => 'Huttenhower, Curtis',
960
+ "nameType"=>"Personal" },
961
+ { 'familyName' => 'Troyanskaya',
962
+ 'givenName' => 'Olga G',
963
+ 'name' => 'Troyanskaya, Olga G' }])
964
+ expect(subject.titles).to eq([{ 'title' => 'Finding function: evaluation methods for functional genomic data' }])
965
+ expect(subject.dates).to include({ 'date' => '2006-07-25', 'dateType' => 'Issued' })
966
+ expect(subject.publication_year).to eq('2006')
967
+ expect(subject.publisher).to eq('Springer Science and Business Media LLC')
968
+ expect(subject.agency).to eq('Crossref')
969
+ end
970
+
971
+ it 'markup' do
972
+ input = 'https://doi.org/10.1098/rspb.2017.0132'
973
+ subject = described_class.new(input: input, from: 'crossref_json')
974
+ expect(subject.valid?).to be true
975
+ expect(subject.id).to eq('https://doi.org/10.1098/rspb.2017.0132')
976
+ expect(subject.url).to eq('https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132')
977
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
978
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
979
+ expect(subject.creators.size).to eq(6)
980
+ expect(subject.creators.first).to eq(
981
+ 'affiliation' => [{ 'name' => 'School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia' }], 'familyName' => 'Dougherty', 'givenName' => 'Liam R.', 'name' => 'Dougherty, Liam R.', 'nameIdentifiers' => [{
982
+ 'nameIdentifier' => 'https://orcid.org/0000-0003-1406-0680', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org'
983
+ }], 'nameType' => 'Personal'
984
+ )
985
+ expect(subject.titles).to eq([{ 'title' => 'Sexual conflict and correlated evolution between male persistence and female resistance traits in the seed beetle <i>Callosobruchus maculatus</i>' }])
986
+ expect(subject.dates).to include({ 'date' => '2017-05-24', 'dateType' => 'Issued' })
987
+ expect(subject.publication_year).to eq('2017')
988
+ expect(subject.publisher).to eq('The Royal Society')
989
+ expect(subject.agency).to eq('Crossref')
990
+ expect(subject.date_registered).to eq('2017-05-24')
991
+ end
992
+
993
+ it 'empty given name' do
994
+ input = 'https://doi.org/10.1111/J.1865-1682.2010.01171.X'
995
+ subject = described_class.new(input: input, from: 'crossref_json')
996
+ expect(subject.valid?).to be true
997
+ expect(subject.id).to eq('https://doi.org/10.1111/j.1865-1682.2010.01171.x')
998
+ expect(subject.url).to eq('https://onlinelibrary.wiley.com/doi/10.1111/j.1865-1682.2010.01171.x')
999
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1000
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1001
+ expect(subject.creators.length).to eq(5)
1002
+ expect(subject.creators[3]).to eq('familyName' => 'Ehtisham-ul-Haq',
1003
+ 'name' => 'Ehtisham-ul-Haq')
1004
+ expect(subject.titles).to eq([{ 'title' => 'Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study' }])
1005
+ expect(subject.rights_list).to eq([{ 'rightsUri' => 'http://doi.wiley.com/10.1002/tdm_license_1.1' }])
1006
+ expect(subject.dates).to eq([{"date"=>"2010-09-29", "dateType"=>"Issued"}, {"date"=>"2021-07-07", "dateType"=>"Updated"}])
1007
+ expect(subject.publication_year).to eq('2010')
1008
+ expect(subject.publisher).to eq('Wiley')
1009
+ end
1010
+
1011
+ it 'invalid date' do
1012
+ input = 'https://doi.org/10.1055/s-0039-1690894'
1013
+ subject = described_class.new(input: input, from: 'crossref_json')
1014
+ expect(subject.valid?).to be true
1015
+ expect(subject.id).to eq('https://doi.org/10.1055/s-0039-1690894')
1016
+ expect(subject.url).to eq('http://www.thieme-connect.de/DOI/DOI?10.1055%2Fs-0039-1690894')
1017
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1018
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1019
+ expect(subject.creators.length).to eq(4)
1020
+ expect(subject.creators[1]).to eq('affiliation' => [{ 'name' => 'Department of Chemistry, Tianjin Key Laboratory of Molecular Optoelectronic Sciences, and Tianjin Collaborative Innovation Centre of Chemical Science and Engineering, Tianjin University' }, { 'name' => 'Joint School of National University of Singapore and Tianjin University, International Campus of Tianjin University' }],
1021
+ 'familyName' => 'Ma',
1022
+ 'givenName' => 'Jun-An',
1023
+ 'name' => 'Ma, Jun-An',
1024
+ 'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0002-3902-6799',
1025
+ 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }],
1026
+ 'nameType' => 'Personal')
1027
+ expect(subject.titles).to eq([{ 'title' => "Silver-Catalyzed [3+3] Annulation of Glycine Imino Esters with Seyferth–Gilbert Reagent To Access Tetrahydro-1,2,4-triazinecarboxylate Esters"}])
1028
+ expect(subject.dates).to eq([{ 'date' => '2020-04-08', 'dateType' => 'Issued' },
1029
+ { 'date' => '2020-06-16', 'dateType' => 'Updated' }])
1030
+ expect(subject.publication_year).to eq('2020')
1031
+ expect(subject.publisher).to eq('Georg Thieme Verlag KG')
1032
+ end
1033
+
1034
+ it 'journal article with' do
1035
+ input = 'https://doi.org/10.1111/nph.14619'
1036
+ subject = described_class.new(input: input, from: 'crossref_json')
1037
+ expect(subject.valid?).to be true
1038
+ expect(subject.id).to eq('https://doi.org/10.1111/nph.14619')
1039
+ expect(subject.url).to eq('https://onlinelibrary.wiley.com/doi/10.1111/nph.14619')
1040
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1041
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1042
+ expect(subject.creators.length).to eq(3)
1043
+ expect(subject.creators.first).to eq('nameType' => 'Personal',
1044
+ 'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0002-4156-3761', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }], 'name' => 'Dissmeyer, Nico', 'givenName' => 'Nico', 'familyName' => 'Dissmeyer', 'affiliation' => [{ 'name' => 'Independent Junior Research Group on Protein Recognition and Degradation; Leibniz Institute of Plant Biochemistry (IPB); Weinberg 3 Halle (Saale) D-06120 Germany' }, { 'name' => 'ScienceCampus Halle - Plant-based Bioeconomy; Betty-Heimann-Strasse 3 Halle (Saale) D-06120 Germany' }])
1045
+ expect(subject.titles).to eq([{ 'title' => 'Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway' }])
1046
+ expect(subject.rights_list).to eq([
1047
+ { 'rightsUri' => 'http://doi.wiley.com/10.1002/tdm_license_1.1' }
1048
+ ])
1049
+ expect(subject.dates).to eq([{"date"=>"2017-06-05", "dateType"=>"Issued"},
1050
+ {"date"=>"2021-07-07", "dateType"=>"Updated"}])
1051
+ expect(subject.publication_year).to eq('2017')
1052
+ expect(subject.publisher).to eq('Wiley')
1053
+ expect(subject.related_identifiers.length).to eq(49)
1054
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '0028-646X',
1055
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
1056
+ expect(subject.related_identifiers.last).to eq('relatedIdentifier' => '10.1002/pmic.201400530',
1057
+ 'relatedIdentifierType' => 'DOI', 'relationType' => 'References')
1058
+ expect(subject.container).to eq('firstPage' => '929', 'identifier' => '0028-646X',
1059
+ 'identifierType' => 'ISSN', 'issue' => '3', 'lastPage' => '935', 'title' => 'New Phytologist', 'type' => 'Journal', 'volume' => '218')
1060
+ expect(subject.agency).to eq('Crossref')
1061
+ expect(subject.date_registered).to eq('2017-06-05')
1062
+ end
1063
+
1064
+ it 'author literal' do
1065
+ input = 'https://doi.org/10.1038/ng.3834'
1066
+ subject = described_class.new(input: input, from: 'crossref_json')
1067
+ expect(subject.valid?).to be true
1068
+ expect(subject.id).to eq('https://doi.org/10.1038/ng.3834')
1069
+ expect(subject.url).to eq('http://www.nature.com/articles/ng.3834')
1070
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1071
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1072
+ expect(subject.creators.length).to eq(14)
1073
+ expect(subject.creators[1]).to eq('name' => 'GTEx Consortium')
1074
+ expect(subject.titles).to eq([{ 'title' => 'The impact of structural variation on human gene expression' }])
1075
+ expect(subject.dates).to include({ 'date' => '2017-04-03', 'dateType' => 'Issued' })
1076
+ expect(subject.publication_year).to eq('2017')
1077
+ expect(subject.publisher).to eq('Springer Science and Business Media LLC')
1078
+ expect(subject.agency).to eq('Crossref')
1079
+ expect(subject.date_registered).to eq('2017-04-03')
1080
+ end
1081
+
1082
+ it 'affiliation is space' do
1083
+ input = 'https://doi.org/10.1177/0042098011428175'
1084
+ subject = described_class.new(input: input, from: 'crossref_json')
1085
+ expect(subject.valid?).to be true
1086
+ expect(subject.id).to eq('https://doi.org/10.1177/0042098011428175')
1087
+ expect(subject.url).to eq('http://journals.sagepub.com/doi/10.1177/0042098011428175')
1088
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1089
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1090
+ expect(subject.creators.length).to eq(1)
1091
+ expect(subject.creators.first).to eq('familyName' => 'Petrovici', 'givenName' => 'Norbert', 'name' => 'Petrovici, Norbert', 'nameType' => 'Personal')
1092
+ expect(subject.titles).to eq([{ 'title' => 'Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation' }])
1093
+ expect(subject.dates).to include({ 'date' => '2011-12-22', 'dateType' => 'Issued' })
1094
+ expect(subject.publication_year).to eq('2011')
1095
+ expect(subject.publisher).to eq('SAGE Publications')
1096
+ expect(subject.agency).to eq('Crossref')
1097
+ expect(subject.date_registered).to eq('2011-12-23')
1098
+ end
1099
+
1100
+ it 'multiple issn' do
1101
+ input = 'https://doi.org/10.1007/978-3-642-34922-5_19'
1102
+ subject = described_class.new(input: input, from: 'crossref_json')
1103
+ expect(subject.valid?).to be true
1104
+ expect(subject.id).to eq('https://doi.org/10.1007/978-3-642-34922-5_19')
1105
+ expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-642-34922-5_19')
1106
+ expect(subject.types).to eq('bibtex' => 'inbook', 'citeproc' => 'chapter',
1107
+ 'resourceType' => 'BookChapter', 'resourceTypeGeneral' => 'BookChapter', 'ris' => 'CHAP', 'schemaOrg' => 'Chapter')
1108
+ expect(subject.creators.length).to eq(3)
1109
+ expect(subject.creators.first).to eq('familyName' => 'Razib', 'givenName' => 'Ali',
1110
+ 'name' => 'Razib, Ali', 'nameType' => 'Personal')
1111
+ expect(subject.titles).to eq([{ 'title' => 'Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array' }])
1112
+ expect(subject.dates).to include({ 'date' => '2013', 'dateType' => 'Issued' })
1113
+ expect(subject.publication_year).to eq('2013')
1114
+ expect(subject.publisher).to eq('Springer Berlin Heidelberg')
1115
+ expect(subject.container).to eq('identifier' => '1860-0808', 'identifierType' => 'ISSN', "firstPage" => "269", "lastPage" => "287",
1116
+ 'title' => 'Soft Computing: State of the Art Theory and Novel Applications', 'type' => 'Book')
1117
+ expect(subject.agency).to eq('Crossref')
1118
+ expect(subject.date_registered).to eq('2012-10-31')
1119
+ end
1120
+
1121
+ it 'article id as page number' do
1122
+ input = 'https://doi.org/10.1103/physrevlett.120.117701'
1123
+ subject = described_class.new(input: input, from: 'crossref_json')
1124
+ expect(subject.valid?).to be true
1125
+ expect(subject.id).to eq('https://doi.org/10.1103/physrevlett.120.117701')
1126
+ expect(subject.url).to eq('https://link.aps.org/doi/10.1103/PhysRevLett.120.117701')
1127
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1128
+ 'resourceType' => 'JournalArticle', 'resourceTypeGeneral' => 'JournalArticle', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1129
+ expect(subject.creators.length).to eq(5)
1130
+ expect(subject.creators.first).to eq('familyName' => 'Marrazzo', 'givenName' => 'Antimo', 'name' => 'Marrazzo, Antimo', "nameType"=>"Personal")
1131
+ expect(subject.titles).to eq([{ 'title' => 'Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator' }])
1132
+ expect(subject.dates).to include({ 'date' => '2018-03-13', 'dateType' => 'Issued' })
1133
+ expect(subject.publication_year).to eq('2018')
1134
+ expect(subject.publisher).to eq('American Physical Society (APS)')
1135
+ expect(subject.container).to eq('identifier' => '1079-7114',
1136
+ 'identifierType' => 'ISSN', 'issue' => '11', 'title' => 'Physical Review Letters', 'type' => 'Journal', 'volume' => '120')
1137
+ expect(subject.agency).to eq('Crossref')
1138
+ expect(subject.date_registered).to eq('2018-03-13')
1139
+ end
1140
+
1141
+ it 'posted content copernicus' do
1142
+ input = 'https://doi.org/10.5194/CP-2020-95'
1143
+ subject = described_class.new(input: input, from: 'crossref_json')
1144
+ expect(subject.valid?).to be true
1145
+ expect(subject.url).to eq('https://cp.copernicus.org/preprints/cp-2020-95/cp-2020-95.pdf')
1146
+ expect(subject.types).to eq('bibtex' => 'article', 'citeproc' => 'article-journal',
1147
+ 'resourceType' => 'PostedContent', 'resourceTypeGeneral' => 'Preprint', 'ris' => 'JOUR', 'schemaOrg' => 'ScholarlyArticle')
1148
+ expect(subject.creators.count).to eq(6)
1149
+ expect(subject.creators.first).to eq('nameType' => 'Personal', 'familyName' => 'Shao',
1150
+ 'givenName' => 'Jun',
1151
+ 'name' => 'Shao, Jun',
1152
+ 'nameIdentifiers' => [{ 'nameIdentifier' => 'https://orcid.org/0000-0001-6130-6474', 'nameIdentifierScheme' => 'ORCID', 'schemeUri' => 'https://orcid.org' }])
1153
+ expect(subject.titles).to eq([{ 'title' => "The Atmospheric Bridge Communicated the δ&amp;lt;sup&amp;gt;13&amp;lt;/sup&amp;gt;C Decline during the Last Deglaciation to the Global Upper Ocean"}])
1154
+ expect(subject.id).to eq('https://doi.org/10.5194/cp-2020-95')
1155
+ expect(subject.identifiers.empty?).to be(true)
1156
+ expect(subject.descriptions.first['description']).to start_with('Abstract. During the early last glacial termination')
1157
+ expect(subject.dates).to include({ 'date' => '2020-07-28', 'dateType' => 'Issued' })
1158
+ expect(subject.publication_year).to eq('2020')
1159
+ expect(subject.publisher).to eq('Copernicus GmbH')
1160
+ expect(subject.agency).to eq('Crossref')
1161
+ end
1162
+
1163
+ it 'book oup' do
1164
+ input = '10.1093/oxfordhb/9780198746140.013.5'
1165
+ subject = described_class.new(input: input, from: 'crossref_json')
1166
+ expect(subject.valid?).to be true
1167
+ expect(subject.url).to eq('https://academic.oup.com/edited-volume/28081/chapter/212116415')
1168
+ expect(subject.types).to eq('bibtex' => 'book', 'citeproc' => 'book', 'resourceType' => 'Book',
1169
+ 'resourceTypeGeneral' => 'Book', 'ris' => 'BOOK', 'schemaOrg' => 'Book')
1170
+ expect(subject.creators.count).to eq(1)
1171
+ expect(subject.creators.first).to eq('familyName' => 'Clayton', 'givenName' => 'Barbra R.',
1172
+ 'name' => 'Clayton, Barbra R.')
1173
+ expect(subject.contributors.count).to eq(2)
1174
+ expect(subject.contributors.first).to eq('contributorType' => 'Editor', 'familyName' => 'Cozort',
1175
+ 'givenName' => 'Daniel', 'name' => 'Cozort, Daniel', "nameType" => "Personal")
1176
+ expect(subject.titles).to eq([{ 'title' => 'The Changing Way of the Bodhisattva' }])
1177
+ expect(subject.id).to eq('https://doi.org/10.1093/oxfordhb/9780198746140.013.5')
1178
+ expect(subject.identifiers.empty?).to be(true)
1179
+ expect(subject.descriptions.first['description']).to start_with('This chapter explores the nature of the connections')
1180
+ expect(subject.dates).to include({ 'date' => '2018-04-05', 'dateType' => 'Issued' })
1181
+ expect(subject.publication_year).to eq('2018')
1182
+ expect(subject.publisher).to eq('Oxford University Press')
1183
+ expect(subject.agency).to eq('Crossref')
1184
+ end
1185
+
1186
+ it 'report osti' do
1187
+ input = '10.2172/972169'
1188
+ subject = described_class.new(input: input, from: 'crossref_json')
1189
+ expect(subject.valid?).to be true
1190
+ expect(subject.url).to eq('http://www.osti.gov/servlets/purl/972169-1QXROM')
1191
+ expect(subject.types).to eq('bibtex' => 'techreport', 'citeproc' => 'report',
1192
+ 'resourceType' => 'Report', 'resourceTypeGeneral' => 'Report', 'ris' => 'RPRT', 'schemaOrg' => 'Report')
1193
+ expect(subject.creators.count).to eq(4)
1194
+ expect(subject.creators.first).to eq('familyName' => 'Denholm', 'givenName' => 'P.', 'name' => 'Denholm, P.')
1195
+ expect(subject.contributors.count).to eq(0)
1196
+ expect(subject.titles).to eq([{ 'title' => 'Role of Energy Storage with Renewable Electricity Generation' }])
1197
+ expect(subject.id).to eq('https://doi.org/10.2172/972169')
1198
+ expect(subject.descriptions.empty?).to be(true)
1199
+ expect(subject.dates).to include({ 'date' => '2010-01-01', 'dateType' => 'Issued' })
1200
+ expect(subject.publication_year).to eq('2010')
1201
+ expect(subject.publisher).to eq('Office of Scientific and Technical Information (OSTI)')
1202
+ expect(subject.agency).to eq('Crossref')
1203
+ end
1204
+
1205
+ it 'journal issue' do
1206
+ input = 'https://doi.org/10.6002/ect.2015.0371'
1207
+ subject = described_class.new(input: input, from: 'crossref_json')
1208
+ expect(subject.valid?).to be true
1209
+ expect(subject.id).to eq('https://doi.org/10.6002/ect.2015.0371')
1210
+ expect(subject.url).to eq('http://ectrx.org/forms/ectrxcontentshow.php?doi_id=10.6002%2Fect.2015.0371')
1211
+ expect(subject.types).to eq('bibtex' => 'misc', 'citeproc' => 'article-journal',
1212
+ 'resourceType' => 'JournalIssue', 'resourceTypeGeneral' => 'Text', 'ris' => 'JOUR', 'schemaOrg' => 'PublicationIssue')
1213
+ expect(subject.creators).to eq([{ 'name' => ':(unav)', 'nameType' => 'Organizational' }])
1214
+ expect(subject.titles).to eq([{ 'title' => ':(unav)' }])
1215
+ expect(subject.dates).to eq([{ 'date' => '2018-10', 'dateType' => 'Issued' },
1216
+ { 'date' => '2018-10-03', 'dateType' => 'Updated' }])
1217
+ expect(subject.publication_year).to eq('2018')
1218
+ expect(subject.publisher).to eq('Baskent University')
1219
+ expect(subject.related_identifiers.length).to eq(2)
1220
+ expect(subject.related_identifiers.first).to eq('relatedIdentifier' => '2146-8427',
1221
+ 'relatedIdentifierType' => 'ISSN', 'relationType' => 'IsPartOf', 'resourceTypeGeneral' => 'Collection')
1222
+ expect(subject.container).to eq('identifier' => '2146-8427', 'identifierType' => 'ISSN',
1223
+ 'issue' => '5', 'title' => 'Experimental and Clinical Transplantation', 'type' => 'Journal', 'volume' => '16')
1224
+ expect(subject.agency).to eq('Crossref')
1225
+ end
1226
+
1227
+ it 'not found error' do
1228
+ input = 'https://doi.org/10.7554/elife.01567x'
1229
+ subject = described_class.new(input: input, from: 'crossref_json')
1230
+ expect(subject.valid?).to be false
1231
+ expect(subject.id).to eq('https://doi.org/10.7554/elife.01567x')
1232
+ expect(subject.doi).to eq('10.7554/elife.01567x')
1233
+ expect(subject.agency).to eq('Crossref')
1234
+ expect(subject.state).to eq('not_found')
1235
+ end
1236
+ end
1237
+ end