bolognese 0.8 → 0.8.1
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/bibtex.rb +1 -1
- data/lib/bolognese/codemeta.rb +1 -1
- data/lib/bolognese/crossref.rb +1 -1
- data/lib/bolognese/datacite.rb +32 -2
- data/lib/bolognese/datacite_json.rb +1 -1
- data/lib/bolognese/metadata.rb +9 -3
- data/lib/bolognese/schema_org.rb +19 -2
- data/lib/bolognese/version.rb +1 -1
- data/spec/bibtex_spec.rb +1 -0
- data/spec/codemeta_spec.rb +2 -0
- data/spec/datacite_json_spec.rb +3 -0
- data/spec/datacite_spec.rb +13 -4
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_IsSupplementTo.yml +171 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_isReferencedBy.yml +173 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ef0d823038f4256509d1215ce8fae2ca6d62f4
|
4
|
+
data.tar.gz: a4a9ad1a9530c9e4e96566c6e1c349205d2dd7e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347c241f0201e837225394d7bec559fa0675696edd725df6a635f5ddf4b6975fe5194fa2fc25c7ba97069272e4440e1660ea0d2a2eb0dbf312a4d3370a49d970
|
7
|
+
data.tar.gz: a7906e3128cc090e14017716a3534c444ff18a9f209083f9e1d64a833f27fb7d01720fe07a2895c87af65bb1656b94716fe6e55dbd596f5056d5c8027653aed4
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (0.8)
|
4
|
+
bolognese (0.8.1)
|
5
5
|
activesupport (~> 4.2, >= 4.2.5)
|
6
6
|
bibtex-ruby (~> 4.1)
|
7
7
|
builder (~> 3.2, >= 3.2.2)
|
@@ -123,4 +123,4 @@ DEPENDENCIES
|
|
123
123
|
webmock (~> 1.22, >= 1.22.3)
|
124
124
|
|
125
125
|
BUNDLED WITH
|
126
|
-
1.
|
126
|
+
1.14.5
|
data/lib/bolognese/bibtex.rb
CHANGED
data/lib/bolognese/codemeta.rb
CHANGED
data/lib/bolognese/crossref.rb
CHANGED
data/lib/bolognese/datacite.rb
CHANGED
@@ -31,11 +31,13 @@ module Bolognese
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def valid?
|
34
|
-
errors.blank?
|
34
|
+
datacite.present? && errors.blank?
|
35
35
|
end
|
36
36
|
|
37
37
|
def errors
|
38
38
|
schema.validate(Nokogiri::XML(raw)).map { |error| error.to_s }.unwrap
|
39
|
+
rescue Nokogiri::XML::SyntaxError => e
|
40
|
+
e.message
|
39
41
|
end
|
40
42
|
|
41
43
|
def schema_version
|
@@ -227,8 +229,36 @@ module Bolognese
|
|
227
229
|
related_identifier(relation_type: "IsNewVersionOf")
|
228
230
|
end
|
229
231
|
|
232
|
+
def is_variant_form_of
|
233
|
+
related_identifier(relation_type: "IsVariantFormOf")
|
234
|
+
end
|
235
|
+
|
236
|
+
def is_original_form_of
|
237
|
+
related_identifier(relation_type: "IsOriginalFormOf")
|
238
|
+
end
|
239
|
+
|
230
240
|
def references
|
231
|
-
related_identifier(relation_type: "
|
241
|
+
related_identifier(relation_type: "References Cites").presence
|
242
|
+
end
|
243
|
+
|
244
|
+
def is_referenced_by
|
245
|
+
related_identifier(relation_type: "IsCitedBy IsReferencedBy").presence
|
246
|
+
end
|
247
|
+
|
248
|
+
def is_supplement_to
|
249
|
+
related_identifier(relation_type: "IsSupplementTo")
|
250
|
+
end
|
251
|
+
|
252
|
+
def is_supplemented_by
|
253
|
+
get_related_identifier(relation_type: "isSupplementedBy")
|
254
|
+
end
|
255
|
+
|
256
|
+
def reviews
|
257
|
+
related_identifier(relation_type: "Reviews").presence
|
258
|
+
end
|
259
|
+
|
260
|
+
def is_reviewed_by
|
261
|
+
related_identifier(relation_type: "IsReviewedBy").presence
|
232
262
|
end
|
233
263
|
|
234
264
|
def publisher
|
data/lib/bolognese/metadata.rb
CHANGED
@@ -41,7 +41,7 @@ module Bolognese
|
|
41
41
|
:is_referenced_by, :references, :is_documented_by, :documents,
|
42
42
|
:is_compiled_by, :compiles, :is_variant_form_of, :is_original_form_of,
|
43
43
|
:is_reviewed_by, :reviews, :is_derived_from, :is_source_of, :format,
|
44
|
-
:related_identifier
|
44
|
+
:related_identifier, :reverse
|
45
45
|
|
46
46
|
def publication_year
|
47
47
|
date_published && date_published[0..3]
|
@@ -55,6 +55,11 @@ module Bolognese
|
|
55
55
|
[page_start, page_end].compact.join("-").presence
|
56
56
|
end
|
57
57
|
|
58
|
+
def reverse
|
59
|
+
{ "citation" => Array.wrap(is_referenced_by).map { |r| { "@id" => r["id"] }}.unwrap,
|
60
|
+
"isBasedOn" => Array.wrap(is_supplement_to).map { |r| { "@id" => r["id"] }}.unwrap }.compact
|
61
|
+
end
|
62
|
+
|
58
63
|
def schema_org
|
59
64
|
hsh = {
|
60
65
|
"@context" => id.present? ? "http://schema.org" : nil,
|
@@ -66,7 +71,7 @@ module Bolognese
|
|
66
71
|
"alternateName" => alternate_name,
|
67
72
|
"author" => to_schema_org(author),
|
68
73
|
"editor" => editor,
|
69
|
-
"description" => description.
|
74
|
+
"description" => Array.wrap(description).map { |d| d["text"] }.unwrap,
|
70
75
|
"license" => license.present? ? license["id"] : nil,
|
71
76
|
"version" => version,
|
72
77
|
"keywords" => keywords,
|
@@ -84,6 +89,7 @@ module Bolognese
|
|
84
89
|
"predecessor_of" => is_previous_version_of,
|
85
90
|
"successor_of" => is_new_version_of,
|
86
91
|
"citation" => references,
|
92
|
+
"@reverse" => reverse,
|
87
93
|
"schemaVersion" => schema_version,
|
88
94
|
"publisher" => { "@type" => "Organization", "name" => publisher },
|
89
95
|
"funder" => funder,
|
@@ -151,7 +157,7 @@ module Bolognese
|
|
151
157
|
|
152
158
|
def bibtex
|
153
159
|
bib = {
|
154
|
-
bibtex_type: bibtex_type.to_sym,
|
160
|
+
bibtex_type: bibtex_type.present? ? bibtex_type.to_sym : "misc",
|
155
161
|
bibtex_key: id,
|
156
162
|
doi: doi,
|
157
163
|
url: url,
|
data/lib/bolognese/schema_org.rb
CHANGED
@@ -31,7 +31,7 @@ module Bolognese
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def valid?
|
34
|
-
|
34
|
+
schema_org.present?
|
35
35
|
end
|
36
36
|
|
37
37
|
def doi
|
@@ -114,13 +114,18 @@ module Bolognese
|
|
114
114
|
Array.wrap(has_part) +
|
115
115
|
Array.wrap(is_previous_version_of) +
|
116
116
|
Array.wrap(is_new_version_of) +
|
117
|
-
Array.wrap(references)
|
117
|
+
Array.wrap(references) +
|
118
|
+
Array.wrap(is_supplemented_by)
|
118
119
|
end
|
119
120
|
|
120
121
|
def get_related_identifier(relation_type: nil)
|
121
122
|
normalize_ids(metadata.fetch(relation_type, nil), SO_TO_DC_RELATION_TYPES[relation_type])
|
122
123
|
end
|
123
124
|
|
125
|
+
def get_reverse_related_identifier(relation_type: nil)
|
126
|
+
normalize_ids(metadata.dig("@reverse", relation_type), SO_TO_DC_RELATION_TYPES[relation_type])
|
127
|
+
end
|
128
|
+
|
124
129
|
def is_identical_to
|
125
130
|
get_related_identifier(relation_type: "sameAs")
|
126
131
|
end
|
@@ -145,6 +150,18 @@ module Bolognese
|
|
145
150
|
get_related_identifier(relation_type: "citation")
|
146
151
|
end
|
147
152
|
|
153
|
+
def is_referenced_by
|
154
|
+
get_reverse_related_identifier(relation_type: "citation")
|
155
|
+
end
|
156
|
+
|
157
|
+
def is_supplement_to
|
158
|
+
get_reverse_related_identifier(relation_type: "isBasedOn")
|
159
|
+
end
|
160
|
+
|
161
|
+
def is_supplemented_by
|
162
|
+
get_related_identifier(relation_type: "isBasedOn")
|
163
|
+
end
|
164
|
+
|
148
165
|
def publisher
|
149
166
|
metadata.dig("publisher", "name")
|
150
167
|
end
|
data/lib/bolognese/version.rb
CHANGED
data/spec/bibtex_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe Bolognese::Bibtex, vcr: true do
|
|
7
7
|
|
8
8
|
context "get metadata" do
|
9
9
|
it "Crossref DOI" do
|
10
|
+
expect(subject.valid?).to be true
|
10
11
|
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
11
12
|
expect(subject.type).to eq("ScholarlyArticle")
|
12
13
|
expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
|
data/spec/codemeta_spec.rb
CHANGED
@@ -8,6 +8,7 @@ describe Bolognese::Codemeta, vcr: true do
|
|
8
8
|
|
9
9
|
context "get metadata" do
|
10
10
|
it "maremma" do
|
11
|
+
expect(subject.valid?).to be true
|
11
12
|
expect(subject.id).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
12
13
|
expect(subject.url).to eq("https://github.com/datacite/maremma")
|
13
14
|
expect(subject.type).to eq("SoftwareSourceCode")
|
@@ -76,6 +77,7 @@ describe Bolognese::Codemeta, vcr: true do
|
|
76
77
|
it "maremma" do
|
77
78
|
string = IO.read(fixture_path + 'maremma/codemeta.json')
|
78
79
|
subject = Bolognese::Codemeta.new(string: string)
|
80
|
+
expect(subject.valid?).to be true
|
79
81
|
expect(subject.id).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
80
82
|
expect(subject.url).to eq("https://github.com/datacite/maremma")
|
81
83
|
expect(subject.type).to eq("SoftwareSourceCode")
|
data/spec/datacite_json_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe Bolognese::DataciteJson, vcr: true do
|
|
7
7
|
|
8
8
|
context "get metadata as string" do
|
9
9
|
it "BlogPosting" do
|
10
|
+
expect(subject.valid?).to be true
|
10
11
|
expect(subject.id).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
11
12
|
expect(subject.type).to eq("ScholarlyArticle")
|
12
13
|
expect(subject.additional_type).to eq("BlogPosting")
|
@@ -25,6 +26,7 @@ describe Bolognese::DataciteJson, vcr: true do
|
|
25
26
|
it "SoftwareSourceCode" do
|
26
27
|
string = IO.read(fixture_path + "datacite_software.json")
|
27
28
|
subject = Bolognese::DataciteJson.new(string: string)
|
29
|
+
expect(subject.valid?).to be true
|
28
30
|
json = JSON.parse(subject.codemeta)
|
29
31
|
expect(json["@context"]).to eq("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
30
32
|
expect(json["@id"]).to eq("https://doi.org/10.5063/f1m61h5x")
|
@@ -52,6 +54,7 @@ describe Bolognese::DataciteJson, vcr: true do
|
|
52
54
|
it "BlogPosting" do
|
53
55
|
id = "https://doi.org/10.5438/4K3M-NYVG"
|
54
56
|
subject = Bolognese::Datacite.new(id: id)
|
57
|
+
expect(subject.valid?).to be true
|
55
58
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
56
59
|
expect(bibtex[:bibtex_type].to_s).to eq("article")
|
57
60
|
expect(bibtex[:bibtex_key]).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
data/spec/datacite_spec.rb
CHANGED
@@ -19,7 +19,7 @@ describe Bolognese::Datacite, vcr: true do
|
|
19
19
|
expect(subject.license).to eq("url"=>"http://creativecommons.org/publicdomain/zero/1.0/")
|
20
20
|
expect(subject.date_published).to eq("2011")
|
21
21
|
expect(subject.has_part).to eq([{"id"=>"https://doi.org/10.5061/dryad.8515/1", "relationType"=>"HasPart"}, {"id"=>"https://doi.org/10.5061/dryad.8515/2", "relationType"=>"HasPart"}])
|
22
|
-
expect(subject.
|
22
|
+
expect(subject.is_referenced_by).to eq("id"=>"https://doi.org/10.1371/journal.ppat.1000446", "relationType"=>"IsReferencedBy")
|
23
23
|
expect(subject.publisher).to eq("Dryad Digital Repository")
|
24
24
|
expect(subject.provider).to eq("DataCite")
|
25
25
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
|
@@ -76,7 +76,7 @@ describe Bolognese::Datacite, vcr: true do
|
|
76
76
|
expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
|
77
77
|
expect(subject.license).to eq([{"url"=>"info:eu-repo/semantics/openAccess", "name"=>"Open Access"}, {"url"=>"https://creativecommons.org/licenses/by-nc-sa/4.0/", "name"=>"Creative Commons Attribution-NonCommercial-ShareAlike"}])
|
78
78
|
expect(subject.date_published).to eq("2016-03-27")
|
79
|
-
expect(subject.
|
79
|
+
expect(subject.is_supplement_to).to eq("id"=>"https://github.com/kjgarza/frame_experiment_analysis/tree/v1.0", "relationType"=>"IsSupplementTo")
|
80
80
|
expect(subject.publisher).to eq("Zenodo")
|
81
81
|
expect(subject.provider).to eq("DataCite")
|
82
82
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
|
@@ -146,9 +146,18 @@ describe Bolognese::Datacite, vcr: true do
|
|
146
146
|
"funderName" => "European Commission")
|
147
147
|
end
|
148
148
|
|
149
|
-
it "Schema.org JSON" do
|
149
|
+
it "Schema.org JSON isReferencedBy" do
|
150
150
|
json = JSON.parse(subject.schema_org)
|
151
151
|
expect(json["@id"]).to eq("https://doi.org/10.5061/dryad.8515")
|
152
|
+
expect(json["@reverse"]).to eq("citation"=>{"@id"=>"https://doi.org/10.1371/journal.ppat.1000446"})
|
153
|
+
end
|
154
|
+
|
155
|
+
it "Schema.org JSON IsSupplementTo" do
|
156
|
+
id = "https://doi.org/10.5517/CC8H01S"
|
157
|
+
subject = Bolognese::Datacite.new(id: id)
|
158
|
+
json = JSON.parse(subject.schema_org)
|
159
|
+
expect(json["@id"]).to eq("https://doi.org/10.5517/cc8h01s")
|
160
|
+
expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1107/s1600536804021154"})
|
152
161
|
end
|
153
162
|
end
|
154
163
|
|
@@ -196,7 +205,7 @@ describe Bolognese::Datacite, vcr: true do
|
|
196
205
|
expect(subject.date_published).to eq("2011")
|
197
206
|
expect(subject.has_part).to eq([{"id"=>"https://doi.org/10.5061/dryad.8515/1", "relationType"=>"HasPart"},
|
198
207
|
{"id"=>"https://doi.org/10.5061/dryad.8515/2", "relationType"=>"HasPart"}])
|
199
|
-
expect(subject.
|
208
|
+
expect(subject.is_referenced_by).to eq("id"=>"https://doi.org/10.1371/journal.ppat.1000446", "relationType"=>"IsReferencedBy")
|
200
209
|
expect(subject.publisher).to eq("Dryad Digital Repository")
|
201
210
|
expect(subject.provider).to eq("DataCite")
|
202
211
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
|
data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_IsSupplementTo.yml
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/10.5517/cc8h01s
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- application/vnd.datacite.datacite+xml
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 303
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
Vary:
|
22
|
+
- Accept
|
23
|
+
Location:
|
24
|
+
- http://data.datacite.org/10.5517%2Fcc8h01s
|
25
|
+
Expires:
|
26
|
+
- Wed, 01 Mar 2017 22:34:28 GMT
|
27
|
+
Content-Type:
|
28
|
+
- text/html;charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '169'
|
31
|
+
Date:
|
32
|
+
- Wed, 01 Mar 2017 22:24:34 GMT
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
<html><head><title>Handle Redirect</title></head>
|
37
|
+
<body><a href="http://data.datacite.org/10.5517%2Fcc8h01s">http://data.datacite.org/10.5517%2Fcc8h01s</a></body></html>
|
38
|
+
http_version:
|
39
|
+
recorded_at: Wed, 01 Mar 2017 22:24:35 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://data.datacite.org/10.5517%2Fcc8h01s
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- Maremma - https://github.com/datacite/maremma
|
49
|
+
Accept:
|
50
|
+
- application/vnd.datacite.datacite+xml
|
51
|
+
response:
|
52
|
+
status:
|
53
|
+
code: 301
|
54
|
+
message: ''
|
55
|
+
headers:
|
56
|
+
Server:
|
57
|
+
- openresty/1.11.2.2
|
58
|
+
Date:
|
59
|
+
- Wed, 01 Mar 2017 22:24:35 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/html
|
62
|
+
Content-Length:
|
63
|
+
- '191'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Location:
|
67
|
+
- https://data.datacite.org/10.5517%2Fcc8h01s
|
68
|
+
body:
|
69
|
+
encoding: UTF-8
|
70
|
+
string: "<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body
|
71
|
+
bgcolor=\"white\">\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>openresty/1.11.2.2</center>\r\n</body>\r\n</html>\r\n"
|
72
|
+
http_version:
|
73
|
+
recorded_at: Wed, 01 Mar 2017 22:24:35 GMT
|
74
|
+
- request:
|
75
|
+
method: get
|
76
|
+
uri: https://data.datacite.org/10.5517%2Fcc8h01s
|
77
|
+
body:
|
78
|
+
encoding: US-ASCII
|
79
|
+
string: ''
|
80
|
+
headers:
|
81
|
+
User-Agent:
|
82
|
+
- Maremma - https://github.com/datacite/maremma
|
83
|
+
Accept:
|
84
|
+
- application/vnd.datacite.datacite+xml
|
85
|
+
response:
|
86
|
+
status:
|
87
|
+
code: 200
|
88
|
+
message: ''
|
89
|
+
headers:
|
90
|
+
Server:
|
91
|
+
- openresty/1.11.2.2
|
92
|
+
Date:
|
93
|
+
- Wed, 01 Mar 2017 22:24:35 GMT
|
94
|
+
Content-Type:
|
95
|
+
- application/vnd.datacite.datacite+xml
|
96
|
+
Content-Length:
|
97
|
+
- '2496'
|
98
|
+
Connection:
|
99
|
+
- keep-alive
|
100
|
+
Cache-Control:
|
101
|
+
- no-transform, max-age=3600
|
102
|
+
Last-Modified:
|
103
|
+
- Sun, 01 May 2016 13:41:38 GMT
|
104
|
+
Vary:
|
105
|
+
- Accept
|
106
|
+
Access-Control-Allow-Origin:
|
107
|
+
- "*"
|
108
|
+
Access-Control-Allow-Methods:
|
109
|
+
- GET, POST, OPTIONS
|
110
|
+
body:
|
111
|
+
encoding: ASCII-8BIT
|
112
|
+
string: !binary |-
|
113
|
+
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxyZXNv
|
114
|
+
dXJjZSB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2No
|
115
|
+
ZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2No
|
116
|
+
ZW1hLWluc3RhbmNlIiB4c2k6c2NoZW1hTG9jYXRpb249Imh0dHA6Ly9kYXRh
|
117
|
+
Y2l0ZS5vcmcvc2NoZW1hL2tlcm5lbC0zIGh0dHA6Ly9zY2hlbWEuZGF0YWNp
|
118
|
+
dGUub3JnL21ldGEva2VybmVsLTMvbWV0YWRhdGEueHNkIiB4bWxucz0iaHR0
|
119
|
+
cDovL2RhdGFjaXRlLm9yZy9zY2hlbWEva2VybmVsLTMiPg0KICA8aWRlbnRp
|
120
|
+
ZmllciBpZGVudGlmaWVyVHlwZT0iRE9JIj4xMC41NTE3L2NjOGgwMXM8L2lk
|
121
|
+
ZW50aWZpZXI+DQogIDxjcmVhdG9ycz4NCiAgICA8Y3JlYXRvc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dXJlcy48L2Rlc2NyaXB0aW9uPg0KICA8L2Rlc2Ny
|
168
|
+
aXB0aW9ucz4NCjwvcmVzb3VyY2U+
|
169
|
+
http_version:
|
170
|
+
recorded_at: Wed, 01 Mar 2017 22:24:35 GMT
|
171
|
+
recorded_with: VCR 3.0.3
|
data/spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_isReferencedBy.yml
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/10.5061/dryad.8515
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- application/vnd.datacite.datacite+xml
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 303
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
Vary:
|
22
|
+
- Accept
|
23
|
+
Location:
|
24
|
+
- http://data.datacite.org/10.5061%2Fdryad.8515
|
25
|
+
Expires:
|
26
|
+
- Wed, 01 Mar 2017 22:34:28 GMT
|
27
|
+
Content-Type:
|
28
|
+
- text/html;charset=utf-8
|
29
|
+
Content-Length:
|
30
|
+
- '175'
|
31
|
+
Date:
|
32
|
+
- Wed, 01 Mar 2017 22:24:43 GMT
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
<html><head><title>Handle Redirect</title></head>
|
37
|
+
<body><a href="http://data.datacite.org/10.5061%2Fdryad.8515">http://data.datacite.org/10.5061%2Fdryad.8515</a></body></html>
|
38
|
+
http_version:
|
39
|
+
recorded_at: Wed, 01 Mar 2017 22:24:44 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://data.datacite.org/10.5061%2Fdryad.8515
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
User-Agent:
|
48
|
+
- Maremma - https://github.com/datacite/maremma
|
49
|
+
Accept:
|
50
|
+
- application/vnd.datacite.datacite+xml
|
51
|
+
response:
|
52
|
+
status:
|
53
|
+
code: 301
|
54
|
+
message: ''
|
55
|
+
headers:
|
56
|
+
Server:
|
57
|
+
- openresty/1.11.2.2
|
58
|
+
Date:
|
59
|
+
- Wed, 01 Mar 2017 22:24:44 GMT
|
60
|
+
Content-Type:
|
61
|
+
- text/html
|
62
|
+
Content-Length:
|
63
|
+
- '191'
|
64
|
+
Connection:
|
65
|
+
- keep-alive
|
66
|
+
Location:
|
67
|
+
- https://data.datacite.org/10.5061%2Fdryad.8515
|
68
|
+
body:
|
69
|
+
encoding: UTF-8
|
70
|
+
string: "<html>\r\n<head><title>301 Moved Permanently</title></head>\r\n<body
|
71
|
+
bgcolor=\"white\">\r\n<center><h1>301 Moved Permanently</h1></center>\r\n<hr><center>openresty/1.11.2.2</center>\r\n</body>\r\n</html>\r\n"
|
72
|
+
http_version:
|
73
|
+
recorded_at: Wed, 01 Mar 2017 22:24:44 GMT
|
74
|
+
- request:
|
75
|
+
method: get
|
76
|
+
uri: https://data.datacite.org/10.5061%2Fdryad.8515
|
77
|
+
body:
|
78
|
+
encoding: US-ASCII
|
79
|
+
string: ''
|
80
|
+
headers:
|
81
|
+
User-Agent:
|
82
|
+
- Maremma - https://github.com/datacite/maremma
|
83
|
+
Accept:
|
84
|
+
- application/vnd.datacite.datacite+xml
|
85
|
+
response:
|
86
|
+
status:
|
87
|
+
code: 200
|
88
|
+
message: ''
|
89
|
+
headers:
|
90
|
+
Server:
|
91
|
+
- openresty/1.11.2.2
|
92
|
+
Date:
|
93
|
+
- Wed, 01 Mar 2017 22:24:44 GMT
|
94
|
+
Content-Type:
|
95
|
+
- application/vnd.datacite.datacite+xml
|
96
|
+
Content-Length:
|
97
|
+
- '2601'
|
98
|
+
Connection:
|
99
|
+
- keep-alive
|
100
|
+
Cache-Control:
|
101
|
+
- no-transform, max-age=3600
|
102
|
+
Last-Modified:
|
103
|
+
- Sat, 04 Feb 2017 17:54:37 GMT
|
104
|
+
Vary:
|
105
|
+
- Accept
|
106
|
+
Access-Control-Allow-Origin:
|
107
|
+
- "*"
|
108
|
+
Access-Control-Allow-Methods:
|
109
|
+
- GET, POST, OPTIONS
|
110
|
+
body:
|
111
|
+
encoding: ASCII-8BIT
|
112
|
+
string: !binary |-
|
113
|
+
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHJlc291
|
114
|
+
cmNlIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwt
|
115
|
+
MyIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVt
|
116
|
+
YS1pbnN0YW5jZSIgeG1sbnM6bWV0cz0iaHR0cDovL3d3dy5sb2MuZ292L01F
|
117
|
+
VFMvIiB4bWxuczpkc3BhY2U9Imh0dHA6Ly93d3cuZHNwYWNlLm9yZy94bWxu
|
118
|
+
cy9kc3BhY2UvZGltIiB4bWxuczpkaW09Imh0dHA6Ly93d3cuZHNwYWNlLm9y
|
119
|
+
Zy94bWxucy9kc3BhY2UvZGltIiB4bWxuczpkcnlhZD0iaHR0cDovL3B1cmwu
|
120
|
+
b3JnL2RyeWFkL3Rlcm1zLyIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8v
|
121
|
+
ZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtMyBodHRwOi8vc2NoZW1hLmRh
|
122
|
+
dGFjaXRlLm9yZy9tZXRhL2tlcm5lbC0zL21ldGFkYXRhLnhzZCI+ICA8aWRl
|
123
|
+
bnRpZmllciBpZGVudGlmaWVyVHlwZT0iRE9JIj4xMC41MDYxL0RSWUFELjg1
|
124
|
+
MTU8L2lkZW50aWZp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4wLyIvPiAgPC9yaWdodHNMaXN0PjwvcmVzb3VyY2U+
|
171
|
+
http_version:
|
172
|
+
recorded_at: Wed, 01 Mar 2017 22:24:44 GMT
|
173
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
@@ -529,6 +529,8 @@ files:
|
|
529
529
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Funding_schema_version_3.yml
|
530
530
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Funding_schema_version_4.yml
|
531
531
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON.yml
|
532
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_IsSupplementTo.yml
|
533
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/Schema_org_JSON_isReferencedBy.yml
|
532
534
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/is_identical_to.yml
|
533
535
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata/multiple_licenses.yml
|
534
536
|
- spec/fixtures/vcr_cassettes/Bolognese_Datacite/get_metadata_as_bibtex/BlogPosting.yml
|