briard 2.7.1 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +6 -6
- data/Gemfile.lock +2 -2
- data/README.md +7 -0
- data/briard.gemspec +1 -1
- data/lib/briard/author_utils.rb +50 -33
- data/lib/briard/doi_utils.rb +5 -1
- data/lib/briard/metadata.rb +1 -1
- data/lib/briard/metadata_utils.rb +2 -0
- data/lib/briard/readers/crossref_json_reader.rb +167 -0
- data/lib/briard/readers/crossref_reader.rb +3 -3
- data/lib/briard/readers/datacite_reader.rb +1 -1
- data/lib/briard/utils.rb +13 -3
- data/lib/briard/version.rb +1 -1
- data/spec/author_utils_spec.rb +36 -32
- data/spec/cli_spec.rb +1 -1
- data/spec/doi_utils_spec.rb +8 -8
- data/spec/fixtures/crossref.json +572 -0
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/default.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_bibtex.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_citation.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_crossref.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_datacite.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_jats.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/crossref/to_schema_org.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/default.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_bibtex.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_citation.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_datacite.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_datacite_json.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_jats.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/datacite/to_schema_org.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/default.yml +7 -9
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/to_datacite.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_CLI/convert_from_id/schema_org/to_schema_org.yml +9 -7
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/crossref.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/datacite.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/jalc.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/kisti.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/medra.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_CLI/find_from_format_by_id/op.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/author.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/no_author.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/single_author.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/authors_as_string/with_organization.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_datacite_metadata/change_state.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_datacite_metadata/change_title.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_description.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_identifiers.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/change_state.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/test_resolver.yml → datacite_api_url/doi_with_protocol.yml} +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/datacite_api_url/dx_doi_org_url.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/datacite_api_url/force_test_resolver.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/https_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/doi_with_protocol.yml → datacite_api_url/test_resolver.yml} +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url → datacite_api_url}/test_resolver_http.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/dx_doi_org_url.yml → doi_from_url/crossref_api_url.yml} +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/doi_with_special_characters.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/not_a_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/sandbox_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_from_url/url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/crossref.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/datacite.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/jalc.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/kisti.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/medra.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/not_a_valid_prefix.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/not_found.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_registration_agency/op.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/doi_with_protocol.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/dx_doi_org_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/force_stage_resolver.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/https_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/stage_resolver.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/doi_resolver/stage_resolver_http.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/crossref.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/datacite.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/datacite_doi_http.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/github.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/orcid.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/schema_org.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/bibtex.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/citeproc.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/codemeta.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/crosscite.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/crossref.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/datacite.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/datacite_json.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/ris.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_file/schema_org.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/find_from_format_from_string/crosscite.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_for_match.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_for_with_schemeUri_in_hash.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_match.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/hsh_to_fos_no_match.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_for_match.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_match.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/fos/name_to_fos_no_match.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org/with_id.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org_creators/with_affiliation.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/from_schema_org_creators/without_affiliation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/cff-converter-python.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/ruby-cff.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_cff_metadata/ruby-cff_repository_url.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_codemeta_metadata/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_codemeta_metadata/metadata_reports.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_ORCID_ID.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_SICI_DOI.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/DOI_with_data_citation.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/JaLC.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/KISTI.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/OP.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/affiliation_is_space.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/another_book.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/another_book_chapter.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/article_id_as_page_number.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/author_literal.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_chapter.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_chapter_with_RDF_for_container.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/book_oup.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/component.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dataset.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dataset_usda.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/date_in_future.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/dissertation.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/empty_given_name.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/invalid_date.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_original_language_title.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with_RDF_for_container.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_article_with_funding.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/journal_issue.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/mEDRA.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/markup.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/missing_creator.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_issn.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_titles.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/multiple_titles_with_missing.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/not_found_error.yml +105 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/peer_review.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/posted_content.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/posted_content_copernicus.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/report_osti.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/vor_with_url.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/yet_another_book.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_json_metadata/yet_another_book_chapter.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/JaLC.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/KISTI.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/OP.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/affiliation_is_space.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/another_book.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/another_book_chapter.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/article_id_as_page_number.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/author_literal.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_chapter.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/book_oup.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/component.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dataset.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dataset_usda.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/date_in_future.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/dissertation.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/empty_given_name.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/invalid_date.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article.yml +57 -59
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +57 -58
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with_RDF_for_container.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_article_with_funding.yml +57 -59
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/journal_issue.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/mEDRA.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/markup.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/missing_creator.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_issn.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_titles.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/multiple_titles_with_missing.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/not_found_error.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/peer_review.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/posted_content.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/posted_content_copernicus.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/report_osti.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/vor_with_url.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/yet_another_book.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_json_metadata/metadata_from_api.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/BlogPosting.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_staging_system.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_staging_system_schema_3.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/DOI_not_found.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Dataset.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Referee_report_in_staging_system.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/Schema_org_type.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_only_full_name.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_with_scheme.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/cc-by_3_0_us.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/content_url.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/date.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/dissertation.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/doi_with_sign.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/empty_subject.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/funding_references.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/funding_schema_version_3.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/is_identical_to.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/keywords_with_attributes.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/multiple_licenses.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/series-information.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/subject_scheme.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datacite_metadata/subject_scheme_FOR.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date/publication_date.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/date.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/year-month.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_date_parts/year.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/date.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/year-month.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_from_parts/year.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/date.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/year-month.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_date_parts/year.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/future.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/invalid.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/nil.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/past.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_datetime_from_time/present.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_familyName.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_Thai.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_display-order.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/has_name_in_sort-order.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/hyper-authorship.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/is_organization.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/multiple_author_names_in_one_field.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/multiple_name_identifier.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation_and_country.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_affiliation_crossref.yml +112 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/name_with_role.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_one_author/only_familyName_and_givenName.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/BlogPosting.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/get_schema_org_metadata_front_matter/BlogPosting.yml +18 -18
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/harvard_dataverse.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/pangaea.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_schema_org_metadata/zenodo.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/only_title.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_and_pages.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_volume_and_pages.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/get_series_information/title_volume_issue_and_pages.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_as_cff_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_as_codemeta_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url_cff_file.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/github/github_from_url_file.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/handle_input/unknown_DOI_prefix.yml +4 -4
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_contributors/none.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_creators/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_dates/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_descriptions/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_identifier/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_language/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_person/creator_only_name.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_publication_year/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_publisher/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_related_identifiers/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_related_identifiers/related_identifier.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_resource_type/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_rights_list/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_sizes/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_subjects/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_titles/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/insert_version/insert.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_comma.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_family_name.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/{doi_api_url/force_test_resolver.yml → is_personal_name_/has_family_name_crossref.yml} +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_id.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_known_given_name.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_no_info.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_orcid_id.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/is_personal_name_/has_type_organization.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/missing_comma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/nil.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/overlapping_keys.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/jsonlint/valid.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/not_found.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/with_trailing_slash.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/SICI_doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_prefix_too_long.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_prefix_with_string.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/doi_with_protocol.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/dx_doi_org_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/https_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/not_valid_doi_prefix.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_doi/url_with_one_slash.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/doi_as_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/ftp.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/invalid_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/sandbox_via_options.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/sandbox_via_url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/string.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/url.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_id/url_with_utf-8.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_ids/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_ids/url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_array.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_empty_array.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_hash.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_issn/from_string.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/uri.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/with_trailing_slash.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/array.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/array_of_strings.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/first.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/hash.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/nil.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/parse_attributes/string.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/decode_anothe_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/decode_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/random_doi/encode_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/onlies_keep_specific_tags.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/removes_a_tags.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_id.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_not_found.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/hsh_to_spdx_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/name_to_spdx_exists.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/spdx/name_to_spdx_id.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/to_schema_org/with_id.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/to_schema_org_identifiers/with_identifiers.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_doi/doi.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_10.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_11.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_12.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_13.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_14.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_4.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_5.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_6.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_7.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_8.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/1_7_9.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/funder_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_funder_doi/non-funder_doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_https.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_id.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_sandbox.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_with_spaces.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_wrong_id.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid/validate_orcid_www.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi_as_url.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/doi_with_protocol.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_prefix/only_prefix.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/DOI.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/ISSN.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/URL.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/validate_url/string.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/BlogPosting.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/Dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/climate_data.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/from_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/text.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_bibtex/with_pages.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/Collection_of_Jupyter_notebooks.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/SoftwareSourceCode_Zenodo.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/SoftwareSourceCode_also_Zenodo.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_cff/ruby-cff.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Journal_article_vancouver_style.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/Missing_author.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/interactive_resource_without_dates.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citation/software_w/version.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/Another_dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/BlogPosting.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/Dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/container_title.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/interactive_resource_without_dates.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/missing_creator.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/organization_author.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/software.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/software_w/version.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_citeproc/with_pages.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crosscite/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/another_schema_org_from_front-matter.yml +18 -18
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/journal_article_from_datacite.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/posted_content.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/schema_org_from_another_science_blog.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_crossref/schema_org_from_front_matter.yml +18 -18
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/climate_data.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/text.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_csv/with_pages.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/from_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +7 -7
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_editor.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_datacite_xml/with_version.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/book_chapter.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/from_schema_org.yml +17 -17
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/interactive_resource_without_dates.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_jats_xml/with_editor.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_rdf_xml/with_pages.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/BlogPosting.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/Dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/alternate_name.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_ris/with_pages.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Another_Schema_org_JSON.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Funding.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/data_catalog.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/geo_location_box.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/interactive_resource_without_dates.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/series_information.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/subject_scheme.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/BlogPosting.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/Dataset.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/journal_article.yml +5 -5
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/write_metadata_as_turtle/with_pages.yml +5 -5
- data/spec/readers/citeproc_reader_spec.rb +2 -2
- data/spec/readers/codemeta_reader_spec.rb +3 -4
- data/spec/readers/crossref_json_reader_spec.rb +1237 -0
- data/spec/readers/crossref_reader_spec.rb +57 -64
- data/spec/readers/datacite_json_reader_spec.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +53 -82
- data/spec/readers/npm_reader_spec.rb +2 -2
- data/spec/readers/ris_reader_spec.rb +2 -5
- data/spec/readers/schema_org_reader_spec.rb +7 -12
- data/spec/writers/bibtex_writer_spec.rb +2 -2
- data/spec/writers/citation_writer_spec.rb +2 -2
- data/spec/writers/citeproc_writer_spec.rb +1 -1
- data/spec/writers/codemeta_writer_spec.rb +1 -1
- data/spec/writers/crosscite_writer_spec.rb +4 -5
- data/spec/writers/crossref_writer_spec.rb +3 -6
- data/spec/writers/datacite_json_writer_spec.rb +2 -4
- data/spec/writers/datacite_writer_spec.rb +7 -9
- data/spec/writers/schema_org_writer_spec.rb +8 -9
- metadata +59 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6be06ae87915ce9307275bea4fec8176dd9e93f38cdd99d89522cac4e29cb7a1
|
4
|
+
data.tar.gz: 4f9907cc3f4c9ef7885e88d635f1667be1699c1db1d51f742a09ecc14eddc358
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9da37799aafb46e13c97c6b67befe4b9566e9ec0aae892b082f5dd09f78a678819f28c5538a91d575379f65e01055456aa1eb1d83015829c10ce0f32dac596a9
|
7
|
+
data.tar.gz: cf09273fa22a240fb578785c0f9719fde52d3beeb767c360b2a548dd82c017e782b9af5e29e1277e4719718dfc0eeea911d0b2571742c45dc2a7216e33759888
|
@@ -42,9 +42,9 @@ jobs:
|
|
42
42
|
[[ $? -ne 2 ]]
|
43
43
|
"
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
- name: Upload Sarif output
|
46
|
+
if: steps.check_files.outputs.files_exists == 'true'
|
47
|
+
uses: github/codeql-action/upload-sarif@v2
|
48
|
+
with:
|
49
|
+
# Path to SARIF file relative to the root of the repository
|
50
|
+
sarif_file: rubocop.sarif
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
briard (2.
|
4
|
+
briard (2.8.0)
|
5
5
|
activesupport (>= 4.2.5, < 8.0)
|
6
6
|
base32-url (>= 0.5.0, < 1)
|
7
7
|
benchmark_methods (~> 0.7)
|
@@ -19,7 +19,7 @@ PATH
|
|
19
19
|
iso8601 (~> 0.9.1)
|
20
20
|
json-ld-preloaded (~> 3.1, >= 3.1.3)
|
21
21
|
jsonlint (~> 0.3.0)
|
22
|
-
loofah (~> 2.
|
22
|
+
loofah (~> 2.19)
|
23
23
|
maremma (>= 4.9.7, < 5)
|
24
24
|
namae (~> 1.0)
|
25
25
|
nokogiri (~> 1.13.1)
|
data/README.md
CHANGED
@@ -28,6 +28,13 @@ Briard reads and/or writes these metadata formats:
|
|
28
28
|
<td>application/vnd.crossref.unixref+xml</td>
|
29
29
|
<td>Yes</td>
|
30
30
|
<td>Yes</td>
|
31
|
+
</tr>
|
32
|
+
<tr>
|
33
|
+
<td><a href='https://api.crossref.org'>CrossRef JSON</a></td>
|
34
|
+
<td>crossref_json</td>
|
35
|
+
<td>application/vnd.crossref+json</td>
|
36
|
+
<td>Yes</td>
|
37
|
+
<td>No</td>
|
31
38
|
</tr>
|
32
39
|
<tr>
|
33
40
|
<td><a href='https://schema.datacite.org/'>DataCite XML</a></td>
|
data/briard.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_dependency 'iso8601', '~> 0.9.1'
|
36
36
|
s.add_dependency 'json-ld-preloaded', '~> 3.1', '>= 3.1.3'
|
37
37
|
s.add_dependency 'jsonlint', '~> 0.3.0'
|
38
|
-
s.add_dependency 'loofah', '~> 2.
|
38
|
+
s.add_dependency 'loofah', '~> 2.19'
|
39
39
|
s.add_dependency 'maremma', '>= 4.9.7', '< 5'
|
40
40
|
s.add_dependency 'namae', '~> 1.0'
|
41
41
|
s.add_dependency 'nokogiri', '~> 1.13.1'
|
data/lib/briard/author_utils.rb
CHANGED
@@ -18,17 +18,18 @@ module Briard
|
|
18
18
|
return nil if author.fetch('creatorName', nil).is_a?(Array)
|
19
19
|
|
20
20
|
name = parse_attributes(author.fetch('creatorName', nil)) ||
|
21
|
-
parse_attributes(author.fetch('contributorName', nil))
|
22
|
-
|
23
|
-
|
21
|
+
parse_attributes(author.fetch('contributorName', nil)) ||
|
22
|
+
parse_attributes(author.fetch('name', nil))
|
23
|
+
given_name = parse_attributes(author.fetch('givenName', nil)) ||
|
24
|
+
parse_attributes(author.fetch('given', nil))
|
25
|
+
family_name = parse_attributes(author.fetch('familyName', nil)) ||
|
26
|
+
parse_attributes(author.fetch('family', nil))
|
24
27
|
name = cleanup_author(name)
|
25
28
|
name = [family_name, given_name].join(', ') if family_name.present? && given_name.present?
|
26
29
|
contributor_type = parse_attributes(author.fetch('contributorType', nil))
|
27
30
|
|
28
31
|
name_type = parse_attributes(author.fetch('creatorName', nil), content: 'nameType',
|
29
|
-
first: true) || parse_attributes(author.fetch('contributorName', nil), content: 'nameType',
|
30
|
-
first: true)
|
31
|
-
|
32
|
+
first: true) || parse_attributes(author.fetch('contributorName', nil), content: 'nameType', first: true)
|
32
33
|
name_identifiers = Array.wrap(author.fetch('nameIdentifier', nil)).map do |ni|
|
33
34
|
if ni['nameIdentifierScheme'] == 'ORCID'
|
34
35
|
{
|
@@ -51,21 +52,38 @@ module Briard
|
|
51
52
|
end
|
52
53
|
end.presence
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
# Crossref metadata
|
56
|
+
if name_identifiers.blank? && author['ORCID'].present?
|
57
|
+
name_identifiers = [{
|
58
|
+
'nameIdentifier' => normalize_orcid(author.fetch('ORCID')),
|
59
|
+
'schemeUri' => 'https://orcid.org',
|
60
|
+
'nameIdentifierScheme' => 'ORCID' }]
|
61
|
+
end
|
62
|
+
|
63
|
+
if name_type.blank? && Array.wrap(name_identifiers).find { |ni| ni['nameIdentifierScheme'] == 'ORCID' }.present?
|
64
|
+
name_type = 'Personal'
|
65
|
+
elsif name_type.blank? && Array.wrap(name_identifiers).find { |ni| %w(ISNI ROR).include? ni['nameIdentifierScheme'] }.present?
|
66
|
+
name_type = 'Organizational'
|
67
|
+
elsif name_type.blank? && is_personal_name?(given_name: given_name, name: name) && name.to_s.exclude?(';')
|
68
|
+
name_type = 'Personal'
|
69
|
+
end
|
70
|
+
|
71
|
+
author = {
|
72
|
+
'nameType' => name_type,
|
73
|
+
'name' => name,
|
74
|
+
'givenName' => given_name,
|
75
|
+
'familyName' => family_name,
|
76
|
+
'nameIdentifiers' => name_identifiers,
|
77
|
+
'affiliation' => get_affiliations(author.fetch('affiliation', nil)),
|
78
|
+
'contributorType' => contributor_type }.compact
|
61
79
|
|
62
80
|
return author if family_name.present?
|
63
81
|
|
64
|
-
if
|
82
|
+
if name_type == 'Personal'
|
65
83
|
Namae.options[:include_particle_in_family] = true
|
66
84
|
names = Namae.parse(name)
|
67
85
|
parsed_name = names.first
|
68
|
-
|
86
|
+
|
69
87
|
if parsed_name.present?
|
70
88
|
given_name = parsed_name.given
|
71
89
|
family_name = parsed_name.family
|
@@ -79,14 +97,14 @@ module Briard
|
|
79
97
|
'name' => name,
|
80
98
|
'givenName' => given_name,
|
81
99
|
'familyName' => family_name,
|
82
|
-
'nameIdentifiers' =>
|
83
|
-
'affiliation' =>
|
100
|
+
'nameIdentifiers' => name_identifiers,
|
101
|
+
'affiliation' => get_affiliations(author.fetch('affiliation', nil)),
|
84
102
|
'contributorType' => contributor_type }.compact
|
85
103
|
else
|
86
104
|
{ 'nameType' => name_type,
|
87
105
|
'name' => name,
|
88
|
-
'nameIdentifiers' =>
|
89
|
-
'affiliation' =>
|
106
|
+
'nameIdentifiers' => name_identifiers,
|
107
|
+
'affiliation' => get_affiliations(author.fetch('affiliation', nil)),
|
90
108
|
'contributorType' => contributor_type }.compact
|
91
109
|
end
|
92
110
|
end
|
@@ -102,21 +120,16 @@ module Briard
|
|
102
120
|
# remove spaces around hyphens
|
103
121
|
author = author.gsub(' - ', '-')
|
104
122
|
|
105
|
-
# titleize strings
|
106
123
|
# remove non-standard space characters
|
107
|
-
author.
|
124
|
+
author.gsub(/[[:space:]]/, ' ')
|
108
125
|
end
|
109
126
|
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
(author.fetch('name', '').include?(',') &&
|
117
|
-
author.fetch('name', '').exclude?(';')) ||
|
118
|
-
name_exists?(author.fetch('name', '').split.first)
|
119
|
-
|
127
|
+
# check if given name is in the database of known given names:
|
128
|
+
# https://github.com/bmuller/gender_detector
|
129
|
+
def is_personal_name?(given_name: nil, name: nil)
|
130
|
+
return true if name_exists?(given_name.to_s) ||
|
131
|
+
name_exists?(name.to_s.split.first) ||
|
132
|
+
name_exists?(name.to_s.split(', ').last)
|
120
133
|
false
|
121
134
|
end
|
122
135
|
|
@@ -145,6 +158,8 @@ module Briard
|
|
145
158
|
end
|
146
159
|
|
147
160
|
def get_affiliations(affiliations)
|
161
|
+
return nil unless affiliations.present?
|
162
|
+
|
148
163
|
Array.wrap(affiliations).map do |a|
|
149
164
|
affiliation_identifier = nil
|
150
165
|
if a.is_a?(String)
|
@@ -159,16 +174,18 @@ module Briard
|
|
159
174
|
end
|
160
175
|
affiliation_identifier = !affiliation_identifier.to_s.start_with?('https://') && schemeURI.present? ? normalize_id(schemeURI + affiliation_identifier) : normalize_id(affiliation_identifier)
|
161
176
|
end
|
162
|
-
name = a['__content__'].to_s.squish.presence
|
177
|
+
name = (a['name'] || a['__content__']).to_s.squish.presence
|
163
178
|
affiliation_identifier_scheme = a['affiliationIdentifierScheme']
|
164
179
|
scheme_uri = a['SchemeURI']
|
165
180
|
end
|
166
181
|
|
182
|
+
next unless name.present?
|
183
|
+
|
167
184
|
{ 'name' => name,
|
168
185
|
'affiliationIdentifier' => affiliation_identifier,
|
169
186
|
'affiliationIdentifierScheme' => affiliation_identifier_scheme,
|
170
187
|
'schemeUri' => scheme_uri }.compact
|
171
|
-
end.presence
|
188
|
+
end.compact.presence
|
172
189
|
end
|
173
190
|
end
|
174
191
|
end
|
data/lib/briard/doi_utils.rb
CHANGED
@@ -27,11 +27,15 @@ module Briard
|
|
27
27
|
sandbox.present? || options[:sandbox] ? 'https://handle.stage.datacite.org/' : 'https://doi.org/'
|
28
28
|
end
|
29
29
|
|
30
|
-
def
|
30
|
+
def datacite_api_url(doi, options = {})
|
31
31
|
sandbox = Array(/handle\.stage\.datacite.\org/.match(doi)).last
|
32
32
|
sandbox.present? || options[:sandbox] ? "https://api.stage.datacite.org/dois/#{doi_from_url(doi)}?include=media,client" : "https://api.datacite.org/dois/#{doi_from_url(doi)}?include=media,client"
|
33
33
|
end
|
34
34
|
|
35
|
+
def crossref_api_url(doi, options = {})
|
36
|
+
"https://api.crossref.org/works/#{doi_from_url(doi)}"
|
37
|
+
end
|
38
|
+
|
35
39
|
def normalize_doi(doi, options = {})
|
36
40
|
doi_str = validate_doi(doi)
|
37
41
|
return nil unless doi_str.present?
|
data/lib/briard/metadata.rb
CHANGED
@@ -34,7 +34,7 @@ module Briard
|
|
34
34
|
end
|
35
35
|
|
36
36
|
# generate name for method to call dynamically
|
37
|
-
hsh = @from.present? ? send("get_#{@from}", id: id,
|
37
|
+
hsh = @from.present? ? send("get_#{@from}", id: id, **options) : {}
|
38
38
|
string = hsh.fetch('string', nil)
|
39
39
|
|
40
40
|
elsif options[:input].present? && File.exist?(options[:input])
|
@@ -11,6 +11,7 @@ require_relative 'readers/citeproc_reader'
|
|
11
11
|
require_relative 'readers/cff_reader'
|
12
12
|
require_relative 'readers/codemeta_reader'
|
13
13
|
require_relative 'readers/crosscite_reader'
|
14
|
+
require_relative 'readers/crossref_json_reader'
|
14
15
|
require_relative 'readers/crossref_reader'
|
15
16
|
require_relative 'readers/datacite_json_reader'
|
16
17
|
require_relative 'readers/datacite_reader'
|
@@ -48,6 +49,7 @@ module Briard
|
|
48
49
|
include Briard::Readers::CffReader
|
49
50
|
include Briard::Readers::CodemetaReader
|
50
51
|
include Briard::Readers::CrossciteReader
|
52
|
+
include Briard::Readers::CrossrefJsonReader
|
51
53
|
include Briard::Readers::CrossrefReader
|
52
54
|
include Briard::Readers::DataciteReader
|
53
55
|
include Briard::Readers::DataciteJsonReader
|
@@ -0,0 +1,167 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Briard
|
4
|
+
module Readers
|
5
|
+
module CrossrefJsonReader
|
6
|
+
def get_crossref_json(id: nil, **options)
|
7
|
+
return { 'string' => nil, 'state' => 'not_found' } unless id.present?
|
8
|
+
|
9
|
+
url = crossref_api_url(id, options)
|
10
|
+
response = Maremma.get(url, raw: true)
|
11
|
+
string = response.body.fetch('data', nil)
|
12
|
+
|
13
|
+
{ 'string' => string }
|
14
|
+
end
|
15
|
+
|
16
|
+
def read_crossref_json(string: nil, **options)
|
17
|
+
if string.present?
|
18
|
+
errors = jsonlint(string)
|
19
|
+
return { 'errors' => errors } if errors.present?
|
20
|
+
end
|
21
|
+
|
22
|
+
read_options = ActiveSupport::HashWithIndifferentAccess.new(options.except(:doi, :id, :url,
|
23
|
+
:sandbox, :validate, :ra))
|
24
|
+
|
25
|
+
meta = string.present? ? Maremma.from_json(string).fetch('message', {}) : {}
|
26
|
+
|
27
|
+
resource_type = meta.fetch('type', nil)
|
28
|
+
resource_type = resource_type.present? ? resource_type.underscore.camelcase : nil
|
29
|
+
|
30
|
+
types = {
|
31
|
+
'resourceTypeGeneral' => Briard::Utils::CR_TO_DC_TRANSLATIONS[resource_type] || 'Text',
|
32
|
+
'resourceType' => resource_type,
|
33
|
+
'schemaOrg' => Briard::Utils::CR_TO_SO_TRANSLATIONS[resource_type] || 'CreativeWork',
|
34
|
+
'citeproc' => Briard::Utils::CR_TO_CP_TRANSLATIONS[resource_type] || 'article-journal',
|
35
|
+
'bibtex' => Briard::Utils::CR_TO_BIB_TRANSLATIONS[resource_type] || 'misc',
|
36
|
+
'ris' => Briard::Utils::CR_TO_RIS_TRANSLATIONS[resource_type] || 'GEN'
|
37
|
+
}.compact
|
38
|
+
|
39
|
+
creators = if meta.fetch('author', nil).present?
|
40
|
+
get_authors(from_citeproc(Array.wrap(meta.fetch('author', nil))))
|
41
|
+
else
|
42
|
+
[{ 'nameType' => 'Organizational', 'name' => ':(unav)' }]
|
43
|
+
end
|
44
|
+
editors = Array.wrap(meta.fetch('editor', nil)).each {|e| e['contributorType'] = "Editor"}
|
45
|
+
contributors = get_authors(from_citeproc(editors))
|
46
|
+
|
47
|
+
published_date = get_date_from_date_parts(meta.fetch('issued', nil)) || get_date_from_date_parts(meta.fetch('created', nil))
|
48
|
+
updated_date = get_date_from_date_parts(meta.fetch('deposited', nil))
|
49
|
+
dates = [{ 'date' => published_date, 'dateType' => 'Issued' }]
|
50
|
+
dates << { 'date' => updated_date, 'dateType' => 'Updated' } if updated_date.present?
|
51
|
+
publication_year = published_date.to_s[0..3]
|
52
|
+
date_registered = get_date_from_date_parts(meta.fetch('registered', nil)) || get_date_from_date_parts(meta.fetch('created', nil))
|
53
|
+
|
54
|
+
rights_list = if meta.fetch('license', nil)
|
55
|
+
[hsh_to_spdx('rightsURI' => meta.dig('license', 0, 'URL'))]
|
56
|
+
end
|
57
|
+
issn = Array.wrap(meta.fetch('issn-type', nil)).find {|i| i['type'] == 'electronic'} ||
|
58
|
+
Array.wrap(meta.fetch('issn-type', nil)).find {|i| i['type'] == 'print'} || {}
|
59
|
+
issn = issn.fetch('value', nil) if issn.present?
|
60
|
+
|
61
|
+
related_identifiers = if meta.fetch('container-title',
|
62
|
+
nil).present? && issn.present?
|
63
|
+
[{ 'relationType' => 'IsPartOf',
|
64
|
+
'relatedIdentifierType' => 'ISSN',
|
65
|
+
'resourceTypeGeneral' => 'Collection',
|
66
|
+
'relatedIdentifier' => issn }.compact]
|
67
|
+
else
|
68
|
+
[]
|
69
|
+
end
|
70
|
+
related_identifiers += Array.wrap(meta.fetch('reference', nil)).map do |ref|
|
71
|
+
doi = ref.fetch('DOI', nil)
|
72
|
+
next unless doi.present?
|
73
|
+
|
74
|
+
{ 'relationType' => 'References',
|
75
|
+
'relatedIdentifierType' => 'DOI',
|
76
|
+
'relatedIdentifier' => doi.downcase }
|
77
|
+
end.compact
|
78
|
+
|
79
|
+
funding_references = Array.wrap(meta.fetch('funder', nil)).reduce([]) do |sum, funding|
|
80
|
+
funding_reference = {
|
81
|
+
'funderName' => funding['name'],
|
82
|
+
'funderIdentifier' => funding['DOI'] ? doi_as_url(funding['DOI']) : nil,
|
83
|
+
'funderIdentifierType' => funding['DOI'].to_s.starts_with?("10.13039") ? "Crossref Funder ID" : nil
|
84
|
+
}.compact
|
85
|
+
if funding['name'].present? && funding['award'].present?
|
86
|
+
Array.wrap(funding['award']).each do |award|
|
87
|
+
funding_reference['awardNumber'] = award
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
sum += [funding_reference] if funding_reference.present?
|
92
|
+
sum
|
93
|
+
end
|
94
|
+
container_type = case resource_type
|
95
|
+
when 'JournalArticle', 'JournalIssue'
|
96
|
+
'Journal'
|
97
|
+
when 'BookChapter'
|
98
|
+
'Book'
|
99
|
+
when 'Monograph'
|
100
|
+
'BookSeries'
|
101
|
+
else
|
102
|
+
'Periodical'
|
103
|
+
end
|
104
|
+
|
105
|
+
container = if meta.fetch('container-title', nil).present?
|
106
|
+
first_page = if meta.fetch('page', nil).present?
|
107
|
+
meta.fetch('page').split('-').map(&:strip)[0]
|
108
|
+
end
|
109
|
+
last_page = if meta.fetch('page', nil).present?
|
110
|
+
meta.fetch('page').split('-').map(&:strip)[1]
|
111
|
+
end
|
112
|
+
|
113
|
+
{ 'type' => container_type,
|
114
|
+
'title' => parse_attributes(meta.fetch('container-title', nil), first: true).to_s.squish,
|
115
|
+
'identifier' => issn,
|
116
|
+
'identifierType' => issn.present? ? 'ISSN' : nil,
|
117
|
+
'volume' => meta.fetch('volume', nil),
|
118
|
+
'issue' => meta.fetch('issue', nil),
|
119
|
+
'firstPage' => first_page,
|
120
|
+
'lastPage' => last_page }.compact
|
121
|
+
end
|
122
|
+
|
123
|
+
id = normalize_id(meta.fetch('id', nil) || meta.fetch('DOI', nil))
|
124
|
+
|
125
|
+
id = normalize_doi(options[:doi] || options[:id] || meta.fetch('DOI', nil))
|
126
|
+
title = meta.fetch('title', nil).is_a?(Array) ? meta.fetch('title', nil)[0] : meta.fetch('title', nil)
|
127
|
+
title = title.blank? ? ':(unav)' : title.squish
|
128
|
+
state = meta.present? || read_options.present? ? 'findable' : 'not_found'
|
129
|
+
subjects = Array.wrap(meta.fetch('categories', nil)).reduce([]) do |sum, subject|
|
130
|
+
sum += name_to_fos(subject)
|
131
|
+
|
132
|
+
sum
|
133
|
+
end
|
134
|
+
abstract = meta.fetch('abstract', nil)
|
135
|
+
agency = get_doi_ra(id)
|
136
|
+
|
137
|
+
{ 'id' => id,
|
138
|
+
'types' => types,
|
139
|
+
'doi' => doi_from_url(id),
|
140
|
+
'url' => normalize_id(meta.dig('resource', 'primary', 'URL')),
|
141
|
+
'titles' => [{ 'title' => title }],
|
142
|
+
'creators' => creators,
|
143
|
+
'contributors' => contributors,
|
144
|
+
'container' => container,
|
145
|
+
'publisher' => meta.fetch('publisher', nil),
|
146
|
+
'related_identifiers' => related_identifiers,
|
147
|
+
'dates' => dates,
|
148
|
+
'publication_year' => publication_year,
|
149
|
+
'descriptions' => if abstract.present?
|
150
|
+
[{ 'description' => sanitize(abstract),
|
151
|
+
'descriptionType' => 'Abstract' }]
|
152
|
+
else
|
153
|
+
[]
|
154
|
+
end,
|
155
|
+
'rights_list' => rights_list,
|
156
|
+
'identifiers' => [],
|
157
|
+
'funding_references' => funding_references,
|
158
|
+
'version_info' => meta.fetch('version', nil),
|
159
|
+
'subjects' => subjects,
|
160
|
+
'agency' => agency,
|
161
|
+
'date_registered' => date_registered,
|
162
|
+
'state' => state }.merge(read_options)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
@@ -105,14 +105,14 @@ module Briard
|
|
105
105
|
end
|
106
106
|
|
107
107
|
resource_type = (resource_type || model).to_s.underscore.camelcase.presence
|
108
|
-
schema_org = Briard::Utils::CR_TO_SO_TRANSLATIONS[resource_type] || '
|
108
|
+
schema_org = Briard::Utils::CR_TO_SO_TRANSLATIONS[resource_type] || 'CreativeWork'
|
109
109
|
types = {
|
110
110
|
'resourceTypeGeneral' => Briard::Utils::CR_TO_DC_TRANSLATIONS[resource_type],
|
111
111
|
'resourceType' => resource_type,
|
112
112
|
'schemaOrg' => schema_org,
|
113
113
|
'citeproc' => Briard::Utils::CR_TO_CP_TRANSLATIONS[resource_type] || 'article-journal',
|
114
114
|
'bibtex' => Briard::Utils::CR_TO_BIB_TRANSLATIONS[resource_type] || 'misc',
|
115
|
-
'ris' => Briard::Utils::CR_TO_RIS_TRANSLATIONS[resource_type] || '
|
115
|
+
'ris' => Briard::Utils::CR_TO_RIS_TRANSLATIONS[resource_type] || 'GEN'
|
116
116
|
}.compact
|
117
117
|
|
118
118
|
titles = if bibliographic_metadata['titles'].present?
|
@@ -221,7 +221,7 @@ module Briard
|
|
221
221
|
'funding_references' => crossref_funding_reference(program_metadata),
|
222
222
|
'publisher' => publisher,
|
223
223
|
'container' => container,
|
224
|
-
'agency' => agency = options[:ra] || '
|
224
|
+
'agency' => agency = options[:ra] || 'Crossref',
|
225
225
|
'related_identifiers' => related_identifiers,
|
226
226
|
'dates' => dates,
|
227
227
|
'publication_year' => publication_year,
|
@@ -6,7 +6,7 @@ module Briard
|
|
6
6
|
def get_datacite(id: nil, **options)
|
7
7
|
return { 'string' => nil, 'state' => 'not_found' } unless id.present?
|
8
8
|
|
9
|
-
api_url =
|
9
|
+
api_url = datacite_api_url(id, options)
|
10
10
|
response = Maremma.get(api_url)
|
11
11
|
attributes = response.body.dig('data', 'attributes')
|
12
12
|
return { 'string' => nil, 'state' => 'not_found' } unless attributes.present?
|
data/lib/briard/utils.rb
CHANGED
@@ -110,12 +110,13 @@ module Briard
|
|
110
110
|
CR_TO_CP_TRANSLATIONS = {
|
111
111
|
'Proceedings' => nil,
|
112
112
|
'ReferenceBook' => nil,
|
113
|
-
'JournalIssue' =>
|
113
|
+
'JournalIssue' => 'article-journal',
|
114
114
|
'ProceedingsArticle' => 'paper-conference',
|
115
115
|
'Other' => nil,
|
116
116
|
'Dissertation' => 'thesis',
|
117
117
|
'Dataset' => 'dataset',
|
118
118
|
'EditedBook' => 'book',
|
119
|
+
'PostedContent' => 'article-journal',
|
119
120
|
'JournalArticle' => 'article-journal',
|
120
121
|
'Journal' => nil,
|
121
122
|
'Report' => 'report',
|
@@ -252,7 +253,7 @@ module Briard
|
|
252
253
|
'BookChapter' => 'BookChapter',
|
253
254
|
'SaComponent' => 'Text',
|
254
255
|
'StandardSeries' => 'Standard',
|
255
|
-
'Monograph' => '
|
256
|
+
'Monograph' => 'Book',
|
256
257
|
'Component' => nil,
|
257
258
|
'ReferenceEntry' => nil,
|
258
259
|
'JournalVolume' => nil,
|
@@ -355,8 +356,9 @@ module Briard
|
|
355
356
|
|
356
357
|
CR_TO_RIS_TRANSLATIONS = {
|
357
358
|
'Proceedings' => 'CONF',
|
359
|
+
'PostedContent' => 'JOUR',
|
358
360
|
'ReferenceBook' => 'BOOK',
|
359
|
-
'JournalIssue' =>
|
361
|
+
'JournalIssue' => 'JOUR',
|
360
362
|
'ProceedingsArticle' => 'CPAPER',
|
361
363
|
'Other' => 'GEN',
|
362
364
|
'Dissertation' => 'THES',
|
@@ -544,6 +546,8 @@ module Briard
|
|
544
546
|
elsif options[:ext] == '.json' && URI(Maremma.from_json(string).to_h.fetch('@context',
|
545
547
|
'')).host == 'schema.org'
|
546
548
|
'schema_org'
|
549
|
+
elsif options[:ext] == '.json' && Maremma.from_json(string).to_h.dig('source') == 'Crossref'
|
550
|
+
'crossref_json'
|
547
551
|
elsif options[:ext] == '.json' && Maremma.from_json(string).to_h.dig('@context') == ('https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld')
|
548
552
|
'codemeta'
|
549
553
|
elsif options[:ext] == '.json' && Maremma.from_json(string).to_h.dig('schemaVersion').to_s.start_with?('http://datacite.org/schema/kernel')
|
@@ -1049,6 +1053,8 @@ module Briard
|
|
1049
1053
|
if a['literal'].present?
|
1050
1054
|
a['@type'] = 'Organization'
|
1051
1055
|
a['name'] = a['literal']
|
1056
|
+
elsif a['name'].present?
|
1057
|
+
a['@type'] = 'Organization'
|
1052
1058
|
else
|
1053
1059
|
a['@type'] = 'Person'
|
1054
1060
|
a['name'] = [a['given'], a['family']].compact.join(' ')
|
@@ -1168,10 +1174,14 @@ module Briard
|
|
1168
1174
|
|
1169
1175
|
def get_date_from_date_parts(date_as_parts)
|
1170
1176
|
date_parts = date_as_parts.fetch('date-parts', []).first
|
1177
|
+
return nil if date_parts == [nil]
|
1178
|
+
|
1171
1179
|
year = date_parts[0]
|
1172
1180
|
month = date_parts[1]
|
1173
1181
|
day = date_parts[2]
|
1174
1182
|
get_date_from_parts(year, month, day)
|
1183
|
+
rescue NoMethodError # if date_parts is nil
|
1184
|
+
nil
|
1175
1185
|
end
|
1176
1186
|
|
1177
1187
|
def get_date_from_parts(year, month = nil, day = nil)
|
data/lib/briard/version.rb
CHANGED