bolognese 0.4.3 → 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 +5 -5
- 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 +4 -0
- data/.rubocop.yml +658 -0
- data/CHANGELOG.md +1864 -0
- data/CITATION +17 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +250 -98
- data/README.md +963 -21
- data/Rakefile +1 -0
- data/bin/bolognese +5 -1
- data/bolognese.gemspec +33 -21
- data/lib/bolognese/array.rb +13 -0
- data/lib/bolognese/author_utils.rb +147 -33
- data/lib/bolognese/citeproc_extensions.rb +48 -0
- data/lib/bolognese/cli.rb +28 -21
- data/lib/bolognese/datacite_utils.rb +292 -104
- data/lib/bolognese/doi_utils.rb +44 -20
- data/lib/bolognese/metadata.rb +249 -23
- data/lib/bolognese/metadata_utils.rb +228 -0
- data/lib/bolognese/pubmed.rb +2 -0
- data/lib/bolognese/readers/bibtex_reader.rb +100 -0
- data/lib/bolognese/readers/citeproc_reader.rb +125 -0
- data/lib/bolognese/readers/codemeta_reader.rb +108 -0
- data/lib/bolognese/readers/crosscite_reader.rb +17 -0
- data/lib/bolognese/readers/crossref_reader.rb +413 -0
- data/lib/bolognese/readers/datacite_json_reader.rb +17 -0
- data/lib/bolognese/readers/datacite_reader.rb +341 -0
- data/lib/bolognese/readers/npm_reader.rb +115 -0
- data/lib/bolognese/readers/ris_reader.rb +114 -0
- data/lib/bolognese/readers/schema_org_reader.rb +264 -0
- data/lib/bolognese/string.rb +3 -1
- data/lib/bolognese/utils.rb +1463 -25
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/whitelist_scrubber.rb +47 -0
- data/lib/bolognese/writers/bibtex_writer.rb +32 -0
- data/lib/bolognese/writers/citation_writer.rb +14 -0
- data/lib/bolognese/writers/citeproc_writer.rb +11 -0
- data/lib/bolognese/writers/codemeta_writer.rb +29 -0
- data/lib/bolognese/writers/crosscite_writer.rb +11 -0
- data/lib/bolognese/writers/crossref_writer.rb +11 -0
- data/lib/bolognese/writers/csv_writer.rb +24 -0
- data/lib/bolognese/writers/datacite_json_writer.rb +13 -0
- data/lib/bolognese/writers/datacite_writer.rb +12 -0
- data/lib/bolognese/writers/jats_writer.rb +137 -0
- data/lib/bolognese/writers/rdf_xml_writer.rb +11 -0
- data/lib/bolognese/writers/ris_writer.rb +29 -0
- data/lib/bolognese/writers/schema_org_writer.rb +55 -0
- data/lib/bolognese/writers/turtle_writer.rb +11 -0
- data/lib/bolognese.rb +19 -5
- data/package.json +12 -0
- data/resources/2008/09/xsd.xsl +997 -0
- data/resources/datacite-contributorType-v4.xsd +35 -0
- data/resources/datacite-dateType-v4.xsd +25 -0
- data/resources/datacite-descriptionType-v4.xsd +19 -0
- data/resources/datacite-funderIdentifierType-v4.xsd +15 -0
- data/resources/datacite-nameType-v4.xsd +10 -0
- data/resources/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/datacite-relationType-v4.xsd +49 -0
- data/resources/datacite-resourceType-v4.xsd +28 -0
- data/resources/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-2.1/include/datacite-contributorType-v1.1.xsd +22 -0
- data/resources/kernel-2.1/include/datacite-contributorType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-dateType-v1.1.xsd +31 -0
- data/resources/kernel-2.1/include/datacite-dateType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-descriptionType-v1.1.xsd +14 -0
- data/resources/kernel-2.1/include/datacite-descriptionType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-relatedIdentifierType-v1.1.xsd +24 -0
- data/resources/kernel-2.1/include/datacite-relatedIdentifierType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-relationType-v1.1.xsd +29 -0
- data/resources/kernel-2.1/include/datacite-relationType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-resourceType-v1.1.xsd +22 -0
- data/resources/kernel-2.1/include/datacite-resourceType-v2.xsd +3 -0
- data/resources/kernel-2.1/include/datacite-titleType-v1.1.xsd +11 -0
- data/resources/kernel-2.1/include/datacite-titleType-v2.xsd +3 -0
- data/resources/kernel-2.1/metadata.xsd +315 -0
- data/resources/kernel-2.2/include/datacite-contributorType-v2.xsd +29 -0
- data/resources/kernel-2.2/include/datacite-dateType-v2.xsd +21 -0
- data/resources/kernel-2.2/include/datacite-descriptionType-v2.xsd +15 -0
- data/resources/kernel-2.2/include/datacite-relatedIdentifierType-v2.xsd +25 -0
- data/resources/kernel-2.2/include/datacite-relationType-v2.xsd +29 -0
- data/resources/kernel-2.2/include/datacite-resourceType-v2.xsd +23 -0
- data/resources/kernel-2.2/include/datacite-titleType-v2.xsd +10 -0
- data/resources/kernel-2.2/metadata.xsd +316 -0
- data/resources/kernel-3/include/datacite-contributorType-v3.1.xsd +35 -0
- data/resources/kernel-3/include/datacite-dateType-v3.xsd +21 -0
- data/resources/kernel-3/include/datacite-descriptionType-v3.xsd +17 -0
- data/resources/kernel-3/include/datacite-relatedIdentifierType-v3.1.xsd +30 -0
- data/resources/kernel-3/include/datacite-relationType-v3.1.xsd +38 -0
- data/resources/kernel-3/include/datacite-resourceType-v3.xsd +26 -0
- data/resources/kernel-3/include/datacite-titleType-v3.xsd +12 -0
- data/resources/kernel-3/include/xml.xsd +286 -0
- data/resources/kernel-3/metadata.xsd +380 -0
- data/resources/kernel-3.0/include/datacite-contributorType-v3.xsd +33 -0
- data/resources/kernel-3.0/include/datacite-dateType-v3.xsd +21 -0
- data/resources/kernel-3.0/include/datacite-descriptionType-v3.xsd +17 -0
- data/resources/kernel-3.0/include/datacite-relatedIdentifierType-v3.xsd +27 -0
- data/resources/kernel-3.0/include/datacite-relationType-v3.xsd +33 -0
- data/resources/kernel-3.0/include/datacite-resourceType-v3.xsd +26 -0
- data/resources/kernel-3.0/include/datacite-titleType-v3.xsd +12 -0
- data/resources/kernel-3.0/include/xml.xsd +286 -0
- data/resources/kernel-3.0/metadata.xsd +377 -0
- data/resources/kernel-3.1/include/datacite-contributorType-v3.1.xsd +35 -0
- data/resources/kernel-3.1/include/datacite-dateType-v3.xsd +21 -0
- data/resources/kernel-3.1/include/datacite-descriptionType-v3.xsd +17 -0
- data/resources/kernel-3.1/include/datacite-relatedIdentifierType-v3.1.xsd +30 -0
- data/resources/kernel-3.1/include/datacite-relationType-v3.1.xsd +38 -0
- data/resources/kernel-3.1/include/datacite-resourceType-v3.xsd +26 -0
- data/resources/kernel-3.1/include/datacite-titleType-v3.xsd +12 -0
- data/resources/kernel-3.1/include/xml.xsd +286 -0
- data/resources/kernel-3.1/metadata.xsd +380 -0
- data/resources/kernel-4/include/datacite-contributorType-v4.xsd +37 -0
- data/resources/kernel-4/include/datacite-dateType-v4.xsd +27 -0
- data/resources/kernel-4/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +39 -0
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +59 -0
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +52 -0
- data/resources/kernel-4/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4/include/xml.xsd +286 -0
- data/resources/kernel-4/metadata.xsd +715 -0
- data/resources/kernel-4.0/include/datacite-contributorType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-dateType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-descriptionType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-funderIdentifierType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-relatedIdentifierType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-relationType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-resourceType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/datacite-titleType-v4.xsd +1 -1
- data/resources/kernel-4.0/include/xml.xsd +286 -0
- data/resources/kernel-4.0/metadata.xsd +2 -2
- data/resources/kernel-4.1/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.1/include/datacite-dateType-v4.1.xsd +23 -0
- data/resources/kernel-4.1/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.1/include/datacite-funderIdentifierType-v4.xsd +15 -0
- data/resources/kernel-4.1/include/datacite-nameType-v4.1.xsd +10 -0
- data/resources/kernel-4.1/include/datacite-relatedIdentifierType-v4.xsd +32 -0
- data/resources/kernel-4.1/include/datacite-relationType-v4.1.xsd +46 -0
- data/resources/kernel-4.1/include/datacite-resourceType-v4.1.xsd +28 -0
- data/resources/kernel-4.1/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.1/include/xml.xsd +286 -0
- data/resources/kernel-4.1/metadata.xsd +483 -0
- data/resources/kernel-4.2/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.2/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.2/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.2/include/datacite-funderIdentifierType-v4.xsd +15 -0
- data/resources/kernel-4.2/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.2/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.2/include/datacite-relationType-v4.xsd +49 -0
- data/resources/kernel-4.2/include/datacite-resourceType-v4.xsd +28 -0
- data/resources/kernel-4.2/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.2/include/xml.xsd +286 -0
- data/resources/kernel-4.2/metadata.xsd +479 -0
- data/resources/kernel-4.3/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.3/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.3/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.3/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.3/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.3/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.3/include/datacite-relationType-v4.xsd +49 -0
- data/resources/kernel-4.3/include/datacite-resourceType-v4.xsd +28 -0
- data/resources/kernel-4.3/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.3/include/xml.xsd +286 -0
- data/resources/kernel-4.3/metadata.xsd +515 -0
- 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/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
- 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 +7477 -0
- data/resources/spdx/licenses.json +5297 -0
- data/resources/xml.xsd +286 -0
- metadata +466 -179
- data/.travis.yml +0 -23
- data/lib/bolognese/crossref.rb +0 -233
- data/lib/bolognese/datacite.rb +0 -176
- data/lib/bolognese/date_utils.rb +0 -48
- data/lib/bolognese/github.rb +0 -106
- data/lib/bolognese/orcid.rb +0 -24
- data/lib/bolognese/schema_org.rb +0 -170
- data/spec/cli_spec.rb +0 -56
- data/spec/crossref_spec.rb +0 -190
- data/spec/datacite_spec.rb +0 -93
- data/spec/datacite_utils_spec.rb +0 -159
- data/spec/doi_utils_spec.rb +0 -89
- data/spec/fixtures/crossref.xml +0 -742
- data/spec/fixtures/datacite.xml +0 -40
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/crossref/as_crossref.yml +0 -760
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/crossref/as_datacite.yml +0 -1476
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/crossref/as_schema_org.yml +0 -1476
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/datacite/as_datacite.yml +0 -214
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/datacite/as_schema_org.yml +0 -384
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/schema_org/as_datacite.yml +0 -653
- data/spec/fixtures/vcr_cassettes/Bolognese_CLI/read/schema_org/as_schema_org.yml +0 -653
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/doi_registration_agency/crossref.yml +0 -971
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/doi_registration_agency/datacite.yml +0 -971
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/doi_registration_agency/medra.yml +0 -971
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/doi_registration_agency/not_found.yml +0 -971
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/DOI_with_ORCID_ID.yml +0 -506
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/DOI_with_SICI_DOI.yml +0 -214
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/DOI_with_data_citation.yml +0 -901
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/date_in_future.yml +0 -305
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/journal_article.yml +0 -1080
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/not_found_error.yml +0 -183
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata/posted_content.yml +0 -389
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_datacite_xml/DOI_with_ORCID_ID.yml +0 -506
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_datacite_xml/DOI_with_data_citation.yml +0 -901
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_datacite_xml/with_ORCID_ID.yml +0 -366
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_datacite_xml/with_data_citation.yml +0 -719
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_datacite_xml/with_editor.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/get_metadata_as_string/DOI_with_data_citation.yml +0 -719
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/SICI_doi.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/doi.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/doi_from_url_without_doi_proxy.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/doi_prefix_too_long.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/doi_prefix_with_string.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/doi_with_protocol.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/dx_doi_org_url.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/https_url.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_doi/not_valid_doi_prefix.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_ids/doi.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_ids/url.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_url/doi.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/normalize_url/url.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attribute/array.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attribute/hash.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attribute/nil.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attribute/string.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attributes/array.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attributes/hash.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attributes/nil.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/parse_attributes/string.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/validate_url/DOI.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/validate_url/URL.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Crossref/validate_url/string.yml +0 -930
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/BlogPosting.yml +0 -477
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Dataset.yml +0 -1925
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Date.yml +0 -458
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_string/Dataset.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_alternate_identifiers/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_contributors/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_contributors/none.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_creators/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_dates/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_descriptions/insert.yml +0 -155
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_identifier/doi.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_person/creator.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_person/creator_given_and_family_name.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_person/creator_only_name.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_publication_year/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_publisher/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/get_related_identifier_type.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/get_related_identifier_type_DOI.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/get_related_identifier_type_URL.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_related_identifiers/rel_identifiers.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_resource_type/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_rights_list/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_subjects/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_titles/doi.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_titles/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/insert_version/insert.yml +0 -173
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_PID_provider/crossref.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_PID_provider/crossref_doi_not_url.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_PID_provider/datacite.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_PID_provider/datacite_doi_http.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/find_PID_provider/orcid.yml +0 -44
- data/spec/fixtures/vcr_cassettes/Bolognese_SchemaOrg/get_metadata/BlogPosting.yml +0 -632
- data/spec/fixtures/vcr_cassettes/Bolognese_SchemaOrg/get_metadata/not_found_error.yml +0 -93
- data/spec/metadata_spec.rb +0 -41
- data/spec/orcid_spec.rb +0 -23
- data/spec/schema_org_spec.rb +0 -33
- data/spec/spec_helper.rb +0 -88
- data/spec/utils_spec.rb +0 -107
data/lib/bolognese/schema_org.rb
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
module Bolognese
|
|
2
|
-
class SchemaOrg < Metadata
|
|
3
|
-
|
|
4
|
-
DC_TO_SO_TRANSLATIONS = {
|
|
5
|
-
"Audiovisual" => "VideoObject",
|
|
6
|
-
"Collection" => "Collection",
|
|
7
|
-
"Dataset" => "Dataset",
|
|
8
|
-
"Event" => "Event",
|
|
9
|
-
"Image" => "ImageObject",
|
|
10
|
-
"InteractiveResource" => nil,
|
|
11
|
-
"Model" => nil,
|
|
12
|
-
"PhysicalObject" => nil,
|
|
13
|
-
"Service" => "Service",
|
|
14
|
-
"Software" => "SoftwareSourceCode",
|
|
15
|
-
"Sound" => "AudioObject",
|
|
16
|
-
"Text" => "ScholarlyArticle",
|
|
17
|
-
"Workflow" => nil,
|
|
18
|
-
"Other" => "CreativeWork"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
attr_reader = :id, :raw, :metadata, :schema_org
|
|
22
|
-
|
|
23
|
-
def initialize(id: nil, string: nil)
|
|
24
|
-
id = normalize_url(id) if id.present?
|
|
25
|
-
|
|
26
|
-
if string.present?
|
|
27
|
-
@raw = string
|
|
28
|
-
elsif id.present?
|
|
29
|
-
response = Maremma.get(id)
|
|
30
|
-
@raw = response.body.fetch("data", nil)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def metadata
|
|
35
|
-
@metadata ||= begin
|
|
36
|
-
if raw.present?
|
|
37
|
-
doc = Nokogiri::XML(raw)
|
|
38
|
-
tag = doc.at_xpath('//script[@type="application/ld+json"]')
|
|
39
|
-
Maremma.from_json(tag)
|
|
40
|
-
else
|
|
41
|
-
{}
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def exists?
|
|
47
|
-
metadata.present?
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def doi
|
|
51
|
-
doi_from_url(id)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def id
|
|
55
|
-
normalize_url(metadata.fetch("@id", nil))
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def url
|
|
59
|
-
normalize_url(metadata.fetch("url", nil))
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def type
|
|
63
|
-
metadata.fetch("@type", nil)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def additional_type
|
|
67
|
-
metadata.fetch("additionalType", nil)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def name
|
|
71
|
-
metadata.fetch("name", nil)
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def alternate_name
|
|
75
|
-
metadata.fetch("alternateName", nil)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def author
|
|
79
|
-
Array(metadata.fetch("author", nil)).map { |a| a.except("name") }
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def editor
|
|
83
|
-
Array(metadata.fetch("editor", nil)).map { |a| a.except("name") }
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def description
|
|
87
|
-
metadata.fetch("description", nil)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def license
|
|
91
|
-
metadata.fetch("license", nil)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
def version
|
|
95
|
-
metadata.fetch("version", nil)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def keywords
|
|
99
|
-
metadata.fetch("keywords", nil)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def date_created
|
|
103
|
-
metadata.fetch("dateCreated", nil)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def date_published
|
|
107
|
-
metadata.fetch("datePublished", nil)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
def date_modified
|
|
111
|
-
metadata.fetch("dateModified", nil)
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
def related_identifiers(relation_type)
|
|
115
|
-
normalize_ids(metadata.fetch(relation_type, nil))
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
def is_part_of
|
|
119
|
-
related_identifiers("isPartOf").first
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
def has_part
|
|
123
|
-
related_identifiers("hasPart")
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def citation
|
|
127
|
-
related_identifiers("citation")
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
def publisher
|
|
131
|
-
metadata.fetch("publisher", nil)
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
def container_title
|
|
135
|
-
if publisher.is_a?(Hash)
|
|
136
|
-
publisher.fetch("name", nil)
|
|
137
|
-
elsif publisher.is_a?(String)
|
|
138
|
-
publisher
|
|
139
|
-
end
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
def provider
|
|
143
|
-
metadata.fetch("provider", nil)
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
def as_schema_org
|
|
147
|
-
{ "@context" => "http://schema.org",
|
|
148
|
-
"@type" => type,
|
|
149
|
-
"@id" => id,
|
|
150
|
-
"url" => url,
|
|
151
|
-
"name" => name,
|
|
152
|
-
"alternateName" => alternate_name,
|
|
153
|
-
"author" => author,
|
|
154
|
-
"editor" => editor,
|
|
155
|
-
"description" => description,
|
|
156
|
-
"license" => license,
|
|
157
|
-
"version" => version,
|
|
158
|
-
"keywords" => keywords,
|
|
159
|
-
"dateCreated" => date_created,
|
|
160
|
-
"datePublished" => date_published,
|
|
161
|
-
"dateModified" => date_modified,
|
|
162
|
-
"isPartOf" => is_part_of,
|
|
163
|
-
"hasPart" => has_part,
|
|
164
|
-
"citation" => citation,
|
|
165
|
-
"publisher" => publisher,
|
|
166
|
-
"provider" => provider
|
|
167
|
-
}.compact
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
end
|
data/spec/cli_spec.rb
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'bolognese/cli'
|
|
3
|
-
|
|
4
|
-
describe Bolognese::CLI do
|
|
5
|
-
let(:subject) do
|
|
6
|
-
described_class.new
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
describe "read", vcr: true do
|
|
10
|
-
context "crossref" do
|
|
11
|
-
let(:id) { "10.7554/eLife.01567" }
|
|
12
|
-
it 'as schema_org' do
|
|
13
|
-
subject.options = { as: "schema_org" }
|
|
14
|
-
expect { subject.read id }.to output(/additionalType/).to_stdout
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it 'as crossref' do
|
|
18
|
-
subject.options = { as: "crossref" }
|
|
19
|
-
expect { subject.read id }.to output(/journal_metadata/).to_stdout
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'as datacite' do
|
|
23
|
-
subject.options = { as: "datacite" }
|
|
24
|
-
expect { subject.read id }.to output(/http:\/\/datacite.org\/schema\/kernel-4/).to_stdout
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
context "datacite" do
|
|
29
|
-
let(:id) { "10.5061/dryad.8515" }
|
|
30
|
-
|
|
31
|
-
it 'as schema_org' do
|
|
32
|
-
subject.options = { as: "schema_org" }
|
|
33
|
-
expect { subject.read id }.to output(/Phylogeny, Malaria, Parasites, Taxonomy, Mitochondrial genome, Africa, Plasmodium/).to_stdout
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'as datacite' do
|
|
37
|
-
subject.options = { as: "datacite" }
|
|
38
|
-
expect { subject.read id }.to output(/http:\/\/datacite.org\/schema\/kernel-3/).to_stdout
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
context "schema_org" do
|
|
43
|
-
let(:id) { "https://blog.datacite.org/eating-your-own-dog-food" }
|
|
44
|
-
|
|
45
|
-
it 'as schema_org' do
|
|
46
|
-
subject.options = { as: "schema_org" }
|
|
47
|
-
expect { subject.read id }.to output(/datacite, doi, metadata, featured/).to_stdout
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it 'as datacite' do
|
|
51
|
-
subject.options = { as: "datacite" }
|
|
52
|
-
expect { subject.read id }.to output(/http:\/\/datacite.org\/schema\/kernel-4/).to_stdout
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
data/spec/crossref_spec.rb
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Bolognese::Crossref, vcr: true do
|
|
4
|
-
let(:id) { "10.7554/eLife.01567" }
|
|
5
|
-
|
|
6
|
-
subject { Bolognese::Crossref.new(id: id) }
|
|
7
|
-
|
|
8
|
-
context "get metadata" do
|
|
9
|
-
it "DOI with data citation" do
|
|
10
|
-
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
|
11
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
12
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
13
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Martial", "familyName"=>"Sankar"},
|
|
14
|
-
{"@type"=>"Person", "givenName"=>"Kaisa", "familyName"=>"Nieminen"},
|
|
15
|
-
{"@type"=>"Person", "givenName"=>"Laura", "familyName"=>"Ragni"},
|
|
16
|
-
{"@type"=>"Person", "givenName"=>"Ioannis", "familyName"=>"Xenarios"},
|
|
17
|
-
{"@type"=>"Person", "givenName"=>"Christian S", "familyName"=>"Hardtke"}])
|
|
18
|
-
expect(subject.license).to eq("http://creativecommons.org/licenses/by/3.0/")
|
|
19
|
-
expect(subject.name).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
20
|
-
expect(subject.date_published).to eq("2014-02-11")
|
|
21
|
-
expect(subject.date_modified).to eq("2015-08-11T05:35:02Z")
|
|
22
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"eLife", "issn"=>"2050-084X")
|
|
23
|
-
expect(subject.citation.count).to eq(27)
|
|
24
|
-
expect(subject.citation[21]).to eq("@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.b835k", "position"=>"22", "datePublished"=>"2014")
|
|
25
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "journal article" do
|
|
29
|
-
id = "https://doi.org/10.1371/journal.pone.0000030"
|
|
30
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
31
|
-
expect(subject.id).to eq(id)
|
|
32
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
33
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
34
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Markus", "familyName"=>"Ralser"},
|
|
35
|
-
{"@type"=>"Person", "givenName"=>"Gino", "familyName"=>"Heeren"},
|
|
36
|
-
{"@type"=>"Person", "givenName"=>"Michael", "familyName"=>"Breitenbach"},
|
|
37
|
-
{"@type"=>"Person", "givenName"=>"Hans", "familyName"=>"Lehrach"},
|
|
38
|
-
{"@type"=>"Person", "givenName"=>"Sylvia", "familyName"=>"Krobitsch"}])
|
|
39
|
-
expect(subject.editor).to eq([{"@type"=>"Person", "givenName"=>"Guilhem", "familyName"=>"Janbon"}])
|
|
40
|
-
expect(subject.name).to eq("Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes")
|
|
41
|
-
expect(subject.license).to eq("http://creativecommons.org/licenses/by/4.0/")
|
|
42
|
-
expect(subject.date_published).to eq("2006-12-20")
|
|
43
|
-
expect(subject.date_modified).to eq("2016-12-31T21:37:08Z")
|
|
44
|
-
expect(subject.page_start).to eq("e30")
|
|
45
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"PLoS ONE", "issn"=>"1932-6203")
|
|
46
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
it "posted_content" do
|
|
50
|
-
id = "https://doi.org/10.1101/097196"
|
|
51
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
52
|
-
expect(subject.id).to eq(id)
|
|
53
|
-
expect(subject.type).to eq("CreativeWork")
|
|
54
|
-
expect(subject.additional_type).to eq("PostedContent")
|
|
55
|
-
expect(subject.author.count).to eq(10)
|
|
56
|
-
expect(subject.author.last).to eq("@type"=>"Person", "@id"=>"http://orcid.org/0000-0003-4060-7360", "givenName"=>"Timothy", "familyName"=>"Clark")
|
|
57
|
-
expect(subject.name).to eq("A Data Citation Roadmap for Scholarly Data Repositories")
|
|
58
|
-
expect(subject.alternate_name).to eq("biorxiv;097196v1")
|
|
59
|
-
expect(subject.description).to start_with("This article presents a practical roadmap")
|
|
60
|
-
expect(subject.date_published).to eq("2016-12-28")
|
|
61
|
-
expect(subject.date_modified).to eq("2016-12-29T00:10:20Z")
|
|
62
|
-
expect(subject.is_part_of).to be_nil
|
|
63
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it "DOI with SICI DOI" do
|
|
67
|
-
id = "https://doi.org/10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2"
|
|
68
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
69
|
-
expect(subject.id).to eq("https://doi.org/10.1890/0012-9658(2006)87%5B2832:tiopma%5D2.0.co;2")
|
|
70
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
71
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
72
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"A.", "familyName"=>"Fenton"}, {"@type"=>"Person", "givenName"=>"S. A.", "familyName"=>"Rands"}])
|
|
73
|
-
expect(subject.license).to eq("http://doi.wiley.com/10.1002/tdm_license_1")
|
|
74
|
-
expect(subject.name).to eq("THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES")
|
|
75
|
-
expect(subject.date_published).to eq("2006-11")
|
|
76
|
-
expect(subject.date_modified).to eq("2016-10-04T17:20:17Z")
|
|
77
|
-
expect(subject.page_start).to eq("2832")
|
|
78
|
-
expect(subject.page_end).to eq("2841")
|
|
79
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"Ecology", "issn"=>"0012-9658")
|
|
80
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it "DOI with ORCID ID" do
|
|
84
|
-
id = "https://doi.org/10.1155/2012/291294"
|
|
85
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
86
|
-
expect(subject.id).to eq("https://doi.org/10.1155/2012/291294")
|
|
87
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
88
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
89
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Wendy", "familyName"=>"Thanassi"},
|
|
90
|
-
{"@type"=>"Person", "givenName"=>"Art", "familyName"=>"Noda"},
|
|
91
|
-
{"@type"=>"Person",
|
|
92
|
-
"@id"=>"http://orcid.org/0000-0003-2043-4925",
|
|
93
|
-
"givenName"=>"Beatriz",
|
|
94
|
-
"familyName"=>"Hernandez"},
|
|
95
|
-
{"@type"=>"Person", "givenName"=>"Jeffery", "familyName"=>"Newell"},
|
|
96
|
-
{"@type"=>"Person", "givenName"=>"Paul", "familyName"=>"Terpeluk"},
|
|
97
|
-
{"@type"=>"Person", "givenName"=>"David", "familyName"=>"Marder"},
|
|
98
|
-
{"@type"=>"Person", "givenName"=>"Jerome A.", "familyName"=>"Yesavage"}])
|
|
99
|
-
expect(subject.license).to eq("http://creativecommons.org/licenses/by/3.0/")
|
|
100
|
-
expect(subject.name).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
|
101
|
-
expect(subject.date_published).to eq("2012")
|
|
102
|
-
expect(subject.date_modified).to eq("2016-08-02T12:42:41Z")
|
|
103
|
-
expect(subject.page_start).to eq("1")
|
|
104
|
-
expect(subject.page_end).to eq("7")
|
|
105
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"Pulmonary Medicine", "issn"=>"2090-1836")
|
|
106
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
it "date in future" do
|
|
110
|
-
id = "https://doi.org/10.1016/j.ejphar.2015.03.018"
|
|
111
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
112
|
-
expect(subject.id).to eq(id)
|
|
113
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
114
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
115
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Sarah E.", "familyName"=>"Beck"},
|
|
116
|
-
{"@type"=>"Person", "givenName"=>"Suzanne E.", "familyName"=>"Queen"},
|
|
117
|
-
{"@type"=>"Person", "givenName"=>"Kenneth W.", "familyName"=>"Witwer"},
|
|
118
|
-
{"@type"=>"Person", "givenName"=>"Kelly A.", "familyName"=>"Metcalf Pate"},
|
|
119
|
-
{"@type"=>"Person", "givenName"=>"Lisa M.", "familyName"=>"Mangus"},
|
|
120
|
-
{"@type"=>"Person", "givenName"=>"Lucio", "familyName"=>"Gama"},
|
|
121
|
-
{"@type"=>"Person", "givenName"=>"Robert J.", "familyName"=>"Adams"},
|
|
122
|
-
{"@type"=>"Person", "givenName"=>"Janice E.", "familyName"=>"Clements"},
|
|
123
|
-
{"@type"=>"Person", "givenName"=>"M.", "familyName"=>"Christine Zink"},
|
|
124
|
-
{"@type"=>"Person", "givenName"=>"Joseph L.", "familyName"=>"Mankowski"}])
|
|
125
|
-
expect(subject.name).to eq("Paving the path to HIV neurotherapy: Predicting SIV CNS disease")
|
|
126
|
-
expect(subject.date_published).to eq("2015-07")
|
|
127
|
-
expect(subject.date_modified).to eq("2016-08-20T02:19:38Z")
|
|
128
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"European Journal of Pharmacology", "issn"=>"00142999")
|
|
129
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it "not found error" do
|
|
133
|
-
id = "https://doi.org/10.7554/elife.01567x"
|
|
134
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
135
|
-
expect(subject.id).to be_nil
|
|
136
|
-
expect(subject.exists?).to be false
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
context "get metadata as string" do
|
|
141
|
-
it "DOI with data citation" do
|
|
142
|
-
id = "10.7554/eLife.01567"
|
|
143
|
-
string = Bolognese::Crossref.new(id: id).raw
|
|
144
|
-
|
|
145
|
-
subject = Bolognese::Crossref.new(string: string)
|
|
146
|
-
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
|
147
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
148
|
-
expect(subject.additional_type).to eq("JournalArticle")
|
|
149
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Martial", "familyName"=>"Sankar"},
|
|
150
|
-
{"@type"=>"Person", "givenName"=>"Kaisa", "familyName"=>"Nieminen"},
|
|
151
|
-
{"@type"=>"Person", "givenName"=>"Laura", "familyName"=>"Ragni"},
|
|
152
|
-
{"@type"=>"Person", "givenName"=>"Ioannis", "familyName"=>"Xenarios"},
|
|
153
|
-
{"@type"=>"Person", "givenName"=>"Christian S", "familyName"=>"Hardtke"}])
|
|
154
|
-
expect(subject.license).to eq("http://creativecommons.org/licenses/by/3.0/")
|
|
155
|
-
expect(subject.name).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
156
|
-
expect(subject.date_published).to eq("2014-02-11")
|
|
157
|
-
expect(subject.date_modified).to eq("2015-08-11T05:35:02Z")
|
|
158
|
-
expect(subject.is_part_of).to eq("@type"=>"Periodical", "name"=>"eLife", "issn"=>"2050-084X")
|
|
159
|
-
expect(subject.citation.count).to eq(27)
|
|
160
|
-
expect(subject.citation[21]).to eq("@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.b835k", "position"=>"22", "datePublished"=>"2014")
|
|
161
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"Crossref")
|
|
162
|
-
end
|
|
163
|
-
end
|
|
164
|
-
|
|
165
|
-
context "get metadata as datacite xml" do
|
|
166
|
-
it "with data citation" do
|
|
167
|
-
expect(subject.validation_errors).to be_empty
|
|
168
|
-
datacite = Maremma.from_xml(subject.as_datacite).fetch("resource", {})
|
|
169
|
-
expect(datacite.dig("titles", "title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
170
|
-
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").count).to eq(25)
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
it "with ORCID ID" do
|
|
174
|
-
id = "https://doi.org/10.1155/2012/291294"
|
|
175
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
176
|
-
expect(subject.validation_errors).to be_empty
|
|
177
|
-
datacite = Maremma.from_xml(subject.as_datacite).fetch("resource", {})
|
|
178
|
-
expect(datacite.dig("creators", "creator").count).to eq(7)
|
|
179
|
-
expect(datacite.dig("creators", "creator").first).to eq("creatorName"=>"Thanassi, Wendy", "givenName"=>"Wendy", "familyName"=>"Thanassi")
|
|
180
|
-
end
|
|
181
|
-
|
|
182
|
-
it "with editor" do
|
|
183
|
-
id = "https://doi.org/10.1371/journal.pone.0000030"
|
|
184
|
-
subject = Bolognese::Crossref.new(id: id)
|
|
185
|
-
expect(subject.validation_errors).to be_empty
|
|
186
|
-
datacite = Maremma.from_xml(subject.as_datacite).fetch("resource", {})
|
|
187
|
-
expect(datacite.dig("contributors", "contributor")).to eq("contributorType"=>"Editor", "contributorName"=>"Janbon, Guilhem", "givenName"=>"Guilhem", "familyName"=>"Janbon")
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
end
|
data/spec/datacite_spec.rb
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Bolognese::Datacite, vcr: true do
|
|
4
|
-
context "get metadata" do
|
|
5
|
-
let(:id) { "https://doi.org/10.5061/DRYAD.8515" }
|
|
6
|
-
|
|
7
|
-
subject { Bolognese::Datacite.new(id: id) }
|
|
8
|
-
|
|
9
|
-
it "Dataset" do
|
|
10
|
-
expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
|
|
11
|
-
expect(subject.type).to eq("Dataset")
|
|
12
|
-
expect(subject.additional_type).to eq("DataPackage")
|
|
13
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Benjamin", "familyName"=>"Ollomo"},
|
|
14
|
-
{"@type"=>"Person", "givenName"=>"Patrick", "familyName"=>"Durand"},
|
|
15
|
-
{"@type"=>"Person", "givenName"=>"Franck", "familyName"=>"Prugnolle"},
|
|
16
|
-
{"@type"=>"Person", "givenName"=>"Emmanuel J. P.", "familyName"=>"Douzery"},
|
|
17
|
-
{"@type"=>"Person", "givenName"=>"Céline", "familyName"=>"Arnathau"},
|
|
18
|
-
{"@type"=>"Person", "givenName"=>"Dieudonné", "familyName"=>"Nkoghe"},
|
|
19
|
-
{"@type"=>"Person", "givenName"=>"Eric", "familyName"=>"Leroy"},
|
|
20
|
-
{"@type"=>"Person", "givenName"=>"François", "familyName"=>"Renaud"}])
|
|
21
|
-
expect(subject.name).to eq("Data from: A new malaria agent in African hominids.")
|
|
22
|
-
expect(subject.alternate_name).to eq("Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.")
|
|
23
|
-
expect(subject.license).to eq("http://creativecommons.org/publicdomain/zero/1.0/")
|
|
24
|
-
expect(subject.date_published).to eq("2011")
|
|
25
|
-
expect(subject.has_part).to eq([{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.8515/1"},
|
|
26
|
-
{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.8515/2"}])
|
|
27
|
-
expect(subject.citation).to eq([{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.1371/journal.ppat.1000446"}])
|
|
28
|
-
expect(subject.publisher).to eq("@type"=>"Organization", "name"=>"Dryad Digital Repository")
|
|
29
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"DataCite")
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it "BlogPosting" do
|
|
33
|
-
id = "https://doi.org/10.5438/4K3M-NYVG"
|
|
34
|
-
subject = Bolognese::Datacite.new(id: id)
|
|
35
|
-
expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
|
36
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
37
|
-
expect(subject.additional_type).to eq("BlogPosting")
|
|
38
|
-
expect(subject.author).to eq([{"@type"=>"Person", "@id"=>"http://orcid.org/0000-0003-1419-2405", "givenName"=>"Martin", "familyName"=>"Fenner"}])
|
|
39
|
-
expect(subject.name).to eq("Eating your own Dog Food")
|
|
40
|
-
expect(subject.alternate_name).to eq("MS-49-3632-5083")
|
|
41
|
-
expect(subject.description).to start_with("Eating your own dog food")
|
|
42
|
-
expect(subject.date_published).to eq("2016-12-20")
|
|
43
|
-
expect(subject.date_modified).to eq("2016-12-20")
|
|
44
|
-
expect(subject.is_part_of).to eq("@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5438/0000-00ss")
|
|
45
|
-
expect(subject.citation).to eq([{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5438/0012"},
|
|
46
|
-
{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5438/55e5-t5c0"}])
|
|
47
|
-
expect(subject.publisher).to eq("@type"=>"Organization", "name"=>"DataCite")
|
|
48
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"DataCite")
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it "Date" do
|
|
52
|
-
id = "https://doi.org/10.4230/lipics.tqc.2013.93"
|
|
53
|
-
subject = Bolognese::Datacite.new(id: id)
|
|
54
|
-
expect(subject.id).to eq("https://doi.org/10.4230/lipics.tqc.2013.93")
|
|
55
|
-
expect(subject.type).to eq("ScholarlyArticle")
|
|
56
|
-
expect(subject.additional_type).to eq("ConferencePaper")
|
|
57
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Nathaniel", "familyName"=>"Johnston"}])
|
|
58
|
-
expect(subject.name).to eq("The Minimum Size of Qubit Unextendible Product Bases")
|
|
59
|
-
expect(subject.description).to start_with("We investigate the problem of constructing unextendible product bases in the qubit case")
|
|
60
|
-
expect(subject.date_published).to eq("2013")
|
|
61
|
-
expect(subject.publisher).to eq("@type"=>"Organization", "name"=>"Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik GmbH, Wadern/Saarbruecken, Germany")
|
|
62
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"DataCite")
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
context "get metadata as string" do
|
|
67
|
-
it "Dataset" do
|
|
68
|
-
id = "https://doi.org/10.5061/DRYAD.8515"
|
|
69
|
-
string = Bolognese::Datacite.new(id: id).raw
|
|
70
|
-
|
|
71
|
-
subject = Bolognese::Datacite.new(string: string)
|
|
72
|
-
expect(subject.id).to eq("https://doi.org/10.5061/dryad.8515")
|
|
73
|
-
expect(subject.type).to eq("Dataset")
|
|
74
|
-
expect(subject.additional_type).to eq("DataPackage")
|
|
75
|
-
expect(subject.author).to eq([{"@type"=>"Person", "givenName"=>"Benjamin", "familyName"=>"Ollomo"},
|
|
76
|
-
{"@type"=>"Person", "givenName"=>"Patrick", "familyName"=>"Durand"},
|
|
77
|
-
{"@type"=>"Person", "givenName"=>"Franck", "familyName"=>"Prugnolle"},
|
|
78
|
-
{"@type"=>"Person", "givenName"=>"Emmanuel J. P.", "familyName"=>"Douzery"},
|
|
79
|
-
{"@type"=>"Person", "givenName"=>"Céline", "familyName"=>"Arnathau"},
|
|
80
|
-
{"@type"=>"Person", "givenName"=>"Dieudonné", "familyName"=>"Nkoghe"},
|
|
81
|
-
{"@type"=>"Person", "givenName"=>"Eric", "familyName"=>"Leroy"},
|
|
82
|
-
{"@type"=>"Person", "givenName"=>"François", "familyName"=>"Renaud"}])
|
|
83
|
-
expect(subject.name).to eq("Data from: A new malaria agent in African hominids.")
|
|
84
|
-
expect(subject.alternate_name).to eq("Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.")
|
|
85
|
-
expect(subject.license).to eq("http://creativecommons.org/publicdomain/zero/1.0/")
|
|
86
|
-
expect(subject.date_published).to eq("2011")
|
|
87
|
-
expect(subject.has_part).to eq([{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.8515/1"},
|
|
88
|
-
{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5061/dryad.8515/2"}])
|
|
89
|
-
expect(subject.citation).to eq([{"@type"=>"CreativeWork", "@id"=>"https://doi.org/10.1371/journal.ppat.1000446"}])
|
|
90
|
-
expect(subject.provider).to eq("@type"=>"Organization", "name"=>"DataCite")
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|