bolognese 0.9.56 → 0.9.58
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +6 -4
- data/README.md +7 -0
- data/bolognese.gemspec +1 -0
- data/lib/bolognese.rb +1 -0
- data/lib/bolognese/metadata.rb +12 -4
- data/lib/bolognese/readers/bibtex_reader.rb +4 -1
- data/lib/bolognese/readers/crossref_reader.rb +60 -34
- data/lib/bolognese/readers/datacite_reader.rb +4 -11
- data/lib/bolognese/readers/ris_reader.rb +2 -1
- data/lib/bolognese/utils.rb +111 -51
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +1 -1
- data/lib/bolognese/writers/citeproc_writer.rb +1 -1
- data/lib/bolognese/writers/crosscite_writer.rb +2 -1
- data/lib/bolognese/writers/jats_writer.rb +94 -0
- data/lib/bolognese/writers/ris_writer.rb +2 -1
- data/lib/bolognese/writers/schema_org_writer.rb +2 -1
- data/resources/kernel-4/include/datacite-dateType-v4.1.xsd +1 -1
- data/resources/kernel-4/include/datacite-relationType-v4.1.xsd +1 -1
- data/resources/kernel-4/include/datacite-resourceType-v4.1.xsd +1 -1
- data/resources/kernel-4/metadata.xsd +1 -1
- data/spec/author_utils_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/crossref/default.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/crossref/to_bibtex.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/crossref/to_crossref.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/crossref/to_datacite.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/crossref/to_schema_org.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml +27 -13
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +25 -13
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_citation.yml +17 -17
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +27 -13
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +26 -12
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +27 -13
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +15 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +16 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_citation.yml +20 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +16 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +15 -50
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +16 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_bibtex.yml +15 -15
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +14 -14
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +16 -16
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/author.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/no_author.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_doi.yml +26 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_title.yml +23 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/sandbox_url.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +35 -31
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +36 -30
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +35 -31
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +27 -27
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi_with_protocol.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/dx_doi_org_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/force_test_resolver.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/https_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver_http.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/doi_with_protocol.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/dx_doi_org_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/force_test_resolver.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/https_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/test_resolver.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_search/test_resolver_http.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +39 -86
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +36 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +40 -85
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +36 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +19 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +21 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/schema_org.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +31 -82
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +20 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +21 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/codemeta.yml +23 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crosscite.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +21 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +24 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +23 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml +20 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/no_codemeta_json.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/not_found_error.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +34 -30
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +33 -29
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +35 -31
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml +150 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml +34 -30
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml +33 -31
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article.yml +33 -31
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +26 -26
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +34 -30
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_raw/journal_article.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +23 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting_in_test_system.yml +22 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml +24 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_not_found.yml +24 -29
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +24 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding.yml +22 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +20 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml +23 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +26 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +24 -66
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml +24 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +24 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +24 -66
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +24 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml +28 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +26 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorName.yml +23 -64
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml +25 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifiers/has_ORCID.yml +11 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifiers/has_jacow_org_scheme.yml +13 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifiers/has_multiple_name_identifier.yml +14 -80
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifiers/has_no_ORCID.yml +13 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_familyName.yml +11 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_multiple_names_in_display-order.yml +7 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_Thai.yml +12 -80
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +12 -78
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +13 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +12 -80
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +9 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +9 -79
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_name_identifier.yml +13 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation.yml +14 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_role.yml +14 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +20 -20
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/not_found_error.yml +2 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +17 -23
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/unknown_DOI_prefix.yml +8 -22
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_alternate_identifiers/insert.yml +6 -41
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml +6 -41
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +6 -41
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +5 -42
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +6 -41
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_family_name.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_known_given_name.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_no_info.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +19 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +20 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +22 -63
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_with_protocol.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_options.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/hash.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_as_url.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_with_protocol.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/only_prefix.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/BlogPosting.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/Dataset.yml +5 -42
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml +20 -20
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/maremma.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/text.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_pages.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml +8 -43
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article_vancouver_style.yml +12 -12
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml +4 -39
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/container_title.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/journal_article.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_pages.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/journal_article.yml +9 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/maremma.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +19 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +20 -20
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +38 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +40 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml +60 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/maremma.yml +73 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +79 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +79 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml +121 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml +79 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +19 -19
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/alternate_name.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/journal_article.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/with_pages.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +5 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +7 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml +18 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting.yml +101 -80
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_Citeproc_JSON.yml +94 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_DataCite_JSON.yml +94 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Crossref_DOI.yml +94 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/DataONE.yml +94 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml +99 -80
- data/spec/readers/crossref_reader_spec.rb +32 -20
- data/spec/readers/datacite_reader_spec.rb +0 -4
- data/spec/writers/bibtex_writer_spec.rb +1 -1
- data/spec/writers/citation_writer_spec.rb +1 -1
- data/spec/writers/crosscite_writer_spec.rb +4 -4
- data/spec/writers/datacite_json_writer_spec.rb +3 -3
- data/spec/writers/datacite_writer_spec.rb +4 -4
- data/spec/writers/jats_writer_spec.rb +173 -0
- data/spec/writers/ris_writer_spec.rb +19 -21
- data/spec/writers/schema_org_writer_spec.rb +2 -6
- metadata +27 -12
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/datacite/default.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/datacite/to_bibtex.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/datacite/to_datacite.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/datacite/to_datacite_invalid.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_file/datacite/to_schema_org.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting_from_string.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Schema_4_1_from_string.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Schema_4_1_from_string_with_doi_in_options.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/missing_creator.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_raw/BlogPosting.yml +0 -38
@@ -17,7 +17,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
17
17
|
it "DOI with data citation" do
|
18
18
|
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
19
19
|
expect(subject.type).to eq("ScholarlyArticle")
|
20
|
-
expect(subject.url).to eq("
|
20
|
+
expect(subject.url).to eq("https://elifesciences.org/articles/01567")
|
21
21
|
expect(subject.additional_type).to eq("JournalArticle")
|
22
22
|
expect(subject.resource_type_general).to eq("Text")
|
23
23
|
expect(subject.author.length).to eq(5)
|
@@ -25,10 +25,10 @@ describe Bolognese::Metadata, vcr: true do
|
|
25
25
|
expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
26
26
|
expect(subject.title).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
27
27
|
expect(subject.date_published).to eq("2014-02-11")
|
28
|
-
expect(subject.date_modified).to eq("
|
28
|
+
expect(subject.date_modified).to eq("2017-10-18T19:09:43Z")
|
29
29
|
expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"eLife", "issn"=>"2050-084X")
|
30
|
-
expect(subject.references.count).to eq(
|
31
|
-
expect(subject.references[
|
30
|
+
expect(subject.references.count).to eq(26)
|
31
|
+
expect(subject.references[20]).to eq("id"=>"https://doi.org/10.5061/dryad.b835k", "type"=>"CreativeWork", "title" => "Data from: Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
32
32
|
expect(subject.funding).to eq([{"type"=>"Organization", "name"=>"SystemsX"},
|
33
33
|
{"type"=>"Organization",
|
34
34
|
"id"=>"https://doi.org/10.13039/501100003043",
|
@@ -39,7 +39,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
39
39
|
{"type"=>"Organization",
|
40
40
|
"id"=>"https://doi.org/10.13039/501100006390",
|
41
41
|
"name"=>"University of Lausanne"}])
|
42
|
-
expect(subject.publisher).to eq("eLife Sciences Organisation, Ltd.")
|
43
42
|
expect(subject.provider).to eq("Crossref")
|
44
43
|
end
|
45
44
|
|
@@ -58,9 +57,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
58
57
|
expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by/4.0")
|
59
58
|
expect(subject.date_published).to eq("2006-12-20")
|
60
59
|
expect(subject.date_modified).to eq("2017-06-17T12:26:15Z")
|
61
|
-
expect(subject.
|
60
|
+
expect(subject.first_page).to eq("e30")
|
62
61
|
expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"PLoS ONE", "issn"=>"1932-6203")
|
63
|
-
expect(subject.publisher).to eq("Public Library of Science (PLoS)")
|
64
62
|
expect(subject.provider).to eq("Crossref")
|
65
63
|
end
|
66
64
|
|
@@ -72,15 +70,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
72
70
|
expect(subject.type).to eq("ScholarlyArticle")
|
73
71
|
expect(subject.additional_type).to eq("PostedContent")
|
74
72
|
expect(subject.resource_type_general).to eq("Text")
|
75
|
-
expect(subject.author.count).to eq(
|
73
|
+
expect(subject.author.count).to eq(11)
|
76
74
|
expect(subject.author.last).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-4060-7360", "name"=>"Timothy Clark", "givenName"=>"Timothy", "familyName"=>"Clark")
|
77
75
|
expect(subject.title).to eq("A Data Citation Roadmap for Scholarly Data Repositories")
|
78
|
-
expect(subject.alternate_name).to eq("biorxiv;
|
79
|
-
expect(subject.description).to start_with("This article presents a practical roadmap")
|
80
|
-
expect(subject.date_published).to eq("
|
81
|
-
expect(subject.date_modified).to eq("
|
76
|
+
expect(subject.alternate_name).to eq("biorxiv;097196v2")
|
77
|
+
expect(subject.description["text"]).to start_with("This article presents a practical roadmap")
|
78
|
+
expect(subject.date_published).to eq("2017-10-09")
|
79
|
+
expect(subject.date_modified).to eq("2017-10-10T05:10:49Z")
|
82
80
|
expect(subject.is_part_of).to be_nil
|
83
|
-
expect(subject.publisher).to eq("Cold Spring Harbor Laboratory")
|
84
81
|
expect(subject.provider).to eq("Crossref")
|
85
82
|
end
|
86
83
|
|
@@ -97,9 +94,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
97
94
|
expect(subject.title).to eq("THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES")
|
98
95
|
expect(subject.date_published).to eq("2006-11")
|
99
96
|
expect(subject.date_modified).to eq("2017-04-01T06:47:57Z")
|
100
|
-
expect(subject.
|
97
|
+
expect(subject.first_page).to eq("2832")
|
98
|
+
expect(subject.last_page).to eq("2841")
|
101
99
|
expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"Ecology", "issn"=>"0012-9658")
|
102
|
-
expect(subject.publisher).to eq("Wiley-Blackwell")
|
103
100
|
expect(subject.provider).to eq("Crossref")
|
104
101
|
end
|
105
102
|
|
@@ -117,9 +114,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
117
114
|
expect(subject.title).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
118
115
|
expect(subject.date_published).to eq("2012")
|
119
116
|
expect(subject.date_modified).to eq("2016-08-02T18:42:41Z")
|
120
|
-
expect(subject.
|
121
|
-
expect(subject.
|
122
|
-
expect(subject.
|
117
|
+
expect(subject.first_page).to eq("1")
|
118
|
+
expect(subject.last_page).to eq("7")
|
119
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"Pulmonary Medicine", "issn"=>"2090-1836")
|
123
120
|
expect(subject.provider).to eq("Crossref")
|
124
121
|
end
|
125
122
|
|
@@ -137,7 +134,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
137
134
|
expect(subject.date_published).to eq("2015-07")
|
138
135
|
expect(subject.date_modified).to eq("2017-06-23T08:44:48Z")
|
139
136
|
expect(subject.is_part_of).to eq("type"=>"Periodical", "title"=>"European Journal of Pharmacology", "issn"=>"00142999")
|
140
|
-
expect(subject.publisher).to eq("Elsevier BV")
|
141
137
|
expect(subject.provider).to eq("Crossref")
|
142
138
|
end
|
143
139
|
|
@@ -155,7 +151,23 @@ describe Bolognese::Metadata, vcr: true do
|
|
155
151
|
expect(subject.description).to eq("x-ray diffraction structure")
|
156
152
|
expect(subject.date_published).to eq("1984-07-17")
|
157
153
|
expect(subject.date_modified).to eq("2014-05-27T16:45:59Z")
|
158
|
-
expect(subject.
|
154
|
+
expect(subject.provider).to eq("Crossref")
|
155
|
+
end
|
156
|
+
|
157
|
+
it "book chapter" do
|
158
|
+
input = "https://doi.org/10.1007/978-3-662-46370-3_13"
|
159
|
+
subject = Bolognese::Metadata.new(input: input)
|
160
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-662-46370-3_13")
|
161
|
+
expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-662-46370-3_13")
|
162
|
+
expect(subject.type).to eq("Chapter")
|
163
|
+
expect(subject.additional_type).to eq("BookChapter")
|
164
|
+
expect(subject.resource_type_general).to eq("Text")
|
165
|
+
expect(subject.author.length).to eq(2)
|
166
|
+
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Ronald L. Diercks", "givenName"=>"Ronald L.", "familyName"=>"Diercks")
|
167
|
+
expect(subject.title).to eq("Clinical Symptoms and Physical Examinations")
|
168
|
+
expect(subject.date_published).to eq("2015")
|
169
|
+
expect(subject.date_modified).to eq("2015-04-14T02:31:13Z")
|
170
|
+
expect(subject.publisher).to eq("Springer Berlin Heidelberg")
|
159
171
|
expect(subject.provider).to eq("Crossref")
|
160
172
|
end
|
161
173
|
|
@@ -39,7 +39,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
39
39
|
subject = Bolognese::Metadata.new(input: input)
|
40
40
|
expect(subject.valid?).to be true
|
41
41
|
expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
42
|
-
expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food/")
|
43
42
|
expect(subject.type).to eq("ScholarlyArticle")
|
44
43
|
expect(subject.additional_type).to eq("BlogPosting")
|
45
44
|
expect(subject.resource_type_general).to eq("Text")
|
@@ -61,7 +60,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
61
60
|
subject = Bolognese::Metadata.new(input: input)
|
62
61
|
expect(subject.valid?).to be true
|
63
62
|
expect(subject.id).to eq("https://doi.org/10.4230/lipics.tqc.2013.93")
|
64
|
-
expect(subject.url).to eq("http://drops.dagstuhl.de/opus/volltexte/2013/4317/")
|
65
63
|
expect(subject.type).to eq("ScholarlyArticle")
|
66
64
|
expect(subject.additional_type).to eq("ConferencePaper")
|
67
65
|
expect(subject.resource_type_general).to eq("Text")
|
@@ -79,7 +77,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
79
77
|
subject = Bolognese::Metadata.new(input: input)
|
80
78
|
expect(subject.valid?).to be true
|
81
79
|
expect(subject.id).to eq("https://doi.org/10.5281/zenodo.48440")
|
82
|
-
expect(subject.url).to eq("https://zenodo.org/record/48440")
|
83
80
|
expect(subject.type).to eq("SoftwareSourceCode")
|
84
81
|
expect(subject.additional_type).to eq("Software")
|
85
82
|
expect(subject.resource_type_general).to eq("Software")
|
@@ -99,7 +96,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
99
96
|
subject = Bolognese::Metadata.new(input: input)
|
100
97
|
expect(subject.valid?).to be true
|
101
98
|
expect(subject.id).to eq("https://doi.org/10.6084/m9.figshare.4234751.v1")
|
102
|
-
expect(subject.url).to eq("https://figshare.com/articles/RAIN_v1/4234751/1")
|
103
99
|
expect(subject.type).to eq("Dataset")
|
104
100
|
expect(subject.additional_type).to eq("Dataset")
|
105
101
|
expect(subject.resource_type_general).to eq("Dataset")
|
@@ -9,7 +9,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
9
9
|
expect(bibtex[:bibtex_type].to_s).to eq("article")
|
10
10
|
expect(bibtex[:bibtex_key]).to eq("https://doi.org/10.7554/elife.01567")
|
11
11
|
expect(bibtex[:doi]).to eq("10.7554/elife.01567")
|
12
|
-
expect(bibtex[:url]).to eq("
|
12
|
+
expect(bibtex[:url]).to eq("https://elifesciences.org/articles/01567")
|
13
13
|
expect(bibtex[:title]).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
14
14
|
expect(bibtex[:author]).to eq("Sankar, Martial and Nieminen, Kaisa and Ragni, Laura and Xenarios, Ioannis and Hardtke, Christian S")
|
15
15
|
expect(bibtex[:journal]).to eq("eLife")
|
@@ -15,7 +15,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
15
15
|
subject = Bolognese::Metadata.new(input: input, from: "crossref", style: "vancouver", locale: "de-de")
|
16
16
|
expect(subject.style).to eq("vancouver")
|
17
17
|
expect(subject.locale).to eq("de-de")
|
18
|
-
expect(subject.citation).to eq("1. Sankar M, Nieminen K, Ragni L, Xenarios I, Hardtke CS. Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth. eLife [Internet]. 2014 Feb 11;3. Available from:
|
18
|
+
expect(subject.citation).to eq("1. Sankar M, Nieminen K, Ragni L, Xenarios I, Hardtke CS. Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth. eLife [Internet]. 2014 Feb 11;3. Available from: https://elifesciences.org/articles/01567")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "Dataset" do
|
@@ -6,11 +6,11 @@ describe Bolognese::Metadata, vcr: true do
|
|
6
6
|
input = "10.7554/eLife.01567"
|
7
7
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
8
8
|
crosscite = JSON.parse(subject.crosscite)
|
9
|
-
expect(crosscite.fetch("url")).to eq("
|
9
|
+
expect(crosscite.fetch("url")).to eq("https://elifesciences.org/articles/01567")
|
10
10
|
expect(crosscite.fetch("resource_type_general")).to eq("Text")
|
11
11
|
expect(crosscite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
12
|
-
expect(crosscite.fetch("references").length).to eq(
|
13
|
-
expect(crosscite.fetch("references").first).to eq("id"=>"https://doi.org/10.1038/nature02100", "
|
12
|
+
expect(crosscite.fetch("references").length).to eq(26)
|
13
|
+
expect(crosscite.fetch("references").first).to eq("type"=>"CreativeWork", "id"=>"https://doi.org/10.1038/nature02100", "title"=>"APL regulates vascular tissue identity in Arabidopsis")
|
14
14
|
expect(crosscite.fetch("license")).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
15
15
|
end
|
16
16
|
|
@@ -71,7 +71,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
71
71
|
expect(crosscite.fetch("author").length).to eq(8)
|
72
72
|
expect(crosscite.fetch("author").first).to eq("type"=>"Person", "familyName" => "Ollomo", "givenName" => "Benjamin", "name" => "Benjamin Ollomo")
|
73
73
|
expect(crosscite.fetch("date_registered")).to eq("2011-02-01T17:32:02Z")
|
74
|
-
expect(crosscite.fetch("date_updated")).to eq("2017-
|
74
|
+
expect(crosscite.fetch("date_updated")).to eq("2017-09-02T07:32:23Z")
|
75
75
|
expect(crosscite.fetch("provider_id")).to eq("CDL")
|
76
76
|
expect(crosscite.fetch("client_id")).to eq("CDL.DRYAD")
|
77
77
|
end
|
@@ -6,11 +6,11 @@ describe Bolognese::Metadata, vcr: true do
|
|
6
6
|
input = "10.7554/eLife.01567"
|
7
7
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
8
8
|
datacite = JSON.parse(subject.datacite_json)
|
9
|
-
expect(datacite.fetch("url")).to eq("
|
9
|
+
expect(datacite.fetch("url")).to eq("https://elifesciences.org/articles/01567")
|
10
10
|
expect(datacite.fetch("resource_type_general")).to eq("Text")
|
11
11
|
expect(datacite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
12
|
-
expect(datacite.fetch("references").length).to eq(
|
13
|
-
expect(datacite.fetch("references").first).to eq("id"=>"https://doi.org/10.1038/nature02100", "type"=>"CreativeWork")
|
12
|
+
expect(datacite.fetch("references").length).to eq(26)
|
13
|
+
expect(datacite.fetch("references").first).to eq("id"=>"https://doi.org/10.1038/nature02100", "type"=>"CreativeWork", "title" => "APL regulates vascular tissue identity in Arabidopsis")
|
14
14
|
expect(datacite.fetch("rights")).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
15
15
|
end
|
16
16
|
|
@@ -8,12 +8,12 @@ describe Bolognese::Metadata, vcr: true do
|
|
8
8
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
9
9
|
expect(datacite.dig("resourceType", "resourceTypeGeneral")).to eq("Text")
|
10
10
|
expect(datacite.dig("titles", "title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
11
|
-
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").length).to eq(
|
11
|
+
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").length).to eq(27)
|
12
12
|
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").first).to eq("relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "__content__"=>"2050-084X")
|
13
13
|
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier")[1]).to eq("relatedIdentifierType"=>"DOI", "relationType"=>"References", "__content__"=>"https://doi.org/10.1038/nature02100")
|
14
14
|
expect(datacite.dig("rightsList")).to eq("rights"=>{"rightsURI"=>"http://creativecommons.org/licenses/by/3.0"})
|
15
15
|
expect(datacite.dig("fundingReferences", "fundingReference").count).to eq(4)
|
16
|
-
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier"=>{"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
16
|
+
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier" => {"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
17
17
|
end
|
18
18
|
|
19
19
|
it "with ORCID ID" do
|
@@ -153,12 +153,12 @@ describe Bolognese::Metadata, vcr: true do
|
|
153
153
|
expect(datacite.dig("identifier", "__content__")).to eq("10.5061/DRYAD.8515")
|
154
154
|
expect(datacite.dig("resourceType", "resourceTypeGeneral")).to eq("Dataset")
|
155
155
|
expect(datacite.dig("titles", "title")).to eq("Data from: Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
156
|
-
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").length).to eq(
|
156
|
+
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").length).to eq(27)
|
157
157
|
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").first).to eq("relatedIdentifierType"=>"ISSN", "relationType"=>"IsPartOf", "__content__"=>"2050-084X")
|
158
158
|
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier")[1]).to eq("relatedIdentifierType"=>"DOI", "relationType"=>"References", "__content__"=>"https://doi.org/10.1038/nature02100")
|
159
159
|
expect(datacite.dig("rightsList")).to eq("rights"=>{"rightsURI"=>"http://creativecommons.org/licenses/by/3.0"})
|
160
160
|
expect(datacite.dig("fundingReferences", "fundingReference").count).to eq(4)
|
161
|
-
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier"=>{"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
161
|
+
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier" => {"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
162
162
|
end
|
163
163
|
|
164
164
|
it "validates against schema" do
|
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bolognese::Metadata, vcr: true do
|
4
|
+
context "write metadata as jats xml" do
|
5
|
+
it "with data citation" do
|
6
|
+
input = "10.7554/eLife.01567"
|
7
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
8
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
9
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
10
|
+
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
11
|
+
expect(jats.dig("source")).to eq("eLife")
|
12
|
+
expect(jats.dig("person_group", "name").length).to eq(5)
|
13
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
14
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014-02-11", "__content__"=>"2014")
|
15
|
+
expect(jats.dig("month")).to eq("02")
|
16
|
+
expect(jats.dig("day")).to eq("11")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "with ORCID ID" do
|
20
|
+
input = "https://doi.org/10.1155/2012/291294"
|
21
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
22
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
23
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
24
|
+
expect(jats.dig("article_title")).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
25
|
+
expect(jats.dig("source")).to eq("Pulmonary Medicine")
|
26
|
+
expect(jats.dig("person_group", "name").length).to eq(7)
|
27
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Thanassi", "given_names"=>"Wendy")
|
28
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2012", "__content__"=>"2012")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "with editor" do
|
32
|
+
input = "https://doi.org/10.1371/journal.pone.0000030"
|
33
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
34
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
35
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
36
|
+
expect(jats.dig("article_title")).to eq("Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes")
|
37
|
+
expect(jats.dig("source")).to eq("PLoS ONE")
|
38
|
+
expect(jats.dig("person_group", 0, "name").length).to eq(5)
|
39
|
+
expect(jats.dig("person_group", 0, "name").first).to eq("surname"=>"Ralser", "given_names"=>"Markus")
|
40
|
+
expect(jats.dig("person_group", 1, "name")).to eq("surname"=>"Janbon", "given_names"=>"Guilhem")
|
41
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2006-12-20", "__content__"=>"2006")
|
42
|
+
expect(jats.dig("month")).to eq("12")
|
43
|
+
expect(jats.dig("day")).to eq("20")
|
44
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.1371/journal.pone.0000030")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "book chapter" do
|
48
|
+
input = "https://doi.org/10.5005/jp/books/12414_3"
|
49
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
50
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
51
|
+
expect(jats.dig("publication_type")).to eq("book")
|
52
|
+
expect(jats.dig("article_title")).to eq("Chapter-02 Physical Examinations")
|
53
|
+
expect(jats.dig("source")).to eq("Jaypee Brothers Medical Publishers (P) Ltd.")
|
54
|
+
expect(jats.dig("person_group", "name")).to eq("surname"=>"Saha", "given_names"=>"Ashis")
|
55
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2015", "__content__"=>"2015")
|
56
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5005/jp/books/12414_3")
|
57
|
+
end
|
58
|
+
|
59
|
+
it "Crossref DOI" do
|
60
|
+
input = fixture_path + "crossref.bib"
|
61
|
+
subject = Bolognese::Metadata.new(input: input, from: "bibtex")
|
62
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
63
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
64
|
+
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
65
|
+
expect(jats.dig("source")).to eq("eLife")
|
66
|
+
expect(jats.dig("person_group", "name").length).to eq(5)
|
67
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
68
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014", "__content__"=>"2014")
|
69
|
+
expect(jats.dig("month")).to be_nil
|
70
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.7554/elife.01567")
|
71
|
+
end
|
72
|
+
|
73
|
+
it "BlogPosting Citeproc JSON" do
|
74
|
+
input = fixture_path + "citeproc.json"
|
75
|
+
subject = Bolognese::Metadata.new(input: input, from: "citeproc")
|
76
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
77
|
+
expect(jats.dig("publication_type")).to be_nil
|
78
|
+
expect(jats.dig("article_title")).to eq("Eating your own Dog Food")
|
79
|
+
expect(jats.dig("source")).to eq("DataCite Blog")
|
80
|
+
expect(jats.dig("person_group", "name")).to eq("surname"=>"Fenner", "given_names"=>"Martin")
|
81
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2016-12-20", "__content__"=>"2016")
|
82
|
+
expect(jats.dig("month")).to eq("12")
|
83
|
+
expect(jats.dig("day")).to eq("20")
|
84
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5438/4k3m-nyvg")
|
85
|
+
end
|
86
|
+
|
87
|
+
it "rdataone" do
|
88
|
+
input = fixture_path + 'codemeta.json'
|
89
|
+
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
90
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
91
|
+
expect(jats.dig("publication_type")).to eq("software")
|
92
|
+
expect(jats.dig("article_title")).to eq("R Interface to the DataONE REST API")
|
93
|
+
expect(jats.dig("source")).to eq("https://cran.r-project.org")
|
94
|
+
expect(jats.dig("person_group", "name").length).to eq(3)
|
95
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Jones", "given_names"=>"Matt")
|
96
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2016-05-27", "__content__"=>"2016")
|
97
|
+
expect(jats.dig("month")).to eq("05")
|
98
|
+
expect(jats.dig("day")).to eq("27")
|
99
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5063/f1m61h5x")
|
100
|
+
end
|
101
|
+
|
102
|
+
it "maremma" do
|
103
|
+
input = "https://github.com/datacite/maremma"
|
104
|
+
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
105
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
106
|
+
expect(jats.dig("publication_type")).to eq("software")
|
107
|
+
expect(jats.dig("article_title")).to eq("Maremma: a Ruby library for simplified network calls")
|
108
|
+
expect(jats.dig("source")).to eq("DataCite")
|
109
|
+
expect(jats.dig("person_group", "name")).to eq("surname"=>"Fenner", "given_names"=>"Martin")
|
110
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2017-02-24", "__content__"=>"2017")
|
111
|
+
expect(jats.dig("month")).to eq("02")
|
112
|
+
expect(jats.dig("day")).to eq("24")
|
113
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5438/qeg0-3gm3")
|
114
|
+
end
|
115
|
+
|
116
|
+
it "Text pass-thru" do
|
117
|
+
input = "https://doi.org/10.23640/07243.5153971"
|
118
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
119
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
120
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
121
|
+
expect(jats.dig("article_title")).to eq("Recommendation of: ORCID Works Metadata Working Group")
|
122
|
+
expect(jats.dig("source")).to eq("Figshare")
|
123
|
+
expect(jats.dig("person_group", "name").length).to eq(20)
|
124
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Paglione", "given_names"=>"Laura")
|
125
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2017", "__content__"=>"2017")
|
126
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.23640/07243.5153971")
|
127
|
+
end
|
128
|
+
|
129
|
+
it "Dataset in schema 4.0" do
|
130
|
+
input = "https://doi.org/10.5061/DRYAD.8515"
|
131
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
132
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
133
|
+
expect(jats.dig("publication_type")).to eq("data")
|
134
|
+
expect(jats.dig("data_title")).to eq("Data from: A new malaria agent in African hominids.")
|
135
|
+
expect(jats.dig("source")).to eq("Dryad Digital Repository")
|
136
|
+
expect(jats.dig("person_group", "name").length).to eq(8)
|
137
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Ollomo", "given_names"=>"Benjamin")
|
138
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2011", "__content__"=>"2011")
|
139
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5061/dryad.8515")
|
140
|
+
end
|
141
|
+
|
142
|
+
it "with data citation schema.org" do
|
143
|
+
input = "https://blog.datacite.org/eating-your-own-dog-food/"
|
144
|
+
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
145
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
146
|
+
expect(jats.dig("publication_type")).to be_nil
|
147
|
+
expect(jats.dig("article_title")).to eq("Eating your own Dog Food")
|
148
|
+
expect(jats.dig("source")).to eq("DataCite Blog")
|
149
|
+
expect(jats.dig("person_group", "name")).to eq("surname"=>"Fenner", "given_names"=>"Martin")
|
150
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2016-12-20", "__content__"=>"2016")
|
151
|
+
expect(jats.dig("month")).to eq("12")
|
152
|
+
expect(jats.dig("day")).to eq("20")
|
153
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.5438/4k3m-nyvg")
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
context "change metadata as datacite xml" do
|
158
|
+
it "with data citation" do
|
159
|
+
input = "10.7554/eLife.01567"
|
160
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
161
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
162
|
+
expect(jats.dig("publication_type")).to eq("journal")
|
163
|
+
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
164
|
+
expect(jats.dig("source")).to eq("eLife")
|
165
|
+
expect(jats.dig("person_group", "name").length).to eq(5)
|
166
|
+
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
167
|
+
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014-02-11", "__content__"=>"2014")
|
168
|
+
expect(jats.dig("month")).to eq("02")
|
169
|
+
expect(jats.dig("day")).to eq("11")
|
170
|
+
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.7554/elife.01567")
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -12,9 +12,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
12
12
|
expect(ris[2]).to eq("T2 - eLife")
|
13
13
|
expect(ris[3]).to eq("AU - Sankar, Martial")
|
14
14
|
expect(ris[8]).to eq("DO - 10.7554/elife.01567")
|
15
|
-
expect(ris[9]).to eq("UR -
|
16
|
-
expect(ris[10]).to
|
17
|
-
expect(ris[11]).to eq("
|
15
|
+
expect(ris[9]).to eq("UR - https://elifesciences.org/articles/01567")
|
16
|
+
expect(ris[10]).to start_with("AB - Among various advantages")
|
17
|
+
expect(ris[11]).to eq("PY - 2014")
|
18
18
|
expect(ris[12]).to eq("VL - 3")
|
19
19
|
expect(ris[13]).to eq("ER - ")
|
20
20
|
end
|
@@ -32,9 +32,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
32
32
|
expect(ris[11]).to eq("UR - http://www.hindawi.com/journals/pm/2012/291294/")
|
33
33
|
expect(ris[12]).to start_with("AB - . To find a statistically significant separation point for the QuantiFERON")
|
34
34
|
expect(ris[13]).to eq("PY - 2012")
|
35
|
-
expect(ris[14]).to eq("
|
36
|
-
expect(ris[15]).to eq("
|
37
|
-
expect(ris[16]).to eq("
|
35
|
+
expect(ris[14]).to eq("VL - 2012")
|
36
|
+
expect(ris[15]).to eq("SP - 1")
|
37
|
+
expect(ris[16]).to eq("EP - 7")
|
38
38
|
expect(ris[17]).to eq("ER - ")
|
39
39
|
end
|
40
40
|
|
@@ -47,14 +47,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
47
47
|
expect(ris[1]).to eq("T1 - Visions and reality: the idea of competence-oriented assessment for German medical students is not yet realised in licensing examinations")
|
48
48
|
expect(ris[2]).to eq("AU - Huber-Lang, Markus")
|
49
49
|
expect(ris[8]).to eq("DO - 10.3205/zma001102")
|
50
|
-
expect(ris[9]).to start_with("
|
51
|
-
expect(ris[10]).to
|
52
|
-
expect(ris[
|
53
|
-
expect(ris[20]).to eq("
|
54
|
-
expect(ris[21]).to eq("
|
55
|
-
expect(ris[
|
56
|
-
expect(ris[24]).to eq("
|
57
|
-
expect(ris[25]).to eq("ER - ")
|
50
|
+
expect(ris[9]).to start_with("AB - Objective: Competence orientation")
|
51
|
+
expect(ris[10]).to eq("KW - medical competence")
|
52
|
+
expect(ris[19]).to eq("PY - 2017")
|
53
|
+
expect(ris[20]).to eq("PB - German Medical Science GMS Publishing House")
|
54
|
+
expect(ris[21]).to eq("AN - urn:nbn:de:0183-zma0011024")
|
55
|
+
expect(ris[23]).to eq("LA - en")
|
56
|
+
expect(ris[24]).to eq("ER - ")
|
58
57
|
end
|
59
58
|
|
60
59
|
it "Crossref DOI" do
|
@@ -83,13 +82,12 @@ describe Bolognese::Metadata, vcr: true do
|
|
83
82
|
expect(ris[1]).to eq("T1 - Eating your own Dog Food")
|
84
83
|
expect(ris[2]).to eq("AU - Fenner, Martin")
|
85
84
|
expect(ris[3]).to eq("DO - 10.5438/4k3m-nyvg")
|
86
|
-
expect(ris[4]).to eq("
|
87
|
-
expect(ris[5]).to eq("
|
88
|
-
expect(ris[
|
89
|
-
expect(ris[9]).to eq("
|
90
|
-
expect(ris[10]).to eq("
|
91
|
-
expect(ris[11]).to eq("
|
92
|
-
expect(ris[12]).to eq("ER - ")
|
85
|
+
expect(ris[4]).to eq("AB - 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...")
|
86
|
+
expect(ris[5]).to eq("KW - datacite")
|
87
|
+
expect(ris[8]).to eq("PY - 2016")
|
88
|
+
expect(ris[9]).to eq("PB - DataCite")
|
89
|
+
expect(ris[10]).to eq("AN - MS-49-3632-5083")
|
90
|
+
expect(ris[11]).to eq("ER - ")
|
93
91
|
end
|
94
92
|
|
95
93
|
it "BlogPosting Citeproc JSON" do
|