bolognese 1.5.21 → 1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +5 -5
- data/lib/bolognese/datacite_utils.rb +2 -2
- data/lib/bolognese/metadata.rb +7 -4
- data/lib/bolognese/metadata_utils.rb +2 -2
- data/lib/bolognese/readers/citeproc_reader.rb +1 -1
- data/lib/bolognese/readers/codemeta_reader.rb +1 -1
- data/lib/bolognese/readers/crossref_reader.rb +1 -1
- data/lib/bolognese/readers/datacite_reader.rb +1 -1
- data/lib/bolognese/readers/npm_reader.rb +1 -1
- data/lib/bolognese/readers/schema_org_reader.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/codemeta_writer.rb +1 -1
- data/lib/bolognese/writers/jats_writer.rb +2 -2
- data/lib/bolognese/writers/schema_org_writer.rb +1 -1
- data/spec/readers/codemeta_reader_spec.rb +1 -1
- data/spec/readers/datacite_json_reader_spec.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +1 -1
- data/spec/readers/npm_reader_spec.rb +3 -3
- data/spec/readers/schema_org_reader_spec.rb +2 -2
- data/spec/writers/datacite_writer_spec.rb +1 -0
- 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: 1a22da55003185429ddc212b5518e74cc414d94d5f87b8047f2ed07859bc8f0d
|
4
|
+
data.tar.gz: adcf4f5f25e7c820b2c23bf0f685f5af1e09c3ba3cd1ec4b850f180fe6919aa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 818dba03b12581b2345bf7da3728e99ed713bd16cf0367ccc61aeb072049564ad59f7e56b58d5e68a0c68d40eeafcb0402307721c5b42d8cfeb2c3f2a0fdc96a
|
7
|
+
data.tar.gz: 4dd76c4414a071860b76f108c5ef4145c188a1f909816c2d860c33dfc80b1dc55cffebd5060affabad5b79a6e2b88d61a0fe7107b3d133bfa0905cb866bc6199
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (1.
|
4
|
+
bolognese (1.6)
|
5
5
|
activesupport (>= 4.2.5)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (>= 5.1.0)
|
@@ -30,12 +30,12 @@ PATH
|
|
30
30
|
GEM
|
31
31
|
remote: https://rubygems.org/
|
32
32
|
specs:
|
33
|
-
activesupport (6.0.
|
33
|
+
activesupport (6.0.3)
|
34
34
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
35
35
|
i18n (>= 0.7, < 2)
|
36
36
|
minitest (~> 5.1)
|
37
37
|
tzinfo (~> 1.1)
|
38
|
-
zeitwerk (~> 2.2)
|
38
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
39
39
|
addressable (2.7.0)
|
40
40
|
public_suffix (>= 2.0.2, < 5.0)
|
41
41
|
benchmark_methods (0.7)
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
oj (>= 2.8.3)
|
106
106
|
oj_mimic_json (~> 1.0, >= 1.0.1)
|
107
107
|
mini_portile2 (2.4.0)
|
108
|
-
minitest (5.14.
|
108
|
+
minitest (5.14.1)
|
109
109
|
multi_json (1.14.1)
|
110
110
|
multipart-post (2.1.1)
|
111
111
|
namae (1.0.1)
|
@@ -150,7 +150,7 @@ GEM
|
|
150
150
|
rspec-mocks (~> 3.9.0)
|
151
151
|
rspec-core (3.9.2)
|
152
152
|
rspec-support (~> 3.9.3)
|
153
|
-
rspec-expectations (3.9.
|
153
|
+
rspec-expectations (3.9.2)
|
154
154
|
diff-lcs (>= 1.2.0, < 2.0)
|
155
155
|
rspec-support (~> 3.9.0)
|
156
156
|
rspec-mocks (3.9.1)
|
data/lib/bolognese/metadata.rb
CHANGED
@@ -9,7 +9,7 @@ module Bolognese
|
|
9
9
|
attr_accessor :string, :from, :sandbox, :meta, :regenerate, :issue, :show_errors
|
10
10
|
attr_reader :doc, :page_start, :page_end
|
11
11
|
attr_writer :id, :provider_id, :client_id, :doi, :identifiers, :creators, :contributors, :titles, :publisher,
|
12
|
-
:rights_list, :dates, :publication_year, :volume, :url, :
|
12
|
+
:rights_list, :dates, :publication_year, :volume, :url, :version,
|
13
13
|
:subjects, :contributor, :descriptions, :language, :sizes,
|
14
14
|
:formats, :schema_version, :meta, :container, :agency,
|
15
15
|
:format, :funding_references, :state, :geo_locations,
|
@@ -106,7 +106,7 @@ module Bolognese
|
|
106
106
|
:publication_year,
|
107
107
|
:descriptions,
|
108
108
|
:rights_list,
|
109
|
-
:
|
109
|
+
:version,
|
110
110
|
:subjects,
|
111
111
|
:language,
|
112
112
|
:geo_locations,
|
@@ -189,10 +189,13 @@ module Bolognese
|
|
189
189
|
@url ||= meta.fetch("url", nil)
|
190
190
|
end
|
191
191
|
|
192
|
-
def
|
193
|
-
@
|
192
|
+
def version
|
193
|
+
@version ||= meta.fetch("version", nil)
|
194
194
|
end
|
195
195
|
|
196
|
+
# for backwards compatibility
|
197
|
+
alias_attribute :version_info, :version
|
198
|
+
|
196
199
|
def publication_year
|
197
200
|
@publication_year ||= meta.fetch("publication_year", nil)
|
198
201
|
end
|
@@ -158,7 +158,7 @@ module Bolognese
|
|
158
158
|
"publisher" => publisher,
|
159
159
|
"title" => parse_attributes(titles, content: "title", first: true),
|
160
160
|
"URL" => url,
|
161
|
-
"version" =>
|
161
|
+
"version" => version
|
162
162
|
}.compact.symbolize_keys
|
163
163
|
end
|
164
164
|
|
@@ -180,7 +180,7 @@ module Bolognese
|
|
180
180
|
"identifiers" => identifiers,
|
181
181
|
"sizes" => sizes,
|
182
182
|
"formats" => formats,
|
183
|
-
"version" =>
|
183
|
+
"version" => version,
|
184
184
|
"rights_list" => rights_list,
|
185
185
|
"descriptions" => descriptions,
|
186
186
|
"geo_locations" => geo_locations,
|
@@ -119,7 +119,7 @@ module Bolognese
|
|
119
119
|
"publication_year" => publication_year,
|
120
120
|
"descriptions" => meta.fetch("abstract", nil).present? ? [{ "description" => sanitize(meta.fetch("abstract")), "descriptionType" => "Abstract" }] : [],
|
121
121
|
"rights_list" => rights_list,
|
122
|
-
"
|
122
|
+
"version" => meta.fetch("version", nil),
|
123
123
|
"subjects" => subjects,
|
124
124
|
"state" => state
|
125
125
|
}.merge(read_options)
|
@@ -79,7 +79,7 @@ module Bolognese
|
|
79
79
|
"publication_year" => publication_year,
|
80
80
|
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
|
81
81
|
"rights_list" => [{ "rightsUri" => meta.fetch("license", nil) }.compact],
|
82
|
-
"
|
82
|
+
"version" => meta.fetch("version", nil),
|
83
83
|
"subjects" => subjects,
|
84
84
|
"state" => state
|
85
85
|
}.merge(read_options)
|
@@ -172,7 +172,7 @@ module Bolognese
|
|
172
172
|
"publication_year" => publication_year,
|
173
173
|
"descriptions" => crossref_description(bibliographic_metadata),
|
174
174
|
"rights_list" => crossref_license(program_metadata),
|
175
|
-
"
|
175
|
+
"version" => nil,
|
176
176
|
"subjects" => nil,
|
177
177
|
"language" => nil,
|
178
178
|
"sizes" => nil,
|
@@ -230,7 +230,7 @@ module Bolognese
|
|
230
230
|
"publication_year" => parse_attributes(meta.fetch("publicationYear", nil), first: true).to_s.strip.presence,
|
231
231
|
"descriptions" => descriptions,
|
232
232
|
"rights_list" => Array.wrap(rights_list),
|
233
|
-
"
|
233
|
+
"version" => meta.fetch("version", nil).to_s.presence,
|
234
234
|
"subjects" => subjects,
|
235
235
|
"language" => parse_attributes(meta.fetch("language", nil), first: true).to_s.strip.presence,
|
236
236
|
"geo_locations" => geo_locations,
|
@@ -105,7 +105,7 @@ module Bolognese
|
|
105
105
|
#"publication_year" => publication_year,
|
106
106
|
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : [],
|
107
107
|
"rights_list" => rights_list,
|
108
|
-
"
|
108
|
+
"version" => meta.fetch("version", nil),
|
109
109
|
"subjects" => subjects
|
110
110
|
#"state" => state
|
111
111
|
}.merge(read_options)
|
@@ -173,7 +173,7 @@ module Bolognese
|
|
173
173
|
"dates" => dates,
|
174
174
|
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
|
175
175
|
"rights_list" => rights_list,
|
176
|
-
"
|
176
|
+
"version" => meta.fetch("version", nil).to_s.presence,
|
177
177
|
"subjects" => subjects,
|
178
178
|
"state" => state,
|
179
179
|
"schema_version" => meta.fetch("schemaVersion", nil).to_s.presence,
|
data/lib/bolognese/version.rb
CHANGED
@@ -15,7 +15,7 @@ module Bolognese
|
|
15
15
|
"name" => parse_attributes(titles, content: "title", first: true),
|
16
16
|
"authors" => creators,
|
17
17
|
"description" => parse_attributes(descriptions, content: "description", first: true),
|
18
|
-
"version" =>
|
18
|
+
"version" => version,
|
19
19
|
"tags" => subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) } : nil,
|
20
20
|
"datePublished" => get_date(dates, "Issued"),
|
21
21
|
"dateModified" => get_date(dates, "Updated"),
|
@@ -22,7 +22,7 @@ module Bolognese
|
|
22
22
|
insert_issue(xml) if container.to_h["issue"].present?
|
23
23
|
insert_fpage(xml) if container.to_h["firstPage"].present?
|
24
24
|
insert_lpage(xml) if container.to_h["lastPage"].present?
|
25
|
-
insert_version(xml) if
|
25
|
+
insert_version(xml) if version.present?
|
26
26
|
insert_pub_id(xml)
|
27
27
|
end
|
28
28
|
|
@@ -112,7 +112,7 @@ module Bolognese
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def insert_version(xml)
|
115
|
-
xml.version(
|
115
|
+
xml.version(version)
|
116
116
|
end
|
117
117
|
|
118
118
|
def insert_pub_id(xml)
|
@@ -15,7 +15,7 @@ module Bolognese
|
|
15
15
|
"editor" => to_schema_org_contributors(contributors),
|
16
16
|
"description" => parse_attributes(descriptions, content: "description", first: true),
|
17
17
|
"license" => Array.wrap(rights_list).map { |l| l["rightsUri"] }.compact.unwrap,
|
18
|
-
"version" =>
|
18
|
+
"version" => version,
|
19
19
|
"keywords" => subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.join(", ") : nil,
|
20
20
|
"inLanguage" => language,
|
21
21
|
"contentSize" => Array.wrap(sizes).unwrap,
|
@@ -68,7 +68,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
68
68
|
expect(subject.titles).to eq([{"title"=>"R Interface to the DataONE REST API"}])
|
69
69
|
expect(subject.descriptions.first["description"]).to start_with("Provides read and write access to data and metadata")
|
70
70
|
expect(subject.subjects).to eq([{"subject"=>"data sharing"}, {"subject"=>"data repository"}, {"subject"=>"DataONE"}])
|
71
|
-
expect(subject.
|
71
|
+
expect(subject.version).to eq("2.0.0")
|
72
72
|
expect(subject.dates).to eq([{"date"=>"2016-05-27", "dateType"=>"Issued"}, {"date"=>"2016-05-27", "dateType"=>"Created"}, {"date"=>"2016-05-27", "dateType"=>"Updated"}])
|
73
73
|
expect(subject.publication_year).to eq("2016")
|
74
74
|
expect(subject.publisher).to eq("https://cran.r-project.org")
|
@@ -69,7 +69,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
69
69
|
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5281/zenodo.28518", "identifierType"=>"DOI"}, {"identifier"=>"https://zenodo.org/record/28518", "identifierType"=>"URL"}])
|
70
70
|
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
71
71
|
expect(subject.publication_year).to eq("2015")
|
72
|
-
expect(subject.
|
72
|
+
expect(subject.version).to eq("v0.3.2")
|
73
73
|
expect(subject.datacite).to include("<version>v0.3.2</version>")
|
74
74
|
expect(subject.related_identifiers.length).to eq(2)
|
75
75
|
expect(subject.related_identifiers.first).to eq("relatedIdentifier"=>"https://github.com/jakevdp/supersmoother/tree/v0.3.2", "relatedIdentifierType"=>"URL", "relationType"=>"IsSupplementTo")
|
@@ -867,7 +867,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
867
867
|
"nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0002-8743-4455", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
868
868
|
"affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]}])
|
869
869
|
expect(subject.titles).to eq([{"title"=>"Multi-Sensor Reanalysis (MSR) of total ozone, version 2"}])
|
870
|
-
expect(subject.
|
870
|
+
expect(subject.version).to eq("2")
|
871
871
|
expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"2015", "dateType"=>"Issued"}])
|
872
872
|
expect(subject.publication_year).to eq("2015")
|
873
873
|
expect(subject.publisher).to eq("Royal Netherlands Meteorological Institute (KNMI)")
|
@@ -24,7 +24,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
24
24
|
expect(subject.titles).to eq([{"title"=>"fullstack_app"}])
|
25
25
|
expect(subject.descriptions).to be_empty
|
26
26
|
expect(subject.rights_list).to eq([{"rights"=>"ISC"}])
|
27
|
-
expect(subject.
|
27
|
+
expect(subject.version).to eq("1.0.0")
|
28
28
|
#expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
29
29
|
#expect(subject.publication_year).to eq("2016")
|
30
30
|
end
|
@@ -40,7 +40,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
40
40
|
expect(subject.creators).to eq([{"name"=>":(unav)", "nameType"=>"Organizational"}])
|
41
41
|
expect(subject.titles).to eq([{"title"=>"CITapp"}])
|
42
42
|
expect(subject.descriptions).to eq([{"description"=>"Concealed Information Test app", "descriptionType"=>"Abstract"}])
|
43
|
-
expect(subject.
|
43
|
+
expect(subject.version).to eq("1.1.0")
|
44
44
|
#expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
45
45
|
#expect(subject.publication_year).to eq("2016")
|
46
46
|
end
|
@@ -58,7 +58,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
58
58
|
expect(subject.descriptions).to eq([{"description"=>
|
59
59
|
+ "The EDAM Browser is a client-side web-based visualization javascript widget. Its goals are to help describing bio-related resources and service with EDAM, and to facilitate and foster community contributions to EDAM.",
|
60
60
|
"descriptionType"=>"Abstract"}])
|
61
|
-
expect(subject.
|
61
|
+
expect(subject.version).to eq("1.0.0")
|
62
62
|
#expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
63
63
|
#expect(subject.publication_year).to eq("2016")
|
64
64
|
end
|
@@ -165,7 +165,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
165
165
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceType"=>"Gene expression matrices", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
166
166
|
expect(subject.creators).to eq([{"name"=>"The GTEx Consortium", "nameType"=>"Organizational", "nameIdentifiers"=>[], "affiliation" => []}])
|
167
167
|
expect(subject.titles).to eq([{"title"=>"Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery"}])
|
168
|
-
expect(subject.
|
168
|
+
expect(subject.version).to eq("v7")
|
169
169
|
expect(subject.subjects).to eq([{"subject"=>"gtex"}, {"subject"=>"annotation"}, {"subject"=>"phenotype"}, {"subject"=>"gene regulation"}, {"subject"=>"transcriptomics"}])
|
170
170
|
expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
|
171
171
|
expect(subject.publication_year).to eq("2017")
|
@@ -275,7 +275,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
275
275
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
276
276
|
# expect(subject.creators).to eq([{"familyName"=>"Lindman", "givenName"=>"Karin", "name"=>"Lindman, Karin", "nameIdentifiers"=>[{"nameIdentifier"=> "https://orcid.org/0000-0003-1298-517X", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "nameType"=>"Personal"}])
|
277
277
|
expect(subject.titles).to eq([{"title"=>"Ovary data from the Visual Sweden project DROID"}])
|
278
|
-
expect(subject.
|
278
|
+
expect(subject.version).to eq("1.0")
|
279
279
|
expect(subject.subjects).to eq([{"subject"=>"pathology"}, {"subject"=>"whole slide imaging"}, {"subject"=>"annotated"}])
|
280
280
|
expect(subject.dates).to eq([{"date"=>"2019-01-09", "dateType"=>"Issued"}, {"date"=>"2019-01-09", "dateType"=>"Created"}, {"date"=>"2019-01-09", "dateType"=>"Updated"}])
|
281
281
|
expect(subject.publication_year).to eq("2019")
|
@@ -145,6 +145,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
145
145
|
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
146
146
|
expect(subject.publication_year).to eq("2015")
|
147
147
|
expect(subject.version_info).to eq("v0.3.2")
|
148
|
+
expect(subject.version).to eq("v0.3.2")
|
148
149
|
expect(subject.publisher).to eq("Zenodo")
|
149
150
|
expect(subject.agency).to eq("DataCite")
|
150
151
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
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.
|
4
|
+
version: '1.6'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|