bolognese 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/datacite_utils.rb +2 -2
- data/lib/bolognese/metadata.rb +4 -7
- 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 +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e096d175d7f9184274a6a18584aeb10a15f24c88c5e34f42916ec0cf6fc5e052
|
|
4
|
+
data.tar.gz: b5b2034bb8cf6c902faa88eecc3866a112b8520e12bacb375dcc3b24ba3ead89
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0263214c5bb855eed1a018ade0b94709683cb9fcbf14f692909ef727aebf51a71098fed2946e100cf212b6de0ee6c76390fdc4612e00003859ce8bd56784a8d
|
|
7
|
+
data.tar.gz: '081329825dec027a324fdd71784554242a416e80f55e3957e63439be1ca906d28b8c28a937f397e2bfcfd1442369ba48cdf3b2f94a4a33b3ece13b770db65871'
|
data/Gemfile.lock
CHANGED
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_info,
|
|
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_info,
|
|
110
110
|
:subjects,
|
|
111
111
|
:language,
|
|
112
112
|
:geo_locations,
|
|
@@ -189,13 +189,10 @@ module Bolognese
|
|
|
189
189
|
@url ||= meta.fetch("url", nil)
|
|
190
190
|
end
|
|
191
191
|
|
|
192
|
-
def
|
|
193
|
-
@
|
|
192
|
+
def version_info
|
|
193
|
+
@version_info ||= meta.fetch("version_info", nil) || meta.fetch("version", nil)
|
|
194
194
|
end
|
|
195
195
|
|
|
196
|
-
# for backwards compatibility
|
|
197
|
-
alias_attribute :version_info, :version
|
|
198
|
-
|
|
199
196
|
def publication_year
|
|
200
197
|
@publication_year ||= meta.fetch("publication_year", nil)
|
|
201
198
|
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_info
|
|
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_info,
|
|
184
184
|
"rights_list" => rights_list,
|
|
185
185
|
"descriptions" => descriptions,
|
|
186
186
|
"geo_locations" => geo_locations,
|
|
@@ -121,7 +121,7 @@ module Bolognese
|
|
|
121
121
|
"publication_year" => publication_year,
|
|
122
122
|
"descriptions" => meta.fetch("abstract", nil).present? ? [{ "description" => sanitize(meta.fetch("abstract")), "descriptionType" => "Abstract" }] : [],
|
|
123
123
|
"rights_list" => rights_list,
|
|
124
|
-
"
|
|
124
|
+
"version_info" => meta.fetch("version", nil),
|
|
125
125
|
"subjects" => subjects,
|
|
126
126
|
"state" => state
|
|
127
127
|
}.merge(read_options)
|
|
@@ -81,7 +81,7 @@ module Bolognese
|
|
|
81
81
|
"publication_year" => publication_year,
|
|
82
82
|
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
|
|
83
83
|
"rights_list" => [{ "rightsUri" => meta.fetch("license", nil) }.compact],
|
|
84
|
-
"
|
|
84
|
+
"version_info" => meta.fetch("version", nil),
|
|
85
85
|
"subjects" => subjects,
|
|
86
86
|
"state" => state
|
|
87
87
|
}.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_info" => nil,
|
|
176
176
|
"subjects" => nil,
|
|
177
177
|
"language" => nil,
|
|
178
178
|
"sizes" => nil,
|
|
@@ -235,7 +235,7 @@ module Bolognese
|
|
|
235
235
|
"publication_year" => parse_attributes(meta.fetch("publicationYear", nil), first: true).to_s.strip.presence,
|
|
236
236
|
"descriptions" => descriptions,
|
|
237
237
|
"rights_list" => Array.wrap(rights_list),
|
|
238
|
-
"
|
|
238
|
+
"version_info" => meta.fetch("version", nil).to_s.presence,
|
|
239
239
|
"subjects" => subjects,
|
|
240
240
|
"language" => parse_attributes(meta.fetch("language", nil), first: true).to_s.strip.presence,
|
|
241
241
|
"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_info" => meta.fetch("version", nil),
|
|
109
109
|
"subjects" => subjects
|
|
110
110
|
#"state" => state
|
|
111
111
|
}.merge(read_options)
|
|
@@ -178,7 +178,7 @@ module Bolognese
|
|
|
178
178
|
"dates" => dates,
|
|
179
179
|
"descriptions" => meta.fetch("description", nil).present? ? [{ "description" => sanitize(meta.fetch("description")), "descriptionType" => "Abstract" }] : nil,
|
|
180
180
|
"rights_list" => rights_list,
|
|
181
|
-
"
|
|
181
|
+
"version_info" => meta.fetch("version", nil).to_s.presence,
|
|
182
182
|
"subjects" => subjects,
|
|
183
183
|
"state" => state,
|
|
184
184
|
"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_info,
|
|
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_info.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_info)
|
|
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_info,
|
|
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_info).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_info).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")
|
|
@@ -967,7 +967,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
967
967
|
"nameIdentifiers"=> [{"nameIdentifier"=>"https://orcid.org/0000-0002-8743-4455", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
968
968
|
"affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]}])
|
|
969
969
|
expect(subject.titles).to eq([{"title"=>"Multi-Sensor Reanalysis (MSR) of total ozone, version 2"}])
|
|
970
|
-
expect(subject.
|
|
970
|
+
expect(subject.version_info).to eq("2")
|
|
971
971
|
expect(subject.dates).to eq([{"date"=>"2014-04-25", "dateType"=>"Available"}, {"date"=>"2015", "dateType"=>"Issued"}])
|
|
972
972
|
expect(subject.publication_year).to eq("2015")
|
|
973
973
|
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_info).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_info).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_info).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
|
|
@@ -180,7 +180,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
180
180
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceType"=>"Gene expression matrices", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
|
181
181
|
expect(subject.creators).to eq([{"name"=>"The GTEx Consortium", "nameType"=>"Organizational", "nameIdentifiers"=>[], "affiliation" => []}])
|
|
182
182
|
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"}])
|
|
183
|
-
expect(subject.
|
|
183
|
+
expect(subject.version_info).to eq("v7")
|
|
184
184
|
expect(subject.subjects).to eq([{"subject"=>"gtex"}, {"subject"=>"annotation"}, {"subject"=>"phenotype"}, {"subject"=>"gene regulation"}, {"subject"=>"transcriptomics"}])
|
|
185
185
|
expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
|
|
186
186
|
expect(subject.publication_year).to eq("2017")
|
|
@@ -290,7 +290,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
290
290
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
|
291
291
|
# 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"}])
|
|
292
292
|
expect(subject.titles).to eq([{"title"=>"Ovary data from the Visual Sweden project DROID"}])
|
|
293
|
-
expect(subject.
|
|
293
|
+
expect(subject.version_info).to eq("1.0")
|
|
294
294
|
expect(subject.subjects).to eq([{"subject"=>"pathology"}, {"subject"=>"whole slide imaging"}, {"subject"=>"annotated"}])
|
|
295
295
|
expect(subject.dates).to eq([{"date"=>"2019-01-09", "dateType"=>"Issued"}, {"date"=>"2019-01-09", "dateType"=>"Created"}, {"date"=>"2019-01-09", "dateType"=>"Updated"}])
|
|
296
296
|
expect(subject.publication_year).to eq("2019")
|
|
@@ -145,7 +145,6 @@ 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")
|
|
149
148
|
expect(subject.publisher).to eq("Zenodo")
|
|
150
149
|
expect(subject.agency).to eq("DataCite")
|
|
151
150
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|