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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93e083aa2d14384d27bb74272e5a6113c448dfa9780a9f6154880fadae4bb5c0
4
- data.tar.gz: c2fd02493d91d2f3de12d3f2958516bba9078abbe939a9bf039def5512d3225a
3
+ metadata.gz: 8045d5f8042da41baf35bc82800bc689db433c16fc6f3607c980aac18d409022
4
+ data.tar.gz: 578ae0ae2c0a8addf955e859d821312c1ca0951e8d9e4b542a6cf55c53055e8e
5
5
  SHA512:
6
- metadata.gz: b4d771f0376e5c51392e12db3e75bc3a4ab52e6e904e6cda9257c252517e49e41619b3b756480c262f0755e503e0307e72dd0d98bc66f3eecc779e6c939211db
7
- data.tar.gz: 42342eb59b5dd49f214e33ae689f7249d45e6f60d7c65b3fb920b56b96ee870e86600fc0673533e92a534dc9c6c0d623f2449ff24c2a3befb4516c5e13973320
6
+ metadata.gz: e39aba0b9e648e4b3880f5883955fe3af49710062e259ccc278a4e170f964a16271a9cf22cbbaa9fdcbb39183aafee71c4aa88284f93667288d619029ae49fcb
7
+ data.tar.gz: b3399a055354e06a990089880c228113cf6db476d4717954ffc053ed42fdbc16669a97327d420b2ecf6b014e79c7191aef0082de75b649170c76a30df58bb490
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.5.1)
4
+ commonmeta-ruby (3.5.2)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
6
  addressable (~> 2.8.1, < 2.8.2)
7
7
  base32-url (>= 0.7.0, < 1)
@@ -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
- Array.wrap(meta["relationships"]).reduce([]) do |sum, relationship|
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"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmeta
4
- VERSION = '3.5.1'
4
+ VERSION = '3.5.2'
5
5
  end
@@ -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
- "id" => "https://orcid.org/0000-0003-0449-4469", "type" => "Person", "contributorRoles" => ["Author"])
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
- "id" => "https://orcid.org/0000-0003-0449-4469")
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
- "type" => "Person",
242
- "familyName" => "Stocker",
243
- "givenName" => "Markus",
244
- "id" => "https://orcid.org/0000-0001-5492-3212")
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
- "id" => "https://orcid.org/0000-0001-8249-7388", "type" => "Person", "contributorRoles" => ["Author"])
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.1
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-21 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport