bolognese 1.3.1 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +9 -0
- data/.github/workflows/changelog.yml +36 -0
- data/.github/workflows/ci.yml +22 -0
- data/.github/workflows/pull-request.yml +9 -0
- data/.github/workflows/release.yml +32 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +658 -0
- data/CHANGELOG.md +1864 -0
- data/Gemfile.lock +163 -129
- data/README.md +3 -2
- data/bolognese.gemspec +22 -20
- data/lib/bolognese/author_utils.rb +49 -25
- data/lib/bolognese/cli.rb +6 -4
- data/lib/bolognese/datacite_utils.rb +143 -17
- data/lib/bolognese/doi_utils.rb +14 -9
- data/lib/bolognese/metadata.rb +27 -19
- data/lib/bolognese/metadata_utils.rb +25 -6
- data/lib/bolognese/readers/bibtex_reader.rb +29 -34
- data/lib/bolognese/readers/citeproc_reader.rb +27 -35
- data/lib/bolognese/readers/codemeta_reader.rb +12 -13
- data/lib/bolognese/readers/crosscite_reader.rb +4 -1
- data/lib/bolognese/readers/crossref_reader.rb +163 -67
- data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +150 -38
- data/lib/bolognese/readers/npm_reader.rb +115 -0
- data/lib/bolognese/readers/ris_reader.rb +10 -14
- data/lib/bolognese/readers/schema_org_reader.rb +58 -25
- data/lib/bolognese/utils.rb +502 -63
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +4 -3
- data/lib/bolognese/writers/codemeta_writer.rb +6 -5
- data/lib/bolognese/writers/csv_writer.rb +1 -1
- data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
- data/lib/bolognese/writers/jats_writer.rb +9 -4
- data/lib/bolognese/writers/ris_writer.rb +2 -2
- data/lib/bolognese/writers/schema_org_writer.rb +11 -7
- data/lib/bolognese.rb +2 -1
- data/package.json +12 -0
- data/resources/kernel-4/include/datacite-contributorType-v4.xsd +24 -22
- data/resources/kernel-4/include/datacite-dateType-v4.xsd +14 -12
- data/resources/kernel-4/include/datacite-descriptionType-v4.xsd +6 -6
- data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +5 -5
- data/resources/kernel-4/include/datacite-nameType-v4.xsd +2 -2
- data/resources/kernel-4/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +24 -21
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +43 -35
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +38 -17
- data/resources/kernel-4/include/datacite-titleType-v4.xsd +5 -5
- data/resources/kernel-4/metadata.xsd +349 -146
- data/resources/kernel-4.3/metadata.xsd +39 -8
- data/resources/kernel-4.4/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.4/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.4/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.4/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.4/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.4/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.4/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.4/include/datacite-relationType-v4.xsd +51 -0
- data/resources/kernel-4.4/include/datacite-resourceType-v4.xsd +43 -0
- data/resources/kernel-4.4/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.4/include/xml.xsd +286 -0
- data/resources/kernel-4.4/metadata.xsd +707 -0
- data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
- data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
- data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.5/include/xml.xsd +286 -0
- data/resources/kernel-4.5/metadata.xsd +711 -0
- data/resources/kernel-4.6/include/datacite-contributorType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-dateType-v4.xsd +27 -0
- data/resources/kernel-4.6/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.6/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.6/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.6/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.6/include/datacite-relatedIdentifierType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-relationType-v4.xsd +57 -0
- data/resources/kernel-4.6/include/datacite-resourceType-v4.xsd +49 -0
- data/resources/kernel-4.6/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.6/include/xml.xsd +286 -0
- data/resources/kernel-4.6/metadata.xsd +712 -0
- data/resources/oecd/dfg-mappings.json +1866 -0
- data/resources/oecd/for-mappings.json +1101 -0
- data/resources/oecd/fos-mappings.json +198 -0
- data/resources/schema_org/jsonldcontext.json +1069 -232
- data/resources/spdx/licenses.json +5297 -0
- metadata +160 -510
- data/.travis.yml +0 -33
- data/spec/array_spec.rb +0 -22
- data/spec/author_utils_spec.rb +0 -188
- data/spec/cli_spec.rb +0 -219
- data/spec/datacite_utils_spec.rb +0 -148
- data/spec/doi_utils_spec.rb +0 -302
- data/spec/find_from_format_spec.rb +0 -98
- data/spec/fixtures/aida.json +0 -82
- data/spec/fixtures/citeproc-no-author.json +0 -26
- data/spec/fixtures/citeproc-no-categories.json +0 -21
- data/spec/fixtures/citeproc.json +0 -30
- data/spec/fixtures/codemeta.json +0 -86
- data/spec/fixtures/codemeta_v2.json +0 -86
- data/spec/fixtures/crosscite.json +0 -63
- data/spec/fixtures/crossref.bib +0 -14
- data/spec/fixtures/crossref.ris +0 -15
- data/spec/fixtures/crossref.xml +0 -606
- data/spec/fixtures/datacite-example-affiliation.xml +0 -114
- data/spec/fixtures/datacite-example-complicated-v3.0.xml +0 -48
- data/spec/fixtures/datacite-example-complicated-v4.0.xml +0 -54
- data/spec/fixtures/datacite-example-complicated-v4.1.xml +0 -57
- data/spec/fixtures/datacite-example-geolocation-2.xml +0 -141
- data/spec/fixtures/datacite-example-geolocation.xml +0 -66
- data/spec/fixtures/datacite-example-polygon-v4.1.xml +0 -163
- data/spec/fixtures/datacite-geolocation-empty.xml +0 -159
- data/spec/fixtures/datacite-metadata-sample-complicated-v2.2.xml +0 -52
- data/spec/fixtures/datacite-multiple-language.xml +0 -38
- data/spec/fixtures/datacite-multiple-rights.xml +0 -59
- data/spec/fixtures/datacite-seriesinformation.xml +0 -41
- data/spec/fixtures/datacite-xml-lang.xml +0 -51
- data/spec/fixtures/datacite.json +0 -83
- data/spec/fixtures/datacite.xml +0 -40
- data/spec/fixtures/datacite_dataset.xml +0 -58
- data/spec/fixtures/datacite_malformed_creator.xml +0 -52
- data/spec/fixtures/datacite_missing_creator.xml +0 -33
- data/spec/fixtures/datacite_schema_3.xml +0 -58
- data/spec/fixtures/datacite_software.json +0 -21
- data/spec/fixtures/datacite_software_missing_comma.json +0 -18
- data/spec/fixtures/datacite_software_overlapping_keys.json +0 -18
- data/spec/fixtures/funding_reference.xml +0 -53
- data/spec/fixtures/gtex.xml +0 -71
- data/spec/fixtures/maremma/codemeta.json +0 -36
- data/spec/fixtures/nist.xml +0 -35
- data/spec/fixtures/ns0.xml +0 -2
- data/spec/fixtures/pure.bib +0 -14
- data/spec/fixtures/pure.ris +0 -15
- data/spec/fixtures/ris_bug.ris +0 -9
- data/spec/fixtures/schema_4.0.xml +0 -140
- data/spec/fixtures/schema_org.json +0 -44
- data/spec/fixtures/schema_org_geolocation.json +0 -82
- data/spec/fixtures/schema_org_geoshape.json +0 -550
- data/spec/fixtures/schema_org_gtex.json +0 -76
- data/spec/fixtures/schema_org_list.json +0 -12628
- data/spec/fixtures/schema_org_tdl_iodp_invalid_authors.json +0 -25
- data/spec/fixtures/schema_org_topmed.json +0 -54
- data/spec/fixtures/schema_org_type_as_array.json +0 -41
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_citation.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_jats.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_citation.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_jats.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_bibtex.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/crossref.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/datacite.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/jalc.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/kisti.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/medra.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/op.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/author.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/no_author.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_state.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_title.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_description.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_state.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi_with_protocol.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/dx_doi_org_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/force_test_resolver.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/https_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver_http.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi_with_special_characters.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/sandbox_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/jalc.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/kisti.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/op.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi_with_protocol.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/dx_doi_org_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/force_test_resolver.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/https_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/test_resolver_http.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/schema_org.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/codemeta.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crosscite.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/metadata_reports.yml +0 -94
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +0 -92
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +0 -91
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/JaLC.yml +0 -126
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/KISTI.yml +0 -147
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/OP.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +0 -127
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book_chapter.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml +0 -159
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml +0 -109
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml +0 -129
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml +0 -90
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/error_unknown.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/jj.yml +0 -87
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +0 -87
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_funding.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_issue.yml +0 -116
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/mEDRA.yml +0 -125
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/markup.yml +0 -92
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/missing_creator.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_t.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml +0 -87
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +0 -86
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml +0 -91
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml +0 -87
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system_schema_3.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +0 -110
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_not_found.yml +0 -89
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Referee_report_in_test_system.yml +0 -97
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/content_url.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/date.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml +0 -97
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +0 -95
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml +0 -108
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +0 -121
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +0 -102
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/series-information.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/xs_string_attributes.yml +0 -93
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date/publication_date.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/date.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year-month.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_familyName.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_Thai.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +0 -1222
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +0 -58
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_name_identifier.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation_and_country.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_role.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/only_familyName_and_givenName.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse.yml +0 -37
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse_via_identifiers_org.yml +0 -156
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/ornl.yml +0 -704
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/pangaea.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/zenodo.yml +0 -580
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/only_title.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_and_pages.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_and_pages.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_issue_and_pages.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_as_codemeta_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url_file.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/unknown_DOI_prefix.yml +0 -47
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_alternate_identifiers/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_descriptions/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_identifier/doi.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_family_name.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_known_given_name.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_no_info.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_orcid_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_with_protocol.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_options.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_array.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/hash.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/non-funder_doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_as_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_with_protocol.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/only_prefix.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/BlogPosting.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/Dataset.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/climate_data.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/text.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml +0 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml +0 -109
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/container_title.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/journal_article.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/missing_creator.yml +0 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_first_page.yml +0 -46
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +0 -46
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/climate_data.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/text.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +0 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +0 -81
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +0 -81
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +0 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +0 -81
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml +0 -84
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml +0 -45
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml +0 -111
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/alternate_name.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/journal_article.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/with_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +0 -57
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/data_catalog.yml +0 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/geo_location_box.yml +0 -98
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/series_information.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +0 -119
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml +0 -49
- data/spec/fixtures/vivli.xml +0 -1
- data/spec/metadata_spec.rb +0 -165
- data/spec/readers/bibtex_reader_spec.rb +0 -59
- data/spec/readers/citeproc_reader_spec.rb +0 -61
- data/spec/readers/codemeta_reader_spec.rb +0 -117
- data/spec/readers/crosscite_reader_spec.rb +0 -41
- data/spec/readers/crossref_reader_spec.rb +0 -509
- data/spec/readers/datacite_json_reader_spec.rb +0 -61
- data/spec/readers/datacite_reader_spec.rb +0 -1041
- data/spec/readers/ris_reader_spec.rb +0 -73
- data/spec/readers/schema_org_reader_spec.rb +0 -325
- data/spec/spec_helper.rb +0 -94
- data/spec/utils_spec.rb +0 -417
- data/spec/writers/bibtex_writer_spec.rb +0 -163
- data/spec/writers/citation_writer_spec.rb +0 -35
- data/spec/writers/citeproc_writer_spec.rb +0 -223
- data/spec/writers/codemeta_writer_spec.rb +0 -46
- data/spec/writers/crosscite_writer_spec.rb +0 -118
- data/spec/writers/crossref_writer_spec.rb +0 -21
- data/spec/writers/csv_writer_spec.rb +0 -93
- data/spec/writers/datacite_json_writer_spec.rb +0 -86
- data/spec/writers/datacite_writer_spec.rb +0 -366
- data/spec/writers/jats_writer_spec.rb +0 -179
- data/spec/writers/rdf_xml_writer_spec.rb +0 -100
- data/spec/writers/ris_writer_spec.rb +0 -203
- data/spec/writers/schema_org_writer_spec.rb +0 -322
- data/spec/writers/turtle_writer_spec.rb +0 -84
data/lib/bolognese/utils.rb
CHANGED
|
@@ -2,46 +2,112 @@
|
|
|
2
2
|
|
|
3
3
|
module Bolognese
|
|
4
4
|
module Utils
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
5
|
+
class << self
|
|
6
|
+
include Utils
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
NORMALIZED_LICENSES = {
|
|
10
|
+
"https://creativecommons.org/licenses/by/1.0" => "https://creativecommons.org/licenses/by/1.0/legalcode",
|
|
11
|
+
"https://creativecommons.org/licenses/by/2.0" => "https://creativecommons.org/licenses/by/2.0/legalcode",
|
|
12
|
+
"https://creativecommons.org/licenses/by/2.5" => "https://creativecommons.org/licenses/by/2.5/legalcode",
|
|
13
|
+
"https://creativecommons.org/licenses/by/3.0" => "https://creativecommons.org/licenses/by/3.0/legalcode",
|
|
14
|
+
"https://creativecommons.org/licenses/by/3.0/us" => "https://creativecommons.org/licenses/by/3.0/legalcode",
|
|
15
|
+
"https://creativecommons.org/licenses/by/4.0" => "https://creativecommons.org/licenses/by/4.0/legalcode",
|
|
16
|
+
"https://creativecommons.org/licenses/by-nc/1.0" => "https://creativecommons.org/licenses/by-nc/1.0/legalcode",
|
|
17
|
+
"https://creativecommons.org/licenses/by-nc/2.0" => "https://creativecommons.org/licenses/by-nc/2.0/legalcode",
|
|
18
|
+
"https://creativecommons.org/licenses/by-nc/2.5" => "https://creativecommons.org/licenses/by-nc/2.5/legalcode",
|
|
19
|
+
"https://creativecommons.org/licenses/by-nc/3.0" => "https://creativecommons.org/licenses/by-nc/3.0/legalcode",
|
|
20
|
+
"https://creativecommons.org/licenses/by-nc/4.0" => "https://creativecommons.org/licenses/by-nc/4.0/legalcode",
|
|
21
|
+
"https://creativecommons.org/licenses/by-nd-nc/1.0" => "https://creativecommons.org/licenses/by-nd-nc/1.0/legalcode",
|
|
22
|
+
"https://creativecommons.org/licenses/by-nd-nc/2.0" => "https://creativecommons.org/licenses/by-nd-nc/2.0/legalcode",
|
|
23
|
+
"https://creativecommons.org/licenses/by-nd-nc/2.5" => "https://creativecommons.org/licenses/by-nd-nc/2.5/legalcode",
|
|
24
|
+
"https://creativecommons.org/licenses/by-nd-nc/3.0" => "https://creativecommons.org/licenses/by-nd-nc/3.0/legalcode",
|
|
25
|
+
"https://creativecommons.org/licenses/by-nd-nc/4.0" => "https://creativecommons.org/licenses/by-nd-nc/4.0/legalcode",
|
|
26
|
+
"https://creativecommons.org/licenses/by-nc-sa/1.0" => "https://creativecommons.org/licenses/by-nc-sa/1.0/legalcode",
|
|
27
|
+
"https://creativecommons.org/licenses/by-nc-sa/2.0" => "https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode",
|
|
28
|
+
"https://creativecommons.org/licenses/by-nc-sa/2.5" => "https://creativecommons.org/licenses/by-nc-sa/2.5/legalcode",
|
|
29
|
+
"https://creativecommons.org/licenses/by-nc-sa/3.0" => "https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode",
|
|
30
|
+
"https://creativecommons.org/licenses/by-nc-sa/4.0" => "https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode",
|
|
31
|
+
"https://creativecommons.org/licenses/by-nd/1.0" => "https://creativecommons.org/licenses/by-nd/1.0/legalcode",
|
|
32
|
+
"https://creativecommons.org/licenses/by-nd/2.0" => "https://creativecommons.org/licenses/by-nd/2.0/legalcode",
|
|
33
|
+
"https://creativecommons.org/licenses/by-nd/2.5" => "https://creativecommons.org/licenses/by-nd/2.5/legalcode",
|
|
34
|
+
"https://creativecommons.org/licenses/by-nd/3.0" => "https://creativecommons.org/licenses/by-nd/3.0/legalcode",
|
|
35
|
+
"https://creativecommons.org/licenses/by-nd/4.0" => "https://creativecommons.org/licenses/by-nd/4.0/legalcode",
|
|
36
|
+
"https://creativecommons.org/licenses/by-sa/1.0" => "https://creativecommons.org/licenses/by-sa/1.0/legalcode",
|
|
37
|
+
"https://creativecommons.org/licenses/by-sa/2.0" => "https://creativecommons.org/licenses/by-sa/2.0/legalcode",
|
|
38
|
+
"https://creativecommons.org/licenses/by-sa/2.5" => "https://creativecommons.org/licenses/by-sa/2.5/legalcode",
|
|
39
|
+
"https://creativecommons.org/licenses/by-sa/3.0" => "https://creativecommons.org/licenses/by-sa/3.0/legalcode",
|
|
40
|
+
"https://creativecommons.org/licenses/by-sa/4.0" => "https://creativecommons.org/licenses/by-sa/4.0/legalcode",
|
|
41
|
+
"https://creativecommons.org/licenses/by-nc-nd/1.0" => "https://creativecommons.org/licenses/by-nc-nd/1.0/legalcode",
|
|
42
|
+
"https://creativecommons.org/licenses/by-nc-nd/2.0" => "https://creativecommons.org/licenses/by-nc-nd/2.0/legalcode",
|
|
43
|
+
"https://creativecommons.org/licenses/by-nc-nd/2.5" => "https://creativecommons.org/licenses/by-nc-nd/2.5/legalcode",
|
|
44
|
+
"https://creativecommons.org/licenses/by-nc-nd/3.0" => "https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode",
|
|
45
|
+
"https://creativecommons.org/licenses/by-nc-nd/4.0" => "https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode",
|
|
46
|
+
"https://creativecommons.org/licenses/publicdomain" => "https://creativecommons.org/licenses/publicdomain/",
|
|
47
|
+
"https://creativecommons.org/publicdomain/zero/1.0" => "https://creativecommons.org/publicdomain/zero/1.0/legalcode",
|
|
12
48
|
}
|
|
13
49
|
|
|
14
50
|
DC_TO_SO_TRANSLATIONS = {
|
|
15
51
|
"Audiovisual" => "MediaObject",
|
|
52
|
+
"Book" => "Book",
|
|
53
|
+
"BookChapter" => "Chapter",
|
|
16
54
|
"Collection" => "Collection",
|
|
55
|
+
"ComputationalNotebook" => "SoftwareSourceCode",
|
|
56
|
+
"ConferencePaper" => "Article",
|
|
57
|
+
"ConferenceProceeding" => "Periodical",
|
|
58
|
+
"DataPaper" => "Article",
|
|
17
59
|
"Dataset" => "Dataset",
|
|
60
|
+
"Dissertation" => "Thesis",
|
|
18
61
|
"Event" => "Event",
|
|
19
62
|
"Image" => "ImageObject",
|
|
20
63
|
"InteractiveResource" => nil,
|
|
64
|
+
"Journal" => "Periodical",
|
|
65
|
+
"JournalArticle" => "ScholarlyArticle",
|
|
21
66
|
"Model" => nil,
|
|
67
|
+
"OutputManagementPlan" => nil,
|
|
68
|
+
"PeerReview" => "Review",
|
|
22
69
|
"PhysicalObject" => nil,
|
|
70
|
+
"Preprint" => nil,
|
|
71
|
+
"Report" => "Report",
|
|
23
72
|
"Service" => "Service",
|
|
24
73
|
"Software" => "SoftwareSourceCode",
|
|
25
74
|
"Sound" => "AudioObject",
|
|
75
|
+
"Standard" => nil,
|
|
26
76
|
"Text" => "ScholarlyArticle",
|
|
27
77
|
"Workflow" => nil,
|
|
28
78
|
"Other" => "CreativeWork",
|
|
29
79
|
# not part of DataCite schema, but used internally
|
|
30
80
|
"Periodical" => "Periodical",
|
|
31
|
-
"DataCatalog" => "DataCatalog"
|
|
81
|
+
"DataCatalog" => "DataCatalog",
|
|
82
|
+
"Award" => "Grant",
|
|
83
|
+
"Project" => "Project"
|
|
32
84
|
}
|
|
33
85
|
|
|
34
86
|
DC_TO_CP_TRANSLATIONS = {
|
|
35
87
|
"Audiovisual" => "motion_picture",
|
|
88
|
+
"Book" => "book",
|
|
89
|
+
"BookChapter" => "chapter",
|
|
36
90
|
"Collection" => nil,
|
|
91
|
+
"ComputationalNotebook" => nil,
|
|
92
|
+
"ConferencePaper" => "paper_conference",
|
|
93
|
+
"ConferenceProceeding" => nil,
|
|
94
|
+
"DataPaper" => "report",
|
|
37
95
|
"Dataset" => "dataset",
|
|
96
|
+
"Dissertation" => nil,
|
|
38
97
|
"Event" => nil,
|
|
39
98
|
"Image" => "graphic",
|
|
40
99
|
"InteractiveResource" => nil,
|
|
100
|
+
"Journal" => nil,
|
|
101
|
+
"JournalArticle" => "article-journal",
|
|
41
102
|
"Model" => nil,
|
|
103
|
+
"OutputManagementPlan" => nil,
|
|
104
|
+
"PeerReview" => "review",
|
|
42
105
|
"PhysicalObject" => nil,
|
|
106
|
+
"Preprint" => nil,
|
|
107
|
+
"Report" => "report",
|
|
43
108
|
"Service" => nil,
|
|
44
109
|
"Sound" => "song",
|
|
110
|
+
"Standard" => nil,
|
|
45
111
|
"Text" => "report",
|
|
46
112
|
"Workflow" => nil,
|
|
47
113
|
"Other" => nil
|
|
@@ -86,7 +152,7 @@ module Bolognese
|
|
|
86
152
|
"EditedBook" => "Book",
|
|
87
153
|
"JournalArticle" => "ScholarlyArticle",
|
|
88
154
|
"Journal" => nil,
|
|
89
|
-
"Report" =>
|
|
155
|
+
"Report" => "Report",
|
|
90
156
|
"BookSeries" => nil,
|
|
91
157
|
"ReportSeries" => nil,
|
|
92
158
|
"BookTrack" => nil,
|
|
@@ -101,7 +167,8 @@ module Bolognese
|
|
|
101
167
|
"ReferenceEntry" => nil,
|
|
102
168
|
"JournalVolume" => "PublicationVolume",
|
|
103
169
|
"BookSet" => nil,
|
|
104
|
-
"PostedContent" => "ScholarlyArticle"
|
|
170
|
+
"PostedContent" => "ScholarlyArticle",
|
|
171
|
+
"PeerReview" => "Review"
|
|
105
172
|
}
|
|
106
173
|
|
|
107
174
|
CR_TO_BIB_TRANSLATIONS = {
|
|
@@ -115,7 +182,7 @@ module Bolognese
|
|
|
115
182
|
"EditedBook" => "book",
|
|
116
183
|
"JournalArticle" => "article",
|
|
117
184
|
"Journal" => nil,
|
|
118
|
-
"Report" =>
|
|
185
|
+
"Report" => "techreport",
|
|
119
186
|
"BookSeries" => nil,
|
|
120
187
|
"ReportSeries" => nil,
|
|
121
188
|
"BookTrack" => nil,
|
|
@@ -169,12 +236,44 @@ module Bolognese
|
|
|
169
236
|
"BookSet" => "book"
|
|
170
237
|
}
|
|
171
238
|
|
|
239
|
+
CR_TO_DC_TRANSLATIONS = {
|
|
240
|
+
"Proceedings" => nil,
|
|
241
|
+
"ReferenceBook" => nil,
|
|
242
|
+
"JournalIssue" => "Text",
|
|
243
|
+
"ProceedingsArticle" => "ConferencePaper",
|
|
244
|
+
"Other" => "Other",
|
|
245
|
+
"Dissertation" => "Dissertation",
|
|
246
|
+
"Dataset" => "Dataset",
|
|
247
|
+
"EditedBook" => "Book",
|
|
248
|
+
"JournalArticle" => "JournalArticle",
|
|
249
|
+
"Journal" => "Journal",
|
|
250
|
+
"Report" => "Report",
|
|
251
|
+
"BookSeries" => nil,
|
|
252
|
+
"ReportSeries" => nil,
|
|
253
|
+
"BookTrack" => nil,
|
|
254
|
+
"Standard" => "Standard",
|
|
255
|
+
"BookSection" => "BookChapter",
|
|
256
|
+
"BookPart" => nil,
|
|
257
|
+
"Book" => "Book",
|
|
258
|
+
"BookChapter" => "BookChapter",
|
|
259
|
+
"SaComponent" => "Text",
|
|
260
|
+
"StandardSeries" => "Standard",
|
|
261
|
+
"Monograph" => "book",
|
|
262
|
+
"Component" => nil,
|
|
263
|
+
"ReferenceEntry" => nil,
|
|
264
|
+
"JournalVolume" => nil,
|
|
265
|
+
"BookSet" => nil,
|
|
266
|
+
"PostedContent" => "JournalArticle",
|
|
267
|
+
"PeerReview" => "PeerReview"
|
|
268
|
+
}
|
|
269
|
+
|
|
172
270
|
SO_TO_DC_TRANSLATIONS = {
|
|
173
271
|
"Article" => "Text",
|
|
174
272
|
"AudioObject" => "Sound",
|
|
175
273
|
"Blog" => "Text",
|
|
176
274
|
"BlogPosting" => "Text",
|
|
177
|
-
"
|
|
275
|
+
"Book" => "Book",
|
|
276
|
+
"Chapter" => "BookChapter",
|
|
178
277
|
"Collection" => "Collection",
|
|
179
278
|
"DataCatalog" => "Dataset",
|
|
180
279
|
"Dataset" => "Dataset",
|
|
@@ -182,9 +281,11 @@ module Bolognese
|
|
|
182
281
|
"ImageObject" => "Image",
|
|
183
282
|
"Movie" => "Audiovisual",
|
|
184
283
|
"PublicationIssue" => "Text",
|
|
284
|
+
"Report" => "Report",
|
|
185
285
|
"ScholarlyArticle" => "Text",
|
|
186
286
|
"Thesis" => "Text",
|
|
187
287
|
"Service" => "Service",
|
|
288
|
+
"Review" => "PeerReview",
|
|
188
289
|
"SoftwareSourceCode" => "Software",
|
|
189
290
|
"VideoObject" => "Audiovisual",
|
|
190
291
|
"WebPage" => "Text",
|
|
@@ -226,6 +327,7 @@ module Bolognese
|
|
|
226
327
|
"ImageObject" => "graphic",
|
|
227
328
|
"Movie" => "motion_picture",
|
|
228
329
|
"PublicationIssue" => nil,
|
|
330
|
+
"Report" => "report",
|
|
229
331
|
"ScholarlyArticle" => "article-journal",
|
|
230
332
|
"Service" => nil,
|
|
231
333
|
"Thesis" => "thesis",
|
|
@@ -246,6 +348,7 @@ module Bolognese
|
|
|
246
348
|
"Event" => nil,
|
|
247
349
|
"ImageObject" => "FIGURE",
|
|
248
350
|
"Movie" => "MPCT",
|
|
351
|
+
"Report" => "RPRT",
|
|
249
352
|
"PublicationIssue" => nil,
|
|
250
353
|
"ScholarlyArticle" => "JOUR",
|
|
251
354
|
"Service" => nil,
|
|
@@ -266,11 +369,11 @@ module Bolognese
|
|
|
266
369
|
"EditedBook" => "BOOK",
|
|
267
370
|
"JournalArticle" => "JOUR",
|
|
268
371
|
"Journal" => nil,
|
|
269
|
-
"Report" =>
|
|
372
|
+
"Report" => "RPRT",
|
|
270
373
|
"BookSeries" => nil,
|
|
271
374
|
"ReportSeries" => nil,
|
|
272
375
|
"BookTrack" => nil,
|
|
273
|
-
"Standard" =>
|
|
376
|
+
"Standard" => "STAND",
|
|
274
377
|
"BookSection" => "CHAP",
|
|
275
378
|
"BookPart" => "CHAP",
|
|
276
379
|
"Book" => "BOOK",
|
|
@@ -285,21 +388,73 @@ module Bolognese
|
|
|
285
388
|
|
|
286
389
|
DC_TO_RIS_TRANSLATIONS = {
|
|
287
390
|
"Audiovisual" => "MPCT",
|
|
391
|
+
"Book" => "BOOK",
|
|
392
|
+
"BookChapter" => "CHAP",
|
|
288
393
|
"Collection" => nil,
|
|
394
|
+
"ComputationalNotebook" => "COMP",
|
|
395
|
+
"ConferencePaper" => "CPAPER",
|
|
396
|
+
"ConferenceProceeding" => "CONF",
|
|
397
|
+
"DataPaper" => nil,
|
|
289
398
|
"Dataset" => "DATA",
|
|
399
|
+
"Dissertation" => "THES",
|
|
290
400
|
"Event" => nil,
|
|
291
401
|
"Image" => "FIGURE",
|
|
292
402
|
"InteractiveResource" => nil,
|
|
403
|
+
"Journal" => nil,
|
|
404
|
+
"JournalArticle" => "JOUR",
|
|
293
405
|
"Model" => nil,
|
|
406
|
+
"OutputManagementPlan" => nil,
|
|
407
|
+
"PeerReview" => nil,
|
|
294
408
|
"PhysicalObject" => nil,
|
|
409
|
+
"Preprint" => nil,
|
|
410
|
+
"Report" => "RRPT",
|
|
295
411
|
"Service" => nil,
|
|
296
412
|
"Software" => "COMP",
|
|
297
413
|
"Sound" => "SOUND",
|
|
414
|
+
"Standard" => nil,
|
|
298
415
|
"Text" => "RPRT",
|
|
299
416
|
"Workflow" => nil,
|
|
300
417
|
"Other" => nil
|
|
301
418
|
}
|
|
302
419
|
|
|
420
|
+
RIS_TO_DC_TRANSLATIONS = {
|
|
421
|
+
"BLOG" => "Text",
|
|
422
|
+
"GEN" => "Text",
|
|
423
|
+
"CTLG" => "Collection",
|
|
424
|
+
"DATA" => "Dataset",
|
|
425
|
+
"FIGURE" => "Image",
|
|
426
|
+
"THES" => "Dissertation",
|
|
427
|
+
"MPCT" => "Audiovisual",
|
|
428
|
+
"JOUR" => "JournalArticle",
|
|
429
|
+
"COMP" => "Software",
|
|
430
|
+
"VIDEO" => "Audiovisual",
|
|
431
|
+
"ELEC" => "Text"
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
BIB_TO_DC_TRANSLATIONS = {
|
|
435
|
+
"article" => "JournalArticle",
|
|
436
|
+
"book" => "Book",
|
|
437
|
+
"inbook" => "BookChapter",
|
|
438
|
+
"inproceedings" => nil,
|
|
439
|
+
"manual" => nil,
|
|
440
|
+
"misc" => "Other",
|
|
441
|
+
"phdthesis" => "Dissertation",
|
|
442
|
+
"proceedings" => "ConferenceProceeding",
|
|
443
|
+
"techreport" => "Report",
|
|
444
|
+
"unpublished" => nil
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
CP_TO_DC_TRANSLATIONS = {
|
|
448
|
+
"song" => "Audiovisual",
|
|
449
|
+
"post-weblog" => "Text",
|
|
450
|
+
"dataset" => "Dataset",
|
|
451
|
+
"graphic" => "Image",
|
|
452
|
+
"motion_picture" => "Audiovisual",
|
|
453
|
+
"article-journal" => "JournalArticle",
|
|
454
|
+
"broadcast" => "Audiovisual",
|
|
455
|
+
"webpage" => "Text"
|
|
456
|
+
}
|
|
457
|
+
|
|
303
458
|
SO_TO_BIB_TRANSLATIONS = {
|
|
304
459
|
"Article" => "article",
|
|
305
460
|
"AudioObject" => "misc",
|
|
@@ -322,11 +477,46 @@ module Bolognese
|
|
|
322
477
|
"WebSite" => "misc"
|
|
323
478
|
}
|
|
324
479
|
|
|
325
|
-
|
|
480
|
+
UNKNOWN_INFORMATION = {
|
|
481
|
+
":unac" => "temporarily inaccessible",
|
|
482
|
+
":unal" => "unallowed, suppressed intentionally",
|
|
483
|
+
":unap" => "not applicable, makes no sense",
|
|
484
|
+
":unas" => "value unassigned (e.g., Untitled)",
|
|
485
|
+
":unav" => "value unavailable, possibly unknown",
|
|
486
|
+
":unkn" => "known to be unknown (e.g., Anonymous, Inconnue)",
|
|
487
|
+
":none" => "never had a value, never will",
|
|
488
|
+
":null" => "explicitly and meaningfully empty",
|
|
489
|
+
":tba" => "to be assigned or announced later",
|
|
490
|
+
":etal" => "too numerous to list (et alia)"
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
RESOURCE_PATHS = {
|
|
494
|
+
spdx: 'spdx/licenses.json',
|
|
495
|
+
fos: 'oecd/fos-mappings.json',
|
|
496
|
+
for: 'oecd/for-mappings.json',
|
|
497
|
+
dfg: 'oecd/dfg-mappings.json'
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
def resources_dir_path
|
|
501
|
+
File.expand_path('../../../resources', __FILE__) + '/'
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
def resource_file( extra_path )
|
|
505
|
+
File.read(resources_dir_path + extra_path)
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
def resource_json( resource_symbol )
|
|
509
|
+
if RESOURCE_PATHS.keys().include?(resource_symbol)
|
|
510
|
+
JSON.load(resource_file(RESOURCE_PATHS[resource_symbol]))
|
|
511
|
+
end
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def find_from_format(id: nil, string: nil, ext: nil, filename: nil)
|
|
326
516
|
if id.present?
|
|
327
517
|
find_from_format_by_id(id)
|
|
328
518
|
elsif ext.present?
|
|
329
|
-
find_from_format_by_ext(string, ext: ext)
|
|
519
|
+
find_from_format_by_filename(filename) || find_from_format_by_ext(string, ext: ext)
|
|
330
520
|
elsif string.present?
|
|
331
521
|
find_from_format_by_string(string)
|
|
332
522
|
else
|
|
@@ -337,11 +527,13 @@ module Bolognese
|
|
|
337
527
|
def find_from_format_by_id(id)
|
|
338
528
|
id = normalize_id(id)
|
|
339
529
|
|
|
340
|
-
if /\A(?:(http|https):\/(\/)?(dx\.)?(doi.org|handle.
|
|
530
|
+
if /\A(?:(http|https):\/(\/)?(dx\.)?(doi.org|handle.stage.datacite.org)\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(id)
|
|
341
531
|
ra = get_doi_ra(id)
|
|
342
532
|
%w(DataCite Crossref mEDRA KISTI JaLC OP).include?(ra) ? ra.downcase : nil
|
|
343
533
|
elsif /\A(?:(http|https):\/(\/)?orcid\.org\/)?(\d{4}-\d{4}-\d{4}-\d{3}[0-9X]+)\z/.match(id)
|
|
344
534
|
"orcid"
|
|
535
|
+
elsif /\A(http|https):\/(\/)?github\.com\/(.+)\/package.json\z/.match(id)
|
|
536
|
+
"npm"
|
|
345
537
|
elsif /\A(http|https):\/(\/)?github\.com\/(.+)\z/.match(id)
|
|
346
538
|
"codemeta"
|
|
347
539
|
else
|
|
@@ -349,6 +541,12 @@ module Bolognese
|
|
|
349
541
|
end
|
|
350
542
|
end
|
|
351
543
|
|
|
544
|
+
def find_from_format_by_filename(filename)
|
|
545
|
+
if filename == "package.json"
|
|
546
|
+
"npm"
|
|
547
|
+
end
|
|
548
|
+
end
|
|
549
|
+
|
|
352
550
|
def find_from_format_by_ext(string, options={})
|
|
353
551
|
if options[:ext] == ".bib"
|
|
354
552
|
"bibtex"
|
|
@@ -356,7 +554,7 @@ module Bolognese
|
|
|
356
554
|
"ris"
|
|
357
555
|
elsif options[:ext] == ".xml" && Maremma.from_xml(string).to_h.dig("crossref_result", "query_result", "body", "query", "doi_record", "crossref")
|
|
358
556
|
"crossref"
|
|
359
|
-
elsif options[:ext] == ".xml" && Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
|
557
|
+
elsif options[:ext] == ".xml" && Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
|
360
558
|
"datacite"
|
|
361
559
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("@context").to_s.start_with?("http://schema.org", "https://schema.org")
|
|
362
560
|
"schema_org"
|
|
@@ -364,7 +562,7 @@ module Bolognese
|
|
|
364
562
|
"codemeta"
|
|
365
563
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("schemaVersion").to_s.start_with?("http://datacite.org/schema/kernel")
|
|
366
564
|
"datacite_json"
|
|
367
|
-
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("types")
|
|
565
|
+
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("types") && Maremma.from_json(string).to_h.dig("publication_year").present?
|
|
368
566
|
"crosscite"
|
|
369
567
|
elsif options[:ext] == ".json" && Maremma.from_json(string).to_h.dig("issued", "date-parts").present?
|
|
370
568
|
"citeproc"
|
|
@@ -374,7 +572,7 @@ module Bolognese
|
|
|
374
572
|
def find_from_format_by_string(string)
|
|
375
573
|
if Maremma.from_xml(string).to_h.dig("crossref_result", "query_result", "body", "query", "doi_record", "crossref").present?
|
|
376
574
|
"crossref"
|
|
377
|
-
elsif Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
|
575
|
+
elsif Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
|
378
576
|
"datacite"
|
|
379
577
|
elsif Maremma.from_json(string).to_h.dig("@context").to_s.start_with?("http://schema.org", "https://schema.org")
|
|
380
578
|
"schema_org"
|
|
@@ -382,7 +580,7 @@ module Bolognese
|
|
|
382
580
|
"codemeta"
|
|
383
581
|
elsif Maremma.from_json(string).to_h.dig("schema-version").to_s.start_with?("http://datacite.org/schema/kernel")
|
|
384
582
|
"datacite_json"
|
|
385
|
-
elsif Maremma.from_json(string).to_h.dig("types").present?
|
|
583
|
+
elsif Maremma.from_json(string).to_h.dig("types").present? && Maremma.from_json(string).to_h.dig("publication_year").present?
|
|
386
584
|
"crosscite"
|
|
387
585
|
elsif Maremma.from_json(string).to_h.dig("issued", "date-parts").present?
|
|
388
586
|
"citeproc"
|
|
@@ -404,10 +602,14 @@ module Bolognese
|
|
|
404
602
|
end
|
|
405
603
|
|
|
406
604
|
def validate_orcid(orcid)
|
|
407
|
-
orcid = Array(/\A(?:(http|https):\/\/(www
|
|
605
|
+
orcid = Array(/\A(?:(?:http|https):\/\/(?:(?:www|sandbox)?\.)?orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\/{0,1}\z/.match(orcid)).last
|
|
408
606
|
orcid.gsub(/[[:space:]]/, "-") if orcid.present?
|
|
409
607
|
end
|
|
410
608
|
|
|
609
|
+
def validate_ror(ror)
|
|
610
|
+
Array(/^(?:(?:(?:http|https):\/\/)?ror\.org\/)?(0\w{6}\d{2})\/{0,1}$/.match(ror)).last
|
|
611
|
+
end
|
|
612
|
+
|
|
411
613
|
def validate_orcid_scheme(orcid_scheme)
|
|
412
614
|
Array(/\A(http|https):\/\/(www\.)?(orcid\.org)/.match(orcid_scheme)).last
|
|
413
615
|
end
|
|
@@ -430,7 +632,7 @@ module Bolognese
|
|
|
430
632
|
elsif element.is_a?(Hash)
|
|
431
633
|
element.fetch( CGI.unescapeHTML(content), nil)
|
|
432
634
|
elsif element.is_a?(Array)
|
|
433
|
-
a = element.map { |e| e.is_a?(Hash) ? e.fetch(
|
|
635
|
+
a = element.map { |e| e.is_a?(Hash) ? e.fetch(CGI.unescapeHTML(content), nil) : e }.uniq
|
|
434
636
|
a = options[:first] ? a.first : a.unwrap
|
|
435
637
|
else
|
|
436
638
|
nil
|
|
@@ -441,7 +643,7 @@ module Bolognese
|
|
|
441
643
|
return nil unless id.present?
|
|
442
644
|
|
|
443
645
|
# check for valid DOI
|
|
444
|
-
doi = normalize_doi(id, options)
|
|
646
|
+
doi = DoiUtils::normalize_doi(id, options)
|
|
445
647
|
return doi if doi.present?
|
|
446
648
|
|
|
447
649
|
# check for valid HTTP uri
|
|
@@ -454,7 +656,7 @@ module Bolognese
|
|
|
454
656
|
nil
|
|
455
657
|
end
|
|
456
658
|
|
|
457
|
-
def normalize_url(id)
|
|
659
|
+
def normalize_url(id, options={})
|
|
458
660
|
return nil unless id.present?
|
|
459
661
|
|
|
460
662
|
# handle info URIs
|
|
@@ -465,12 +667,22 @@ module Bolognese
|
|
|
465
667
|
|
|
466
668
|
return nil unless uri && uri.host && %w(http https ftp).include?(uri.scheme)
|
|
467
669
|
|
|
670
|
+
# optionally turn into https URL
|
|
671
|
+
uri.scheme = "https" if options[:https]
|
|
672
|
+
|
|
468
673
|
# clean up URL
|
|
469
|
-
PostRank::URI.clean(
|
|
674
|
+
uri.path = PostRank::URI.clean(uri.path)
|
|
675
|
+
|
|
676
|
+
uri.to_s
|
|
470
677
|
rescue Addressable::URI::InvalidURIError
|
|
471
678
|
nil
|
|
472
679
|
end
|
|
473
680
|
|
|
681
|
+
def normalize_cc_url(id)
|
|
682
|
+
id = normalize_url(id, https: true)
|
|
683
|
+
NORMALIZED_LICENSES.fetch(id, id)
|
|
684
|
+
end
|
|
685
|
+
|
|
474
686
|
def normalize_orcid(orcid)
|
|
475
687
|
orcid = validate_orcid(orcid)
|
|
476
688
|
return nil unless orcid.present?
|
|
@@ -479,11 +691,19 @@ module Bolognese
|
|
|
479
691
|
"https://orcid.org/" + Addressable::URI.encode(orcid)
|
|
480
692
|
end
|
|
481
693
|
|
|
694
|
+
def normalize_ror(ror)
|
|
695
|
+
ror = validate_ror(ror)
|
|
696
|
+
return nil unless ror.present?
|
|
697
|
+
|
|
698
|
+
# turn ROR into URL
|
|
699
|
+
"https://ror.org/" + Addressable::URI.encode(ror)
|
|
700
|
+
end
|
|
701
|
+
|
|
482
702
|
def normalize_ids(ids: nil, relation_type: nil)
|
|
483
703
|
Array.wrap(ids).select { |idx| idx["@id"].present? }.map do |idx|
|
|
484
704
|
id = normalize_id(idx["@id"])
|
|
485
|
-
related_identifier_type = doi_from_url(id).present? ? "DOI" : "URL"
|
|
486
|
-
id = doi_from_url(id) || id
|
|
705
|
+
related_identifier_type = DoiUtils::doi_from_url(id).present? ? "DOI" : "URL"
|
|
706
|
+
id = DoiUtils::doi_from_url(id) || id
|
|
487
707
|
|
|
488
708
|
{ "relatedIdentifier" => id,
|
|
489
709
|
"relationType" => relation_type,
|
|
@@ -555,6 +775,14 @@ module Bolognese
|
|
|
555
775
|
nil
|
|
556
776
|
end
|
|
557
777
|
|
|
778
|
+
def normalize_publisher(publisher)
|
|
779
|
+
if publisher.respond_to?(:to_hash)
|
|
780
|
+
publisher
|
|
781
|
+
elsif publisher.respond_to?(:to_str)
|
|
782
|
+
{ "name" => publisher }
|
|
783
|
+
end
|
|
784
|
+
end
|
|
785
|
+
|
|
558
786
|
def to_datacite_json(element, options={})
|
|
559
787
|
a = Array.wrap(element).map do |e|
|
|
560
788
|
e.inject({}) {|h, (k,v)| h[k.dasherize] = v; h }
|
|
@@ -579,15 +807,15 @@ module Bolognese
|
|
|
579
807
|
c["affiliation"] = Array.wrap(c["affiliation"]).map do |a|
|
|
580
808
|
if a.is_a?(String)
|
|
581
809
|
name = a
|
|
582
|
-
|
|
810
|
+
affiliation_identifier = nil
|
|
583
811
|
else
|
|
584
812
|
name = a["name"]
|
|
585
|
-
|
|
813
|
+
affiliation_identifier = a["affiliationIdentifier"]
|
|
586
814
|
end
|
|
587
815
|
|
|
588
|
-
{
|
|
589
|
-
"@type" => "Organization",
|
|
590
|
-
"@id" =>
|
|
816
|
+
{
|
|
817
|
+
"@type" => "Organization",
|
|
818
|
+
"@id" => affiliation_identifier,
|
|
591
819
|
"name" => name }.compact
|
|
592
820
|
end.unwrap
|
|
593
821
|
c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil
|
|
@@ -599,31 +827,32 @@ module Bolognese
|
|
|
599
827
|
|
|
600
828
|
def to_schema_org_contributors(element)
|
|
601
829
|
element = Array.wrap(element).map do |c|
|
|
602
|
-
|
|
830
|
+
transformed_c = c.dup
|
|
831
|
+
transformed_c["affiliation"] = Array.wrap(c["affiliation"]).map do |a|
|
|
603
832
|
if a.is_a?(String)
|
|
604
833
|
name = a
|
|
605
|
-
|
|
834
|
+
affiliation_identifier = nil
|
|
606
835
|
else
|
|
607
836
|
name = a["name"]
|
|
608
|
-
|
|
837
|
+
affiliation_identifier = a["affiliationIdentifier"]
|
|
609
838
|
end
|
|
610
839
|
|
|
611
|
-
{
|
|
612
|
-
"@type" => "Organization",
|
|
613
|
-
"@id" =>
|
|
840
|
+
{
|
|
841
|
+
"@type" => "Organization",
|
|
842
|
+
"@id" => affiliation_identifier,
|
|
614
843
|
"name" => name }.compact
|
|
615
844
|
end.unwrap
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
845
|
+
transformed_c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil
|
|
846
|
+
transformed_c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil)
|
|
847
|
+
transformed_c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"]
|
|
848
|
+
transformed_c.except("nameIdentifiers", "nameType").compact
|
|
620
849
|
end.unwrap
|
|
621
850
|
end
|
|
622
851
|
|
|
623
852
|
def to_schema_org_container(element, options={})
|
|
624
853
|
return nil unless (element.is_a?(Hash) || (element.nil? && options[:container_title].present?))
|
|
625
854
|
|
|
626
|
-
{
|
|
855
|
+
{
|
|
627
856
|
"@id" => element["identifier"],
|
|
628
857
|
"@type" => (options[:type] == "Dataset") ? "DataCatalog" : "Periodical",
|
|
629
858
|
"name" => element["title"] || options[:container_title] }.compact
|
|
@@ -631,7 +860,7 @@ module Bolognese
|
|
|
631
860
|
|
|
632
861
|
def to_schema_org_identifiers(element, options={})
|
|
633
862
|
Array.wrap(element).map do |ai|
|
|
634
|
-
{
|
|
863
|
+
{
|
|
635
864
|
"@type" => "PropertyValue",
|
|
636
865
|
"propertyID" => ai["identifierType"],
|
|
637
866
|
"value" => ai["identifier"] }
|
|
@@ -641,7 +870,7 @@ module Bolognese
|
|
|
641
870
|
def to_schema_org_relation(related_identifiers: nil, relation_type: nil)
|
|
642
871
|
return nil unless related_identifiers.present? && relation_type.present?
|
|
643
872
|
|
|
644
|
-
relation_type = relation_type == "References" ? ["References", "Cites", "Documents"] : [relation_type]
|
|
873
|
+
relation_type = relation_type == "References" ? ["References", "Cites", "Documents"] : [relation_type]
|
|
645
874
|
|
|
646
875
|
Array.wrap(related_identifiers).select { |ri| relation_type.include?(ri["relationType"]) }.map do |r|
|
|
647
876
|
if r["relatedIdentifierType"] == "ISSN" && r["relationType"] == "IsPartOf"
|
|
@@ -672,7 +901,7 @@ module Bolognese
|
|
|
672
901
|
|
|
673
902
|
Array.wrap(geo_location).reduce([]) do |sum, gl|
|
|
674
903
|
if gl.fetch("geoLocationPoint", nil)
|
|
675
|
-
sum << {
|
|
904
|
+
sum << {
|
|
676
905
|
"@type" => "Place",
|
|
677
906
|
"geo" => {
|
|
678
907
|
"@type" => "GeoCoordinates",
|
|
@@ -683,7 +912,7 @@ module Bolognese
|
|
|
683
912
|
end
|
|
684
913
|
|
|
685
914
|
if gl.fetch("geoLocationBox", nil)
|
|
686
|
-
sum << {
|
|
915
|
+
sum << {
|
|
687
916
|
"@type" => "Place",
|
|
688
917
|
"geo" => {
|
|
689
918
|
"@type" => "GeoShape",
|
|
@@ -696,19 +925,24 @@ module Bolognese
|
|
|
696
925
|
end
|
|
697
926
|
|
|
698
927
|
if gl.fetch("geoLocationPolygon", nil)
|
|
699
|
-
sum << {
|
|
928
|
+
sum << {
|
|
700
929
|
"@type" => "Place",
|
|
701
930
|
"geo" => {
|
|
702
931
|
"@type" => "GeoShape",
|
|
703
932
|
"address" => gl["geoLocationPlace"],
|
|
704
|
-
"polygon" => Array.wrap(gl.dig("geoLocationPolygon")).map do |glp|
|
|
705
|
-
|
|
706
|
-
|
|
933
|
+
"polygon" => Array.wrap(gl.dig("geoLocationPolygon")).map do |glp|
|
|
934
|
+
Array.wrap(glp).map do |glpp|
|
|
935
|
+
if glpp.dig("polygonPoint")
|
|
936
|
+
[glpp.dig("polygonPoint", "pointLongitude"), glpp.dig("polygonPoint", "pointLatitude")].compact
|
|
937
|
+
end
|
|
938
|
+
end.compact.presence
|
|
939
|
+
end.compact.presence,
|
|
940
|
+
}
|
|
707
941
|
}
|
|
708
942
|
end
|
|
709
943
|
|
|
710
944
|
if gl.fetch("geoLocationPlace", nil) && !gl.fetch("geoLocationPoint", nil) && !gl.fetch("geoLocationBox", nil) && !gl.fetch("geoLocationPolygon", nil)
|
|
711
|
-
sum << {
|
|
945
|
+
sum << {
|
|
712
946
|
"@type" => "Place",
|
|
713
947
|
"geo" => {
|
|
714
948
|
"@type" => "GeoCoordinates",
|
|
@@ -728,18 +962,50 @@ module Bolognese
|
|
|
728
962
|
|
|
729
963
|
def from_schema_org_creators(element)
|
|
730
964
|
element = Array.wrap(element).map do |c|
|
|
965
|
+
if c["affiliation"].is_a?(String)
|
|
966
|
+
c["affiliation"] = { "name" => c["affiliation"] }
|
|
967
|
+
affiliation_identifier_scheme = nil
|
|
968
|
+
scheme_uri = nil
|
|
969
|
+
elsif c.dig("affiliation", "@id").to_s.starts_with?("https://ror.org")
|
|
970
|
+
affiliation_identifier_scheme = "ROR"
|
|
971
|
+
scheme_uri = "https://ror.org/"
|
|
972
|
+
elsif c.dig("affiliation", "@id").to_s.starts_with?("https://isni.org")
|
|
973
|
+
affiliation_identifier_scheme = "ISNI"
|
|
974
|
+
scheme_uri = "https://isni.org/isni/"
|
|
975
|
+
else
|
|
976
|
+
affiliation_identifier_scheme = nil
|
|
977
|
+
scheme_uri = nil
|
|
978
|
+
end
|
|
979
|
+
|
|
731
980
|
c["nameIdentifier"] = [{ "__content__" => c["@id"], "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }] if normalize_orcid(c["@id"])
|
|
732
981
|
c["@type"] = c["@type"].find { |t| %w(Person Organization).include?(t) } if c["@type"].is_a?(Array)
|
|
733
982
|
c["creatorName"] = { "nameType" => c["@type"].present? ? c["@type"].titleize + "al" : nil, "__content__" => c["name"] }.compact
|
|
734
|
-
c.
|
|
983
|
+
c["affiliation"] = { "__content__" => c.dig("affiliation", "name"), "affiliationIdentifier" => c.dig("affiliation", "@id"), "affiliationIdentifierScheme" => affiliation_identifier_scheme, "schemeUri" => scheme_uri }.compact.presence
|
|
984
|
+
c.except("@id", "@type", "name").compact
|
|
735
985
|
end
|
|
736
986
|
end
|
|
737
987
|
|
|
738
988
|
def from_schema_org_contributors(element)
|
|
739
989
|
element = Array.wrap(element).map do |c|
|
|
990
|
+
if c["affiliation"].is_a?(String)
|
|
991
|
+
c["affiliation"] = { "name" => c["affiliation"] }
|
|
992
|
+
affiliation_identifier_scheme = nil
|
|
993
|
+
scheme_uri = nil
|
|
994
|
+
elsif c.dig("affiliation", "@id").to_s.starts_with?("https://ror.org")
|
|
995
|
+
affiliation_identifier_scheme = "ROR"
|
|
996
|
+
scheme_uri = "https://ror.org/"
|
|
997
|
+
elsif c.dig("affiliation", "@id").to_s.starts_with?("https://isni.org")
|
|
998
|
+
affiliation_identifier_scheme = "ISNI"
|
|
999
|
+
scheme_uri = "https://isni.org/isni/"
|
|
1000
|
+
else
|
|
1001
|
+
affiliation_identifier_scheme = nil
|
|
1002
|
+
scheme_uri = nil
|
|
1003
|
+
end
|
|
1004
|
+
|
|
740
1005
|
c["nameIdentifier"] = [{ "__content__" => c["@id"], "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }] if normalize_orcid(c["@id"])
|
|
741
1006
|
c["contributorName"] = { "nameType" => c["@type"].present? ? c["@type"].titleize + "al" : nil, "__content__" => c["name"] }.compact
|
|
742
|
-
c.
|
|
1007
|
+
c["affiliation"] = { "__content__" => c.dig("affiliation", "name"), "affiliationIdentifier" => c.dig("affiliation", "@id"), "affiliationIdentifierScheme" => affiliation_identifier_scheme, "schemeUri" => scheme_uri }.compact.presence
|
|
1008
|
+
c.except("@id", "@type", "name").compact
|
|
743
1009
|
end
|
|
744
1010
|
end
|
|
745
1011
|
|
|
@@ -768,7 +1034,7 @@ module Bolognese
|
|
|
768
1034
|
Array.wrap(element).map do |a|
|
|
769
1035
|
if a["literal"].present?
|
|
770
1036
|
a["@type"] = "Organization"
|
|
771
|
-
a["
|
|
1037
|
+
a["creatorName"] = a["literal"]
|
|
772
1038
|
else
|
|
773
1039
|
a["@type"] = "Person"
|
|
774
1040
|
a["name"] = [a["given"], a["family"]].compact.join(" ")
|
|
@@ -804,12 +1070,16 @@ module Bolognese
|
|
|
804
1070
|
custom_scrubber = Bolognese::WhitelistScrubber.new(options)
|
|
805
1071
|
|
|
806
1072
|
if text.is_a?(String)
|
|
807
|
-
|
|
808
|
-
|
|
1073
|
+
if options[:new_line]
|
|
1074
|
+
# Remove multiple spaces, tabs, and other whitespace characters while preserving single spaces and new lines
|
|
1075
|
+
Loofah.scrub_fragment(text, custom_scrubber).to_s.gsub(/[ \t]+/, ' ').strip
|
|
1076
|
+
else
|
|
1077
|
+
Loofah.scrub_fragment(text, custom_scrubber).to_s.squish
|
|
1078
|
+
end
|
|
809
1079
|
elsif text.is_a?(Hash)
|
|
810
|
-
sanitize(text.fetch(content, nil))
|
|
1080
|
+
sanitize(text.fetch(content, nil), new_line: options[:new_line])
|
|
811
1081
|
elsif text.is_a?(Array)
|
|
812
|
-
a = text.map { |e| e.is_a?(Hash) ? sanitize(e.fetch(content, nil)) : sanitize(e) }.uniq
|
|
1082
|
+
a = text.map { |e| e.is_a?(Hash) ? sanitize(e.fetch(content, nil), new_line: options[:new_line]) : sanitize(e, new_line: options[:new_line]) }.uniq
|
|
813
1083
|
a = options[:first] ? a.first : a.unwrap
|
|
814
1084
|
else
|
|
815
1085
|
nil
|
|
@@ -871,6 +1141,8 @@ module Bolognese
|
|
|
871
1141
|
month = iso8601_time[5..6].to_i
|
|
872
1142
|
day = iso8601_time[8..9].to_i
|
|
873
1143
|
{ 'date-parts' => [[year, month, day].reject { |part| part == 0 }] }
|
|
1144
|
+
rescue TypeError
|
|
1145
|
+
nil
|
|
874
1146
|
end
|
|
875
1147
|
|
|
876
1148
|
def get_date_from_date_parts(date_as_parts)
|
|
@@ -889,7 +1161,7 @@ module Bolognese
|
|
|
889
1161
|
|
|
890
1162
|
def get_iso8601_date(iso8601_time)
|
|
891
1163
|
return nil if iso8601_time.nil?
|
|
892
|
-
|
|
1164
|
+
|
|
893
1165
|
iso8601_time[0..9]
|
|
894
1166
|
end
|
|
895
1167
|
|
|
@@ -921,6 +1193,14 @@ module Bolognese
|
|
|
921
1193
|
nil
|
|
922
1194
|
end
|
|
923
1195
|
|
|
1196
|
+
# iso8601 datetime without hyphens and colons, used by Crossref
|
|
1197
|
+
# return nil if invalid
|
|
1198
|
+
def get_datetime_from_time(time)
|
|
1199
|
+
DateTime.strptime(time.to_s, "%Y%m%d%H%M%S").strftime('%Y-%m-%dT%H:%M:%SZ')
|
|
1200
|
+
rescue ArgumentError
|
|
1201
|
+
nil
|
|
1202
|
+
end
|
|
1203
|
+
|
|
924
1204
|
def get_date(dates, date_type)
|
|
925
1205
|
dd = Array.wrap(dates).find { |d| d["dateType"] == date_type } || {}
|
|
926
1206
|
dd.fetch("date", nil)
|
|
@@ -959,7 +1239,9 @@ module Bolognese
|
|
|
959
1239
|
"urn" => "URN",
|
|
960
1240
|
"md5" => "md5",
|
|
961
1241
|
"minid" => "minid",
|
|
962
|
-
"dataguid" => "dataguid"
|
|
1242
|
+
"dataguid" => "dataguid",
|
|
1243
|
+
"cstr" => "CSTR",
|
|
1244
|
+
"rrid" => "RRID"
|
|
963
1245
|
}
|
|
964
1246
|
|
|
965
1247
|
identifierTypes[identifier_type.downcase] || identifier_type
|
|
@@ -978,7 +1260,7 @@ module Bolognese
|
|
|
978
1260
|
first_page = pages.present? ? pages.split("-").map(&:strip)[0] : nil
|
|
979
1261
|
last_page = pages.present? ? pages.split("-").map(&:strip)[1] : nil
|
|
980
1262
|
|
|
981
|
-
{
|
|
1263
|
+
{
|
|
982
1264
|
"title" => title,
|
|
983
1265
|
"volume" => volume,
|
|
984
1266
|
"issue" => issue,
|
|
@@ -995,5 +1277,162 @@ module Bolognese
|
|
|
995
1277
|
error_array
|
|
996
1278
|
end
|
|
997
1279
|
|
|
1280
|
+
def name_to_spdx(name)
|
|
1281
|
+
spdx = resource_json(:spdx).fetch("licenses")
|
|
1282
|
+
license = spdx.find { |l| l["name"] == name || l["licenseId"] == name || l["seeAlso"].first == normalize_cc_url(name) }
|
|
1283
|
+
|
|
1284
|
+
if license
|
|
1285
|
+
{
|
|
1286
|
+
"rights" => license["name"],
|
|
1287
|
+
"rightsUri" => license["seeAlso"].first,
|
|
1288
|
+
"rightsIdentifier" => license["licenseId"].downcase,
|
|
1289
|
+
"rightsIdentifierScheme" => "SPDX",
|
|
1290
|
+
"schemeUri" => "https://spdx.org/licenses/" }.compact
|
|
1291
|
+
else
|
|
1292
|
+
{ "rights" => name }
|
|
1293
|
+
end
|
|
1294
|
+
end
|
|
1295
|
+
|
|
1296
|
+
def hsh_to_spdx(hsh)
|
|
1297
|
+
spdx = resource_json(:spdx).fetch("licenses")
|
|
1298
|
+
license = spdx.find { |l| l["licenseId"].casecmp?(hsh["rightsIdentifier"]) || l["seeAlso"].first == normalize_cc_url(hsh["rightsURI"]) || l["name"] == hsh["rights"] || l["seeAlso"].first == normalize_cc_url(hsh["rights"]) }
|
|
1299
|
+
|
|
1300
|
+
if license
|
|
1301
|
+
{
|
|
1302
|
+
"rights" => license["name"],
|
|
1303
|
+
"rightsUri" => license["seeAlso"].first,
|
|
1304
|
+
"rightsIdentifier" => license["licenseId"].downcase,
|
|
1305
|
+
"rightsIdentifierScheme" => "SPDX",
|
|
1306
|
+
"schemeUri" => "https://spdx.org/licenses/",
|
|
1307
|
+
"lang" => hsh["lang"] }.compact
|
|
1308
|
+
else
|
|
1309
|
+
{
|
|
1310
|
+
"rights" => hsh["__content__"] || hsh["rights"],
|
|
1311
|
+
"rightsUri" => hsh["rightsURI"] || hsh["rightsUri"],
|
|
1312
|
+
"rightsIdentifier" => hsh["rightsIdentifier"].present? ? hsh["rightsIdentifier"].downcase : nil,
|
|
1313
|
+
"rightsIdentifierScheme" => hsh["rightsIdentifierScheme"],
|
|
1314
|
+
"schemeUri" => hsh["schemeUri"],
|
|
1315
|
+
"lang" => hsh["lang"] }.compact
|
|
1316
|
+
end
|
|
1317
|
+
end
|
|
1318
|
+
|
|
1319
|
+
def name_to_fos(name)
|
|
1320
|
+
# first find subject in Fields of Science (OECD)
|
|
1321
|
+
fos = resource_json(:fos).fetch("fosFields")
|
|
1322
|
+
|
|
1323
|
+
subject = fos.find { |l| l["fosLabel"] == name || "FOS: " + l["fosLabel"] == name }
|
|
1324
|
+
|
|
1325
|
+
if subject
|
|
1326
|
+
return [{
|
|
1327
|
+
"subject" => sanitize(name) },
|
|
1328
|
+
{
|
|
1329
|
+
"subject" => "FOS: " + subject["fosLabel"],
|
|
1330
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
|
1331
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
|
1332
|
+
}]
|
|
1333
|
+
end
|
|
1334
|
+
|
|
1335
|
+
# if not found, look in Fields of Research (Australian and New Zealand Standard Research Classification)
|
|
1336
|
+
# and map to Fields of Science. Add an extra entry for the latter
|
|
1337
|
+
fores = resource_json(:for)
|
|
1338
|
+
for_fields = fores.fetch("forFields")
|
|
1339
|
+
for_disciplines = fores.fetch("forDisciplines")
|
|
1340
|
+
|
|
1341
|
+
subject = for_fields.find { |l| l["forLabel"] == name } ||
|
|
1342
|
+
for_disciplines.find { |l| l["forLabel"] == name }
|
|
1343
|
+
|
|
1344
|
+
if subject
|
|
1345
|
+
[{
|
|
1346
|
+
"subject" => sanitize(name) },
|
|
1347
|
+
{
|
|
1348
|
+
"subject" => "FOS: " + subject["fosLabel"],
|
|
1349
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
|
1350
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
|
1351
|
+
}]
|
|
1352
|
+
else
|
|
1353
|
+
[{ "subject" => sanitize(name) }]
|
|
1354
|
+
end
|
|
1355
|
+
end
|
|
1356
|
+
|
|
1357
|
+
def hsh_to_fos(hsh)
|
|
1358
|
+
# first find subject in Fields of Science (OECD)
|
|
1359
|
+
fos = resource_json(:fos).fetch("fosFields")
|
|
1360
|
+
subject = fos.find { |l| l["fosLabel"] == hsh["__content__"] || "FOS: " + l["fosLabel"] == hsh["__content__"] || l["fosLabel"] == hsh["subject"]}
|
|
1361
|
+
|
|
1362
|
+
if subject
|
|
1363
|
+
return [{
|
|
1364
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1365
|
+
"subjectScheme" => hsh["subjectScheme"],
|
|
1366
|
+
"schemeUri" => hsh["schemeURI"] || hsh["schemeUri"],
|
|
1367
|
+
"valueUri" => hsh["valueURI"] || hsh["valueUri"],
|
|
1368
|
+
"classificationCode" => hsh["classificationCode"],
|
|
1369
|
+
"lang" => hsh["lang"] }.compact,
|
|
1370
|
+
{
|
|
1371
|
+
"subject" => "FOS: " + subject["fosLabel"],
|
|
1372
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
|
1373
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf" }.compact]
|
|
1374
|
+
end
|
|
1375
|
+
|
|
1376
|
+
# if not found, look in Fields of Research (Australian and New Zealand Standard Research Classification)
|
|
1377
|
+
# and map to Fields of Science. Add an extra entry for the latter
|
|
1378
|
+
fores = resource_json(:for)
|
|
1379
|
+
for_fields = fores.fetch("forFields")
|
|
1380
|
+
for_disciplines = fores.fetch("forDisciplines")
|
|
1381
|
+
|
|
1382
|
+
# try to extract forId
|
|
1383
|
+
if hsh["subjectScheme"] == "FOR"
|
|
1384
|
+
for_id = hsh["__content__"].to_s.split(" ").first || hsh["subject"].to_s.split(" ").first
|
|
1385
|
+
for_id = for_id.rjust(6, "0")
|
|
1386
|
+
|
|
1387
|
+
subject = for_fields.find { |l| l["forId"] == for_id } ||
|
|
1388
|
+
for_disciplines.find { |l| l["forId"] == for_id[0..3] }
|
|
1389
|
+
else
|
|
1390
|
+
subject = for_fields.find { |l| l["forLabel"] == hsh["__content__"] || l["forLabel"] == hsh["subject"] } ||
|
|
1391
|
+
for_disciplines.find { |l| l["forLabel"] == hsh["__content__"] || l["forLabel"] == hsh["subject"] }
|
|
1392
|
+
end
|
|
1393
|
+
|
|
1394
|
+
if subject
|
|
1395
|
+
[{
|
|
1396
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1397
|
+
"subjectScheme" => hsh["subjectScheme"],
|
|
1398
|
+
"classificationCode" => hsh["classificationCode"],
|
|
1399
|
+
"schemeUri" => hsh["schemeURI"] || hsh["schemeUri"],
|
|
1400
|
+
"valueUri" => hsh["valueURI"] || hsh["valueUri"],
|
|
1401
|
+
"lang" => hsh["lang"] }.compact,
|
|
1402
|
+
{
|
|
1403
|
+
"subject" => "FOS: " + subject["fosLabel"],
|
|
1404
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
|
1405
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
|
1406
|
+
}]
|
|
1407
|
+
else
|
|
1408
|
+
[{
|
|
1409
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1410
|
+
"subjectScheme" => hsh["subjectScheme"],
|
|
1411
|
+
"classificationCode" => hsh["classificationCode"],
|
|
1412
|
+
"schemeUri" => hsh["schemeURI"] || hsh["schemeUri"],
|
|
1413
|
+
"valueUri" => hsh["valueURI"] || hsh["valueUri"],
|
|
1414
|
+
"lang" => hsh["lang"] }.compact]
|
|
1415
|
+
end
|
|
1416
|
+
end
|
|
1417
|
+
|
|
1418
|
+
def dfg_ids_to_fos(dfg_ids)
|
|
1419
|
+
dfgs = resource_json(:dfg).fetch("dfgFields")
|
|
1420
|
+
ids = Array.wrap(dfg_ids)
|
|
1421
|
+
|
|
1422
|
+
subjects = dfgs.select { |l| ids.include?(l["dfgId"])}
|
|
1423
|
+
subjects.map do |subject|
|
|
1424
|
+
{
|
|
1425
|
+
"classificationCode" => subject["fosId"],
|
|
1426
|
+
"subject" => subject["fosLabel"],
|
|
1427
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
|
1428
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
|
1429
|
+
}
|
|
1430
|
+
end
|
|
1431
|
+
end
|
|
1432
|
+
|
|
1433
|
+
def abstract_description
|
|
1434
|
+
# Fetch the first description with descriptionType "Abstract"
|
|
1435
|
+
Array.wrap(descriptions)&.find { |d| d["descriptionType"] == "Abstract" }
|
|
1436
|
+
end
|
|
998
1437
|
end
|
|
999
1438
|
end
|