bolognese 1.0.5 → 1.0.6
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/readers/datacite_reader.rb +2 -2
- data/lib/bolognese/readers/schema_org_reader.rb +3 -3
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/schema_org_writer.rb +3 -3
- data/spec/readers/datacite_reader_spec.rb +4 -4
- data/spec/readers/schema_org_reader_spec.rb +1 -1
- data/spec/writers/schema_org_writer_spec.rb +1 -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: ba8f7ba69c381c964db85cd05abe07d5a1cbd75eb183a3b620bc374430b7dd5b
|
4
|
+
data.tar.gz: 97d81da9e70f8942c66d577ab47e77f310244c37a7cccffa961bb1aefb46b974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ae170b389bc7a005935f3da908c4a1754674462011eff2e425b796641a5c5f675e6dff6d2bf4de4354cb452309fc467bdb8064a626391e050d736ea035d0f4
|
7
|
+
data.tar.gz: 51bb1e44e863de1670cd31ebcdb53cd6193f925d83d8d4a675dece1d0246fe88cb54ae829098e6f9b71af291753a4810d772fb10af0a1269f4c46d61659d4592
|
data/Gemfile.lock
CHANGED
@@ -117,8 +117,8 @@ module Bolognese
|
|
117
117
|
}
|
118
118
|
end
|
119
119
|
dates << { "date" => meta.fetch("publicationYear", nil), "date_type" => "Issued" } if meta.fetch("publicationYear", nil).present? && get_date(dates, "Issued").blank?
|
120
|
-
sizes = Array.wrap(meta.dig("sizes", "size"))
|
121
|
-
formats = Array.wrap(meta.dig("formats", "format"))
|
120
|
+
sizes = Array.wrap(meta.dig("sizes", "size"))
|
121
|
+
formats = Array.wrap(meta.dig("formats", "format"))
|
122
122
|
funding_references = Array.wrap(meta.dig("fundingReferences", "fundingReference")).compact.map do |fr|
|
123
123
|
{
|
124
124
|
"funder_name" => fr["funderName"],
|
@@ -131,9 +131,9 @@ module Bolognese
|
|
131
131
|
"identifier" => identifier,
|
132
132
|
"alternate_identifiers" => alternate_identifiers,
|
133
133
|
"url" => normalize_id(meta.fetch("url", nil)),
|
134
|
-
"content_url" => Array.wrap(meta.fetch("contentUrl", nil))
|
135
|
-
"size" => meta.fetch("contenSize", nil),
|
136
|
-
"formats" => Array.wrap(meta.fetch("encodingFormat", nil) || meta.fetch("fileFormat", nil))
|
134
|
+
"content_url" => Array.wrap(meta.fetch("contentUrl", nil)),
|
135
|
+
"size" => Array.wrap(meta.fetch("contenSize", nil)).presence,
|
136
|
+
"formats" => Array.wrap(meta.fetch("encodingFormat", nil) || meta.fetch("fileFormat", nil)),
|
137
137
|
"title" => meta.fetch("name", nil).present? ? [{ "text" => meta.fetch("name", nil) }] : nil,
|
138
138
|
"creator" => author,
|
139
139
|
"contributor" => contributor,
|
data/lib/bolognese/version.rb
CHANGED
@@ -18,8 +18,8 @@ module Bolognese
|
|
18
18
|
"version" => version,
|
19
19
|
"keywords" => keywords.present? ? Array.wrap(keywords).map { |k| parse_attributes(k, content: "text", first: true) }.join(", ") : nil,
|
20
20
|
"inLanguage" => language,
|
21
|
-
"contentSize" => size,
|
22
|
-
"encodingFormat" => formats,
|
21
|
+
"contentSize" => Array.wrap(size).unwrap,
|
22
|
+
"encodingFormat" => Array.wrap(formats).unwrap,
|
23
23
|
"dateCreated" => get_date(dates, "Created"),
|
24
24
|
"datePublished" => get_date(dates, "Issued"),
|
25
25
|
"dateModified" => get_date(dates, "Updated"),
|
@@ -33,7 +33,7 @@ module Bolognese
|
|
33
33
|
"successor_of" => to_schema_org_relation(related_identifiers: related_identifiers, relation_type: "IsNewVersionOf"),
|
34
34
|
"citation" => to_schema_org_relation(related_identifiers: related_identifiers, relation_type: "References"),
|
35
35
|
"@reverse" => reverse.presence,
|
36
|
-
"contentUrl" => content_url,
|
36
|
+
"contentUrl" => Array.wrap(content_url).unwrap,
|
37
37
|
"schemaVersion" => schema_version,
|
38
38
|
"periodical" => (types["type"] != "Dataset") && periodical ? to_schema_org(periodical) : nil,
|
39
39
|
"includedInDataCatalog" => (types["type"] == "Dataset") && periodical ? to_schema_org(periodical) : nil,
|
@@ -446,8 +446,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
446
446
|
expect(subject.alternate_identifiers).to eq("type"=>"ISBN", "name"=>"937-0-4523-12357-6")
|
447
447
|
expect(subject.dates).to eq([{"date"=>"2012-12-13", "date_type"=>"Other"}, {"date"=>"2010", "date_type"=>"Issued"}])
|
448
448
|
expect(subject.publication_year).to eq("2010")
|
449
|
-
expect(subject.size).to eq("256 pages")
|
450
|
-
expect(subject.formats).to eq("pdf")
|
449
|
+
expect(subject.size).to eq(["256 pages"])
|
450
|
+
expect(subject.formats).to eq(["pdf"])
|
451
451
|
expect(subject.content_url).to eq("https://example.org/report.pdf")
|
452
452
|
expect(subject.publication_year).to eq("2010")
|
453
453
|
expect(subject.related_identifiers.length).to eq(1)
|
@@ -746,8 +746,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
746
746
|
expect(subject.publication_year).to eq("2017")
|
747
747
|
expect(subject.related_identifiers.length).to eq(4)
|
748
748
|
expect(subject.related_identifiers.last).to eq("id"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "related_identifier_type"=>"URL", "relation_type"=>"IsPartOf")
|
749
|
-
expect(subject.formats).to eq("application/tar")
|
750
|
-
expect(subject.size).to eq("15.7M")
|
749
|
+
expect(subject.formats).to eq(["application/tar"])
|
750
|
+
expect(subject.size).to eq(["15.7M"])
|
751
751
|
expect(subject.periodical).to eq("id"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "title"=>"GTEx", "type"=>"DataCatalog")
|
752
752
|
expect(subject.publisher).to eq("GTEx")
|
753
753
|
expect(subject.funding_references.count).to eq(7)
|
@@ -137,7 +137,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
137
137
|
expect(subject.identifier).to eq("https://doi.org/10.25491/d50j-3083")
|
138
138
|
expect(subject.alternate_identifiers).to eq("name"=>"687610993", "type"=>"md5")
|
139
139
|
expect(subject.url).to eq("https://ors.datacite.org/doi:/10.25491/d50j-3083")
|
140
|
-
expect(subject.content_url).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz")
|
140
|
+
expect(subject.content_url).to eq(["https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz"])
|
141
141
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resource_type"=>"Gene expression matrices", "resource_type_general"=>"Dataset", "ris"=>"DATA", "type"=>"Dataset")
|
142
142
|
expect(subject.creator).to eq("name"=>"The GTEx Consortium", "type"=>"Organization")
|
143
143
|
expect(subject.title).to eq([{"text"=>"Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery"}])
|
@@ -155,7 +155,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
155
155
|
expect(json["author"]).to eq("@type"=>"Organization", "name"=>"The GTEx Consortium")
|
156
156
|
expect(json["includedInDataCatalog"]).to eq("@type"=>"DataCatalog", "name"=>"GTEx")
|
157
157
|
expect(json["identifier"]).to eq([{"@type"=>"PropertyValue", "propertyID"=>"doi", "value"=>"https://doi.org/10.25491/8kmc-g314"},{"@type"=>"PropertyValue", "propertyID"=>"md5", "value"=>"c7c89fe7366d50cd75448aa603c9de58"}])
|
158
|
-
expect(json["contentUrl"]).to eq(
|
158
|
+
expect(json["contentUrl"]).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_covariates.tar.gz")
|
159
159
|
end
|
160
160
|
|
161
161
|
it "alternate identifiers" do
|