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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 101b83ceef5cc504cac6e51becd5840d9c27e78a7247033d61183ce7958d5e08
4
- data.tar.gz: 9409014f1925750a0795f8cc90607b8fdef63a23d9a8b4ce23fd7c16c7ea19a3
3
+ metadata.gz: ba8f7ba69c381c964db85cd05abe07d5a1cbd75eb183a3b620bc374430b7dd5b
4
+ data.tar.gz: 97d81da9e70f8942c66d577ab47e77f310244c37a7cccffa961bb1aefb46b974
5
5
  SHA512:
6
- metadata.gz: b88362a0aa9c1661fcef16b3886964ec4c214a468310f8df40e9ae50be18657a4f7aae999674a1c3109d65f9f503c3f3830bc5c77597817d0a57d0cec73f45c3
7
- data.tar.gz: 250e6261325c0b745d783b865d53d7b9c9d0726fec30b5cc02afeaa1961453f8d5f3afcf1ace249f26b60d9eb1f40d20e041fb10d9fbbbacbdf806012090f81e
6
+ metadata.gz: d0ae170b389bc7a005935f3da908c4a1754674462011eff2e425b796641a5c5f675e6dff6d2bf4de4354cb452309fc467bdb8064a626391e050d736ea035d0f4
7
+ data.tar.gz: 51bb1e44e863de1670cd31ebcdb53cd6193f925d83d8d4a675dece1d0246fe88cb54ae829098e6f9b71af291753a4810d772fb10af0a1269f4c46d61659d4592
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.0.5)
4
+ bolognese (1.0.6)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -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")).unwrap
121
- formats = Array.wrap(meta.dig("formats", "format")).unwrap
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)).unwrap,
135
- "size" => meta.fetch("contenSize", nil),
136
- "formats" => Array.wrap(meta.fetch("encodingFormat", nil) || meta.fetch("fileFormat", nil)).unwrap,
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,
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -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(["https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_covariates.tar.gz"])
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner