bolognese 1.10.0 → 2.6.1
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 +0 -14
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +2 -12
- data/CHANGELOG.md +2 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +210 -162
- data/README.md +1 -1
- data/bolognese.gemspec +31 -36
- data/lib/bolognese/author_utils.rb +18 -8
- data/lib/bolognese/citeproc_extensions.rb +48 -0
- data/lib/bolognese/datacite_utils.rb +28 -10
- data/lib/bolognese/metadata.rb +9 -6
- data/lib/bolognese/metadata_utils.rb +21 -6
- data/lib/bolognese/readers/bibtex_reader.rb +2 -2
- data/lib/bolognese/readers/citeproc_reader.rb +7 -1
- data/lib/bolognese/readers/codemeta_reader.rb +2 -2
- data/lib/bolognese/readers/crosscite_reader.rb +4 -1
- data/lib/bolognese/readers/crossref_reader.rb +53 -8
- data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +36 -43
- data/lib/bolognese/readers/npm_reader.rb +1 -1
- data/lib/bolognese/readers/ris_reader.rb +2 -2
- data/lib/bolognese/readers/schema_org_reader.rb +27 -4
- data/lib/bolognese/utils.rb +114 -25
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +1 -1
- data/lib/bolognese/writers/codemeta_writer.rb +1 -1
- data/lib/bolognese/writers/csv_writer.rb +3 -5
- data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
- data/lib/bolognese/writers/jats_writer.rb +6 -3
- data/lib/bolognese/writers/ris_writer.rb +2 -2
- data/lib/bolognese/writers/schema_org_writer.rb +6 -2
- data/lib/bolognese.rb +1 -4
- data/resources/kernel-4/include/datacite-contributorType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-dateType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +7 -2
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +11 -3
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +10 -1
- data/resources/kernel-4/include/datacite-titleType-v4.xsd +1 -1
- data/resources/kernel-4/metadata.xsd +15 -7
- 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/kernel-4.7/include/datacite-contributorType-v4.xsd +37 -0
- data/resources/kernel-4.7/include/datacite-dateType-v4.xsd +27 -0
- data/resources/kernel-4.7/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.7/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.7/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.7/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.7/include/datacite-relatedIdentifierType-v4.xsd +39 -0
- data/resources/kernel-4.7/include/datacite-relationType-v4.xsd +59 -0
- data/resources/kernel-4.7/include/datacite-resourceType-v4.xsd +52 -0
- data/resources/kernel-4.7/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.7/include/xml.xsd +286 -0
- data/resources/kernel-4.7/metadata.xsd +715 -0
- metadata +160 -718
- data/spec/array_spec.rb +0 -22
- data/spec/author_utils_spec.rb +0 -206
- data/spec/cli_spec.rb +0 -226
- data/spec/datacite_utils_spec.rb +0 -203
- data/spec/doi_utils_spec.rb +0 -314
- data/spec/find_from_format_spec.rb +0 -114
- data/spec/fixtures/aida.json +0 -82
- data/spec/fixtures/cgimp_package.json +0 -18
- data/spec/fixtures/cit_package.json +0 -19
- 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-empty-sizes.xml +0 -57
- data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +0 -102
- data/spec/fixtures/datacite-example-affiliation.xml +0 -114
- data/spec/fixtures/datacite-example-ancientdates-v4.3.xml +0 -29
- data/spec/fixtures/datacite-example-complicated-tba.xml +0 -56
- 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-dissertation-v4.4.xml +0 -56
- data/spec/fixtures/datacite-example-escaped-text.xml +0 -56
- data/spec/fixtures/datacite-example-full-v4.4.xml +0 -114
- data/spec/fixtures/datacite-example-geolocation-2.xml +0 -141
- data/spec/fixtures/datacite-example-geolocation.xml +0 -66
- data/spec/fixtures/datacite-example-nameIdentifier-with-schemeURI.xml +0 -94
- data/spec/fixtures/datacite-example-polygon-v4.1.xml +0 -163
- data/spec/fixtures/datacite-example-relateditems.xml +0 -61
- data/spec/fixtures/datacite-example-xs-string.xml +0 -28
- data/spec/fixtures/datacite-formats-with-xs.xml +0 -22
- data/spec/fixtures/datacite-funderIdentifier.xml +0 -98
- data/spec/fixtures/datacite-geolocation-empty.xml +0 -159
- data/spec/fixtures/datacite-geolocationpolygons-multiple.xml +0 -76
- 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-schema-2.2.xml +0 -80
- data/spec/fixtures/datacite-seriesinformation.xml +0 -41
- data/spec/fixtures/datacite-space-in-sizes.xml +0 -52
- 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/datacite_software_version.json +0 -74
- data/spec/fixtures/edam_package.json +0 -12
- 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/pure.xml +0 -188
- data/spec/fixtures/ris_bug.ris +0 -9
- data/spec/fixtures/schema_4.0.xml +0 -140
- data/spec/fixtures/schema_org.json +0 -49
- 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 -75
- data/spec/fixtures/schema_org_list.json +0 -12623
- data/spec/fixtures/schema_org_tdl_iodp_invalid_authors.json +0 -25
- data/spec/fixtures/schema_org_topmed.json +0 -53
- 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 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_citation.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_crossref.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_datacite.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_jats.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_schema_org.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/default.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_bibtex.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_citation.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_datacite_json.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_jats.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/datacite/to_schema_org.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/default.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_datacite.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/schema_org/to_schema_org.yml +0 -115
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/crossref.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/datacite.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/jalc.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/kisti.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/medra.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/find_from_format_by_id/op.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/author.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/no_author.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/single_author.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/authors_as_string/with_organization.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_state.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_datacite_metadata/change_title.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_description.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_identifiers.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_name.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_license_url.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/change_state.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/validates_against_schema.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/change_metadata_as_datacite_xml/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/doi_with_protocol.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/dx_doi_org_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/force_test_resolver.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/https_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_api_url/test_resolver_http.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/doi_with_special_characters.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/not_a_doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/sandbox_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_from_url/url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/crossref.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/datacite.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/jalc.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/kisti.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/medra.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_a_valid_prefix.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/not_found.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_registration_agency/op.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/doi_with_protocol.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/dx_doi_org_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/force_stage_resolver.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/https_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/stage_resolver.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/doi_resolver/stage_resolver_http.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref.yml +0 -157
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/crossref_doi_not_url.yml +0 -157
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite.yml +0 -157
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/datacite_doi_http.yml +0 -157
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/github.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/orcid.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/schema_org.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_by_ID/unknown_DOI_registration_agency.yml +0 -157
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/bibtex.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/citeproc.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/codemeta.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crosscite.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/crossref.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/datacite_json.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/ris.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_file/schema_org.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_from_format_from_string/crosscite.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_for_with_schemeUri_in_hash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/hsh_to_fos_no_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_for_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/fos/name_to_fos_no_match.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org/with_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/with_affiliation.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/from_schema_org_creators/without_affiliation.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_codemeta_metadata/metadata_reports.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_ORCID_ID.yml +0 -103
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_SICI_DOI.yml +0 -102
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/DOI_with_data_citation.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/JaLC.yml +0 -137
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/KISTI.yml +0 -158
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/OP.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/affiliation_is_space.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +0 -138
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book_chapter.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/article_id_as_page_number.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/author_literal.yml +0 -108
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml +0 -170
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter_with_RDF_for_container.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_oup.yml +0 -98
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml +0 -120
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml +0 -130
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml +0 -143
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dissertation.yml +0 -129
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/empty_given_name.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/invalid_date.yml +0 -101
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_original_language_title.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with.yml +0 -104
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_RDF_for_container.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_article_with_funding.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/journal_issue.yml +0 -127
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/mEDRA.yml +0 -98
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/markup.yml +0 -105
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/missing_creator.yml +0 -100
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_issn.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles.yml +0 -98
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/multiple_titles_with_missing.yml +0 -450
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml +0 -97
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/peer_review.yml +0 -103
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content_copernicus.yml +0 -102
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml +0 -144
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml +0 -102
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml +0 -99
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_json_metadata/metadata_from_api.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_staging_system.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_staging_system_schema_3.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_with_related_id_system.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_not_found.yml +0 -102
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Dataset.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_empty_awardTitle.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Funding_schema_version_4.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Referee_report_in_staging_system.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/Schema_org_type.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_only_full_name.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_scheme.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/author_with_wrong_orcid_scheme.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/cc-by_3_0_us.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/content_url.yml +0 -106
- 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 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/even_more_subject_scheme_FOR.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_references.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/leading_and_trailing_whitespace.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/more_subject_scheme_FOR.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_author_names_in_one_creatorsName.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/multiple_licenses.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/series-information.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/subject_scheme_FOR.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date/publication_date.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/date.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year-month.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_date_parts/year.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/date.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year-month.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_from_parts/year.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/date.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year-month.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_date_parts/year.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/future.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/invalid.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/nil.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/past.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datetime_from_time/present.yml +0 -48
- 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 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_display-order_with_ORCID.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/has_name_in_sort-order.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/hyper-authorship.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/is_organization.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_author_names_in_one_field.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/multiple_name_identifier.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_affiliation_and_country.yml +0 -114
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/name_with_role.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_one_author/only_familyName_and_givenName.yml +0 -57
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/BlogPosting_with_new_DOI.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/harvard_dataverse.yml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/pangaea.yml +0 -57
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_schema_org_metadata/zenodo.yml +0 -62
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/only_title.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_and_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_and_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_series_information/title_volume_issue_and_pages.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_as_codemeta_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/github/github_from_url_file.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/DOI_RA_not_Crossref_or_DataCite.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/handle_input/unknown_DOI_prefix.yml +0 -54
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors/none.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_creators/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates/insert.yml +0 -55
- 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 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_language/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_person/creator_only_name.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publication_year/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_publisher/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers/related_identifier.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_items/insert.yml +0 -73
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_rights_list/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_sizes/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_titles/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_version/insert.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_comma.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_family_name.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_known_given_name.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_no_info.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_orcid_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/is_personal_name_/has_type_organization.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/missing_comma.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/nil.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/overlapping_keys.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/jsonlint/valid.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/not_found.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_cc_url/with_trailing_slash_and_to_https.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/SICI_doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_force_datacite_sandbox.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_datacite_sandbox.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_from_url_without_doi_proxy.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_too_long.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_prefix_with_string.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/doi_with_protocol.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/dx_doi_org_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/https_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/not_valid_doi_prefix.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_doi/url_with_one_slash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/doi_as_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/ftp.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/invalid_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_options.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/sandbox_via_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/string.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_id/url_with_utf-8.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_ids/url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_array.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_empty_array.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_hash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_issn/from_string.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/uri.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/normalize_url/with_trailing_slash_and_to_https.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/array_of_strings.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/first.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/hash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/nil.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/parse_attributes/string.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_only_keep_specific_tags.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_not_found.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/hsh_to_spdx_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_exists.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/spdx/name_to_spdx_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org_identifiers/with_identifiers.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_doi/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_10.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_11.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_12.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_13.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_14.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_4.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_5.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_6.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_7.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_8.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/1_7_9.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/funder_doi_without_prefix.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_funder_doi/non-funder_doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox.yml +0 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +0 -65
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_https.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_trailing_slash.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid_scheme/validate_orcid_scheme_www.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_as_url.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/doi_with_protocol.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_prefix/only_prefix.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml +0 -48
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/string.yml +0 -48
- 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 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/authors_with_affiliations.yml +0 -114
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/climate_data.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/from_schema_org.yml +0 -115
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/keywords_subject_scheme.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/text.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_bibtex/with_pages.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article_vancouver_style.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/interactive_resource_without_dates.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Another_dataset.yml +0 -55
- 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 -115
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/container_title.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/interactive_resource_without_dates.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/keywords_subject_scheme.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/missing_creator.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/multiple_abstracts.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/organization_author.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/software_w/version.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_only_first_page.yml +0 -50
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/with_pages.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/datacite_database_attributes.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_ORCID_ID.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crosscite/with_data_citation_schema_org.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_crossref/from_DataCite.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/climate_data.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/text.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_csv/with_pages.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_ORCID_ID.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_json/with_data_citation_schema_org.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/DOI_not_found.yml +0 -51
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Dataset_in_schema_4_0.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/Text_pass-thru_with_doi_in_options.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_ORCID_ID.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml +0 -115
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_version.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml +0 -88
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/interactive_resource_without_dates.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_ORCID_ID.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml +0 -49
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/with_pages.yml +0 -52
- 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 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/alternate_name.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/keywords_with_subject_scheme.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/maremma.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/with_pages.yml +0 -52
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Funding_OpenAIRE.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_Cyark.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_IsSupplementTo.yml +0 -106
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/Schema_org_JSON_isReferencedBy.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/alternate_identifiers.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/data_catalog.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/geo_location_box.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/interactive_resource_without_dates.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/maremma_schema_org_JSON.yml +0 -75
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/series_information.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml +0 -117
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/journal_article.yml +0 -55
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/with_pages.yml +0 -52
- data/spec/fixtures/vivli.xml +0 -1
- data/spec/metadata_spec.rb +0 -165
- data/spec/readers/bibtex_reader_spec.rb +0 -63
- data/spec/readers/citeproc_reader_spec.rb +0 -61
- data/spec/readers/codemeta_reader_spec.rb +0 -138
- data/spec/readers/crosscite_reader_spec.rb +0 -41
- data/spec/readers/crossref_reader_spec.rb +0 -1102
- data/spec/readers/datacite_json_reader_spec.rb +0 -80
- data/spec/readers/datacite_reader_spec.rb +0 -1688
- data/spec/readers/npm_reader_spec.rb +0 -66
- data/spec/readers/ris_reader_spec.rb +0 -75
- data/spec/readers/schema_org_reader_spec.rb +0 -344
- data/spec/spec_helper.rb +0 -94
- data/spec/utils_spec.rb +0 -666
- data/spec/writers/bibtex_writer_spec.rb +0 -195
- data/spec/writers/citation_writer_spec.rb +0 -52
- data/spec/writers/citeproc_writer_spec.rb +0 -290
- data/spec/writers/codemeta_writer_spec.rb +0 -45
- data/spec/writers/crosscite_writer_spec.rb +0 -122
- data/spec/writers/crossref_writer_spec.rb +0 -21
- data/spec/writers/csv_writer_spec.rb +0 -94
- data/spec/writers/datacite_json_writer_spec.rb +0 -90
- data/spec/writers/datacite_writer_spec.rb +0 -428
- data/spec/writers/jats_writer_spec.rb +0 -193
- data/spec/writers/rdf_xml_writer_spec.rb +0 -86
- data/spec/writers/ris_writer_spec.rb +0 -207
- data/spec/writers/schema_org_writer_spec.rb +0 -369
- data/spec/writers/turtle_writer_spec.rb +0 -84
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'base64'
|
|
4
|
+
|
|
3
5
|
module Bolognese
|
|
4
6
|
module Readers
|
|
5
7
|
module DataciteReader
|
|
@@ -94,13 +96,29 @@ module Bolognese
|
|
|
94
96
|
|
|
95
97
|
titles = get_titles(meta)
|
|
96
98
|
|
|
99
|
+
publisher = Array.wrap(meta.dig("publisher")).map do |r|
|
|
100
|
+
if r.blank?
|
|
101
|
+
nil
|
|
102
|
+
elsif r.is_a?(String)
|
|
103
|
+
{ "name" => r.strip }
|
|
104
|
+
elsif r.is_a?(Hash)
|
|
105
|
+
{
|
|
106
|
+
"name" => r["__content__"].present? ? r["__content__"].strip : nil,
|
|
107
|
+
"publisherIdentifier" => r["publisherIdentifierScheme"] == "ROR" ? normalize_ror(r["publisherIdentifier"]) : r["publisherIdentifier"],
|
|
108
|
+
"publisherIdentifierScheme" => r["publisherIdentifierScheme"],
|
|
109
|
+
"schemeUri" => r["schemeURI"],
|
|
110
|
+
"lang" => r["lang"],
|
|
111
|
+
}.compact
|
|
112
|
+
end
|
|
113
|
+
end.compact.first
|
|
114
|
+
|
|
97
115
|
descriptions = Array.wrap(meta.dig("descriptions", "description")).map do |r|
|
|
98
116
|
if r.blank?
|
|
99
117
|
nil
|
|
100
118
|
elsif r.is_a?(String)
|
|
101
|
-
{ "description" => sanitize(r), "descriptionType" => "Abstract" }
|
|
119
|
+
{ "description" => sanitize(r, new_line: true), "descriptionType" => "Abstract" }
|
|
102
120
|
elsif r.is_a?(Hash)
|
|
103
|
-
{ "description" => sanitize(r["__content__"]), "descriptionType" => r["descriptionType"], "lang" => r["lang"] }.compact
|
|
121
|
+
{ "description" => sanitize(r["__content__"], new_line: true), "descriptionType" => r["descriptionType"], "lang" => r["lang"] }.compact
|
|
104
122
|
end
|
|
105
123
|
end.compact
|
|
106
124
|
rights_list = Array.wrap(meta.dig("rightsList", "rights")).map do |r|
|
|
@@ -190,7 +208,8 @@ module Bolognese
|
|
|
190
208
|
"resourceTypeGeneral" => ri["resourceTypeGeneral"],
|
|
191
209
|
"relatedMetadataScheme" => ri["relatedMetadataScheme"],
|
|
192
210
|
"schemeUri" => ri["schemeURI"],
|
|
193
|
-
"schemeType" => ri["schemeType"]
|
|
211
|
+
"schemeType" => ri["schemeType"],
|
|
212
|
+
"relationTypeInformation" => ri["relationTypeInformation"]
|
|
194
213
|
}.compact
|
|
195
214
|
end
|
|
196
215
|
|
|
@@ -210,7 +229,7 @@ module Bolognese
|
|
|
210
229
|
"relatedItemIdentifierType" => rii["relatedItemIdentifierType"],
|
|
211
230
|
"relatedMetadataScheme" => rii["relatedMetadataScheme"],
|
|
212
231
|
"schemeURI" => rii["schemeURI"],
|
|
213
|
-
"schemeType" => rii["schemeType"]
|
|
232
|
+
"schemeType" => rii["schemeType"],
|
|
214
233
|
}.compact
|
|
215
234
|
end
|
|
216
235
|
|
|
@@ -225,19 +244,20 @@ module Bolognese
|
|
|
225
244
|
|
|
226
245
|
a = {
|
|
227
246
|
"relationType" => ri["relationType"],
|
|
247
|
+
"relationTypeInformation" => ri["relationTypeInformation"],
|
|
228
248
|
"relatedItemType" => ri["relatedItemType"],
|
|
229
249
|
"relatedItemIdentifier" => relatedItemIdentifier,
|
|
230
250
|
"creators" => get_authors(Array.wrap(ri.dig("creators", "creator"))),
|
|
231
251
|
"titles" => get_titles(ri),
|
|
232
252
|
"publicationYear" => ri["publicationYear"],
|
|
233
|
-
"volume" => ri["volume"],
|
|
234
|
-
"issue" => ri["issue"],
|
|
253
|
+
"volume" => parse_attributes(ri["volume"]),
|
|
254
|
+
"issue" => parse_attributes(ri["issue"]),
|
|
235
255
|
"number" => number,
|
|
236
256
|
"numberType" => numberType,
|
|
237
|
-
"firstPage" => ri["firstPage"],
|
|
238
|
-
"lastPage" => ri["lastPage"],
|
|
239
|
-
"publisher" => ri["publisher"],
|
|
240
|
-
"edition" => ri["edition"],
|
|
257
|
+
"firstPage" => parse_attributes(ri["firstPage"]),
|
|
258
|
+
"lastPage" => parse_attributes(ri["lastPage"]),
|
|
259
|
+
"publisher" => parse_attributes(ri["publisher"]),
|
|
260
|
+
"edition" => parse_attributes(ri["edition"]),
|
|
241
261
|
"contributors" => get_authors(Array.wrap(ri.dig("contributors", "contributor"))),
|
|
242
262
|
}.compact
|
|
243
263
|
end
|
|
@@ -246,17 +266,13 @@ module Bolognese
|
|
|
246
266
|
if !gl.is_a?(Hash) || gl["geoLocationPoint"].is_a?(String) || gl["geoLocationBox"].is_a?(String) || gl["geoLocationPolygon"].is_a?(String)
|
|
247
267
|
nil
|
|
248
268
|
else
|
|
249
|
-
|
|
250
|
-
# Handle scenario where multiple geoLocationPolygons are allowed within a single geoLocation
|
|
251
|
-
# we want to return an array if it's already an array (i.e. multiple geoLocationPolygons)
|
|
252
|
-
# vs if it's singular just return the object
|
|
253
|
-
# This is for backwards compatability to allow both scenarios.
|
|
269
|
+
## Array of geoLocationPolygons within a geoLocation is Unsupported in JSON.
|
|
254
270
|
if gl.dig("geoLocationPolygon").kind_of?(Array)
|
|
255
|
-
geoLocationPolygon =
|
|
256
|
-
Array.wrap(glp.dig("polygonPoint")).map { |glpp| { "polygonPoint" => glpp } }.compact.presence
|
|
257
|
-
end.compact.presence
|
|
271
|
+
geoLocationPolygon = nil
|
|
258
272
|
else
|
|
259
|
-
geoLocationPolygon = Array.wrap(gl.dig("geoLocationPolygon", "polygonPoint")).map { |glp| { "polygonPoint" => glp } }
|
|
273
|
+
geoLocationPolygon = Array.wrap(gl.dig("geoLocationPolygon", "polygonPoint")).map { |glp| { "polygonPoint" => glp } }
|
|
274
|
+
.push(Array.wrap(gl.dig("geoLocationPolygon", "inPolygonPoint")).map { |glp| { "inPolygonPoint" => glp } }.first)
|
|
275
|
+
.compact.presence
|
|
260
276
|
end
|
|
261
277
|
|
|
262
278
|
{
|
|
@@ -286,8 +302,7 @@ module Bolognese
|
|
|
286
302
|
"titles" => titles,
|
|
287
303
|
"creators" => get_authors(Array.wrap(meta.dig("creators", "creator"))),
|
|
288
304
|
"contributors" => get_authors(Array.wrap(meta.dig("contributors", "contributor"))),
|
|
289
|
-
"
|
|
290
|
-
"publisher" => parse_attributes(meta.fetch("publisher", nil), first: true).to_s.strip.presence,
|
|
305
|
+
"publisher" => publisher,
|
|
291
306
|
"agency" => "datacite",
|
|
292
307
|
"funding_references" => funding_references,
|
|
293
308
|
"dates" => dates,
|
|
@@ -307,28 +322,6 @@ module Bolognese
|
|
|
307
322
|
}.merge(read_options)
|
|
308
323
|
end
|
|
309
324
|
|
|
310
|
-
def set_container(meta)
|
|
311
|
-
series_information = Array.wrap(meta.dig("descriptions", "description")).find { |r| r["descriptionType"] == "SeriesInformation" }.to_h.fetch("__content__", nil)
|
|
312
|
-
si = get_series_information(series_information)
|
|
313
|
-
|
|
314
|
-
is_part_of = Array.wrap(meta.dig("relatedIdentifiers", "relatedIdentifier")).find { |ri| ri["relationType"] == "IsPartOf" }.to_h
|
|
315
|
-
|
|
316
|
-
if si["title"].present? || is_part_of.present?
|
|
317
|
-
{
|
|
318
|
-
"type" => meta.dig("resourceType", "resourceTypeGeneral") == "Dataset" ? "DataRepository" : "Series",
|
|
319
|
-
"identifier" => is_part_of["__content__"],
|
|
320
|
-
"identifierType" => is_part_of["relatedIdentifierType"],
|
|
321
|
-
"title" => si["title"],
|
|
322
|
-
"volume" => si["volume"],
|
|
323
|
-
"issue" => si["issue"],
|
|
324
|
-
"firstPage" => si["firstPage"],
|
|
325
|
-
"lastPage" => si["lastPage"]
|
|
326
|
-
}.compact
|
|
327
|
-
else
|
|
328
|
-
{}
|
|
329
|
-
end
|
|
330
|
-
end
|
|
331
|
-
|
|
332
325
|
def get_titles(meta)
|
|
333
326
|
titles = Array.wrap(meta.dig("titles", "title")).map do |r|
|
|
334
327
|
if r.blank?
|
|
@@ -103,7 +103,7 @@ module Bolognese
|
|
|
103
103
|
#"related_identifiers" => related_identifiers,
|
|
104
104
|
#"dates" => dates,
|
|
105
105
|
#"publication_year" => publication_year,
|
|
106
|
-
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : [],
|
|
106
|
+
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description"), new_line: true), "descriptionType" => "Abstract" }] : [],
|
|
107
107
|
"rights_list" => rights_list,
|
|
108
108
|
"version_info" => meta.fetch("version", nil),
|
|
109
109
|
"subjects" => subjects
|
|
@@ -89,12 +89,12 @@ module Bolognese
|
|
|
89
89
|
"url" => meta.fetch("UR", nil),
|
|
90
90
|
"titles" => meta.fetch("T1", nil).present? ? [{ "title" => meta.fetch("T1", nil) }] : nil,
|
|
91
91
|
"creators" => get_authors(author),
|
|
92
|
-
"publisher" => meta.fetch("PB", "(:unav)"),
|
|
92
|
+
"publisher" => { "name" => meta.fetch("PB", "(:unav)") },
|
|
93
93
|
"container" => container,
|
|
94
94
|
"related_identifiers" => related_identifiers,
|
|
95
95
|
"dates" => dates,
|
|
96
96
|
"publication_year" => publication_year,
|
|
97
|
-
"descriptions" => meta.fetch("AB", nil).present? ? [{ "description" => sanitize(meta.fetch("AB")), "descriptionType" => "Abstract" }] : nil,
|
|
97
|
+
"descriptions" => meta.fetch("AB", nil).present? ? [{ "description" => sanitize(meta.fetch("AB"), new_line: true), "descriptionType" => "Abstract" }] : nil,
|
|
98
98
|
"subjects" => subjects,
|
|
99
99
|
"language" => meta.fetch("LA", nil),
|
|
100
100
|
"state" => state
|
|
@@ -10,7 +10,9 @@ module Bolognese
|
|
|
10
10
|
"isPartOf" => "IsPartOf",
|
|
11
11
|
"hasPart" => "HasPart",
|
|
12
12
|
"isPredecessor" => "IsPreviousVersionOf",
|
|
13
|
-
"isSuccessor" => "IsNewVersionOf"
|
|
13
|
+
"isSuccessor" => "IsNewVersionOf",
|
|
14
|
+
"workTranslation" => "HasTranslation",
|
|
15
|
+
"translationOfWork" => "IsTranslationOf"
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
SO_TO_DC_REVERSE_RELATION_TYPES = {
|
|
@@ -74,7 +76,17 @@ module Bolognese
|
|
|
74
76
|
creators = get_authors(from_schema_org_creators(Array.wrap(authors)))
|
|
75
77
|
end
|
|
76
78
|
contributors = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("editor", nil))))
|
|
77
|
-
|
|
79
|
+
translators = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("translator", nil))))
|
|
80
|
+
translators.map! do |translator|
|
|
81
|
+
translator["contributorType"] = "Translator"
|
|
82
|
+
translator
|
|
83
|
+
end
|
|
84
|
+
contributors += translators
|
|
85
|
+
|
|
86
|
+
publisher = {
|
|
87
|
+
"name" => parse_attributes(meta.fetch("publisher", nil), content: "name", first: true),
|
|
88
|
+
"publisherIdentifier" => parse_attributes(meta.fetch("publisher", nil), content: "@id", first: true),
|
|
89
|
+
}.compact if meta.fetch("publisher", nil).present?
|
|
78
90
|
|
|
79
91
|
ct = (schema_org == "Dataset") ? "includedInDataCatalog" : "Periodical"
|
|
80
92
|
container = if meta.fetch(ct, nil).present?
|
|
@@ -102,7 +114,9 @@ module Bolognese
|
|
|
102
114
|
Array.wrap(schema_org_references(meta)) +
|
|
103
115
|
Array.wrap(schema_org_is_referenced_by(meta)) +
|
|
104
116
|
Array.wrap(schema_org_is_supplement_to(meta)) +
|
|
105
|
-
Array.wrap(schema_org_is_supplemented_by(meta))
|
|
117
|
+
Array.wrap(schema_org_is_supplemented_by(meta)) +
|
|
118
|
+
Array.wrap(schema_org_has_translation(meta)) +
|
|
119
|
+
Array.wrap(schema_org_is_translation_of(meta))
|
|
106
120
|
|
|
107
121
|
rights_list = Array.wrap(meta.fetch("license", nil)).compact.map do |rl|
|
|
108
122
|
hsh_to_spdx("__content__" => rl["name"], "rightsURI" => rl["id"])
|
|
@@ -123,6 +137,7 @@ module Bolognese
|
|
|
123
137
|
dates << { "date" => meta.fetch("datePublished"), "dateType" => "Issued" } if Date.edtf(meta.fetch("datePublished", nil)).present?
|
|
124
138
|
dates << { "date" => meta.fetch("dateCreated"), "dateType" => "Created" } if Date.edtf(meta.fetch("dateCreated", nil)).present?
|
|
125
139
|
dates << { "date" => meta.fetch("dateModified"), "dateType" => "Updated" } if Date.edtf(meta.fetch("dateModified", nil)).present?
|
|
140
|
+
dates << { "date" => meta.fetch("temporalCoverage"), "dateType" => "Coverage" } if Date.edtf(meta.fetch("temporalCoverage", nil)).present?
|
|
126
141
|
publication_year = meta.fetch("datePublished")[0..3] if meta.fetch("datePublished", nil).present?
|
|
127
142
|
|
|
128
143
|
if meta.fetch("inLanguage", nil).is_a?(String)
|
|
@@ -180,7 +195,7 @@ module Bolognese
|
|
|
180
195
|
"related_identifiers" => related_identifiers,
|
|
181
196
|
"publication_year" => publication_year,
|
|
182
197
|
"dates" => dates,
|
|
183
|
-
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
|
|
198
|
+
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description"), new_line: true), "descriptionType" => "Abstract" }] : nil,
|
|
184
199
|
"rights_list" => rights_list,
|
|
185
200
|
"version_info" => meta.fetch("version", nil).to_s.presence,
|
|
186
201
|
"subjects" => subjects,
|
|
@@ -236,6 +251,14 @@ module Bolognese
|
|
|
236
251
|
schema_org_related_identifier(meta, relation_type: "isBasedOn")
|
|
237
252
|
end
|
|
238
253
|
|
|
254
|
+
def schema_org_has_translation(meta)
|
|
255
|
+
schema_org_related_identifier(meta, relation_type: "workTranslation", )
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
def schema_org_is_translation_of(meta)
|
|
259
|
+
schema_org_related_identifier(meta, relation_type: "translationOfWork")
|
|
260
|
+
end
|
|
261
|
+
|
|
239
262
|
end
|
|
240
263
|
end
|
|
241
264
|
end
|
data/lib/bolognese/utils.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Bolognese
|
|
|
32
32
|
"https://creativecommons.org/licenses/by-nd/2.0" => "https://creativecommons.org/licenses/by-nd/2.0/legalcode",
|
|
33
33
|
"https://creativecommons.org/licenses/by-nd/2.5" => "https://creativecommons.org/licenses/by-nd/2.5/legalcode",
|
|
34
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/
|
|
35
|
+
"https://creativecommons.org/licenses/by-nd/4.0" => "https://creativecommons.org/licenses/by-nd/4.0/legalcode",
|
|
36
36
|
"https://creativecommons.org/licenses/by-sa/1.0" => "https://creativecommons.org/licenses/by-sa/1.0/legalcode",
|
|
37
37
|
"https://creativecommons.org/licenses/by-sa/2.0" => "https://creativecommons.org/licenses/by-sa/2.0/legalcode",
|
|
38
38
|
"https://creativecommons.org/licenses/by-sa/2.5" => "https://creativecommons.org/licenses/by-sa/2.5/legalcode",
|
|
@@ -67,7 +67,9 @@ module Bolognese
|
|
|
67
67
|
"OutputManagementPlan" => nil,
|
|
68
68
|
"PeerReview" => "Review",
|
|
69
69
|
"PhysicalObject" => nil,
|
|
70
|
+
"Poster" => "Poster",
|
|
70
71
|
"Preprint" => nil,
|
|
72
|
+
"Presentation" => "PresentationDigitalDocument",
|
|
71
73
|
"Report" => "Report",
|
|
72
74
|
"Service" => "Service",
|
|
73
75
|
"Software" => "SoftwareSourceCode",
|
|
@@ -78,7 +80,9 @@ module Bolognese
|
|
|
78
80
|
"Other" => "CreativeWork",
|
|
79
81
|
# not part of DataCite schema, but used internally
|
|
80
82
|
"Periodical" => "Periodical",
|
|
81
|
-
"DataCatalog" => "DataCatalog"
|
|
83
|
+
"DataCatalog" => "DataCatalog",
|
|
84
|
+
"Award" => "Grant",
|
|
85
|
+
"Project" => "Project"
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
DC_TO_CP_TRANSLATIONS = {
|
|
@@ -101,7 +105,9 @@ module Bolognese
|
|
|
101
105
|
"OutputManagementPlan" => nil,
|
|
102
106
|
"PeerReview" => "review",
|
|
103
107
|
"PhysicalObject" => nil,
|
|
108
|
+
"Poster" => "document",
|
|
104
109
|
"Preprint" => nil,
|
|
110
|
+
"Presentation" => "presentation",
|
|
105
111
|
"Report" => "report",
|
|
106
112
|
"Service" => nil,
|
|
107
113
|
"Sound" => "song",
|
|
@@ -278,6 +284,8 @@ module Bolognese
|
|
|
278
284
|
"Event" => "Event",
|
|
279
285
|
"ImageObject" => "Image",
|
|
280
286
|
"Movie" => "Audiovisual",
|
|
287
|
+
"Poster" => "Poster",
|
|
288
|
+
"PresentationDigitalDocument" => "Presentation",
|
|
281
289
|
"PublicationIssue" => "Text",
|
|
282
290
|
"Report" => "Report",
|
|
283
291
|
"ScholarlyArticle" => "Text",
|
|
@@ -324,6 +332,8 @@ module Bolognese
|
|
|
324
332
|
"Event" => nil,
|
|
325
333
|
"ImageObject" => "graphic",
|
|
326
334
|
"Movie" => "motion_picture",
|
|
335
|
+
"Poster" => "document",
|
|
336
|
+
"PresentationDigitalDocument" => "presentation",
|
|
327
337
|
"PublicationIssue" => nil,
|
|
328
338
|
"Report" => "report",
|
|
329
339
|
"ScholarlyArticle" => "article-journal",
|
|
@@ -346,8 +356,10 @@ module Bolognese
|
|
|
346
356
|
"Event" => nil,
|
|
347
357
|
"ImageObject" => "FIGURE",
|
|
348
358
|
"Movie" => "MPCT",
|
|
349
|
-
"
|
|
359
|
+
"Poster" => "GEN",
|
|
360
|
+
"PresentationDigitalDocument" => "SLIDE",
|
|
350
361
|
"PublicationIssue" => nil,
|
|
362
|
+
"Report" => "RPRT",
|
|
351
363
|
"ScholarlyArticle" => "JOUR",
|
|
352
364
|
"Service" => nil,
|
|
353
365
|
"SoftwareSourceCode" => "COMP",
|
|
@@ -404,7 +416,9 @@ module Bolognese
|
|
|
404
416
|
"OutputManagementPlan" => nil,
|
|
405
417
|
"PeerReview" => nil,
|
|
406
418
|
"PhysicalObject" => nil,
|
|
419
|
+
"Poster" => "GEN",
|
|
407
420
|
"Preprint" => nil,
|
|
421
|
+
"Presentation" => "SLIDE",
|
|
408
422
|
"Report" => "RRPT",
|
|
409
423
|
"Service" => nil,
|
|
410
424
|
"Software" => "COMP",
|
|
@@ -417,7 +431,7 @@ module Bolognese
|
|
|
417
431
|
|
|
418
432
|
RIS_TO_DC_TRANSLATIONS = {
|
|
419
433
|
"BLOG" => "Text",
|
|
420
|
-
"GEN" => "
|
|
434
|
+
"GEN" => "Poster",
|
|
421
435
|
"CTLG" => "Collection",
|
|
422
436
|
"DATA" => "Dataset",
|
|
423
437
|
"FIGURE" => "Image",
|
|
@@ -426,7 +440,8 @@ module Bolognese
|
|
|
426
440
|
"JOUR" => "JournalArticle",
|
|
427
441
|
"COMP" => "Software",
|
|
428
442
|
"VIDEO" => "Audiovisual",
|
|
429
|
-
"ELEC" => "Text"
|
|
443
|
+
"ELEC" => "Text",
|
|
444
|
+
"SLIDE" => "Presentation"
|
|
430
445
|
}
|
|
431
446
|
|
|
432
447
|
BIB_TO_DC_TRANSLATIONS = {
|
|
@@ -450,7 +465,9 @@ module Bolognese
|
|
|
450
465
|
"motion_picture" => "Audiovisual",
|
|
451
466
|
"article-journal" => "JournalArticle",
|
|
452
467
|
"broadcast" => "Audiovisual",
|
|
453
|
-
"webpage" => "Text"
|
|
468
|
+
"webpage" => "Text",
|
|
469
|
+
"document" => "Poster",
|
|
470
|
+
"presentation" => "Presentation"
|
|
454
471
|
}
|
|
455
472
|
|
|
456
473
|
SO_TO_BIB_TRANSLATIONS = {
|
|
@@ -466,6 +483,8 @@ module Bolognese
|
|
|
466
483
|
"Event" => "misc",
|
|
467
484
|
"ImageObject" => "misc",
|
|
468
485
|
"Movie" => "misc",
|
|
486
|
+
"Poster" => "misc",
|
|
487
|
+
"PresentationDigitalDocument" => "misc",
|
|
469
488
|
"PublicationIssue" => "misc",
|
|
470
489
|
"ScholarlyArticle" => "article",
|
|
471
490
|
"Service" => "misc",
|
|
@@ -600,12 +619,12 @@ module Bolognese
|
|
|
600
619
|
end
|
|
601
620
|
|
|
602
621
|
def validate_orcid(orcid)
|
|
603
|
-
orcid = Array(/\A(?:(?:http|https):\/\/(?:(?:www|sandbox)?\.)?orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\z/.match(orcid)).last
|
|
622
|
+
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
|
|
604
623
|
orcid.gsub(/[[:space:]]/, "-") if orcid.present?
|
|
605
624
|
end
|
|
606
625
|
|
|
607
626
|
def validate_ror(ror)
|
|
608
|
-
Array(/^(?:(?:(?:http|https):\/\/)?ror\.org\/)?(0\w{6}\d{2})$/.match(ror)).last
|
|
627
|
+
Array(/^(?:(?:(?:http|https):\/\/)?ror\.org\/)?(0\w{6}\d{2})\/{0,1}$/.match(ror)).last
|
|
609
628
|
end
|
|
610
629
|
|
|
611
630
|
def validate_orcid_scheme(orcid_scheme)
|
|
@@ -649,7 +668,7 @@ module Bolognese
|
|
|
649
668
|
return nil unless uri && uri.host && %w(http https).include?(uri.scheme)
|
|
650
669
|
|
|
651
670
|
# clean up URL
|
|
652
|
-
|
|
671
|
+
normalize_uri_with_path_cleanup(uri)
|
|
653
672
|
rescue Addressable::URI::InvalidURIError
|
|
654
673
|
nil
|
|
655
674
|
end
|
|
@@ -669,9 +688,7 @@ module Bolognese
|
|
|
669
688
|
uri.scheme = "https" if options[:https]
|
|
670
689
|
|
|
671
690
|
# clean up URL
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
uri.to_s
|
|
691
|
+
normalize_uri_with_path_cleanup(uri)
|
|
675
692
|
rescue Addressable::URI::InvalidURIError
|
|
676
693
|
nil
|
|
677
694
|
end
|
|
@@ -773,6 +790,14 @@ module Bolognese
|
|
|
773
790
|
nil
|
|
774
791
|
end
|
|
775
792
|
|
|
793
|
+
def normalize_publisher(publisher)
|
|
794
|
+
if publisher.respond_to?(:to_hash)
|
|
795
|
+
publisher
|
|
796
|
+
elsif publisher.respond_to?(:to_str)
|
|
797
|
+
{ "name" => publisher }
|
|
798
|
+
end
|
|
799
|
+
end
|
|
800
|
+
|
|
776
801
|
def to_datacite_json(element, options={})
|
|
777
802
|
a = Array.wrap(element).map do |e|
|
|
778
803
|
e.inject({}) {|h, (k,v)| h[k.dasherize] = v; h }
|
|
@@ -817,7 +842,8 @@ module Bolognese
|
|
|
817
842
|
|
|
818
843
|
def to_schema_org_contributors(element)
|
|
819
844
|
element = Array.wrap(element).map do |c|
|
|
820
|
-
|
|
845
|
+
transformed_c = c.dup
|
|
846
|
+
transformed_c["affiliation"] = Array.wrap(c["affiliation"]).map do |a|
|
|
821
847
|
if a.is_a?(String)
|
|
822
848
|
name = a
|
|
823
849
|
affiliation_identifier = nil
|
|
@@ -831,10 +857,10 @@ module Bolognese
|
|
|
831
857
|
"@id" => affiliation_identifier,
|
|
832
858
|
"name" => name }.compact
|
|
833
859
|
end.unwrap
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
860
|
+
transformed_c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil
|
|
861
|
+
transformed_c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil)
|
|
862
|
+
transformed_c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"]
|
|
863
|
+
transformed_c.except("nameIdentifiers", "nameType").compact
|
|
838
864
|
end.unwrap
|
|
839
865
|
end
|
|
840
866
|
|
|
@@ -921,8 +947,10 @@ module Bolognese
|
|
|
921
947
|
"address" => gl["geoLocationPlace"],
|
|
922
948
|
"polygon" => Array.wrap(gl.dig("geoLocationPolygon")).map do |glp|
|
|
923
949
|
Array.wrap(glp).map do |glpp|
|
|
924
|
-
|
|
925
|
-
|
|
950
|
+
if glpp.dig("polygonPoint")
|
|
951
|
+
[glpp.dig("polygonPoint", "pointLongitude"), glpp.dig("polygonPoint", "pointLatitude")].compact
|
|
952
|
+
end
|
|
953
|
+
end.compact.presence
|
|
926
954
|
end.compact.presence,
|
|
927
955
|
}
|
|
928
956
|
}
|
|
@@ -1021,7 +1049,7 @@ module Bolognese
|
|
|
1021
1049
|
Array.wrap(element).map do |a|
|
|
1022
1050
|
if a["literal"].present?
|
|
1023
1051
|
a["@type"] = "Organization"
|
|
1024
|
-
a["
|
|
1052
|
+
a["creatorName"] = a["literal"]
|
|
1025
1053
|
else
|
|
1026
1054
|
a["@type"] = "Person"
|
|
1027
1055
|
a["name"] = [a["given"], a["family"]].compact.join(" ")
|
|
@@ -1057,12 +1085,16 @@ module Bolognese
|
|
|
1057
1085
|
custom_scrubber = Bolognese::WhitelistScrubber.new(options)
|
|
1058
1086
|
|
|
1059
1087
|
if text.is_a?(String)
|
|
1060
|
-
|
|
1061
|
-
|
|
1088
|
+
if options[:new_line]
|
|
1089
|
+
# Remove multiple spaces, tabs, and other whitespace characters while preserving single spaces and new lines
|
|
1090
|
+
Loofah.scrub_fragment(text, custom_scrubber).to_s.gsub(/[ \t]+/, ' ').strip
|
|
1091
|
+
else
|
|
1092
|
+
Loofah.scrub_fragment(text, custom_scrubber).to_s.squish
|
|
1093
|
+
end
|
|
1062
1094
|
elsif text.is_a?(Hash)
|
|
1063
|
-
sanitize(text.fetch(content, nil))
|
|
1095
|
+
sanitize(text.fetch(content, nil), new_line: options[:new_line])
|
|
1064
1096
|
elsif text.is_a?(Array)
|
|
1065
|
-
a = text.map { |e| e.is_a?(Hash) ? sanitize(e.fetch(content, nil)) : sanitize(e) }.uniq
|
|
1097
|
+
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
|
|
1066
1098
|
a = options[:first] ? a.first : a.unwrap
|
|
1067
1099
|
else
|
|
1068
1100
|
nil
|
|
@@ -1222,7 +1254,9 @@ module Bolognese
|
|
|
1222
1254
|
"urn" => "URN",
|
|
1223
1255
|
"md5" => "md5",
|
|
1224
1256
|
"minid" => "minid",
|
|
1225
|
-
"dataguid" => "dataguid"
|
|
1257
|
+
"dataguid" => "dataguid",
|
|
1258
|
+
"cstr" => "CSTR",
|
|
1259
|
+
"rrid" => "RRID"
|
|
1226
1260
|
}
|
|
1227
1261
|
|
|
1228
1262
|
identifierTypes[identifier_type.downcase] || identifier_type
|
|
@@ -1410,5 +1444,60 @@ module Bolognese
|
|
|
1410
1444
|
}
|
|
1411
1445
|
end
|
|
1412
1446
|
end
|
|
1447
|
+
|
|
1448
|
+
def abstract_description
|
|
1449
|
+
# Fetch the first description with descriptionType "Abstract"
|
|
1450
|
+
Array.wrap(descriptions)&.find { |d| d["descriptionType"] == "Abstract" }
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
def generate_container(types, related_items, related_identifiers, descriptions)
|
|
1454
|
+
container_type = (types.respond_to?(:dig) && types&.dig("resourceTypeGeneral")) == "Dataset" ? "DataRepository" : "Series"
|
|
1455
|
+
|
|
1456
|
+
# relatedItem container
|
|
1457
|
+
related_item = Array.wrap(related_items).find { |ri| ri["relationType"] == "IsPublishedIn" }.to_h
|
|
1458
|
+
|
|
1459
|
+
if related_item.present?
|
|
1460
|
+
return {
|
|
1461
|
+
"type" => container_type,
|
|
1462
|
+
"identifier" => related_item.dig("relatedItemIdentifier", "relatedItemIdentifier"),
|
|
1463
|
+
"identifierType" => related_item.dig("relatedItemIdentifier", "relatedItemIdentifierType"),
|
|
1464
|
+
"title" => related_item.dig("titles", 0).then { |t| t ? parse_attributes(t, content: "title", first: true) : nil },
|
|
1465
|
+
"volume" => related_item["volume"],
|
|
1466
|
+
"issue" => related_item["issue"],
|
|
1467
|
+
"edition" => related_item["edition"],
|
|
1468
|
+
"number" => related_item["number"],
|
|
1469
|
+
"chapterNumber" => related_item["numberType"] == "Chapter" ? related_item["number"] : nil,
|
|
1470
|
+
"firstPage" => related_item["firstPage"],
|
|
1471
|
+
"lastPage" => related_item["lastPage"]
|
|
1472
|
+
}.compact
|
|
1473
|
+
end
|
|
1474
|
+
|
|
1475
|
+
# Legacy SeriesInformation/relatedIdentifier container fallback
|
|
1476
|
+
series_information = Array.wrap(descriptions).find { |r| r["descriptionType"] == "SeriesInformation" }.to_h.fetch("description", nil)
|
|
1477
|
+
si = get_series_information(series_information)
|
|
1478
|
+
|
|
1479
|
+
is_part_of = Array.wrap(related_identifiers).find { |ri| ri["relationType"] == "IsPartOf" }.to_h
|
|
1480
|
+
|
|
1481
|
+
if si["title"].present?
|
|
1482
|
+
return {
|
|
1483
|
+
"type" => container_type,
|
|
1484
|
+
"identifier" => is_part_of["relatedIdentifier"],
|
|
1485
|
+
"identifierType" => is_part_of["relatedIdentifierType"],
|
|
1486
|
+
"title" => si["title"],
|
|
1487
|
+
"volume" => si["volume"],
|
|
1488
|
+
"issue" => si["issue"],
|
|
1489
|
+
"firstPage" => si["firstPage"],
|
|
1490
|
+
"lastPage" => si["lastPage"]
|
|
1491
|
+
}.compact
|
|
1492
|
+
end
|
|
1493
|
+
end
|
|
1494
|
+
|
|
1495
|
+
private
|
|
1496
|
+
|
|
1497
|
+
def normalize_uri_with_path_cleanup(uri)
|
|
1498
|
+
normalized_uri = uri.normalize
|
|
1499
|
+
normalized_uri.path = normalized_uri.path.sub(%r{/\z}, "") if normalized_uri.path.present?
|
|
1500
|
+
normalized_uri.to_s
|
|
1501
|
+
end
|
|
1413
1502
|
end
|
|
1414
1503
|
end
|
data/lib/bolognese/version.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Bolognese
|
|
|
21
21
|
volume: container.to_h["volume"],
|
|
22
22
|
issue: container.to_h["issue"],
|
|
23
23
|
pages: pages,
|
|
24
|
-
publisher: publisher,
|
|
24
|
+
publisher: publisher["name"],
|
|
25
25
|
year: publication_year,
|
|
26
26
|
copyright: Array.wrap(rights_list).map { |l| l["rights"] }.first,
|
|
27
27
|
}.compact
|
|
@@ -19,7 +19,7 @@ module Bolognese
|
|
|
19
19
|
"tags" => subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) } : nil,
|
|
20
20
|
"datePublished" => get_date(dates, "Issued") || publication_year,
|
|
21
21
|
"dateModified" => get_date(dates, "Updated"),
|
|
22
|
-
"publisher" => publisher,
|
|
22
|
+
"publisher" => publisher["name"],
|
|
23
23
|
"license" => Array.wrap(rights_list).map { |l| l["rightsUri"] }.compact.unwrap,
|
|
24
24
|
}.compact
|
|
25
25
|
JSON.pretty_generate hsh.presence
|
|
@@ -4,18 +4,16 @@ module Bolognese
|
|
|
4
4
|
require "csv"
|
|
5
5
|
|
|
6
6
|
def csv
|
|
7
|
-
return nil unless valid?
|
|
8
|
-
|
|
9
7
|
bib = {
|
|
10
8
|
doi: doi,
|
|
11
9
|
url: url,
|
|
12
10
|
registered: get_iso8601_date(date_registered),
|
|
13
11
|
state: state,
|
|
14
|
-
resource_type_general: types["resourceTypeGeneral"],
|
|
15
|
-
resource_type: types["resourceType"],
|
|
12
|
+
resource_type_general: types.respond_to?(:to_h) ? types.to_h["resourceTypeGeneral"] : nil,
|
|
13
|
+
resource_type: types.respond_to?(:to_h) ? types.to_h["resourceType"] : nil,
|
|
16
14
|
title: parse_attributes(titles, content: "title", first: true),
|
|
17
15
|
author: authors_as_string(creators),
|
|
18
|
-
publisher: publisher,
|
|
16
|
+
publisher: publisher.respond_to?(:to_h) ? publisher.to_h["name"] : nil,
|
|
19
17
|
publication_year: publication_year
|
|
20
18
|
}.values
|
|
21
19
|
|
|
@@ -4,7 +4,9 @@ module Bolognese
|
|
|
4
4
|
module Writers
|
|
5
5
|
module DataciteJsonWriter
|
|
6
6
|
def datacite_json
|
|
7
|
-
|
|
7
|
+
if crosscite_hsh.present?
|
|
8
|
+
JSON.pretty_generate crosscite_hsh.transform_keys! { |key| key.camelcase(uppercase_first_letter = :lower) }
|
|
9
|
+
end
|
|
8
10
|
end
|
|
9
11
|
end
|
|
10
12
|
end
|
|
@@ -77,16 +77,19 @@ module Bolognese
|
|
|
77
77
|
|
|
78
78
|
def insert_source(xml)
|
|
79
79
|
if is_chapter?
|
|
80
|
-
xml.source(publisher)
|
|
80
|
+
xml.source(publisher["name"])
|
|
81
81
|
elsif is_article? || is_data?
|
|
82
|
-
xml.source(container && container["title"] || publisher)
|
|
82
|
+
xml.source(container && container["title"] || publisher["name"])
|
|
83
83
|
else
|
|
84
84
|
xml.source(parse_attributes(titles, content: "title", first: true))
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def insert_publisher_name(xml)
|
|
89
|
-
|
|
89
|
+
attributes = {
|
|
90
|
+
"xml:lang" => publisher["lang"]
|
|
91
|
+
}.compact
|
|
92
|
+
xml.send("publisher-name", attributes, publisher["name"])
|
|
90
93
|
end
|
|
91
94
|
|
|
92
95
|
def insert_publication_date(xml)
|
|
@@ -11,10 +11,10 @@ module Bolognese
|
|
|
11
11
|
"AU" => to_ris(creators),
|
|
12
12
|
"DO" => doi,
|
|
13
13
|
"UR" => url,
|
|
14
|
-
"AB" => parse_attributes(
|
|
14
|
+
"AB" => parse_attributes(abstract_description, content: "description", first: true),
|
|
15
15
|
"KW" => Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.presence,
|
|
16
16
|
"PY" => publication_year,
|
|
17
|
-
"PB" => publisher,
|
|
17
|
+
"PB" => publisher["name"],
|
|
18
18
|
"LA" => language,
|
|
19
19
|
"VL" => container.to_h["volume"],
|
|
20
20
|
"IS" => container.to_h["issue"],
|