commonmeta-ruby 3.5.1 → 3.5.2
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/commonmeta/readers/json_feed_reader.rb +13 -2
- data/lib/commonmeta/version.rb +1 -1
- data/spec/readers/json_feed_reader_spec.rb +10 -9
- 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: 8045d5f8042da41baf35bc82800bc689db433c16fc6f3607c980aac18d409022
|
4
|
+
data.tar.gz: 578ae0ae2c0a8addf955e859d821312c1ca0951e8d9e4b542a6cf55c53055e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e39aba0b9e648e4b3880f5883955fe3af49710062e259ccc278a4e170f964a16271a9cf22cbbaa9fdcbb39183aafee71c4aa88284f93667288d619029ae49fcb
|
7
|
+
data.tar.gz: b3399a055354e06a990089880c228113cf6db476d4717954ffc053ed42fdbc16669a97327d420b2ecf6b014e79c7191aef0082de75b649170c76a30df58bb490
|
data/Gemfile.lock
CHANGED
@@ -129,8 +129,19 @@ module Commonmeta
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def get_funding_references(meta)
|
132
|
-
# check that relationships resolve and have type "HasAward"
|
133
|
-
|
132
|
+
# check that relationships resolve and have type "HasAward" or funding is provided by blog metadata
|
133
|
+
if funding = meta.dig("blog", "funding")
|
134
|
+
fundref = {
|
135
|
+
"funderIdentifier" => funding["funder_id"],
|
136
|
+
"funderIdentifierType" => "Crossref Funder ID",
|
137
|
+
"funderName" => funding["funder_name"],
|
138
|
+
"awardNumber" => funding["award_number"]
|
139
|
+
}
|
140
|
+
|
141
|
+
else
|
142
|
+
fundref = nil
|
143
|
+
end
|
144
|
+
Array.wrap(fundref) + Array.wrap(meta["relationships"]).reduce([]) do |sum, relationship|
|
134
145
|
begin
|
135
146
|
# funder is European Commission
|
136
147
|
if validate_prefix(relationship["url"]) == "10.3030" || URI.parse(relationship["url"]).host == "cordis.europa.eu"
|
data/lib/commonmeta/version.rb
CHANGED
@@ -95,7 +95,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
95
95
|
expect(subject.date).to eq("published" => "2013-06-25", "updated" => "2023-09-07")
|
96
96
|
expect(subject.descriptions.first["description"]).to start_with("This paper in markdown format was written by Ethan White et al.")
|
97
97
|
expect(subject.publisher).to eq("name" => "Front Matter")
|
98
|
-
expect(subject.related_identifiers).to eq([{"id"=>"https://doi.org/10.4033/iee.2013.6b.6.f", "type"=>"IsPreprintOf"}])
|
98
|
+
expect(subject.related_identifiers).to eq([{ "id" => "https://doi.org/10.4033/iee.2013.6b.6.f", "type" => "IsPreprintOf" }])
|
99
99
|
expect(subject.subjects).to eq([{ "subject" => "Computer and information sciences" },
|
100
100
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
101
101
|
"subject" => "FOS: Computer and information sciences",
|
@@ -120,7 +120,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
120
120
|
expect(subject.date).to eq("published" => "2019-07-01", "updated" => "2023-09-07")
|
121
121
|
expect(subject.descriptions.first["description"]).to start_with("The connections between scholarly resources generated by persistent identifiers (PIDs)")
|
122
122
|
expect(subject.publisher).to eq("name" => "Front Matter")
|
123
|
-
expect(subject.funding_references).to eq([{ "awardNumber" => "777523", "funderIdentifier"=>"http://doi.org/10.13039/501100000780", "funderName" => "European Commission" }])
|
123
|
+
expect(subject.funding_references).to eq([{ "awardNumber" => "777523", "funderIdentifier" => "http://doi.org/10.13039/501100000780", "funderName" => "European Commission" }])
|
124
124
|
expect(subject.related_identifiers).to eq([{ "id" => "https://doi.org/10.5438/bv9z-dc66", "type" => "IsIdenticalTo" }])
|
125
125
|
expect(subject.subjects).to eq([{ "subject" => "Computer and information sciences" },
|
126
126
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
@@ -140,7 +140,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
140
140
|
expect(subject.type).to eq("Article")
|
141
141
|
expect(subject.contributors.length).to eq(1)
|
142
142
|
expect(subject.contributors.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.",
|
143
|
-
|
143
|
+
"id" => "https://orcid.org/0000-0003-0449-4469", "type" => "Person", "contributorRoles" => ["Author"])
|
144
144
|
expect(subject.titles).to eq([{ "title" => "The Residency Visual Abstract" }])
|
145
145
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
146
146
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -165,7 +165,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
165
165
|
expect(subject.type).to eq("Article")
|
166
166
|
expect(subject.contributors.length).to eq(1)
|
167
167
|
expect(subject.contributors.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.", "type" => "Person", "contributorRoles" => ["Author"],
|
168
|
-
|
168
|
+
"id" => "https://orcid.org/0000-0003-0449-4469")
|
169
169
|
expect(subject.titles).to eq([{ "title" => "How to Build an Academic Powerhouse: Let's Study Who's Doing it" }])
|
170
170
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
171
171
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -238,10 +238,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
238
238
|
expect(subject.type).to eq("Article")
|
239
239
|
expect(subject.contributors.length).to eq(1)
|
240
240
|
expect(subject.contributors.first).to eq("contributorRoles" => ["Author"],
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
241
|
+
"type" => "Person",
|
242
|
+
"familyName" => "Stocker",
|
243
|
+
"givenName" => "Markus",
|
244
|
+
"id" => "https://orcid.org/0000-0001-5492-3212")
|
245
245
|
expect(subject.titles).to eq([{ "title" => "ORCID Integration Series: PANGAEA" }])
|
246
246
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
247
247
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -253,6 +253,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
253
253
|
"subject" => "FOS: Computer and information sciences",
|
254
254
|
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
255
255
|
expect(subject.language).to eq("en")
|
256
|
+
expect(subject.funding_references).to eq([{ "awardNumber" => "654039", "funderIdentifier" => "https://doi.org/10.13039/501100007601", "funderIdentifierType"=>"Crossref Funder ID", "funderName" => "European Union’s Horizon 2020 research and innovation programme" }])
|
256
257
|
expect(subject.container).to eq("identifier" => "https://project-thor.eu", "identifierType" => "URL", "title" => "Project THOR", "type" => "Periodical")
|
257
258
|
end
|
258
259
|
|
@@ -364,7 +365,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
364
365
|
expect(subject.type).to eq("Article")
|
365
366
|
expect(subject.contributors.length).to eq(1)
|
366
367
|
expect(subject.contributors.first).to eq("familyName" => "Karcher", "givenName" => "Sebastian",
|
367
|
-
|
368
|
+
"id" => "https://orcid.org/0000-0001-8249-7388", "type" => "Person", "contributorRoles" => ["Author"])
|
368
369
|
expect(subject.titles).to eq([{ "title" => "Seeking Public Comment on CSL 1.0.2 Release" }])
|
369
370
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
370
371
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmeta-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|