bolognese 0.9.69 → 0.9.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/metadata.rb +7 -1
- data/lib/bolognese/readers/datacite_reader.rb +1 -0
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/crosscite_writer.rb +2 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml +58 -72
- data/spec/readers/datacite_reader_spec.rb +8 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa532a527dc2408faeaec9458938092aab74a2a3997e264ec50afb6a767dd8ba
|
4
|
+
data.tar.gz: b3aa0fbb08121d749a8673fc81ed2c384e592056b7cddf9a0ca34d8cfb0b3388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1af79419bab8c30d6b5deb494a2a79435b5c202fac74595f69e2a74e156de56e9d8ece89d47aa1c3edcf598918555915ca8d55cbae298ab3d527a7f7611c187
|
7
|
+
data.tar.gz: 2e390863f9735f84326d9546e459f16a02079b37308a107143db3dd24ba6503f65fa0167bd1905365104875ec1ef019a60d57d668ba2a4b9742f5fd71cb2ba72
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/metadata.rb
CHANGED
@@ -74,7 +74,7 @@ module Bolognese
|
|
74
74
|
:is_documented_by, :documents, :is_compiled_by, :compiles,
|
75
75
|
:is_variant_form_of, :is_original_form_of, :is_reviewed_by, :reviews,
|
76
76
|
:is_derived_from, :is_source_of, :format, :funding, :type, :bibtex_type,
|
77
|
-
:citeproc_type, :ris_type, :style, :locale, :state
|
77
|
+
:citeproc_type, :ris_type, :style, :locale, :state, :is_active
|
78
78
|
|
79
79
|
attr_reader :id, :from, :raw, :metadata, :doc, :provider,
|
80
80
|
:page_start, :page_end, :should_passthru, :errors,
|
@@ -101,6 +101,7 @@ module Bolognese
|
|
101
101
|
else
|
102
102
|
hsh = { "url" => options[:url],
|
103
103
|
"state" => options[:state],
|
104
|
+
"is_active" => options[:is_active],
|
104
105
|
"date_registered" => options[:date_registered],
|
105
106
|
"date_updated" => options[:date_updated],
|
106
107
|
"provider_id" => options[:provider_id],
|
@@ -125,6 +126,7 @@ module Bolognese
|
|
125
126
|
|
126
127
|
@url = hsh.to_h["url"].presence
|
127
128
|
@state = hsh.to_h["state"].presence
|
129
|
+
@is_active = hsh.to_h["is_active"].presence
|
128
130
|
@date_registered = hsh.to_h["date_registered"].presence
|
129
131
|
@date_updated = hsh.to_h["date_updated"].presence
|
130
132
|
@provider_id = hsh.to_h["provider_id"].presence
|
@@ -189,6 +191,10 @@ module Bolognese
|
|
189
191
|
@state ||= metadata.fetch("state", nil)
|
190
192
|
end
|
191
193
|
|
194
|
+
def is_active
|
195
|
+
@is_active ||= metadata.fetch("is_active", nil)
|
196
|
+
end
|
197
|
+
|
192
198
|
def title
|
193
199
|
@title ||= metadata.fetch("title", nil)
|
194
200
|
end
|
@@ -35,6 +35,7 @@ module Bolognese
|
|
35
35
|
{ "string" => string,
|
36
36
|
"url" => attributes.fetch("url", nil),
|
37
37
|
"state" => attributes.fetch("state", nil),
|
38
|
+
"is_active" => attributes.fetch("is-active", nil),
|
38
39
|
"date_registered" => attributes.fetch("registered", nil),
|
39
40
|
"date_updated" => attributes.fetch("updated", nil),
|
40
41
|
"provider_id" => provider_id,
|
data/lib/bolognese/version.rb
CHANGED
data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/DOI_in_test_system.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.datacite.org/prefixes/10.
|
5
|
+
uri: https://api.datacite.org/prefixes/10.22002
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -16,55 +16,47 @@ http_interactions:
|
|
16
16
|
code: 200
|
17
17
|
message: OK
|
18
18
|
headers:
|
19
|
-
|
20
|
-
-
|
21
|
-
Access-Control-Allow-Methods:
|
22
|
-
- GET, POST, PATCH, PUT, DELETE, OPTIONS
|
23
|
-
Access-Control-Allow-Origin:
|
24
|
-
- "*"
|
25
|
-
Access-Control-Expose-Headers:
|
26
|
-
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
27
|
-
Cache-Control:
|
28
|
-
- max-age=0, private, must-revalidate
|
19
|
+
Date:
|
20
|
+
- Fri, 12 Jan 2018 18:11:18 GMT
|
29
21
|
Content-Type:
|
30
22
|
- application/vnd.api+json; charset=utf-8
|
31
|
-
|
32
|
-
-
|
33
|
-
Etag:
|
34
|
-
- W/"c8a4751fe1e4ab5bfa3498691f588231"
|
35
|
-
Server:
|
36
|
-
- openresty/1.11.2.2
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
37
25
|
Status:
|
38
26
|
- 200 OK
|
39
|
-
Vary:
|
40
|
-
- Accept-Encoding
|
41
|
-
Via:
|
42
|
-
- kong/0.10.3
|
43
27
|
X-Anonymous-Consumer:
|
44
28
|
- 'true'
|
45
|
-
|
46
|
-
-
|
47
|
-
|
48
|
-
-
|
29
|
+
Cache-Control:
|
30
|
+
- max-age=0, private, must-revalidate
|
31
|
+
Vary:
|
32
|
+
- Accept-Encoding
|
33
|
+
Etag:
|
34
|
+
- W/"00d8969c9fcc61dfeb1b2a3edbdb2f8e"
|
35
|
+
X-Runtime:
|
36
|
+
- '0.018061'
|
37
|
+
X-Request-Id:
|
38
|
+
- b2f057f5-d86c-4f44-afba-471ed7037399
|
49
39
|
X-Powered-By:
|
50
40
|
- Phusion Passenger 5.1.12
|
51
|
-
|
52
|
-
-
|
53
|
-
|
54
|
-
-
|
55
|
-
|
56
|
-
-
|
57
|
-
|
58
|
-
-
|
41
|
+
Server:
|
42
|
+
- nginx/1.12.2 + Phusion Passenger 5.1.12
|
43
|
+
Access-Control-Allow-Origin:
|
44
|
+
- "*"
|
45
|
+
Access-Control-Allow-Methods:
|
46
|
+
- GET, POST, PATCH, PUT, DELETE, OPTIONS
|
47
|
+
Access-Control-Allow-Headers:
|
48
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
49
|
+
Access-Control-Expose-Headers:
|
50
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
59
51
|
body:
|
60
52
|
encoding: ASCII-8BIT
|
61
53
|
string: !binary |-
|
62
|
-
|
54
|
+
eyJkYXRhIjp7ImlkIjoiMTAuMjIwMDIiLCJ0eXBlIjoicHJlZml4ZXMiLCJhdHRyaWJ1dGVzIjp7InJlZ2lzdHJhdGlvbi1hZ2VuY3kiOiJEYXRhQ2l0ZSIsImNyZWF0ZWQiOiIyMDE2LTA1LTMxVDE0OjAyOjMyLjAwMFoiLCJ1cGRhdGVkIjpudWxsfSwicmVsYXRpb25zaGlwcyI6eyJjbGllbnRzIjp7ImRhdGEiOlt7ImlkIjoidGluZC5jYWx0ZWNoIiwidHlwZSI6ImNsaWVudHMifV19LCJwcm92aWRlcnMiOnsiZGF0YSI6W3siaWQiOiJ0aW5kIiwidHlwZSI6InByb3ZpZGVycyJ9XX19fSwiaW5jbHVkZWQiOlt7ImlkIjoidGluZC5jYWx0ZWNoIiwidHlwZSI6ImNsaWVudHMiLCJhdHRyaWJ1dGVzIjp7Im5hbWUiOiJDYWx0ZWNoIiwic3ltYm9sIjoiVElORC5DQUxURUNIIiwieWVhciI6MjAxNiwiY29udGFjdC1uYW1lIjoiVElORCIsImNvbnRhY3QtZW1haWwiOiJ0ZWNoQHRpbmQuaW8iLCJkb21haW5zIjoiZGF0YS5jYWx0ZWNoLmVkdSIsImlzLWFjdGl2ZSI6dHJ1ZSwicGFzc3dvcmQiOiJ5ZXMiLCJjcmVhdGVkIjoiMjAxNi0xMi0xNVQxMjoyOTo1N1oiLCJ1cGRhdGVkIjoiMjAxNy0xMS0wN1QxNzoxMDoxMVoifSwicmVsYXRpb25zaGlwcyI6eyJwcmVmaXhlcyI6eyJtZXRhIjp7fX0sInByb3ZpZGVyIjp7Im1ldGEiOnt9fSwicmVwb3NpdG9yeSI6eyJtZXRhIjp7fX19fSx7ImlkIjoidGluZCIsInR5cGUiOiJwcm92aWRlcnMiLCJhdHRyaWJ1dGVzIjp7Im5hbWUiOiJUSU5EIiwic3ltYm9sIjoiVElORCIsInllYXIiOjIwMTYsImNvbnRhY3QtbmFtZSI6IkF1ZHVuIEJqw7hya8O4eSIsImNvbnRhY3QtZW1haWwiOiJhdWR1bkB0aW5kdGVjaG5vbG9naWVzLmNvbSIsImxvZ28tdXJsIjoiaHR0cHM6Ly9hc3NldHMuZGF0YWNpdGUub3JnL2ltYWdlcy9tZW1iZXJzL3RpbmQucG5nIiwiaXMtYWN0aXZlIjp0cnVlLCJwYXNzd29yZCI6InllcyIsImNyZWF0ZWQiOiIyMDE2LTA3LTExVDE0OjU2OjI2LjAwMFoiLCJ1cGRhdGVkIjoiMjAxNy0xMS0wN1QxNzowODoyOC4wMDBaIn0sInJlbGF0aW9uc2hpcHMiOnsiY2xpZW50cyI6eyJtZXRhIjp7fX0sInByZWZpeGVzIjp7Im1ldGEiOnt9fX19XX0=
|
63
55
|
http_version:
|
64
|
-
recorded_at: Fri,
|
56
|
+
recorded_at: Fri, 12 Jan 2018 18:11:20 GMT
|
65
57
|
- request:
|
66
58
|
method: get
|
67
|
-
uri: https://api.test.datacite.org/dois/10.
|
59
|
+
uri: https://api.test.datacite.org/dois/10.22002/d1.694?include=client,provider
|
68
60
|
body:
|
69
61
|
encoding: US-ASCII
|
70
62
|
string: ''
|
@@ -78,50 +70,44 @@ http_interactions:
|
|
78
70
|
code: 200
|
79
71
|
message: OK
|
80
72
|
headers:
|
81
|
-
|
82
|
-
-
|
83
|
-
Access-Control-Allow-Methods:
|
84
|
-
- GET, POST, PATCH, PUT, DELETE, OPTIONS
|
85
|
-
Access-Control-Allow-Origin:
|
86
|
-
- "*"
|
87
|
-
Access-Control-Expose-Headers:
|
88
|
-
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
89
|
-
Cache-Control:
|
90
|
-
- max-age=0, private, must-revalidate
|
73
|
+
Date:
|
74
|
+
- Fri, 12 Jan 2018 18:11:22 GMT
|
91
75
|
Content-Type:
|
92
76
|
- application/vnd.api+json; charset=utf-8
|
93
|
-
|
94
|
-
-
|
95
|
-
Etag:
|
96
|
-
- W/"24cfe4701ecbf43cdb75dd9554145ab2"
|
97
|
-
Server:
|
98
|
-
- openresty/1.11.2.2
|
77
|
+
Connection:
|
78
|
+
- keep-alive
|
99
79
|
Status:
|
100
80
|
- 200 OK
|
101
|
-
Vary:
|
102
|
-
- Accept-Encoding
|
103
|
-
Via:
|
104
|
-
- kong/0.10.3
|
105
81
|
X-Anonymous-Consumer:
|
106
82
|
- 'true'
|
107
|
-
|
108
|
-
-
|
109
|
-
|
110
|
-
-
|
83
|
+
Cache-Control:
|
84
|
+
- max-age=0, private, must-revalidate
|
85
|
+
Vary:
|
86
|
+
- Accept-Encoding
|
87
|
+
Etag:
|
88
|
+
- W/"86ba73d74ecdef190ed868022940e8ba"
|
89
|
+
X-Runtime:
|
90
|
+
- '0.056634'
|
91
|
+
X-Request-Id:
|
92
|
+
- b979005e-d574-4231-a84d-5984bdd06d08
|
111
93
|
X-Powered-By:
|
112
94
|
- Phusion Passenger 5.1.12
|
113
|
-
|
114
|
-
-
|
115
|
-
|
116
|
-
-
|
117
|
-
|
118
|
-
-
|
119
|
-
|
120
|
-
-
|
95
|
+
Server:
|
96
|
+
- nginx/1.12.2 + Phusion Passenger 5.1.12
|
97
|
+
Access-Control-Allow-Origin:
|
98
|
+
- "*"
|
99
|
+
Access-Control-Allow-Methods:
|
100
|
+
- GET, POST, PATCH, PUT, DELETE, OPTIONS
|
101
|
+
Access-Control-Allow-Headers:
|
102
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
103
|
+
Access-Control-Expose-Headers:
|
104
|
+
- DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization
|
121
105
|
body:
|
122
|
-
encoding:
|
123
|
-
string:
|
124
|
-
|
106
|
+
encoding: UTF-8
|
107
|
+
string: '{"data":{"id":"10.22002/d1.694","type":"dois","attributes":{"doi":"10.22002/d1.694","identifier":"https://handle.test.datacite.org/10.22002/d1.694","url":null,"author":{"name":"Tester"},"title":"Test
|
108
|
+
license","container-title":"CaltechDATA","description":null,"resource-type-subtype":"Dataset","license":null,"version":2,"related-identifier":[],"schema-version":"http://datacite.org/schema/kernel-4","state":"inactive","is-active":true,"xml":"PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz4KPHJlc291\ncmNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hl\nbWEtaW5zdGFuY2UiIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVt\nYS9rZXJuZWwtNCIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNp\ndGUub3JnL3NjaGVtYS9rZXJuZWwtNCBodHRwOi8vc2NoZW1hLmRhdGFjaXRl\nLm9yZy9tZXRhL2tlcm5lbC00L21ldGFkYXRhLnhzZCI+CiAgPGlkZW50aWZp\nZXIgaWRlbnRpZmllclR5cGU9IkRPSSI+MTAuMjIwMDIvRDEuNjk0PC9pZGVu\ndGlmaWVyPgogIDxjcmVhdG9ycz4KICAgIDxjcmVhdG9yPgogICAgICA8Y3Jl\nYXRvck5hbWU+VGVzdGVyPC9jcmVhdG9yTmFtZT4KICAgICAgPGFmZmlsaWF0\naW9uPkNhbHRlY2g8L2FmZmlsaWF0aW9uPgogICAgPC9jcmVhdG9yPgogIDwv\nY3JlYXRvcnM+CiAgPHRpdGxlcz4KICAgIDx0aXRsZT5UZXN0IGxpY2Vuc2U8\nL3RpdGxlPgogIDwvdGl0bGVzPgogIDxwdWJsaXNoZXI+Q2FsdGVjaERBVEE8\nL3B1Ymxpc2hlcj4KICA8cHVibGljYXRpb25ZZWFyPjIwMTg8L3B1YmxpY2F0\naW9uWWVhcj4KICA8c3ViamVjdHM+CiAgICA8c3ViamVjdD5UZXN0PC9zdWJq\nZWN0PgogIDwvc3ViamVjdHM+CiAgPGRhdGVzPgogICAgPGRhdGUgZGF0ZVR5\ncGU9Iklzc3VlZCI+MjAxOC0wMS0xMjwvZGF0ZT4KICA8L2RhdGVzPgogIDxs\nYW5ndWFnZT5lbmc8L2xhbmd1YWdlPgogIDxyZXNvdXJjZVR5cGUgcmVzb3Vy\nY2VUeXBlR2VuZXJhbD0iRGF0YXNldCIvPgogIDxmb3JtYXRzPgogICAgPGZv\ncm1hdC8+CiAgPC9mb3JtYXRzPgogIDx2ZXJzaW9uPjEuMDwvdmVyc2lvbj4K\nICA8cmlnaHRzTGlzdD4KICAgIDxyaWdodHMgcmlnaHRzVVJJPSJ3d3cuZ29v\nZ2xlLmNvbSI+Y2MtemVybzwvcmlnaHRzPgogIDwvcmlnaHRzTGlzdD4KPC9y\nZXNvdXJjZT4=\n","published":"2018-01-12","registered":"2018-01-12T14:42:51.000Z","updated":"2018-01-12T14:42:51.000Z"},"relationships":{"client":{"data":{"id":"tind.cal","type":"clients"}},"provider":{"data":{"id":"tind","type":"providers"}},"resource-type":{"meta":{}},"media":{"meta":{}}}},"included":[{"id":"tind.cal","type":"clients","attributes":{"name":"California
|
109
|
+
Institute of Technology","symbol":"TIND.CAL","year":2016,"contact-name":"tech@tind.io","contact-email":"tech@tind.io","domains":"tind.io","is-active":true,"password":"yes","created":"2016-10-25T15:16:46Z","updated":"2017-12-02T22:49:14Z"},"relationships":{"prefixes":{"meta":{}},"provider":{"meta":{}},"repository":{"meta":{}}}},{"id":"tind","type":"providers","attributes":{"name":"TIND
|
110
|
+
Technologies","symbol":"TIND","year":2016,"contact-name":"Alexander Nietzold","contact-email":"alexander@tind.io","logo-url":"https://assets.datacite.org/images/members/tind.png","is-active":true,"password":"yes","created":"2016-06-08T18:16:18.000Z","updated":"2017-12-02T22:48:26.000Z"},"relationships":{"clients":{"meta":{}},"prefixes":{"meta":{}}}}]}'
|
125
111
|
http_version:
|
126
|
-
recorded_at: Fri,
|
112
|
+
recorded_at: Fri, 12 Jan 2018 18:11:23 GMT
|
127
113
|
recorded_with: VCR 3.0.3
|
@@ -326,20 +326,21 @@ describe Bolognese::Metadata, vcr: true do
|
|
326
326
|
end
|
327
327
|
|
328
328
|
it "DOI in test system" do
|
329
|
-
input = "https://handle.test.datacite.org/10.
|
329
|
+
input = "https://handle.test.datacite.org/10.22002/d1.694"
|
330
330
|
subject = Bolognese::Metadata.new(input: input, sandbox: true)
|
331
331
|
expect(subject.valid?).to be true
|
332
|
-
expect(subject.id).to eq("https://handle.test.datacite.org/10.
|
332
|
+
expect(subject.id).to eq("https://handle.test.datacite.org/10.22002/d1.694")
|
333
333
|
expect(subject.type).to eq("Dataset")
|
334
334
|
expect(subject.additional_type).to eq("Dataset")
|
335
335
|
expect(subject.resource_type_general).to eq("Dataset")
|
336
|
-
expect(subject.author).to eq("
|
337
|
-
expect(subject.title).to eq("
|
338
|
-
expect(subject.date_published).to eq("
|
339
|
-
expect(subject.publisher).to eq("
|
336
|
+
expect(subject.author).to eq("name"=>"Tester")
|
337
|
+
expect(subject.title).to eq("Test license")
|
338
|
+
expect(subject.date_published).to eq("2018-01-12")
|
339
|
+
expect(subject.publisher).to eq("CaltechDATA")
|
340
340
|
expect(subject.provider).to eq("DataCite")
|
341
341
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
342
|
-
expect(subject.state).to
|
342
|
+
expect(subject.state).to eq("inactive")
|
343
|
+
expect(subject.is_active).to be true
|
343
344
|
end
|
344
345
|
|
345
346
|
it "BlogPosting in test system" do
|
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: 0.9.
|
4
|
+
version: 0.9.70
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|