bolognese 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -16
- data/README.md +9 -0
- data/lib/bolognese.rb +0 -8
- data/lib/bolognese/array.rb +2 -2
- data/lib/bolognese/author_utils.rb +18 -6
- data/lib/bolognese/cli.rb +2 -17
- data/lib/bolognese/datacite_utils.rb +8 -7
- data/lib/bolognese/metadata.rb +291 -178
- data/lib/bolognese/readers/bibtex_reader.rb +66 -0
- data/lib/bolognese/readers/citeproc_reader.rb +74 -0
- data/lib/bolognese/readers/codemeta_reader.rb +71 -0
- data/lib/bolognese/readers/crosscite_reader.rb +12 -0
- data/lib/bolognese/readers/crossref_reader.rb +209 -0
- data/lib/bolognese/readers/datacite_json_reader.rb +75 -0
- data/lib/bolognese/readers/datacite_reader.rb +181 -0
- data/lib/bolognese/readers/ris_reader.rb +84 -0
- data/lib/bolognese/readers/schema_org_reader.rb +119 -0
- data/lib/bolognese/utils.rb +42 -67
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +25 -0
- data/lib/bolognese/writers/citeproc_writer.rb +29 -0
- data/lib/bolognese/writers/codemeta_writer.rb +25 -0
- data/lib/bolognese/writers/crosscite_writer.rb +49 -0
- data/lib/bolognese/writers/crossref_writer.rb +9 -0
- data/lib/bolognese/writers/datacite_json_writer.rb +45 -0
- data/lib/bolognese/writers/datacite_writer.rb +10 -0
- data/lib/bolognese/writers/rdf_xml_writer.rb +9 -0
- data/lib/bolognese/writers/ris_writer.rb +26 -0
- data/lib/bolognese/writers/schema_org_writer.rb +45 -0
- data/lib/bolognese/writers/turtle_writer.rb +9 -0
- data/spec/author_utils_spec.rb +74 -34
- data/spec/cli_spec.rb +6 -6
- data/spec/datacite_utils_spec.rb +10 -11
- data/spec/doi_utils_spec.rb +2 -1
- data/spec/fixtures/crossref.ris +2 -1
- data/spec/fixtures/datacite.json +6 -9
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml +9 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +9 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +6 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +8 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +10 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +8 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +11 -7
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +10 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +10 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +201 -200
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_bibtex.yml +201 -200
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +201 -200
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +201 -200
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/is_personal_name_/has_type_organization.yml → Bolognese_Metadata/authors_as_string/author.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/authors_as_string/single_author.yml → Bolognese_Metadata/authors_as_string/no_author.yml} +60 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +204 -6
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +204 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +204 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +204 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +102 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +100 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +102 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +100 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_name_identifier/has_ORCID.yml → Bolognese_Metadata/find_from_format_by_ID/schema_org.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_one_author/has_familyName.yml → Bolognese_Metadata/find_from_format_from_file/codemeta.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +97 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/is_personal_name_/has_no_info.yml → Bolognese_Metadata/from_schema_org/with_id.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata → Bolognese_Metadata/get_codemeta_metadata}/maremma.yml +9 -9
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata → Bolognese_Metadata/get_codemeta_metadata}/no_codemeta_json.yml +8 -8
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata → Bolognese_Metadata/get_codemeta_metadata}/not_found_error.yml +8 -8
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata → Bolognese_Metadata/get_crossref_metadata}/DOI_with_ORCID_ID.yml +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata → Bolognese_Metadata/get_crossref_metadata}/DOI_with_SICI_DOI.yml +62 -3
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata → Bolognese_Metadata/get_crossref_metadata}/DOI_with_data_citation.yml +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata → Bolognese_Metadata/get_crossref_metadata}/date_in_future.yml +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata → Bolognese_Metadata/get_crossref_metadata}/journal_article.yml +62 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +97 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Datacite/get_metadata → Bolognese_Metadata/get_datacite_metadata}/author_only_full_name.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +97 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_name_identifier/has_no_ORCID.yml → Bolognese_Metadata/get_datacite_metadata/date.yml} +63 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Datacite/get_metadata → Bolognese_Metadata/get_datacite_metadata}/keywords_with_attributes.yml +64 -3
- data/spec/fixtures/vcr_cassettes/{Bolognese_Datacite/get_metadata → Bolognese_Metadata/get_datacite_metadata}/multiple_author_names_in_one_creatorName.yml +63 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_one_author/has_name_in_display-order.yml → Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml} +63 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata/posted_content.yml → Bolognese_Metadata/get_date_from_date_parts/date.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +201 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifier/has_ORCID.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifier/has_jacow_org_scheme.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_name_identifier/has_no_ORCID.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_familyName.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_multiple_names_in_display-order.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_Thai.yml +134 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +136 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +132 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +136 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_SchemaOrg/get_metadata → Bolognese_Metadata/get_schema_org_metadata}/BlogPosting.yml +201 -200
- data/spec/fixtures/vcr_cassettes/{Bolognese_SchemaOrg/get_metadata → Bolognese_Metadata/get_schema_org_metadata}/not_found_error.yml +2 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_alternate_identifiers/insert.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +203 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref → Bolognese_Metadata}/is_personal_name_/has_family_name.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +201 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref → Bolognese_Metadata}/is_personal_name_/has_known_given_name.yml +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/is_personal_name_/has_type_person.yml → Bolognese_Metadata/is_personal_name_/has_no_info.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +97 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/authors_as_string/author.yml → Bolognese_Metadata/normalize_doi/SICI_doi.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +203 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/authors_as_string/no_author.yml → Bolognese_Metadata/normalize_doi/doi_with_protocol.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +203 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_one_author/is_organization.yml → Bolognese_Metadata/normalize_id/url.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +203 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/is_personal_name_/has_comma.yml → Bolognese_Metadata/normalize_url/uri.yml} +2 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/authors_as_string/with_organization.yml → Bolognese_Metadata/normalize_url/with_trailing_slash.yml} +2 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +203 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/is_personal_name_/has_id.yml → Bolognese_Metadata/parse_attributes/hash.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +203 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/BlogPosting.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/Dataset.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_SchemaOrg/get_metadata/BlogPosting_schema_org_JSON.yml → Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml} +201 -200
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata_as_datacite_xml → Bolognese_Metadata/write_metadata_as_bibtex}/maremma.yml +9 -9
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +731 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_citeproc → Bolognese_Metadata/write_metadata_as_bibtex}/with_pages.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_SchemaOrg/get_metadata_as_bibtex/with_data_citation.yml → Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml} +201 -200
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_citeproc → Bolognese_Metadata/write_metadata_as_citeproc}/journal_article.yml +62 -3
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata_as_ris → Bolognese_Metadata/write_metadata_as_citeproc}/maremma.yml +8 -8
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_ris → Bolognese_Metadata/write_metadata_as_citeproc}/with_pages.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata_as_bibtex → Bolognese_Metadata/write_metadata_as_crosscite}/maremma.yml +9 -9
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_datacite_xml → Bolognese_Metadata/write_metadata_as_crosscite}/with_ORCID_ID.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +731 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_SchemaOrg/get_metadata_as_citeproc/BlogPosting.yml → Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml} +201 -200
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_datacite_xml → Bolognese_Metadata/write_metadata_as_crosscite}/with_editor.yml +62 -3
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_one_author/has_name_in_sort-order.yml → Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +100 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +377 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_datacite_xml → Bolognese_Metadata/write_metadata_as_datacite_json}/with_data_citation.yml +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +654 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +97 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata_as_citeproc → 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 +377 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_ris/journal_article.yml → Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +654 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +944 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_DataciteJson/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_rdf_xml}/BlogPosting.yml +88 -23
- data/spec/fixtures/vcr_cassettes/{Bolognese_Citeproc/get_metadata_as_rdf_xml/BlogPosting.yml → Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_Citeproc_JSON.yml} +26 -20
- data/spec/fixtures/vcr_cassettes/{Bolognese_Bibtex/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_rdf_xml}/Crossref_DOI.yml +26 -20
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_rdf_xml}/journal_article.yml +87 -22
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_rdf_xml}/maremma.yml +35 -29
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_turtle → Bolognese_Metadata/write_metadata_as_rdf_xml}/with_pages.yml +88 -23
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +654 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_bibtex/with_data_citation.yml → Bolognese_Metadata/write_metadata_as_ris/journal_article.yml} +59 -2
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +100 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_bibtex → Bolognese_Metadata/write_metadata_as_ris}/with_pages.yml +62 -3
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +99 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +99 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata/Schema_org_JSON.yml → Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml} +61 -2
- data/spec/fixtures/vcr_cassettes/{Bolognese_Codemeta/get_metadata → Bolognese_Metadata/write_metadata_as_schema_org}/maremma_schema_org_JSON.yml +9 -9
- data/spec/fixtures/vcr_cassettes/{Bolognese_Datacite/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_turtle}/BlogPosting.yml +88 -23
- data/spec/fixtures/vcr_cassettes/{Bolognese_Citeproc/get_metadata_as_turtle/BlogPosting.yml → Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_Citeproc_JSON.yml} +26 -20
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_DataCite_JSON.yml +4589 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Bibtex/get_metadata_as_turtle → Bolognese_Metadata/write_metadata_as_turtle}/Crossref_DOI.yml +26 -20
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/DataONE.yml +4589 -0
- data/spec/fixtures/vcr_cassettes/{Bolognese_Datacite/get_metadata_as_turtle → Bolognese_Metadata/write_metadata_as_turtle}/Dataset.yml +88 -23
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_turtle → Bolognese_Metadata/write_metadata_as_turtle}/journal_article.yml +87 -22
- data/spec/fixtures/vcr_cassettes/{Bolognese_Crossref/get_metadata_as_rdf_xml → Bolognese_Metadata/write_metadata_as_turtle}/with_pages.yml +87 -22
- data/spec/metadata_spec.rb +8 -2
- data/spec/readers/bibtex_reader_spec.rb +30 -0
- data/spec/readers/citeproc_reader_spec.rb +28 -0
- data/spec/readers/codemeta_reader_spec.rb +90 -0
- data/spec/readers/crossref_reader_spec.rb +142 -0
- data/spec/readers/datacite_json_reader_spec.rb +48 -0
- data/spec/readers/datacite_reader_spec.rb +215 -0
- data/spec/readers/ris_reader_spec.rb +32 -0
- data/spec/readers/schema_org_reader_spec.rb +63 -0
- data/spec/utils_spec.rb +24 -25
- data/spec/writers/bibtex_writer_spec.rb +102 -0
- data/spec/writers/citeproc_writer_spec.rb +138 -0
- data/spec/writers/codemeta_writer_spec.rb +36 -0
- data/spec/writers/crosscite_writer_spec.rb +81 -0
- data/spec/writers/crossref_writer_spec.rb +19 -0
- data/spec/writers/datacite_json_writer_spec.rb +74 -0
- data/spec/writers/datacite_writer_spec.rb +124 -0
- data/spec/writers/rdf_xml_writer_spec.rb +97 -0
- data/spec/writers/ris_writer_spec.rb +153 -0
- data/spec/writers/schema_org_writer_spec.rb +59 -0
- data/spec/writers/turtle_writer_spec.rb +82 -0
- metadata +213 -132
- data/codemeta.json +0 -39
- data/lib/bolognese/bibtex.rb +0 -163
- data/lib/bolognese/citeproc.rb +0 -120
- data/lib/bolognese/codemeta.rb +0 -153
- data/lib/bolognese/crossref.rb +0 -281
- data/lib/bolognese/datacite.rb +0 -288
- data/lib/bolognese/datacite_json.rb +0 -220
- data/lib/bolognese/ris.rb +0 -117
- data/lib/bolognese/schema_org.rb +0 -196
- data/spec/bibtex_spec.rb +0 -90
- data/spec/citeproc_spec.rb +0 -66
- data/spec/codemeta_spec.rb +0 -221
- data/spec/crossref_spec.rb +0 -348
- data/spec/datacite_json_spec.rb +0 -125
- data/spec/datacite_spec.rb +0 -406
- data/spec/fixtures/vcr_cassettes/Bolognese_Codemeta/get_metadata_as_schema_org_JSON/maremma.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Codemeta/get_metadata_as_turtle/maremma.yml +0 -4680
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/not_found_error.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_string/DOI_with_data_citation.yml +0 -672
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/author.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/has_multiple_names_in_display-order.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/has_name_in_Thai.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/has_name_in_display-order_with_ORCID.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/hyper-authorship.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/multiple_author_names.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_one_author/multiple_author_names_in_one_field.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/BlogPosting.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Dataset.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Date.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Funding_schema_version_3.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Funding_schema_version_4.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_IsSupplementTo.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_isReferencedBy.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/author.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/author_with_scheme.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/is_identical_to.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/jsonlint.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/multiple_licenses.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_bibtex/BlogPosting.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_bibtex/Dataset.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_citeproc/BlogPosting.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_citeproc/Dataset.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_codemeta/SoftwareSourceCode.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_datacite_xml_4_0/Dataset.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_ris/BlogPosting.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_ris/Dataset.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_turtle/BlogPosting.yml +0 -4620
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_alternate_identifiers/insert.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_contributors/none.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_creators/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_dates/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_descriptions/insert.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_identifier/doi.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_person/creator_only_name.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_publication_year/insert.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_publisher/insert.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/insert.yml +0 -38
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/related_identifier.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_resource_type/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_rights_list/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_subjects/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_titles/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_version/insert.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_DataciteJson/get_metadata_as_turtle/BlogPosting.yml +0 -4583
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/generate/datacite.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/read/datacite.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_SchemaOrg/get_metadata_as_datacite_xml/with_data_citation.yml +0 -653
- data/spec/fixtures/vcr_cassettes/Bolognese_SchemaOrg/get_metadata_as_ris/BlogPosting.yml +0 -653
- data/spec/schema_org_spec.rb +0 -151
@@ -1,5 +1,64 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.datacite.org/prefixes/10.1155
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Access-Control-Allow-Headers:
|
20
|
+
- Content-Type,Accept,Accept-Encoding,Origin,User-Agent,Cache-Control,Keep-Alive
|
21
|
+
Access-Control-Allow-Methods:
|
22
|
+
- GET, POST, OPTIONS
|
23
|
+
Access-Control-Allow-Origin:
|
24
|
+
- "*"
|
25
|
+
Access-Control-Max-Age:
|
26
|
+
- '1728000'
|
27
|
+
Cache-Control:
|
28
|
+
- max-age=0, private, must-revalidate
|
29
|
+
Content-Type:
|
30
|
+
- application/vnd.api+json; charset=utf-8
|
31
|
+
Date:
|
32
|
+
- Sat, 06 May 2017 11:43:21 GMT
|
33
|
+
Etag:
|
34
|
+
- W/"325be65c21373447eaaa6dcd9f27719d"
|
35
|
+
Server:
|
36
|
+
- openresty/1.11.2.2
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
Vary:
|
40
|
+
- Accept-Encoding
|
41
|
+
X-Content-Type-Options:
|
42
|
+
- nosniff
|
43
|
+
X-Frame-Options:
|
44
|
+
- SAMEORIGIN
|
45
|
+
X-Powered-By:
|
46
|
+
- Phusion Passenger 5.1.2
|
47
|
+
X-Request-Id:
|
48
|
+
- 5468dd2f-9416-4f60-958c-83fc61875176
|
49
|
+
X-Runtime:
|
50
|
+
- '0.723466'
|
51
|
+
X-Xss-Protection:
|
52
|
+
- 1; mode=block
|
53
|
+
Content-Length:
|
54
|
+
- '124'
|
55
|
+
Connection:
|
56
|
+
- keep-alive
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"data":{"id":"10.1155","type":"prefixes","attributes":{"registration-agency":"Crossref","updated":"2016-09-21T20:45:51Z"}}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Sat, 06 May 2017 11:43:21 GMT
|
3
62
|
- request:
|
4
63
|
method: get
|
5
64
|
uri: http://www.crossref.org/openurl/?format=unixref&id=doi:10.1155/2012/291294&noredirect=true&pid=tech@datacite.org
|
@@ -25,7 +84,7 @@ http_interactions:
|
|
25
84
|
Content-Language:
|
26
85
|
- en-US
|
27
86
|
Date:
|
28
|
-
-
|
87
|
+
- Sat, 06 May 2017 11:43:20 GMT
|
29
88
|
Connection:
|
30
89
|
- close
|
31
90
|
body:
|
@@ -314,7 +373,7 @@ http_interactions:
|
|
314
373
|
ZT4NCiAgICAgIDwvam91cm5hbD4NCiAgICA8L2Nyb3NzcmVmPg0KICA8L2Rv
|
315
374
|
aV9yZWNvcmQ+DQo8L2RvaV9yZWNvcmRzPg==
|
316
375
|
http_version:
|
317
|
-
recorded_at:
|
376
|
+
recorded_at: Sat, 06 May 2017 11:43:21 GMT
|
318
377
|
- request:
|
319
378
|
method: get
|
320
379
|
uri: http://schema.org/
|
@@ -344,9 +403,9 @@ http_interactions:
|
|
344
403
|
Vary:
|
345
404
|
- Accept, Accept-Encoding
|
346
405
|
X-Cloud-Trace-Context:
|
347
|
-
-
|
406
|
+
- 37ba0bd501ac1ad48196299ee3a54f2a
|
348
407
|
Date:
|
349
|
-
-
|
408
|
+
- Sat, 06 May 2017 11:43:22 GMT
|
350
409
|
Server:
|
351
410
|
- Google Frontend
|
352
411
|
Content-Length:
|
@@ -357,7 +416,7 @@ http_interactions:
|
|
357
416
|
encoding: UTF-8
|
358
417
|
string: ''
|
359
418
|
http_version:
|
360
|
-
recorded_at:
|
419
|
+
recorded_at: Sat, 06 May 2017 11:43:22 GMT
|
361
420
|
- request:
|
362
421
|
method: get
|
363
422
|
uri: http://schema.org/docs/jsonldcontext.json
|
@@ -385,21 +444,21 @@ http_interactions:
|
|
385
444
|
Content-Type:
|
386
445
|
- application/ld+json; charset=utf-8
|
387
446
|
Etag:
|
388
|
-
-
|
447
|
+
- 24751170506112659a2048647386json
|
389
448
|
Last-Modified:
|
390
|
-
-
|
449
|
+
- Sat, 06 May 2017 11:26:59 UTC
|
391
450
|
X-Cloud-Trace-Context:
|
392
|
-
-
|
451
|
+
- d17199a760b7e5cb2a8b935650a91aed
|
393
452
|
Date:
|
394
|
-
-
|
453
|
+
- Sat, 06 May 2017 11:43:22 GMT
|
395
454
|
Server:
|
396
455
|
- Google Frontend
|
397
456
|
Content-Length:
|
398
|
-
- '
|
457
|
+
- '128470'
|
399
458
|
Set-Cookie:
|
400
459
|
- GOOGAPPUID=3-2e; Path=/
|
401
460
|
Expires:
|
402
|
-
-
|
461
|
+
- Sat, 06 May 2017 11:43:22 GMT
|
403
462
|
body:
|
404
463
|
encoding: UTF-8
|
405
464
|
string: |
|
@@ -629,6 +688,7 @@ http_interactions:
|
|
629
688
|
"ComputerStore": {"@id": "schema:ComputerStore"},
|
630
689
|
"ConfirmAction": {"@id": "schema:ConfirmAction"},
|
631
690
|
"Consortium": {"@id": "schema:Consortium"},
|
691
|
+
"ConsumeAction": {"@id": "schema:ConsumeAction"},
|
632
692
|
"ContactPage": {"@id": "schema:ContactPage"},
|
633
693
|
"ContactPoint": {"@id": "schema:ContactPoint"},
|
634
694
|
"ContactPointOption": {"@id": "schema:ContactPointOption"},
|
@@ -861,6 +921,7 @@ http_interactions:
|
|
861
921
|
"ImageGallery": {"@id": "schema:ImageGallery"},
|
862
922
|
"ImageObject": {"@id": "schema:ImageObject"},
|
863
923
|
"ImagingTest": {"@id": "schema:ImagingTest"},
|
924
|
+
"InStock": {"@id": "schema:InStock"},
|
864
925
|
"InStoreOnly": {"@id": "schema:InStoreOnly"},
|
865
926
|
"IndividualProduct": {"@id": "schema:IndividualProduct"},
|
866
927
|
"Infectious": {"@id": "schema:Infectious"},
|
@@ -1096,6 +1157,7 @@ http_interactions:
|
|
1096
1157
|
"Osteopathic": {"@id": "schema:Osteopathic"},
|
1097
1158
|
"Otolaryngologic": {"@id": "schema:Otolaryngologic"},
|
1098
1159
|
"Otolaryngologic": {"@id": "schema:Otolaryngologic"},
|
1160
|
+
"OutOfStock": {"@id": "schema:OutOfStock"},
|
1099
1161
|
"OutletStore": {"@id": "schema:OutletStore"},
|
1100
1162
|
"OwnershipInfo": {"@id": "schema:OwnershipInfo"},
|
1101
1163
|
"PET": {"@id": "schema:PET"},
|
@@ -2604,7 +2666,7 @@ http_interactions:
|
|
2604
2666
|
}
|
2605
2667
|
}
|
2606
2668
|
http_version:
|
2607
|
-
recorded_at:
|
2669
|
+
recorded_at: Sat, 06 May 2017 11:43:22 GMT
|
2608
2670
|
- request:
|
2609
2671
|
method: get
|
2610
2672
|
uri: http://schema.org/
|
@@ -2634,9 +2696,9 @@ http_interactions:
|
|
2634
2696
|
Vary:
|
2635
2697
|
- Accept, Accept-Encoding
|
2636
2698
|
X-Cloud-Trace-Context:
|
2637
|
-
-
|
2699
|
+
- 6607209df4c77b824da6afb28b8cd586
|
2638
2700
|
Date:
|
2639
|
-
-
|
2701
|
+
- Sat, 06 May 2017 11:43:23 GMT
|
2640
2702
|
Server:
|
2641
2703
|
- Google Frontend
|
2642
2704
|
Content-Length:
|
@@ -2647,7 +2709,7 @@ http_interactions:
|
|
2647
2709
|
encoding: UTF-8
|
2648
2710
|
string: ''
|
2649
2711
|
http_version:
|
2650
|
-
recorded_at:
|
2712
|
+
recorded_at: Sat, 06 May 2017 11:43:23 GMT
|
2651
2713
|
- request:
|
2652
2714
|
method: get
|
2653
2715
|
uri: http://schema.org/docs/jsonldcontext.json
|
@@ -2675,21 +2737,21 @@ http_interactions:
|
|
2675
2737
|
Content-Type:
|
2676
2738
|
- application/ld+json; charset=utf-8
|
2677
2739
|
Etag:
|
2678
|
-
-
|
2740
|
+
- 24751170506112659a2048647386json
|
2679
2741
|
Last-Modified:
|
2680
|
-
-
|
2742
|
+
- Sat, 06 May 2017 11:26:59 UTC
|
2681
2743
|
X-Cloud-Trace-Context:
|
2682
|
-
-
|
2744
|
+
- 161734512187db27267d0e105dc4f562
|
2683
2745
|
Date:
|
2684
|
-
-
|
2746
|
+
- Sat, 06 May 2017 11:43:23 GMT
|
2685
2747
|
Server:
|
2686
2748
|
- Google Frontend
|
2687
2749
|
Content-Length:
|
2688
|
-
- '
|
2750
|
+
- '128470'
|
2689
2751
|
Set-Cookie:
|
2690
2752
|
- GOOGAPPUID=3-2e; Path=/
|
2691
2753
|
Expires:
|
2692
|
-
-
|
2754
|
+
- Sat, 06 May 2017 11:43:23 GMT
|
2693
2755
|
body:
|
2694
2756
|
encoding: UTF-8
|
2695
2757
|
string: |
|
@@ -2919,6 +2981,7 @@ http_interactions:
|
|
2919
2981
|
"ComputerStore": {"@id": "schema:ComputerStore"},
|
2920
2982
|
"ConfirmAction": {"@id": "schema:ConfirmAction"},
|
2921
2983
|
"Consortium": {"@id": "schema:Consortium"},
|
2984
|
+
"ConsumeAction": {"@id": "schema:ConsumeAction"},
|
2922
2985
|
"ContactPage": {"@id": "schema:ContactPage"},
|
2923
2986
|
"ContactPoint": {"@id": "schema:ContactPoint"},
|
2924
2987
|
"ContactPointOption": {"@id": "schema:ContactPointOption"},
|
@@ -3151,6 +3214,7 @@ http_interactions:
|
|
3151
3214
|
"ImageGallery": {"@id": "schema:ImageGallery"},
|
3152
3215
|
"ImageObject": {"@id": "schema:ImageObject"},
|
3153
3216
|
"ImagingTest": {"@id": "schema:ImagingTest"},
|
3217
|
+
"InStock": {"@id": "schema:InStock"},
|
3154
3218
|
"InStoreOnly": {"@id": "schema:InStoreOnly"},
|
3155
3219
|
"IndividualProduct": {"@id": "schema:IndividualProduct"},
|
3156
3220
|
"Infectious": {"@id": "schema:Infectious"},
|
@@ -3386,6 +3450,7 @@ http_interactions:
|
|
3386
3450
|
"Osteopathic": {"@id": "schema:Osteopathic"},
|
3387
3451
|
"Otolaryngologic": {"@id": "schema:Otolaryngologic"},
|
3388
3452
|
"Otolaryngologic": {"@id": "schema:Otolaryngologic"},
|
3453
|
+
"OutOfStock": {"@id": "schema:OutOfStock"},
|
3389
3454
|
"OutletStore": {"@id": "schema:OutletStore"},
|
3390
3455
|
"OwnershipInfo": {"@id": "schema:OwnershipInfo"},
|
3391
3456
|
"PET": {"@id": "schema:PET"},
|
@@ -4894,5 +4959,5 @@ http_interactions:
|
|
4894
4959
|
}
|
4895
4960
|
}
|
4896
4961
|
http_version:
|
4897
|
-
recorded_at:
|
4962
|
+
recorded_at: Sat, 06 May 2017 11:43:23 GMT
|
4898
4963
|
recorded_with: VCR 3.0.3
|
data/spec/metadata_spec.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Bolognese::Metadata, vcr: true do
|
4
|
-
|
5
|
-
subject { Bolognese::Metadata.new }
|
4
|
+
let(:input) { "http://doi.org/10.5438/4K3M-NYVG" }
|
5
|
+
subject { Bolognese::Metadata.new(input: input) }
|
6
6
|
|
7
7
|
context "find from format by ID" do
|
8
8
|
it "crossref" do
|
@@ -106,6 +106,12 @@ describe Bolognese::Metadata, vcr: true do
|
|
106
106
|
expect(response).to be_empty
|
107
107
|
end
|
108
108
|
|
109
|
+
it "nil" do
|
110
|
+
json = nil
|
111
|
+
response = subject.jsonlint(json)
|
112
|
+
expect(response).to eq(["No JSON provided"])
|
113
|
+
end
|
114
|
+
|
109
115
|
it "missing_comma" do
|
110
116
|
json = IO.read(fixture_path + "datacite_software_missing_comma.json")
|
111
117
|
response = subject.jsonlint(json)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bolognese::Metadata, vcr: true do
|
4
|
+
let(:input) { fixture_path + "crossref.bib" }
|
5
|
+
|
6
|
+
subject { Bolognese::Metadata.new(input: input) }
|
7
|
+
|
8
|
+
context "get bibtex raw" do
|
9
|
+
it "Crossref DOI" do
|
10
|
+
expect(subject.raw).to eq(IO.read(input))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "get bibtex metadata" do
|
15
|
+
it "Crossref DOI" do
|
16
|
+
expect(subject.valid?).to be true
|
17
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
18
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
19
|
+
expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
|
20
|
+
expect(subject.resource_type_general).to eq("Text")
|
21
|
+
expect(subject.author.length).to eq(5)
|
22
|
+
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
|
23
|
+
expect(subject.title).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
24
|
+
expect(subject.description["text"]).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
25
|
+
expect(subject.license["id"]).to eq("http://creativecommons.org/licenses/by/3.0/")
|
26
|
+
expect(subject.date_published).to eq("2014")
|
27
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"eLife", "issn"=>"2050-084X")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bolognese::Metadata, vcr: true do
|
4
|
+
let(:input) { fixture_path + "citeproc.json" }
|
5
|
+
|
6
|
+
subject { Bolognese::Metadata.new(input: input, from: "citeproc") }
|
7
|
+
|
8
|
+
context "get bibtex raw" do
|
9
|
+
it "BlogPosting" do
|
10
|
+
expect(subject.raw).to eq(IO.read(input))
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "get citeproc metadata" do
|
15
|
+
it "BlogPosting" do
|
16
|
+
expect(subject.valid?).to be true
|
17
|
+
expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
18
|
+
expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
|
19
|
+
expect(subject.type).to eq("BlogPosting")
|
20
|
+
expect(subject.resource_type_general).to eq("Text")
|
21
|
+
expect(subject.author).to eq("type"=>"Person", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
22
|
+
expect(subject.title).to eq("Eating your own Dog Food")
|
23
|
+
expect(subject.description["text"]).to start_with("Eating your own dog food")
|
24
|
+
expect(subject.date_published).to eq("2016-12-20")
|
25
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"DataCite Blog")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bolognese::Metadata, vcr: true do
|
4
|
+
let(:input) { "https://github.com/datacite/maremma" }
|
5
|
+
|
6
|
+
subject { Bolognese::Metadata.new(input: input) }
|
7
|
+
|
8
|
+
context "get codemeta raw" do
|
9
|
+
it "rdataone" do
|
10
|
+
input = fixture_path + 'codemeta.json'
|
11
|
+
subject = Bolognese::Metadata.new(input: input)
|
12
|
+
expect(subject.raw).to eq(IO.read(input))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "get codemeta metadata" do
|
17
|
+
it "maremma" do
|
18
|
+
expect(subject.valid?).to be true
|
19
|
+
expect(subject.id).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
20
|
+
expect(subject.url).to eq("https://github.com/datacite/maremma")
|
21
|
+
expect(subject.type).to eq("SoftwareSourceCode")
|
22
|
+
expect(subject.author).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
23
|
+
expect(subject.title).to eq("Maremma: a Ruby library for simplified network calls")
|
24
|
+
expect(subject.description["text"]).to start_with("Ruby utility library for network requests")
|
25
|
+
expect(subject.keywords).to eq("faraday, excon, net/http")
|
26
|
+
expect(subject.date_created).to eq("2015-11-28")
|
27
|
+
expect(subject.date_published).to eq("2017-02-24")
|
28
|
+
expect(subject.date_modified).to eq("2017-02-24")
|
29
|
+
expect(subject.publisher).to eq("DataCite")
|
30
|
+
end
|
31
|
+
|
32
|
+
it "no codemeta.json" do
|
33
|
+
input = "https://github.com/datacite/homepage"
|
34
|
+
subject = Bolognese::Metadata.new(input: input)
|
35
|
+
expect(subject.id).to be_nil
|
36
|
+
expect(subject.exists?).to be false
|
37
|
+
end
|
38
|
+
|
39
|
+
it "not found error" do
|
40
|
+
input = "https://github.com/datacite/x"
|
41
|
+
subject = Bolognese::Metadata.new(input: input)
|
42
|
+
expect(subject.id).to be_nil
|
43
|
+
expect(subject.exists?).to be false
|
44
|
+
end
|
45
|
+
|
46
|
+
it "rdataone" do
|
47
|
+
input = fixture_path + 'codemeta.json'
|
48
|
+
subject = Bolognese::Metadata.new(input: input)
|
49
|
+
expect(subject.id).to eq("https://doi.org/10.5063/f1m61h5x")
|
50
|
+
expect(subject.url).to eq("https://github.com/DataONEorg/rdataone")
|
51
|
+
expect(subject.type).to eq("SoftwareSourceCode")
|
52
|
+
expect(subject.author).to eq( [{"type"=>"Person",
|
53
|
+
"id"=>"http://orcid.org/0000-0003-0077-4738",
|
54
|
+
"name"=>"Matt Jones",
|
55
|
+
"givenName"=>"Matt",
|
56
|
+
"familyName"=>"Jones"},
|
57
|
+
{"type"=>"Person",
|
58
|
+
"id"=>"http://orcid.org/0000-0002-2192-403X",
|
59
|
+
"name"=>"Peter Slaughter",
|
60
|
+
"givenName"=>"Peter",
|
61
|
+
"familyName"=>"Slaughter"},
|
62
|
+
{"type"=>"Organization", "name"=>"University Of California, Santa Barbara"}])
|
63
|
+
expect(subject.title).to eq("R Interface to the DataONE REST API")
|
64
|
+
expect(subject.description["text"]).to start_with("Provides read and write access to data and metadata")
|
65
|
+
expect(subject.keywords).to eq("data sharing, data repository, DataONE")
|
66
|
+
expect(subject.version).to eq("2.0.0")
|
67
|
+
expect(subject.date_created).to eq("2016-05-27")
|
68
|
+
expect(subject.date_published).to eq("2016-05-27")
|
69
|
+
expect(subject.date_modified).to eq("2016-05-27")
|
70
|
+
expect(subject.publisher).to eq("https://cran.r-project.org")
|
71
|
+
end
|
72
|
+
|
73
|
+
it "maremma" do
|
74
|
+
input = fixture_path + 'maremma/codemeta.json'
|
75
|
+
subject = Bolognese::Metadata.new(input: input)
|
76
|
+
expect(subject.valid?).to be true
|
77
|
+
expect(subject.id).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
78
|
+
expect(subject.url).to eq("https://github.com/datacite/maremma")
|
79
|
+
expect(subject.type).to eq("SoftwareSourceCode")
|
80
|
+
expect(subject.author).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
81
|
+
expect(subject.title).to eq("Maremma: a Ruby library for simplified network calls")
|
82
|
+
expect(subject.description["text"]).to start_with("Simplifies network calls")
|
83
|
+
expect(subject.keywords).to eq("faraday, excon, net/http")
|
84
|
+
expect(subject.date_created).to eq("2015-11-28")
|
85
|
+
expect(subject.date_published).to eq("2017-02-24")
|
86
|
+
expect(subject.date_modified).to eq("2017-02-24")
|
87
|
+
expect(subject.publisher).to eq("DataCite")
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bolognese::Metadata, vcr: true do
|
4
|
+
let(:input) { "10.7554/eLife.01567" }
|
5
|
+
|
6
|
+
subject { Bolognese::Metadata.new(input: input) }
|
7
|
+
|
8
|
+
context "get crossref raw" do
|
9
|
+
it "journal article" do
|
10
|
+
input = fixture_path + 'crossref.xml'
|
11
|
+
subject = Bolognese::Metadata.new(input: input)
|
12
|
+
expect(subject.raw).to eq(IO.read(input))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "get crossref metadata" do
|
17
|
+
it "DOI with data citation" do
|
18
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
19
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
20
|
+
expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
|
21
|
+
expect(subject.additional_type).to eq("JournalArticle")
|
22
|
+
expect(subject.resource_type_general).to eq("Text")
|
23
|
+
expect(subject.author.length).to eq(5)
|
24
|
+
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
|
25
|
+
expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
26
|
+
expect(subject.title).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
27
|
+
expect(subject.date_published).to eq("2014-02-11")
|
28
|
+
expect(subject.date_modified).to eq("2015-08-11T05:35:02Z")
|
29
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"eLife", "issn"=>"2050-084X")
|
30
|
+
expect(subject.references.count).to eq(25)
|
31
|
+
expect(subject.references[19]).to eq("id"=>"https://doi.org/10.5061/dryad.b835k", "type"=>"CreativeWork")
|
32
|
+
expect(subject.funder).to eq([{"name"=>"SystemsX"},
|
33
|
+
{"id"=>"https://doi.org/10.13039/501100003043",
|
34
|
+
"name"=>"EMBO"},
|
35
|
+
{"id"=>"https://doi.org/10.13039/501100001711",
|
36
|
+
"name"=>"Swiss National Science Foundation"},
|
37
|
+
{"id"=>"https://doi.org/10.13039/501100006390",
|
38
|
+
"name"=>"University of Lausanne"}])
|
39
|
+
expect(subject.provider).to eq("Crossref")
|
40
|
+
end
|
41
|
+
|
42
|
+
it "journal article" do
|
43
|
+
input = "https://doi.org/10.1371/journal.pone.0000030"
|
44
|
+
subject = Bolognese::Metadata.new(input: input)
|
45
|
+
expect(subject.id).to eq(input)
|
46
|
+
expect(subject.url).to eq("http://dx.plos.org/10.1371/journal.pone.0000030")
|
47
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
48
|
+
expect(subject.additional_type).to eq("JournalArticle")
|
49
|
+
expect(subject.resource_type_general).to eq("Text")
|
50
|
+
expect(subject.author.length).to eq(5)
|
51
|
+
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Markus Ralser", "givenName"=>"Markus", "familyName"=>"Ralser")
|
52
|
+
expect(subject.editor).to eq("type"=>"Person", "name"=>"Guilhem Janbon", "givenName"=>"Guilhem", "familyName"=>"Janbon")
|
53
|
+
expect(subject.title).to eq("Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes")
|
54
|
+
expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by/4.0")
|
55
|
+
expect(subject.date_published).to eq("2006-12-20")
|
56
|
+
expect(subject.date_modified).to eq("2016-12-31T21:37:08Z")
|
57
|
+
expect(subject.pagination).to eq("e30")
|
58
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"PLoS ONE", "issn"=>"1932-6203")
|
59
|
+
expect(subject.provider).to eq("Crossref")
|
60
|
+
end
|
61
|
+
|
62
|
+
it "posted_content" do
|
63
|
+
input = "https://doi.org/10.1101/097196"
|
64
|
+
subject = Bolognese::Metadata.new(input: input)
|
65
|
+
expect(subject.id).to eq(input)
|
66
|
+
expect(subject.url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")
|
67
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
68
|
+
expect(subject.additional_type).to eq("PostedContent")
|
69
|
+
expect(subject.resource_type_general).to eq("Text")
|
70
|
+
expect(subject.author.count).to eq(10)
|
71
|
+
expect(subject.author.last).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-4060-7360", "name"=>"Timothy Clark", "givenName"=>"Timothy", "familyName"=>"Clark")
|
72
|
+
expect(subject.title).to eq("A Data Citation Roadmap for Scholarly Data Repositories")
|
73
|
+
expect(subject.alternate_name).to eq("biorxiv;097196v1")
|
74
|
+
expect(subject.description).to start_with("This article presents a practical roadmap")
|
75
|
+
expect(subject.date_published).to eq("2016-12-28")
|
76
|
+
expect(subject.date_modified).to eq("2016-12-29T00:10:20Z")
|
77
|
+
expect(subject.is_part_of).to be_nil
|
78
|
+
expect(subject.provider).to eq("Crossref")
|
79
|
+
end
|
80
|
+
|
81
|
+
it "DOI with SICI DOI" do
|
82
|
+
input = "https://doi.org/10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2"
|
83
|
+
subject = Bolognese::Metadata.new(input: input)
|
84
|
+
expect(subject.id).to eq("https://doi.org/10.1890/0012-9658(2006)87%5B2832:tiopma%5D2.0.co;2")
|
85
|
+
expect(subject.url).to eq("http://doi.wiley.com/10.1890/0012-9658(2006)87[2832:TIOPMA]2.0.CO;2")
|
86
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
87
|
+
expect(subject.additional_type).to eq("JournalArticle")
|
88
|
+
expect(subject.resource_type_general).to eq("Text")
|
89
|
+
expect(subject.author).to eq([{"type"=>"Person", "name"=>"A. Fenton", "givenName"=>"A.", "familyName"=>"Fenton"}, {"type"=>"Person", "name"=>"S. A. Rands", "givenName"=>"S. A.", "familyName"=>"Rands"}])
|
90
|
+
expect(subject.license).to eq("id"=>"http://doi.wiley.com/10.1002/tdm_license_1.1")
|
91
|
+
expect(subject.title).to eq("THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES")
|
92
|
+
expect(subject.date_published).to eq("2006-11")
|
93
|
+
expect(subject.date_modified).to eq("2017-04-01T00:47:57Z")
|
94
|
+
expect(subject.pagination).to eq("2832-2841")
|
95
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"Ecology", "issn"=>"0012-9658")
|
96
|
+
expect(subject.provider).to eq("Crossref")
|
97
|
+
end
|
98
|
+
|
99
|
+
it "DOI with ORCID ID" do
|
100
|
+
input = "https://doi.org/10.1155/2012/291294"
|
101
|
+
subject = Bolognese::Metadata.new(input: input)
|
102
|
+
expect(subject.id).to eq("https://doi.org/10.1155/2012/291294")
|
103
|
+
expect(subject.url).to eq("http://www.hindawi.com/journals/pm/2012/291294/")
|
104
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
105
|
+
expect(subject.additional_type).to eq("JournalArticle")
|
106
|
+
expect(subject.resource_type_general).to eq("Text")
|
107
|
+
expect(subject.author.length).to eq(7)
|
108
|
+
expect(subject.author[2]).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-2043-4925", "name"=>"Beatriz Hernandez", "givenName"=>"Beatriz", "familyName"=>"Hernandez")
|
109
|
+
expect(subject.license).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
110
|
+
expect(subject.title).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
111
|
+
expect(subject.date_published).to eq("2012")
|
112
|
+
expect(subject.date_modified).to eq("2016-08-02T12:42:41Z")
|
113
|
+
expect(subject.pagination).to eq("1-7")
|
114
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"Pulmonary Medicine", "issn"=>["2090-1836", "2090-1844"])
|
115
|
+
expect(subject.provider).to eq("Crossref")
|
116
|
+
end
|
117
|
+
|
118
|
+
it "date in future" do
|
119
|
+
input = "https://doi.org/10.1016/j.ejphar.2015.03.018"
|
120
|
+
subject = Bolognese::Metadata.new(input: input)
|
121
|
+
expect(subject.id).to eq(input)
|
122
|
+
expect(subject.url).to eq("http://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
|
123
|
+
expect(subject.type).to eq("ScholarlyArticle")
|
124
|
+
expect(subject.additional_type).to eq("JournalArticle")
|
125
|
+
expect(subject.resource_type_general).to eq("Text")
|
126
|
+
expect(subject.author.length).to eq(10)
|
127
|
+
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Sarah E. Beck", "givenName"=>"Sarah E.", "familyName"=>"Beck")
|
128
|
+
expect(subject.title).to eq("Paving the path to HIV neurotherapy: Predicting SIV CNS disease")
|
129
|
+
expect(subject.date_published).to eq("2015-07")
|
130
|
+
expect(subject.date_modified).to eq("2016-08-20T02:19:38Z")
|
131
|
+
expect(subject.is_part_of).to eq("type"=>"Periodical", "name"=>"European Journal of Pharmacology", "issn"=>"00142999")
|
132
|
+
expect(subject.provider).to eq("Crossref")
|
133
|
+
end
|
134
|
+
|
135
|
+
it "not found error" do
|
136
|
+
input = "https://doi.org/10.7554/elife.01567x"
|
137
|
+
subject = Bolognese::Metadata.new(input: input)
|
138
|
+
expect(subject.id).to be_nil
|
139
|
+
expect(subject.exists?).to be false
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|