briard 2.0

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