bolognese 1.5.14 → 1.5.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/bolognese/datacite_utils.rb +2 -2
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_json_metadata/metadata_from_api.yml +110 -0
- data/spec/readers/datacite_json_reader_spec.rb +18 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae39841e4acc3e53eaa3a4ad85b277f34f7e645db8bdc8935f6465ffb3452832
|
4
|
+
data.tar.gz: '02895d6c376c85e258905c99a16f8b4198abcedf50ea6381e20391d8c07f07b5'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353de10c374dfd435e10408dfcc7d81602a3ad39c88b2042664996ef5501fc919e7b2fdc0bddaef580cbdea5f73b68cbbd8794fd158e2ae049721013a48d49d1
|
7
|
+
data.tar.gz: a8be194f38b54b2c929b24d9cbd9cdcc897bc94ba82782fe36da47b09a2014b7ef1c4f32c26db62aa12e3af454fd418bc0540b3276cc8ba6c0711977b06a2b4f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (1.5.
|
4
|
+
bolognese (1.5.15)
|
5
5
|
activesupport (>= 4.2.5)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (>= 5.1.0)
|
@@ -161,7 +161,7 @@ GEM
|
|
161
161
|
nokogiri (~> 1.6)
|
162
162
|
rspec (~> 3)
|
163
163
|
safe_yaml (1.0.5)
|
164
|
-
simplecov (0.18.
|
164
|
+
simplecov (0.18.5)
|
165
165
|
docile (~> 1.1)
|
166
166
|
simplecov-html (~> 0.11)
|
167
167
|
simplecov-html (0.12.1)
|
data/lib/bolognese/version.rb
CHANGED
data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_json_metadata/metadata_from_api.yml
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/ra/10.5281
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.6; mailto:info@datacite.org)
|
12
|
+
Accept:
|
13
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Wed, 26 Feb 2020 07:30:17 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json;charset=UTF-8
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Set-Cookie:
|
26
|
+
- __cfduid=d41ca6950d58cbbe27fee720ab33ad08c1582702217; expires=Fri, 27-Mar-20
|
27
|
+
07:30:17 GMT; path=/; domain=.doi.org; HttpOnly; SameSite=Lax; Secure
|
28
|
+
Cf-Cache-Status:
|
29
|
+
- DYNAMIC
|
30
|
+
Expect-Ct:
|
31
|
+
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
32
|
+
Strict-Transport-Security:
|
33
|
+
- max-age=31536000; includeSubDomains; preload
|
34
|
+
Server:
|
35
|
+
- cloudflare
|
36
|
+
Cf-Ray:
|
37
|
+
- 56b03679aaeed6c5-FRA
|
38
|
+
body:
|
39
|
+
encoding: ASCII-8BIT
|
40
|
+
string: |-
|
41
|
+
[
|
42
|
+
{
|
43
|
+
"DOI": "10.5281",
|
44
|
+
"RA": "DataCite"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
http_version:
|
48
|
+
recorded_at: Wed, 26 Feb 2020 07:30:17 GMT
|
49
|
+
- request:
|
50
|
+
method: get
|
51
|
+
uri: https://api.datacite.org/dois/10.5281/zenodo.28518
|
52
|
+
body:
|
53
|
+
encoding: US-ASCII
|
54
|
+
string: ''
|
55
|
+
headers:
|
56
|
+
User-Agent:
|
57
|
+
- Mozilla/5.0 (compatible; Maremma/4.6; mailto:info@datacite.org)
|
58
|
+
Accept:
|
59
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
60
|
+
response:
|
61
|
+
status:
|
62
|
+
code: 200
|
63
|
+
message: OK
|
64
|
+
headers:
|
65
|
+
Date:
|
66
|
+
- Wed, 26 Feb 2020 07:30:19 GMT
|
67
|
+
Content-Type:
|
68
|
+
- application/json; charset=utf-8
|
69
|
+
Connection:
|
70
|
+
- keep-alive
|
71
|
+
Status:
|
72
|
+
- 200 OK
|
73
|
+
X-Anonymous-Consumer:
|
74
|
+
- 'true'
|
75
|
+
Cache-Control:
|
76
|
+
- max-age=0, private, must-revalidate
|
77
|
+
Vary:
|
78
|
+
- Accept-Encoding, Origin
|
79
|
+
X-Request-Id:
|
80
|
+
- 4d58cda5-9fbe-46ef-9a5b-d3a0d76125fc
|
81
|
+
Etag:
|
82
|
+
- W/"7d1c557e2368f256e429ea11cb11e51f"
|
83
|
+
X-Runtime:
|
84
|
+
- '1.453844'
|
85
|
+
X-Powered-By:
|
86
|
+
- Phusion Passenger 6.0.4
|
87
|
+
Server:
|
88
|
+
- nginx/1.14.0 + Phusion Passenger 6.0.4
|
89
|
+
body:
|
90
|
+
encoding: ASCII-8BIT
|
91
|
+
string: '{"data":{"id":"10.5281/zenodo.28518","type":"dois","attributes":{"doi":"10.5281/zenodo.28518","prefix":"10.5281","suffix":"zenodo.28518","identifiers":[{"identifier":"https://doi.org/10.5281/zenodo.28518","identifierType":"DOI"},{"identifier":"https://zenodo.org/record/28518","identifierType":"URL"}],"creators":[{"name":"Vanderplas,
|
92
|
+
Jake","nameType":"Personal","givenName":"Jake","familyName":"Vanderplas","affiliation":["University
|
93
|
+
of Washington"],"nameIdentifiers":[]},{"name":"Willmer, Alex","nameType":"Personal","givenName":"Alex","familyName":"Willmer","affiliation":[],"nameIdentifiers":[]}],"titles":[{"title":"Supersmoother:
|
94
|
+
Minor Bug Fix Release"}],"publisher":"Zenodo","container":{},"publicationYear":2015,"subjects":[],"contributors":[],"dates":[{"date":"2015-08-19","dateType":"Issued"}],"language":null,"types":{"ris":"COMP","bibtex":"misc","citeproc":"article","schemaOrg":"SoftwareSourceCode","resourceTypeGeneral":"Software"},"relatedIdentifiers":[{"relationType":"IsSupplementTo","relatedIdentifier":"https://github.com/jakevdp/supersmoother/tree/v0.3.2","relatedIdentifierType":"URL"},{"relationType":"IsVersionOf","relatedIdentifier":"10.5281/zenodo.593209","relatedIdentifierType":"DOI"}],"sizes":[],"formats":[],"version":"v0.3.2","rightsList":[{"rights":"Open
|
95
|
+
Access","rightsUri":"info:eu-repo/semantics/openAccess"}],"descriptions":[{"description":"Fix
|
96
|
+
issues with installation as a dependency","descriptionType":"Abstract"}],"geoLocations":[],"fundingReferences":[],"xml":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHJlc291cmNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5lbC00LjEvbWV0YWRhdGEueHNkIj4KICA8aWRlbnRpZmllciBpZGVudGlmaWVyVHlwZT0iRE9JIj4xMC41MjgxL1pFTk9ETy4y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pha2V2ZHAvc3VwZXJzbW9vdGhlci90cmVlL3YwLjMuMjwvcmVsYXRlZElkZW50aWZpZXI+CiAgICA8cmVsYXRlZElkZW50aWZpZXIgcmVsYXRlZElkZW50aWZpZXJUeXBlPSJET0kiIHJlbGF0aW9uVHlwZT0iSXNWZXJzaW9uT2YiPjEwLjUyODEvemVub2RvLjU5MzIwOTwvcmVsYXRlZElkZW50aWZpZXI+CiAgPC9yZWxhdGVkSWRlbnRpZmllcnM+CiAgPHZlcnNpb24+djAuMy4yPC92ZXJzaW9uPgogIDxyaWdodHNMaXN0PgogICAgPHJpZ2h0cyByaWdodHNVUkk9ImluZm86ZXUtcmVwby9zZW1hbnRpY3Mvb3BlbkFjY2VzcyI+T3BlbiBBY2Nlc3M8L3JpZ2h0cz4KICA8L3JpZ2h0c0xpc3Q+CiAgPGRlc2NyaXB0aW9ucz4KICAgIDxkZXNjcmlwdGlvbiBkZXNjcmlwdGlvblR5cGU9IkFic3RyYWN0Ij4mbHQ7dWwmZ3Q7CiZsdDtsaSZndDtGaXggaXNzdWVzIHdpdGggaW5zdGFsbGF0aW9uIGFzIGEgZGVwZW5kZW5jeSZsdDsvbGkmZ3Q7CiZsdDsvdWwmZ3Q7PC9kZXNjcmlwdGlvbj4KICA8L2Rlc2NyaXB0aW9ucz4KPC9yZXNvdXJjZT4=","url":"https://zenodo.org/record/28518","contentUrl":null,"metadataVersion":3,"schemaVersion":"http://datacite.org/schema/kernel-4","source":null,"isActive":true,"state":"findable","reason":null,"viewCount":0,"viewsOverTime":[],"downloadCount":0,"downloadsOverTime":[],"referenceCount":0,"citationCount":0,"citationsOverTime":[],"created":"2015-08-19T14:28:37.000Z","registered":"2015-08-19T14:28:38.000Z","published":"2015","updated":"2020-02-26T07:17:09.000Z"},"relationships":{"client":{"data":{"id":"cern.zenodo","type":"clients"}},"media":{"data":{"id":"10.5281/zenodo.28518","type":"media"}},"referenceEvents":{"data":[]},"citationEvents":{"data":[]}}},"included":[{"id":"cern.zenodo","type":"clients","attributes":{"name":"Zenodo","symbol":"CERN.ZENODO","year":2013,"contactEmail":"info@zenodo.org","alternateName":"Research.
|
97
|
+
Shared","description":"ZENODO builds and operates a simple and innovative
|
98
|
+
service that enables researchers, scientists, EU projects and institutions
|
99
|
+
to share and showcase multidisciplinary research results (data and publications)
|
100
|
+
that are not part of the existing institutional or subject-based repositories
|
101
|
+
of the research communities.\r\nZENODO enables researchers, scientists, EU
|
102
|
+
projects and institutions to:\r\neasily share the long tail of small research
|
103
|
+
results in a wide variety of formats including text, spreadsheets, audio,
|
104
|
+
video, and images across all fields of science.\r\ndisplay their research
|
105
|
+
results and get credited by making the research results citable and integrate
|
106
|
+
them into existing reporting lines to funding agencies like the European Commission.\r\neasily
|
107
|
+
access and reuse shared research results.","language":["en"],"clientType":"repository","domains":"openaire.cern.ch,zenodo.org","re3data":"https://doi.org/10.17616/R3QP53","opendoar":null,"issn":[],"url":"https://zenodo.org/","created":"2013-01-28T12:07:48.000Z","updated":"2019-08-02T17:08:53.000Z","isActive":true,"hasPassword":true},"relationships":{"provider":{"data":{"id":"cern","type":"providers"}},"prefixes":{"data":[{"id":"10.5281","type":"prefixes"}]}}}]}'
|
108
|
+
http_version:
|
109
|
+
recorded_at: Wed, 26 Feb 2020 07:30:19 GMT
|
110
|
+
recorded_with: VCR 3.0.3
|
@@ -57,5 +57,23 @@ describe Bolognese::Metadata, vcr: true do
|
|
57
57
|
expect(subject.errors).to eq(["The same key is defined more than once: id"])
|
58
58
|
expect(subject.codemeta).to be_nil
|
59
59
|
end
|
60
|
+
|
61
|
+
it "metadata from api" do
|
62
|
+
input = "10.5281/zenodo.28518"
|
63
|
+
subject = Bolognese::Metadata.new(input: input, regenerate: true)
|
64
|
+
expect(subject.valid?).to be true
|
65
|
+
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article", "resourceTypeGeneral"=>"Software", "ris"=>"COMP", "schemaOrg"=>"SoftwareSourceCode")
|
66
|
+
expect(subject.creators.length).to eq(2)
|
67
|
+
expect(subject.creators.first).to eq("affiliation"=>[{"name"=>"University of Washington"}], "familyName"=>"Vanderplas", "givenName"=>"Jake", "name"=>"Vanderplas, Jake", "nameIdentifiers"=>[], "nameType"=>"Personal")
|
68
|
+
expect(subject.titles).to eq([{"title"=>"Supersmoother: Minor Bug Fix Release"}])
|
69
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5281/zenodo.28518", "identifierType"=>"DOI"}, {"identifier"=>"https://zenodo.org/record/28518", "identifierType"=>"URL"}])
|
70
|
+
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
71
|
+
expect(subject.publication_year).to eq("2015")
|
72
|
+
expect(subject.version_info).to eq("v0.3.2")
|
73
|
+
expect(subject.datacite).to include("<version>v0.3.2</version>")
|
74
|
+
expect(subject.related_identifiers.length).to eq(2)
|
75
|
+
expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"https://github.com/jakevdp/supersmoother/tree/v0.3.2", "relatedIdentifierType"=>"URL", "relationType"=>"IsSupplementTo")
|
76
|
+
expect(subject.agency).to eq("DataCite")
|
77
|
+
end
|
60
78
|
end
|
61
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -913,6 +913,7 @@ files:
|
|
913
913
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml
|
914
914
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml
|
915
915
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml
|
916
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_json_metadata/metadata_from_api.yml
|
916
917
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/BlogPosting.yml
|
917
918
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml
|
918
919
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system_schema_3.yml
|