bolognese 1.2.11 → 1.2.14
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/readers/crossref_reader.rb +24 -13
- data/lib/bolognese/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +127 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml +109 -0
- data/spec/readers/crossref_reader_spec.rb +34 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b161e85e32a6b26d50c1aa4be3cbe672a29b7a873223ff1327da0e4cd71c0574
|
4
|
+
data.tar.gz: a69885385e246fc479d1c5ac803b70aa3c1b5a674bbaa8257af049e45f55ad4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8eba6e85d0a04522531abc25769f19144fdbfd62c61233c30cd9ff2e71da3ae3b9d41a97e529c81bcec3984ebb7868b9a56ea90ff0fb6d5b6118d94edf28caf
|
7
|
+
data.tar.gz: 5416771fec0658fed4f8222935f0dd98840e512f50a89e375736094c03282deff66320aefdf15a436743e3ada15263c16ddbfb54c1a7d00abd8261669d84b79c
|
data/Gemfile.lock
CHANGED
@@ -58,7 +58,7 @@ module Bolognese
|
|
58
58
|
bibliographic_metadata = meta.dig("crossref", "journal", "journal_article").to_h
|
59
59
|
program_metadata = bibliographic_metadata.dig("crossmark", "custom_metadata", "program") || bibliographic_metadata.dig("program")
|
60
60
|
journal_issue = meta.dig("crossref", "journal", "journal_issue") || {}
|
61
|
-
journal_article = meta.dig("crossref", "journal", "journal_article") ||
|
61
|
+
journal_article = meta.dig("crossref", "journal", "journal_article") || {}
|
62
62
|
|
63
63
|
resource_type = if journal_article.present?
|
64
64
|
"journal_article"
|
@@ -72,6 +72,8 @@ module Bolognese
|
|
72
72
|
publisher = bibliographic_metadata.dig("institution", "institution_name")
|
73
73
|
when "sa_component"
|
74
74
|
bibliographic_metadata = meta.dig("crossref", "sa_component", "component_list", "component").to_h
|
75
|
+
related_identifier = Array.wrap(query.to_h["crm_item"]).find { |cr| cr["name"] == "relation" }
|
76
|
+
journal_metadata = { "relatedIdentifier" => related_identifier.to_h.fetch("__content", nil) }
|
75
77
|
when "database"
|
76
78
|
bibliographic_metadata = meta.dig("crossref", "database", "dataset").to_h
|
77
79
|
resource_type = "dataset"
|
@@ -88,15 +90,19 @@ module Bolognese
|
|
88
90
|
"ris" => Bolognese::Utils::CR_TO_RIS_TRANSLATIONS[resource_type] || "JOUR"
|
89
91
|
}.compact
|
90
92
|
|
91
|
-
titles =
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
93
|
+
titles = if bibliographic_metadata.dig("titles").present?
|
94
|
+
Array.wrap(bibliographic_metadata.dig("titles")).map do |r|
|
95
|
+
if r.blank? || r["title"].blank?
|
96
|
+
nil
|
97
|
+
elsif r["title"].is_a?(String)
|
98
|
+
{ "title" => sanitize(r["title"]) }
|
99
|
+
else
|
100
|
+
{ "title" => sanitize(r.dig("title", "__content__")) }.compact
|
101
|
+
end
|
102
|
+
end.compact
|
103
|
+
else
|
104
|
+
[{ "title" => ":{unav)" }]
|
105
|
+
end
|
100
106
|
|
101
107
|
date_created = Array.wrap(query.to_h["crm_item"]).find { |cr| cr["name"] == "created" }
|
102
108
|
date_updated = Array.wrap(query.to_h["crm_item"]).find { |cr| cr["name"] == "last-update" }
|
@@ -188,7 +194,9 @@ module Bolognese
|
|
188
194
|
end
|
189
195
|
|
190
196
|
def crossref_people(bibliographic_metadata, contributor_role)
|
191
|
-
person = bibliographic_metadata.dig("contributors", "person_name")
|
197
|
+
person = bibliographic_metadata.dig("contributors", "person_name")
|
198
|
+
person = [{ "name" => ":(unav)", "contributor_role"=>"author" }] if contributor_role == "author" && Array.wrap(person).select { |a| a["contributor_role"] == "author" }.blank?
|
199
|
+
|
192
200
|
Array.wrap(person).select { |a| a["contributor_role"] == contributor_role }.map do |a|
|
193
201
|
name_identifiers = normalize_orcid(parse_attributes(a["ORCID"])).present? ? [{ "nameIdentifier" => normalize_orcid(parse_attributes(a["ORCID"])), "nameIdentifierScheme" => "ORCID", "schemeUri"=>"https://orcid.org" }] : nil
|
194
202
|
if a["surname"].present? || a["given_name"].present? || name_identifiers.present?
|
@@ -200,8 +208,7 @@ module Bolognese
|
|
200
208
|
"contributorType" => contributor_role == "editor" ? "Editor" : nil }.compact
|
201
209
|
else
|
202
210
|
{ "nameType" => "Organizational",
|
203
|
-
"name" => a["name"]
|
204
|
-
"contributorType" => a["contributor_role"] }
|
211
|
+
"name" => a["name"] }
|
205
212
|
end
|
206
213
|
end.unwrap
|
207
214
|
end
|
@@ -239,6 +246,10 @@ module Bolognese
|
|
239
246
|
"relationType" => "IsPartOf",
|
240
247
|
"relatedIdentifierType" => "ISSN",
|
241
248
|
"resourceTypeGeneral" => "Collection" }.compact
|
249
|
+
elsif model_metadata.present? && model_metadata.fetch("relatedIdentifier", nil).present?
|
250
|
+
{ "relatedIdentifier" => model_metadata.fetch("relatedIdentifier", nil),
|
251
|
+
"relationType" => "IsPartOf",
|
252
|
+
"relatedIdentifierType" => "DOI" }.compact
|
242
253
|
else
|
243
254
|
nil
|
244
255
|
end
|
data/lib/bolognese/utils.rb
CHANGED
@@ -731,7 +731,7 @@ module Bolognese
|
|
731
731
|
a["family"] = a["familyName"]
|
732
732
|
a["given"] = a["givenName"]
|
733
733
|
a["literal"] = a["name"] unless a["familyName"].present?
|
734
|
-
a.except("nameType", "type", "@type", "id", "@id", "name", "familyName", "givenName", "affiliation", "nameIdentifiers").compact
|
734
|
+
a.except("nameType", "type", "@type", "id", "@id", "name", "familyName", "givenName", "affiliation", "nameIdentifiers", "contributorType").compact
|
735
735
|
end.presence
|
736
736
|
end
|
737
737
|
|
data/lib/bolognese/version.rb
CHANGED
@@ -0,0 +1,127 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/ra/10.2973
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.2.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
|
+
- Sat, 06 Jul 2019 21:18:45 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json;charset=UTF-8
|
23
|
+
Content-Length:
|
24
|
+
- '54'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Set-Cookie:
|
28
|
+
- __cfduid=df823d1fb8af7a5e1ef6d4405081ea4aa1562447925; expires=Sun, 05-Jul-20
|
29
|
+
21:18:45 GMT; path=/; domain=.doi.org; HttpOnly
|
30
|
+
Expect-Ct:
|
31
|
+
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
32
|
+
Server:
|
33
|
+
- cloudflare
|
34
|
+
Cf-Ray:
|
35
|
+
- 4f249cf00e06bec4-FRA
|
36
|
+
body:
|
37
|
+
encoding: ASCII-8BIT
|
38
|
+
string: |-
|
39
|
+
[
|
40
|
+
{
|
41
|
+
"DOI": "10.2973",
|
42
|
+
"RA": "Crossref"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
http_version:
|
46
|
+
recorded_at: Sat, 06 Jul 2019 21:18:45 GMT
|
47
|
+
- request:
|
48
|
+
method: get
|
49
|
+
uri: https://api.crossref.org/works/10.2973/odp.proc.ir.180.2000/transform/application/vnd.crossref.unixsd+xml
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
User-Agent:
|
55
|
+
- Mozilla/5.0 (compatible; Maremma/4.2.6; mailto:info@datacite.org)
|
56
|
+
Accept:
|
57
|
+
- text/xml
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 200
|
61
|
+
message: OK
|
62
|
+
headers:
|
63
|
+
Link:
|
64
|
+
- <http://dx.doi.org/10.2973/odp.proc.ir.180.2000>; rel="canonical"
|
65
|
+
Access-Control-Allow-Origin:
|
66
|
+
- "*"
|
67
|
+
Access-Control-Allow-Headers:
|
68
|
+
- X-Requested-With
|
69
|
+
Content-Length:
|
70
|
+
- '3538'
|
71
|
+
Server:
|
72
|
+
- http-kit
|
73
|
+
Date:
|
74
|
+
- Sat, 06 Jul 2019 21:18:46 GMT
|
75
|
+
X-Rate-Limit-Limit:
|
76
|
+
- '50'
|
77
|
+
X-Rate-Limit-Interval:
|
78
|
+
- 1s
|
79
|
+
Connection:
|
80
|
+
- close
|
81
|
+
body:
|
82
|
+
encoding: ASCII-8BIT
|
83
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<crossref_result xmlns=\"http://www.crossref.org/qrschema/3.0\"
|
84
|
+
version=\"3.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.crossref.org/qrschema/3.0
|
85
|
+
http://www.crossref.org/schemas/crossref_query_output3.0.xsd\">\r\n <query_result>\r\n
|
86
|
+
\ <head>\r\n <doi_batch_id>none</doi_batch_id>\r\n </head>\r\n <body>\r\n
|
87
|
+
\ <query status=\"resolved\">\r\n <doi type=\"book_title\">10.2973/odp.proc.ir.180.2000</doi>\r\n
|
88
|
+
\ <crm-item name=\"publisher-name\" type=\"string\">International Ocean
|
89
|
+
Discovery Program (IODP)</crm-item>\r\n <crm-item name=\"prefix-name\"
|
90
|
+
type=\"string\">International Ocean Discovery Program Texas</crm-item>\r\n
|
91
|
+
\ <crm-item name=\"member-id\" type=\"number\">1029</crm-item>\r\n <crm-item
|
92
|
+
name=\"citation-id\" type=\"number\">23807285</crm-item>\r\n <crm-item
|
93
|
+
name=\"book-id\" type=\"number\">284099</crm-item>\r\n <crm-item name=\"series-id\"
|
94
|
+
type=\"number\">283327</crm-item>\r\n <crm-item name=\"deposit-timestamp\"
|
95
|
+
type=\"number\">20061017201744</crm-item>\r\n <crm-item name=\"owner-prefix\"
|
96
|
+
type=\"string\">10.2973</crm-item>\r\n <crm-item name=\"last-update\"
|
97
|
+
type=\"date\">2009-02-02T21:19:43Z</crm-item>\r\n <crm-item name=\"created\"
|
98
|
+
type=\"date\">2006-10-17T19:50:37Z</crm-item>\r\n <crm-item name=\"citedby-count\"
|
99
|
+
type=\"number\">15</crm-item>\r\n <doi_record>\r\n <crossref
|
100
|
+
xmlns=\"http://www.crossref.org/xschema/1.0\" xsi:schemaLocation=\"http://www.crossref.org/xschema/1.0
|
101
|
+
http://doi.crossref.org/schemas/unixref1.0.xsd\">\r\n <book book_type=\"monograph\">\r\n
|
102
|
+
\ <book_metadata language=\"en\">\r\n <contributors>\r\n
|
103
|
+
\ <person_name sequence=\"first\" contributor_role=\"editor\">\r\n
|
104
|
+
\ <given_name>B.</given_name>\r\n <surname>Taylor</surname>\r\n
|
105
|
+
\ </person_name>\r\n <person_name sequence=\"additional\"
|
106
|
+
contributor_role=\"editor\">\r\n <given_name>P.</given_name>\r\n
|
107
|
+
\ <surname>Huchon</surname>\r\n </person_name>\r\n
|
108
|
+
\ <person_name sequence=\"additional\" contributor_role=\"editor\">\r\n
|
109
|
+
\ <given_name>A.</given_name>\r\n <surname>Klaus</surname>\r\n
|
110
|
+
\ </person_name>\r\n <organization sequence=\"additional\"
|
111
|
+
contributor_role=\"editor\">et al.</organization>\r\n </contributors>\r\n
|
112
|
+
\ <titles>\r\n <title>Proceedings of the Ocean
|
113
|
+
Drilling Program, 180 Initial Reports</title>\r\n </titles>\r\n
|
114
|
+
\ <series_metadata>\r\n <titles>\r\n <title>Proceedings
|
115
|
+
of the Ocean Drilling Program</title>\r\n </titles>\r\n </series_metadata>\r\n
|
116
|
+
\ <volume>180</volume>\r\n <publication_date
|
117
|
+
media_type=\"online\">\r\n <month>02</month>\r\n <day>04</day>\r\n
|
118
|
+
\ <year>2000</year>\r\n </publication_date>\r\n
|
119
|
+
\ <publisher>\r\n <publisher_name>Ocean Drilling
|
120
|
+
Program</publisher_name>\r\n </publisher>\r\n <doi_data>\r\n
|
121
|
+
\ <doi>10.2973/odp.proc.ir.180.2000</doi>\r\n <resource>http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM</resource>\r\n
|
122
|
+
\ </doi_data>\r\n </book_metadata>\r\n </book>\r\n
|
123
|
+
\ </crossref>\r\n </doi_record>\r\n </query>\r\n </body>\r\n
|
124
|
+
\ </query_result>\r\n</crossref_result>"
|
125
|
+
http_version:
|
126
|
+
recorded_at: Sat, 06 Jul 2019 21:18:46 GMT
|
127
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,109 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/ra/10.1371
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.2.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
|
+
- Sat, 06 Jul 2019 20:25:35 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json;charset=UTF-8
|
23
|
+
Content-Length:
|
24
|
+
- '54'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Set-Cookie:
|
28
|
+
- __cfduid=df3786b4d8fefbec93863a09be6075b1f1562444735; expires=Sun, 05-Jul-20
|
29
|
+
20:25:35 GMT; path=/; domain=.doi.org; HttpOnly
|
30
|
+
Expect-Ct:
|
31
|
+
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
32
|
+
Server:
|
33
|
+
- cloudflare
|
34
|
+
Cf-Ray:
|
35
|
+
- 4f244f0a1b1ad711-FRA
|
36
|
+
body:
|
37
|
+
encoding: ASCII-8BIT
|
38
|
+
string: |-
|
39
|
+
[
|
40
|
+
{
|
41
|
+
"DOI": "10.1371",
|
42
|
+
"RA": "Crossref"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
http_version:
|
46
|
+
recorded_at: Sat, 06 Jul 2019 20:25:35 GMT
|
47
|
+
- request:
|
48
|
+
method: get
|
49
|
+
uri: https://api.crossref.org/works/10.1371/journal.pmed.0030277.g001/transform/application/vnd.crossref.unixsd+xml
|
50
|
+
body:
|
51
|
+
encoding: US-ASCII
|
52
|
+
string: ''
|
53
|
+
headers:
|
54
|
+
User-Agent:
|
55
|
+
- Mozilla/5.0 (compatible; Maremma/4.2.6; mailto:info@datacite.org)
|
56
|
+
Accept:
|
57
|
+
- text/xml
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 200
|
61
|
+
message: OK
|
62
|
+
headers:
|
63
|
+
Link:
|
64
|
+
- <http://dx.doi.org/10.1371/journal.pmed.0030277.g001>; rel="canonical"
|
65
|
+
Access-Control-Allow-Origin:
|
66
|
+
- "*"
|
67
|
+
Access-Control-Allow-Headers:
|
68
|
+
- X-Requested-With
|
69
|
+
Content-Length:
|
70
|
+
- '2142'
|
71
|
+
Server:
|
72
|
+
- http-kit
|
73
|
+
Date:
|
74
|
+
- Sat, 06 Jul 2019 20:25:35 GMT
|
75
|
+
X-Rate-Limit-Limit:
|
76
|
+
- '50'
|
77
|
+
X-Rate-Limit-Interval:
|
78
|
+
- 1s
|
79
|
+
Connection:
|
80
|
+
- close
|
81
|
+
body:
|
82
|
+
encoding: ASCII-8BIT
|
83
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<crossref_result xmlns=\"http://www.crossref.org/qrschema/3.0\"
|
84
|
+
version=\"3.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.crossref.org/qrschema/3.0
|
85
|
+
http://www.crossref.org/schemas/crossref_query_output3.0.xsd\">\r\n <query_result>\r\n
|
86
|
+
\ <head>\r\n <doi_batch_id>none</doi_batch_id>\r\n </head>\r\n <body>\r\n
|
87
|
+
\ <query status=\"resolved\">\r\n <doi type=\"component\">10.1371/journal.pmed.0030277.g001</doi>\r\n
|
88
|
+
\ <crm-item name=\"publisher-name\" type=\"string\">Public Library of
|
89
|
+
Science (PLoS)</crm-item>\r\n <crm-item name=\"prefix-name\" type=\"string\">Public
|
90
|
+
Library of Science</crm-item>\r\n <crm-item name=\"member-id\" type=\"number\">340</crm-item>\r\n
|
91
|
+
\ <crm-item name=\"citation-id\" type=\"number\">78426024</crm-item>\r\n
|
92
|
+
\ <crm-item name=\"journal-id\" type=\"number\">31937</crm-item>\r\n
|
93
|
+
\ <crm-item name=\"deposit-timestamp\" type=\"number\">201510161053338750</crm-item>\r\n
|
94
|
+
\ <crm-item name=\"owner-prefix\" type=\"string\">10.1371</crm-item>\r\n
|
95
|
+
\ <crm-item name=\"last-update\" type=\"date\">2018-10-19T21:13:42Z</crm-item>\r\n
|
96
|
+
\ <crm-item name=\"created\" type=\"date\">2015-10-20T20:01:19Z</crm-item>\r\n
|
97
|
+
\ <crm-item name=\"citedby-count\" type=\"number\">0</crm-item>\r\n
|
98
|
+
\ <crm-item name=\"relation\" type=\"doi\" claim=\"hasComponent\">10.1371/journal.pmed.0030277</crm-item>\r\n
|
99
|
+
\ <doi_record>\r\n <crossref xmlns=\"http://www.crossref.org/xschema/1.1\"
|
100
|
+
xsi:schemaLocation=\"http://www.crossref.org/xschema/1.1 http://doi.crossref.org/schemas/unixref1.1.xsd\">\r\n
|
101
|
+
\ <sa_component>\r\n <component_list>\r\n <component
|
102
|
+
reg-agency=\"CrossRef\">\r\n <description />\r\n <doi_data>\r\n
|
103
|
+
\ <doi>10.1371/journal.pmed.0030277.g001</doi>\r\n <resource>https://dx.plos.org/10.1371/journal.pmed.0030277.g001</resource>\r\n
|
104
|
+
\ </doi_data>\r\n </component>\r\n </component_list>\r\n
|
105
|
+
\ </sa_component>\r\n </crossref>\r\n </doi_record>\r\n
|
106
|
+
\ </query>\r\n </body>\r\n </query_result>\r\n</crossref_result>"
|
107
|
+
http_version:
|
108
|
+
recorded_at: Sat, 06 Jul 2019 20:25:35 GMT
|
109
|
+
recorded_with: VCR 3.0.3
|
@@ -179,6 +179,22 @@ describe Bolognese::Metadata, vcr: true do
|
|
179
179
|
expect(subject.agency).to eq("Crossref")
|
180
180
|
end
|
181
181
|
|
182
|
+
it "component" do
|
183
|
+
input = "10.1371/journal.pmed.0030277.g001"
|
184
|
+
subject = Bolognese::Metadata.new(input: input)
|
185
|
+
expect(subject.valid?).to be true
|
186
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.1371/journal.pmed.0030277.g001", "identifierType"=>"DOI"}])
|
187
|
+
expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pmed.0030277.g001")
|
188
|
+
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resourceType"=>"SaComponent", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
189
|
+
expect(subject.creators).to eq("name"=>":(unav)", "nameType"=>"Organizational")
|
190
|
+
expect(subject.titles).to eq([{"title"=>":{unav)"}])
|
191
|
+
expect(subject.descriptions).to be_empty
|
192
|
+
expect(subject.dates).to eq([{"date"=>"2015-10-20", "dateType"=>"Issued"}, {"date"=>"2018-10-19T21:13:42Z", "dateType"=>"Updated"}])
|
193
|
+
expect(subject.publication_year).to eq("2015")
|
194
|
+
expect(subject.publisher).to eq("Public Library of Science (PLoS)")
|
195
|
+
expect(subject.agency).to eq("Crossref")
|
196
|
+
end
|
197
|
+
|
182
198
|
it "dataset usda" do
|
183
199
|
input = "https://doi.org/10.2737/RDS-2018-0001"
|
184
200
|
subject = Bolognese::Metadata.new(input: input)
|
@@ -249,7 +265,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
249
265
|
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.3390/publications6020015", "identifierType"=>"DOI"}])
|
250
266
|
expect(subject.url).to eq("http://www.mdpi.com/2304-6775/6/2/15")
|
251
267
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
252
|
-
expect(subject.creators).to eq("
|
268
|
+
expect(subject.creators).to eq("name"=>":(unav)", "nameType"=>"Organizational")
|
253
269
|
expect(subject.titles).to eq([{"title"=>"Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics"}])
|
254
270
|
expect(subject.dates).to eq([{"date"=>"2018-04-09", "dateType"=>"Issued"}, {"date"=>"2018-04-10T17:58:05Z", "dateType"=>"Updated"}])
|
255
271
|
expect(subject.publication_year).to eq("2018")
|
@@ -272,6 +288,23 @@ describe Bolognese::Metadata, vcr: true do
|
|
272
288
|
expect(subject.agency).to eq("Crossref")
|
273
289
|
end
|
274
290
|
|
291
|
+
it "another book" do
|
292
|
+
input = "https://doi.org/10.2973/odp.proc.ir.180.2000"
|
293
|
+
subject = Bolognese::Metadata.new(input: input)
|
294
|
+
expect(subject.valid?).to be true
|
295
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.2973/odp.proc.ir.180.2000", "identifierType"=>"DOI"}])
|
296
|
+
expect(subject.url).to eq("http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM")
|
297
|
+
expect(subject.types).to eq("bibtex"=>"book", "citeproc"=>"book", "resourceType"=>"Book", "ris"=>"BOOK", "schemaOrg"=>"Book")
|
298
|
+
expect(subject.creators).to eq("name"=>":(unav)", "nameType"=>"Organizational")
|
299
|
+
expect(subject.contributors.size).to eq(3)
|
300
|
+
expect(subject.contributors.first).to eq("contributorType"=>"Editor", "familyName"=>"Taylor", "givenName"=>"B.", "name"=>"Taylor, B.", "nameType"=>"Personal")
|
301
|
+
expect(subject.titles).to eq([{"title"=>"Proceedings of the Ocean Drilling Program, 180 Initial Reports"}])
|
302
|
+
expect(subject.dates).to eq([{"date"=>"2000-02-04", "dateType"=>"Issued"}, {"date"=>"2009-02-02T21:19:43Z", "dateType"=>"Updated"}])
|
303
|
+
expect(subject.publication_year).to eq("2000")
|
304
|
+
expect(subject.publisher).to eq("Ocean Drilling Program")
|
305
|
+
expect(subject.agency).to eq("Crossref")
|
306
|
+
end
|
307
|
+
|
275
308
|
it "mEDRA" do
|
276
309
|
input = "https://doi.org/10.3280/ecag2018-001005"
|
277
310
|
subject = Bolognese::Metadata.new(input: input)
|
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.2.
|
4
|
+
version: 1.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -830,9 +830,11 @@ files:
|
|
830
830
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/JaLC.yml
|
831
831
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/KISTI.yml
|
832
832
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/OP.yml
|
833
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml
|
833
834
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book_chapter.yml
|
834
835
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book.yml
|
835
836
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/book_chapter.yml
|
837
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/component.yml
|
836
838
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset.yml
|
837
839
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/dataset_usda.yml
|
838
840
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/date_in_future.yml
|