briard 2.6.0 → 2.6.1

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: 3c0da06d466aa771b5721babd9f83515af15aabafe9ba4604622c727bb10ac24
4
- data.tar.gz: 7eb83dd15c81f11b31d412fd22a354cd2b39b454c40a3f48109233e49cc2c9ac
3
+ metadata.gz: '079443c6a699983314b50894d71e41f9f00fb37ac345c3c9adce1b393390232c'
4
+ data.tar.gz: 1daacb3634f9dca35e94af70d6240efda36b9d44c66a923837d86199acdd80e0
5
5
  SHA512:
6
- metadata.gz: afedf2083bc3313858abd8d9b2e43d9be22ef242d44a26119748f4f03b5893642299a4d74e9b435c4dbdc0e039d6905ed3cbdb7f3eb33ff4e2a4630c99ff0714
7
- data.tar.gz: 4c74319d12d3ac671a68072d0e78f44f925055db0362117316d012fd1847b33131155298e28376dc0c5f3a7d4b6730e103df531b275072499959a201577c8e15
6
+ metadata.gz: 5dc7a33c5a48e8e18921dc7e7e32717a4a743bdb15008ec1c53f70738b9bb42019aa29aaef9d792a187c28f12acc09011128815bfda0c1889e0f98d903eec551
7
+ data.tar.gz: 875cae3964a4a6716729f521779f1e6344483420da3843023b11312217f1a3524c4ec7f8220676f18d4956d752f08827228d152233d6c8913ac7e6ac5e408d86
data/.gitignore CHANGED
@@ -57,3 +57,4 @@ coverage/
57
57
  !.env.travis
58
58
 
59
59
  .vscode
60
+ .dccache
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- briard (2.5.1)
4
+ briard (2.6.1)
5
5
  activesupport (>= 4.2.5)
6
6
  base32-url (>= 0.5.0, < 1)
7
7
  benchmark_methods (~> 0.7)
@@ -149,8 +149,8 @@ GEM
149
149
  public_suffix (2.0.5)
150
150
  racc (1.6.0)
151
151
  rack (2.2.4)
152
- rack-test (0.8.3)
153
- rack (>= 1.0, < 3)
152
+ rack-test (2.0.2)
153
+ rack (>= 1.3)
154
154
  rainbow (3.1.1)
155
155
  rake (12.3.3)
156
156
  rdf (3.2.9)
@@ -212,7 +212,7 @@ GEM
212
212
  rubocop-ast (>= 0.4.0)
213
213
  rubocop-rake (0.6.0)
214
214
  rubocop (~> 1.0)
215
- rubocop-rspec (2.13.1)
215
+ rubocop-rspec (2.13.2)
216
216
  rubocop (~> 1.33)
217
217
  ruby-progressbar (1.11.0)
218
218
  scanf (1.0.0)
@@ -246,7 +246,7 @@ DEPENDENCIES
246
246
  bundler (>= 1.0)
247
247
  code-scanning-rubocop (~> 0.6.1)
248
248
  hashdiff (>= 1.0.0.beta1, < 2.0.0)
249
- rack-test (~> 0)
249
+ rack-test (~> 2.0)
250
250
  rake (~> 12.0)
251
251
  rspec (~> 3.4)
252
252
  rspec-xsd (~> 0.1.0)
data/briard.gemspec CHANGED
@@ -49,7 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.add_development_dependency 'bundler', '>= 1.0'
50
50
  s.add_development_dependency 'code-scanning-rubocop', '~> 0.6.1'
51
51
  s.add_development_dependency 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']
52
- s.add_development_dependency 'rack-test', '~> 0'
52
+ s.add_development_dependency 'rack-test', '~> 2.0'
53
53
  s.add_development_dependency 'rake', '~> 12.0'
54
54
  s.add_development_dependency 'rspec', '~> 3.4'
55
55
  s.add_development_dependency 'rspec-xsd', '~> 0.1.0'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Briard
4
- VERSION = '2.6.0'
4
+ VERSION = '2.6.1'
5
5
  end
@@ -3,366 +3,401 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe Briard::Metadata, vcr: true do
6
- context "write metadata as schema_org" do
7
- it "journal article" do
8
- input = "10.7554/eLife.01567"
9
- subject = Briard::Metadata.new(input: input, from: "crossref")
6
+ context 'write metadata as schema_org' do
7
+ it 'journal article' do
8
+ input = '10.7554/eLife.01567'
9
+ subject = described_class.new(input: input, from: 'crossref')
10
10
  json = JSON.parse(subject.schema_org)
11
- expect(json["@id"]).to eq("https://doi.org/10.7554/elife.01567")
12
- expect(json["@type"]).to eq("ScholarlyArticle")
13
- expect(json["isPartOf"]).to eq("@type"=>"Periodical", "issn"=>"2050-084X")
14
- expect(json["periodical"]).to eq("@type"=>"Journal", "firstPage" => "e01567", "identifier"=>"2050-084X", "identifierType"=>"ISSN", "name"=>"eLife", "volume"=>"3")
15
- expect(json["citation"].length).to eq(27)
16
- expect(json["citation"].first).to eq("@id"=>"https://doi.org/10.1038/nature02100", "@type"=>"CreativeWork")
17
- expect(json["funder"]).to eq([{"name"=>"SystemsX", "@type"=>"Organization"},
18
- {"name"=>"EMBO",
19
- "@type"=>"Organization",
20
- "@id"=>"https://doi.org/10.13039/501100003043"},
21
- {"name"=>"Swiss National Science Foundation",
22
- "@type"=>"Organization",
23
- "@id"=>"https://doi.org/10.13039/501100001711"},
24
- {"name"=>"University of Lausanne",
25
- "@type"=>"Organization",
26
- "@id"=>"https://doi.org/10.13039/501100006390"}])
27
- expect(json["license"]).to eq("https://creativecommons.org/licenses/by/3.0/legalcode")
11
+ expect(json['@id']).to eq('https://doi.org/10.7554/elife.01567')
12
+ expect(json['@type']).to eq('ScholarlyArticle')
13
+ expect(json['isPartOf']).to eq('@type' => 'Periodical', 'issn' => '2050-084X')
14
+ expect(json['periodical']).to eq('@type' => 'Journal', 'firstPage' => 'e01567',
15
+ 'identifier' => '2050-084X', 'identifierType' => 'ISSN', 'name' => 'eLife', 'volume' => '3')
16
+ expect(json['citation'].length).to eq(27)
17
+ expect(json['citation'].first).to eq('@id' => 'https://doi.org/10.1038/nature02100',
18
+ '@type' => 'CreativeWork')
19
+ expect(json['funder']).to eq([{ 'name' => 'SystemsX', '@type' => 'Organization' },
20
+ { 'name' => 'EMBO',
21
+ '@type' => 'Organization',
22
+ '@id' => 'https://doi.org/10.13039/501100003043' },
23
+ { 'name' => 'Swiss National Science Foundation',
24
+ '@type' => 'Organization',
25
+ '@id' => 'https://doi.org/10.13039/501100001711' },
26
+ { 'name' => 'University of Lausanne',
27
+ '@type' => 'Organization',
28
+ '@id' => 'https://doi.org/10.13039/501100006390' }])
29
+ expect(json['license']).to eq('https://creativecommons.org/licenses/by/3.0/legalcode')
28
30
  end
29
31
 
30
- it "maremma schema.org JSON" do
31
- input = "https://github.com/datacite/maremma"
32
- subject = Briard::Metadata.new(input: input, from: "codemeta")
32
+ it 'maremma schema.org JSON' do
33
+ input = 'https://github.com/datacite/maremma'
34
+ subject = described_class.new(input: input, from: 'codemeta')
33
35
  json = JSON.parse(subject.schema_org)
34
- expect(json["@id"]).to eq("https://doi.org/10.5438/qeg0-3gm3")
35
- expect(json["@type"]).to eq("SoftwareSourceCode")
36
- expect(json["name"]).to eq("Maremma: a Ruby library for simplified network calls")
37
- expect(json["author"]).to eq("name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner", "@type"=>"Person", "@id"=>"https://orcid.org/0000-0003-0077-4738", "affiliation" => {"@type"=>"Organization", "name"=>"DataCite"})
36
+ expect(json['@id']).to eq('https://doi.org/10.5438/qeg0-3gm3')
37
+ expect(json['@type']).to eq('SoftwareSourceCode')
38
+ expect(json['name']).to eq('Maremma: a Ruby library for simplified network calls')
39
+ expect(json['author']).to eq('name' => 'Martin Fenner', 'givenName' => 'Martin',
40
+ 'familyName' => 'Fenner', '@type' => 'Person', '@id' => 'https://orcid.org/0000-0003-0077-4738', 'affiliation' => { '@type' => 'Organization', 'name' => 'DataCite' })
38
41
  end
39
42
 
40
- it "Schema.org JSON" do
41
- input = "https://doi.org/10.5281/ZENODO.48440"
42
- subject = Briard::Metadata.new(input: input, from: "datacite")
43
+ it 'Schema.org JSON' do
44
+ input = 'https://doi.org/10.5281/ZENODO.48440'
45
+ subject = described_class.new(input: input, from: 'datacite')
43
46
  json = JSON.parse(subject.schema_org)
44
- expect(json["@id"]).to eq("https://doi.org/10.5281/zenodo.48440")
45
- expect(json["@type"]).to eq("SoftwareSourceCode")
46
- expect(json["name"]).to eq("Analysis Tools For Crossover Experiment Of Ui Using Choice Architecture")
47
- expect(json["license"]).to eq(["https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode", "info:eu-repo/semantics/openAccess"])
47
+ expect(json['@id']).to eq('https://doi.org/10.5281/zenodo.48440')
48
+ expect(json['@type']).to eq('SoftwareSourceCode')
49
+ expect(json['name']).to eq('Analysis Tools For Crossover Experiment Of Ui Using Choice Architecture')
50
+ expect(json['license']).to eq(['https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode',
51
+ 'info:eu-repo/semantics/openAccess'])
48
52
  end
49
53
 
50
- it "Another Schema.org JSON" do
51
- input = "https://doi.org/10.5061/DRYAD.8515"
52
- subject = Briard::Metadata.new(input: input, from: "datacite")
54
+ it 'Another Schema.org JSON' do
55
+ input = 'https://doi.org/10.5061/DRYAD.8515'
56
+ subject = described_class.new(input: input, from: 'datacite')
53
57
  json = JSON.parse(subject.schema_org)
54
- expect(json["@id"]).to eq("https://doi.org/10.5061/dryad.8515")
55
- expect(json["@type"]).to eq("Dataset")
56
- expect(json["license"]).to eq("https://creativecommons.org/publicdomain/zero/1.0/legalcode")
57
- expect(json["keywords"]).to eq("plasmodium, malaria, mitochondrial genome, parasites")
58
+ expect(json['@id']).to eq('https://doi.org/10.5061/dryad.8515')
59
+ expect(json['@type']).to eq('Dataset')
60
+ expect(json['license']).to eq('https://creativecommons.org/publicdomain/zero/1.0/legalcode')
61
+ expect(json['keywords']).to eq('plasmodium, malaria, mitochondrial genome, parasites')
58
62
  end
59
63
 
60
- it "Schema.org JSON IsSupplementTo" do
61
- input = "https://doi.org/10.5517/CC8H01S"
62
- subject = Briard::Metadata.new(input: input)
64
+ it 'Schema.org JSON IsSupplementTo' do
65
+ input = 'https://doi.org/10.5517/CC8H01S'
66
+ subject = described_class.new(input: input)
63
67
  json = JSON.parse(subject.schema_org)
64
- expect(json["@id"]).to eq("https://doi.org/10.5517/cc8h01s")
65
- expect(json["@type"]).to eq("Dataset")
66
- expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1107/s1600536804021154", "@type"=>"ScholarlyArticle"})
68
+ expect(json['@id']).to eq('https://doi.org/10.5517/cc8h01s')
69
+ expect(json['@type']).to eq('Dataset')
70
+ expect(json['@reverse']).to eq('isBasedOn' => {
71
+ '@id' => 'https://doi.org/10.1107/s1600536804021154', '@type' => 'ScholarlyArticle'
72
+ })
67
73
  end
68
74
 
69
- it "Schema.org JSON Cyark" do
70
- input = "https://doi.org/10.26301/jgf3-jm06"
71
- subject = Briard::Metadata.new(input: input)
75
+ it 'Schema.org JSON Cyark' do
76
+ input = 'https://doi.org/10.26301/jgf3-jm06'
77
+ subject = described_class.new(input: input)
72
78
  json = JSON.parse(subject.schema_org)
73
- expect(json["@id"]).to eq("https://doi.org/10.26301/jgf3-jm06")
74
- expect(json["@type"]).to eq("Dataset")
79
+ expect(json['@id']).to eq('https://doi.org/10.26301/jgf3-jm06')
80
+ expect(json['@type']).to eq('Dataset')
75
81
  end
76
82
 
77
- it "rdataone" do
78
- input = fixture_path + 'codemeta.json'
79
- subject = Briard::Metadata.new(input: input, from: "codemeta")
83
+ it 'rdataone' do
84
+ input = "#{fixture_path}codemeta.json"
85
+ subject = described_class.new(input: input, from: 'codemeta')
80
86
  json = JSON.parse(subject.schema_org)
81
- expect(json["@id"]).to eq("https://doi.org/10.5063/f1m61h5x")
82
- expect(json["@type"]).to eq("SoftwareSourceCode")
83
- expect(json["name"]).to eq("R Interface to the DataONE REST API")
84
- expect(json["author"]).to eq([{"name"=>"Matt Jones",
85
- "givenName"=>"Matt",
86
- "familyName"=>"Jones",
87
- "@type"=>"Person",
88
- "@id"=>"https://orcid.org/0000-0003-0077-4738",
89
- "affiliation"=>{"@type"=>"Organization", "name"=>"NCEAS"}},
90
- {"name"=>"Peter Slaughter",
91
- "givenName"=>"Peter",
92
- "familyName"=>"Slaughter",
93
- "@type"=>"Person",
94
- "@id"=>"https://orcid.org/0000-0002-2192-403X",
95
- "affiliation"=>{"@type"=>"Organization", "name"=>"NCEAS"}},
96
- {"name"=>"University Of California, Santa Barbara", "@type"=>"Organization"}])
97
- expect(json["version"]).to eq("2.0.0")
98
- expect(json["keywords"]).to eq("data sharing, data repository, dataone")
87
+ expect(json['@id']).to eq('https://doi.org/10.5063/f1m61h5x')
88
+ expect(json['@type']).to eq('SoftwareSourceCode')
89
+ expect(json['name']).to eq('R Interface to the DataONE REST API')
90
+ expect(json['author']).to eq([{ 'name' => 'Matt Jones',
91
+ 'givenName' => 'Matt',
92
+ 'familyName' => 'Jones',
93
+ '@type' => 'Person',
94
+ '@id' => 'https://orcid.org/0000-0003-0077-4738',
95
+ 'affiliation' => { '@type' => 'Organization',
96
+ 'name' => 'NCEAS' } },
97
+ { 'name' => 'Peter Slaughter',
98
+ 'givenName' => 'Peter',
99
+ 'familyName' => 'Slaughter',
100
+ '@type' => 'Person',
101
+ '@id' => 'https://orcid.org/0000-0002-2192-403X',
102
+ 'affiliation' => { '@type' => 'Organization',
103
+ 'name' => 'NCEAS' } },
104
+ { 'name' => 'University Of California, Santa Barbara',
105
+ '@type' => 'Organization' }])
106
+ expect(json['version']).to eq('2.0.0')
107
+ expect(json['keywords']).to eq('data sharing, data repository, dataone')
99
108
  end
100
109
 
101
- it "Funding" do
102
- input = "https://doi.org/10.5438/6423"
103
- subject = Briard::Metadata.new(input: input)
110
+ it 'Funding' do
111
+ input = 'https://doi.org/10.5438/6423'
112
+ subject = described_class.new(input: input)
104
113
  json = JSON.parse(subject.schema_org)
105
- expect(json["@id"]).to eq("https://doi.org/10.5438/6423")
106
- expect(json["@type"]).to eq("Collection")
107
- expect(json["hasPart"].length).to eq(25)
108
- expect(json["hasPart"].first).to eq("@type"=>"CreativeWork", "@id"=>"https://doi.org/10.5281/zenodo.30799")
109
- expect(json["funder"]).to eq("@id"=>"https://doi.org/10.13039/501100000780", "@type"=>"Organization", "name"=>"European Commission")
110
- expect(json["license"]).to eq("https://creativecommons.org/licenses/by/4.0/legalcode")
114
+ expect(json['@id']).to eq('https://doi.org/10.5438/6423')
115
+ expect(json['@type']).to eq('Collection')
116
+ expect(json['hasPart'].length).to eq(25)
117
+ expect(json['hasPart'].first).to eq('@type' => 'CreativeWork', '@id' => 'https://doi.org/10.5281/zenodo.30799')
118
+ expect(json['funder']).to eq('@id' => 'https://doi.org/10.13039/501100000780',
119
+ '@type' => 'Organization', 'name' => 'European Commission')
120
+ expect(json['license']).to eq('https://creativecommons.org/licenses/by/4.0/legalcode')
111
121
  end
112
122
 
113
- it "Funding OpenAIRE" do
114
- input = "https://doi.org/10.5281/ZENODO.1239"
115
- subject = Briard::Metadata.new(input: input)
123
+ it 'Funding OpenAIRE' do
124
+ input = 'https://doi.org/10.5281/ZENODO.1239'
125
+ subject = described_class.new(input: input)
116
126
  json = JSON.parse(subject.schema_org)
117
- expect(json["@id"]).to eq("https://doi.org/10.5281/zenodo.1239")
118
- expect(json["@type"]).to eq("Dataset")
119
- expect(json["funder"]).to eq("@id"=>"https://doi.org/10.13039/501100000780", "@type"=>"Organization", "name"=>"European Commission")
120
- expect(json["license"]).to eq(["https://creativecommons.org/publicdomain/zero/1.0/legalcode", "info:eu-repo/semantics/openAccess"])
127
+ expect(json['@id']).to eq('https://doi.org/10.5281/zenodo.1239')
128
+ expect(json['@type']).to eq('Dataset')
129
+ expect(json['funder']).to eq('@id' => 'https://doi.org/10.13039/501100000780',
130
+ '@type' => 'Organization', 'name' => 'European Commission')
131
+ expect(json['license']).to eq(['https://creativecommons.org/publicdomain/zero/1.0/legalcode',
132
+ 'info:eu-repo/semantics/openAccess'])
121
133
  end
122
134
 
123
- it "subject scheme" do
124
- input = "https://doi.org/10.4232/1.2745"
125
- subject = Briard::Metadata.new(input: input, from: "datacite")
135
+ it 'subject scheme' do
136
+ input = 'https://doi.org/10.4232/1.2745'
137
+ subject = described_class.new(input: input, from: 'datacite')
126
138
  json = JSON.parse(subject.schema_org)
127
- expect(json["@id"]).to eq("https://doi.org/10.4232/1.2745")
128
- expect(json["@type"]).to eq("Dataset")
129
- expect(json["name"]).to eq("Flash Eurobarometer 54 (Madrid Summit)")
130
- expect(json["keywords"]).to eq("KAT12 International Institutions, Relations, Conditions, Internationale Politik und Institutionen, Regierung, politische Systeme, Parteien und Verbände, Wirtschaftssysteme und wirtschaftliche Entwicklung, International politics and organisation, Government, political systems and organisation, Economic systems and development")
139
+ expect(json['@id']).to eq('https://doi.org/10.4232/1.2745')
140
+ expect(json['@type']).to eq('Dataset')
141
+ expect(json['name']).to eq('Flash Eurobarometer 54 (Madrid Summit)')
142
+ expect(json['keywords']).to eq('KAT12 International Institutions, Relations, Conditions, Internationale Politik und Institutionen, Regierung, politische Systeme, Parteien und Verbände, Wirtschaftssysteme und wirtschaftliche Entwicklung, International politics and organisation, Government, political systems and organisation, Economic systems and development')
131
143
  end
132
144
 
133
- it "subject scheme multiple keywords" do
134
- input = "https://doi.org/10.1594/pangaea.721193"
135
- subject = Briard::Metadata.new(input: input, from: "datacite")
145
+ it 'subject scheme multiple keywords' do
146
+ input = 'https://doi.org/10.1594/pangaea.721193'
147
+ subject = described_class.new(input: input, from: 'datacite')
136
148
  json = JSON.parse(subject.schema_org)
137
- expect(json["@id"]).to eq("https://doi.org/10.1594/pangaea.721193")
138
- expect(json["@type"]).to eq("Dataset")
139
- expect(json["name"]).to eq("Seawater carbonate chemistry and processes during experiments with Crassostrea gigas, 2007, supplement to: Kurihara, Haruko; Kato, Shoji; Ishimatsu, Atsushi (2007): Effects of increased seawater pCO2 on early development of the oyster Crassostrea gigas. Aquatic Biology, 1(1), 91-98")
140
- expect(json["keywords"]).to include("animalia, bottles or small containers/aquaria (&lt;20 l)")
141
- expect(json["license"]).to eq("https://creativecommons.org/licenses/by/3.0/legalcode")
149
+ expect(json['@id']).to eq('https://doi.org/10.1594/pangaea.721193')
150
+ expect(json['@type']).to eq('Dataset')
151
+ expect(json['name']).to eq('Seawater carbonate chemistry and processes during experiments with Crassostrea gigas, 2007, supplement to: Kurihara, Haruko; Kato, Shoji; Ishimatsu, Atsushi (2007): Effects of increased seawater pCO2 on early development of the oyster Crassostrea gigas. Aquatic Biology, 1(1), 91-98')
152
+ expect(json['keywords']).to include('animalia, bottles or small containers/aquaria (&lt;20 l)')
153
+ expect(json['license']).to eq('https://creativecommons.org/licenses/by/3.0/legalcode')
142
154
  end
143
155
 
144
- it "author is organization" do
145
- input = fixture_path + 'gtex.xml'
146
- url = "https://ors.datacite.org/doi:/10.25491/9hx8-ke93"
147
- content_url = "https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz"
148
- subject = Briard::Metadata.new(input: input, url: url, content_url: content_url, from: "datacite")
156
+ it 'author is organization' do
157
+ input = "#{fixture_path}gtex.xml"
158
+ url = 'https://ors.datacite.org/doi:/10.25491/9hx8-ke93'
159
+ content_url = 'https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz'
160
+ subject = described_class.new(input: input, url: url, content_url: content_url,
161
+ from: 'datacite')
149
162
  json = JSON.parse(subject.schema_org)
150
- expect(json["@id"]).to eq("https://doi.org/10.25491/9hx8-ke93")
151
- expect(json["@type"]).to eq("Dataset")
152
- expect(json["author"]).to eq("@type"=>"Organization", "name"=>"The GTEx Consortium")
153
- expect(json["url"]).to eq("https://ors.datacite.org/doi:/10.25491/9hx8-ke93")
154
- expect(json["encodingFormat"]).to eq("application/tar")
155
- expect(json["contentSize"]).to eq("15.7M")
156
- expect(json["contentUrl"]).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz")
157
- expect(json["includedInDataCatalog"]).to eq("@id"=>"https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663", "@type"=>"DataCatalog", "name"=>"GTEx")
158
- expect(json["@reverse"]).to eq("isBasedOn"=>{"@id"=>"https://doi.org/10.1038/nmeth.4407", "@type"=>"ScholarlyArticle"})
163
+ expect(json['@id']).to eq('https://doi.org/10.25491/9hx8-ke93')
164
+ expect(json['@type']).to eq('Dataset')
165
+ expect(json['author']).to eq('@type' => 'Organization', 'name' => 'The GTEx Consortium')
166
+ expect(json['url']).to eq('https://ors.datacite.org/doi:/10.25491/9hx8-ke93')
167
+ expect(json['encodingFormat']).to eq('application/tar')
168
+ expect(json['contentSize']).to eq('15.7M')
169
+ expect(json['contentUrl']).to eq('https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz')
170
+ expect(json['includedInDataCatalog']).to eq(
171
+ '@id' => 'https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663', '@type' => 'DataCatalog', 'name' => 'GTEx'
172
+ )
173
+ expect(json['@reverse']).to eq('isBasedOn' => { '@id' => 'https://doi.org/10.1038/nmeth.4407',
174
+ '@type' => 'ScholarlyArticle' })
159
175
  end
160
176
 
161
- it "series information" do
162
- input = "10.4229/23RDEUPVSEC2008-5CO.8.3"
163
- subject = Briard::Metadata.new(input: input, from: "datacite")
177
+ it 'series information' do
178
+ input = '10.4229/23RDEUPVSEC2008-5CO.8.3'
179
+ subject = described_class.new(input: input, from: 'datacite')
164
180
  json = JSON.parse(subject.schema_org)
165
- expect(json["@id"]).to eq("https://doi.org/10.4229/23rdeupvsec2008-5co.8.3")
166
- expect(json["@type"]).to eq("ScholarlyArticle")
167
- expect(json["name"]).to eq("Rural Electrification With Hybrid Power Systems Based on Renewables - Technical System Configurations From the Point of View of the European Industry")
168
- expect(json["author"].count).to eq(3)
169
- expect(json["author"].first).to eq("@type"=>"Person", "name"=>"P. Llamas", "givenName"=>"P.", "familyName"=>"Llamas")
170
- expect(json["periodical"]).to eq("@type"=>"Series", "firstPage"=>"Spain; 3353", "lastPage"=>"3356", "name"=>"23rd European Photovoltaic Solar Energy Conference and Exhibition", "volume"=>"1-5 September 2008")
181
+ expect(json['@id']).to eq('https://doi.org/10.4229/23rdeupvsec2008-5co.8.3')
182
+ expect(json['@type']).to eq('ScholarlyArticle')
183
+ expect(json['name']).to eq('Rural Electrification With Hybrid Power Systems Based on Renewables - Technical System Configurations From the Point of View of the European Industry')
184
+ expect(json['author'].count).to eq(3)
185
+ expect(json['author'].first).to eq('@type' => 'Person', 'name' => 'P. Llamas', 'givenName' => 'P.',
186
+ 'familyName' => 'Llamas')
187
+ expect(json['periodical']).to eq('@type' => 'Series', 'firstPage' => 'Spain; 3353',
188
+ 'lastPage' => '3356', 'name' => '23rd European Photovoltaic Solar Energy Conference and Exhibition', 'volume' => '1-5 September 2008')
171
189
  end
172
190
 
173
- it "data catalog" do
174
- input = "10.25491/8KMC-G314"
175
- subject = Briard::Metadata.new(input: input, from: "datacite")
191
+ it 'data catalog' do
192
+ input = '10.25491/8KMC-G314'
193
+ subject = described_class.new(input: input, from: 'datacite')
176
194
  json = JSON.parse(subject.schema_org)
177
- expect(json["@id"]).to eq("https://doi.org/10.25491/8kmc-g314")
178
- expect(json["@type"]).to eq("Dataset")
179
- expect(json["name"]).to eq("Covariates used in eQTL analysis. Includes genotyping principal components and PEER factors")
180
- expect(json["author"]).to eq("@type"=>"Organization", "name"=>"The GTEx Consortium")
181
- expect(json["includedInDataCatalog"]).to eq("@type"=>"DataCatalog", "name"=>"GTEx")
182
- expect(json["identifier"]).to eq("@type"=>"PropertyValue", "propertyID"=>"md5", "value"=>"c7c89fe7366d50cd75448aa603c9de58")
183
- expect(json["contentUrl"]).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_covariates.tar.gz")
195
+ expect(json['@id']).to eq('https://doi.org/10.25491/8kmc-g314')
196
+ expect(json['@type']).to eq('Dataset')
197
+ expect(json['name']).to eq('Covariates used in eQTL analysis. Includes genotyping principal components and PEER factors')
198
+ expect(json['author']).to eq('@type' => 'Organization', 'name' => 'The GTEx Consortium')
199
+ expect(json['includedInDataCatalog']).to eq('@type' => 'DataCatalog', 'name' => 'GTEx')
200
+ expect(json['identifier']).to eq('@type' => 'PropertyValue', 'propertyID' => 'md5',
201
+ 'value' => 'c7c89fe7366d50cd75448aa603c9de58')
202
+ expect(json['contentUrl']).to eq('https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_covariates.tar.gz')
184
203
  end
185
204
 
186
- it "alternate identifiers" do
187
- input = "10.23725/8na3-9s47"
188
- subject = Briard::Metadata.new(input: input, from: "datacite")
205
+ it 'alternate identifiers' do
206
+ input = '10.23725/8na3-9s47'
207
+ subject = described_class.new(input: input, from: 'datacite')
189
208
  json = JSON.parse(subject.schema_org)
190
- expect(json["@id"]).to eq("https://doi.org/10.23725/8na3-9s47")
191
- expect(json["@type"]).to eq("Dataset")
192
- expect(json["name"]).to eq("NWD165827.recab.cram")
193
- expect(json["author"]).to eq("name"=>"TOPMed")
194
- expect(json["includedInDataCatalog"]).to be_nil
195
- expect(json["identifier"]).to eq(
196
- [{"@type"=>"PropertyValue",
197
- "propertyID"=>"minid",
198
- "value"=>"ark:/99999/fk41CrU4eszeLUDe"},
199
- {"@type"=>"PropertyValue",
200
- "propertyID"=>"dataguid",
201
- "value"=>"dg.4503/c3d66dc9-58da-411c-83c4-dd656aa3c4b7"},
202
- {"@type"=>"PropertyValue",
203
- "propertyID"=>"md5",
204
- "value"=>"3b33f6b9338fccab0901b7d317577ea3"}]
209
+ expect(json['@id']).to eq('https://doi.org/10.23725/8na3-9s47')
210
+ expect(json['@type']).to eq('Dataset')
211
+ expect(json['name']).to eq('NWD165827.recab.cram')
212
+ expect(json['author']).to eq('name' => 'TOPMed')
213
+ expect(json['includedInDataCatalog'].nil?).to be(true)
214
+ expect(json['identifier']).to eq(
215
+ [{ '@type' => 'PropertyValue',
216
+ 'propertyID' => 'minid',
217
+ 'value' => 'ark:/99999/fk41CrU4eszeLUDe' },
218
+ { '@type' => 'PropertyValue',
219
+ 'propertyID' => 'dataguid',
220
+ 'value' => 'dg.4503/c3d66dc9-58da-411c-83c4-dd656aa3c4b7' },
221
+ { '@type' => 'PropertyValue',
222
+ 'propertyID' => 'md5',
223
+ 'value' => '3b33f6b9338fccab0901b7d317577ea3' }]
224
+ )
225
+ expect(json['contentUrl']).to include(
226
+ 's3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram', 'gs://topmed-irc-share/public/NWD165827.recab.cram'
205
227
  )
206
- expect(json["contentUrl"]).to include("s3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram", "gs://topmed-irc-share/public/NWD165827.recab.cram")
207
228
  end
208
229
 
209
- it "affiliation identifier" do
210
- input = fixture_path + 'datacite-example-affiliation.xml'
211
- subject = Briard::Metadata.new(input: input)
230
+ it 'affiliation identifier' do
231
+ input = "#{fixture_path}datacite-example-affiliation.xml"
232
+ subject = described_class.new(input: input)
212
233
  json = JSON.parse(subject.schema_org)
213
- expect(json["@id"]).to eq("https://doi.org/10.5072/example-full")
214
- expect(json["@type"]).to eq("SoftwareSourceCode")
215
- expect(json["name"]).to eq("Full DataCite XML Example")
216
- expect(json["author"].length).to eq(3)
217
- expect(json["author"].first).to eq("@id" => "https://orcid.org/0000-0001-5000-0007",
218
- "@type" => "Person",
219
- "affiliation" => {"@id"=>"https://ror.org/04wxnsj81", "@type"=>"Organization", "name"=>"DataCite"},
220
- "familyName" => "Miller",
221
- "givenName" => "Elizabeth",
222
- "name" => "Elizabeth Miller")
223
- expect(json["identifier"]).to eq(
224
- {"@type"=>"PropertyValue",
225
- "propertyID"=>"URL",
226
- "value"=>"https://schema.datacite.org/meta/kernel-4.2/example/datacite-example-full-v4.2.xml"}
234
+ expect(json['@id']).to eq('https://doi.org/10.5072/example-full')
235
+ expect(json['@type']).to eq('SoftwareSourceCode')
236
+ expect(json['name']).to eq('Full DataCite XML Example')
237
+ expect(json['author'].length).to eq(3)
238
+ expect(json['author'].first).to eq('@id' => 'https://orcid.org/0000-0001-5000-0007',
239
+ '@type' => 'Person',
240
+ 'affiliation' => { '@id' => 'https://ror.org/04wxnsj81', '@type' => 'Organization',
241
+ 'name' => 'DataCite' },
242
+ 'familyName' => 'Miller',
243
+ 'givenName' => 'Elizabeth',
244
+ 'name' => 'Elizabeth Miller')
245
+ expect(json['identifier']).to eq(
246
+ { '@type' => 'PropertyValue',
247
+ 'propertyID' => 'URL',
248
+ 'value' => 'https://schema.datacite.org/meta/kernel-4.2/example/datacite-example-full-v4.2.xml' }
227
249
  )
228
- expect(json["license"]).to eq("https://creativecommons.org/publicdomain/zero/1.0/legalcode")
250
+ expect(json['license']).to eq('https://creativecommons.org/publicdomain/zero/1.0/legalcode')
229
251
  end
230
252
 
231
- it "geo_location_point" do
232
- input = fixture_path + 'datacite-example-geolocation-2.xml'
233
- doi = "10.6071/Z7WC73"
234
- subject = Briard::Metadata.new(input: input, doi: doi)
253
+ it 'geo_location_point' do
254
+ input = "#{fixture_path}datacite-example-geolocation-2.xml"
255
+ doi = '10.6071/Z7WC73'
256
+ subject = described_class.new(input: input, doi: doi)
235
257
  json = JSON.parse(subject.schema_org)
236
- expect(json["@id"]).to eq("https://doi.org/10.6071/z7wc73")
237
- expect(json["@type"]).to eq("Dataset")
238
- expect(json["name"]).to eq("Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek meteorological data, soil moisture and temperature, snow depth and air temperature")
239
- expect(json["author"].length).to eq(6)
240
- expect(json["author"][2]).to eq("@id"=>"https://orcid.org/0000-0002-8862-1404", "@type"=>"Person", "familyName"=>"Stacy", "givenName"=>"Erin", "name"=>"Erin Stacy", "affiliation" => {"@type"=>"Organization", "name"=>"UC Merced"})
241
- expect(json["includedInDataCatalog"]).to be_nil
242
- expect(json["spatialCoverage"]).to eq([{"@type"=>"Place",
243
- "geo"=>
244
- {"@type"=>"GeoCoordinates",
245
- "address"=>"Providence Creek (Lower, Upper and P301)",
246
- "latitude"=>"37.047756",
247
- "longitude"=>"-119.221094"}},
248
- {"@type"=>"Place",
249
- "geo"=>
250
- {"@type"=>"GeoShape",
251
- "address"=>"Providence Creek (Lower, Upper and P301)",
252
- "box"=>"37.046 -119.211 37.075 -119.182"}}])
253
- expect(json["license"]).to eq("https://creativecommons.org/licenses/by/4.0/legalcode")
258
+ expect(json['@id']).to eq('https://doi.org/10.6071/z7wc73')
259
+ expect(json['@type']).to eq('Dataset')
260
+ expect(json['name']).to eq('Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek meteorological data, soil moisture and temperature, snow depth and air temperature')
261
+ expect(json['author'].length).to eq(6)
262
+ expect(json['author'][2]).to eq('@id' => 'https://orcid.org/0000-0002-8862-1404',
263
+ '@type' => 'Person', 'familyName' => 'Stacy', 'givenName' => 'Erin', 'name' => 'Erin Stacy', 'affiliation' => { '@type' => 'Organization', 'name' => 'UC Merced' })
264
+ expect(json['includedInDataCatalog'].nil?).to be(true)
265
+ expect(json['spatialCoverage']).to eq([{ '@type' => 'Place',
266
+ 'geo' =>
267
+ { '@type' => 'GeoCoordinates',
268
+ 'address' => 'Providence Creek (Lower, Upper and P301)',
269
+ 'latitude' => '37.047756',
270
+ 'longitude' => '-119.221094' } },
271
+ { '@type' => 'Place',
272
+ 'geo' =>
273
+ { '@type' => 'GeoShape',
274
+ 'address' => 'Providence Creek (Lower, Upper and P301)',
275
+ 'box' => '37.046 -119.211 37.075 -119.182' } }])
276
+ expect(json['license']).to eq('https://creativecommons.org/licenses/by/4.0/legalcode')
254
277
  end
255
278
 
256
- it "geo_location_box" do
257
- input = "10.1594/PANGAEA.842237"
258
- subject = Briard::Metadata.new(input: input, from: "datacite")
279
+ it 'geo_location_box' do
280
+ input = '10.1594/PANGAEA.842237'
281
+ subject = described_class.new(input: input, from: 'datacite')
259
282
  json = JSON.parse(subject.schema_org)
260
- expect(json["@id"]).to eq("https://doi.org/10.1594/pangaea.842237")
261
- expect(json["@type"]).to eq("Dataset")
262
- expect(json["name"]).to eq("Registry of all stations from the Tara Oceans Expedition (2009-2013)")
263
- expect(json["author"]).to eq([{"familyName"=>"Tara Oceans Consortium",
264
- "givenName"=>"Coordinators",
265
- "name"=>"Coordinators Tara Oceans Consortium"},
266
- {"familyName"=>"Tara Oceans Expedition",
267
- "givenName"=>"Participants",
268
- "name"=>"Participants Tara Oceans Expedition"}])
269
- expect(json["includedInDataCatalog"]).to be_nil
270
- expect(json["spatialCoverage"]).to eq("@type"=>"Place", "geo"=>{"@type"=>"GeoShape", "box"=>"-64.3088 -168.5182 79.6753 174.9006"})
271
- expect(json["license"]).to eq("https://creativecommons.org/licenses/by/3.0/legalcode")
283
+ expect(json['@id']).to eq('https://doi.org/10.1594/pangaea.842237')
284
+ expect(json['@type']).to eq('Dataset')
285
+ expect(json['name']).to eq('Registry of all stations from the Tara Oceans Expedition (2009-2013)')
286
+ expect(json['author']).to eq([{ 'familyName' => 'Tara Oceans Consortium',
287
+ 'givenName' => 'Coordinators',
288
+ 'name' => 'Coordinators Tara Oceans Consortium' },
289
+ { 'familyName' => 'Tara Oceans Expedition',
290
+ 'givenName' => 'Participants',
291
+ 'name' => 'Participants Tara Oceans Expedition' }])
292
+ expect(json['includedInDataCatalog'].nil?).to be(true)
293
+ expect(json['spatialCoverage']).to eq('@type' => 'Place',
294
+ 'geo' => {
295
+ '@type' => 'GeoShape', 'box' => '-64.3088 -168.5182 79.6753 174.9006'
296
+ })
297
+ expect(json['license']).to eq('https://creativecommons.org/licenses/by/3.0/legalcode')
272
298
  end
273
299
 
274
- it "geo_location_polygon" do
275
- input = fixture_path + 'datacite-example-polygon-v4.1.xml'
276
- subject = Briard::Metadata.new(input: input)
300
+ it 'geo_location_polygon' do
301
+ input = "#{fixture_path}datacite-example-polygon-v4.1.xml"
302
+ subject = described_class.new(input: input)
277
303
  json = JSON.parse(subject.schema_org)
278
- expect(json["@id"]).to eq("https://doi.org/10.5072/example-polygon")
279
- expect(json["@type"]).to eq("Dataset")
280
- expect(json["name"]).to eq("Meteo measurements at the Sand Motor")
281
- expect(json["author"]).to eq("@type"=>"Person", "familyName"=>"Den Heijer", "givenName"=>"C", "name"=>"C Den Heijer")
282
- expect(json["includedInDataCatalog"]).to be_nil
283
- expect(json["spatialCoverage"].dig("geo", "polygon").length).to eq(34)
284
- expect(json["spatialCoverage"].dig("geo", "polygon")[0].first).to eq(["4.1738852605822", "52.03913926329928"])
304
+ expect(json['@id']).to eq('https://doi.org/10.5072/example-polygon')
305
+ expect(json['@type']).to eq('Dataset')
306
+ expect(json['name']).to eq('Meteo measurements at the Sand Motor')
307
+ expect(json['author']).to eq('@type' => 'Person', 'familyName' => 'Den Heijer', 'givenName' => 'C',
308
+ 'name' => 'C Den Heijer')
309
+ expect(json['includedInDataCatalog'].nil?).to be(true)
310
+ expect(json['spatialCoverage'].dig('geo', 'polygon').length).to eq(34)
311
+ expect(json['spatialCoverage'].dig('geo',
312
+ 'polygon')[0].first).to eq(['4.1738852605822',
313
+ '52.03913926329928'])
285
314
  end
286
315
 
287
- it "from schema_org gtex" do
288
- input = fixture_path + 'schema_org_gtex.json'
289
- subject = Briard::Metadata.new(input: input, from: "schema_org")
316
+ it 'from schema_org gtex' do
317
+ input = "#{fixture_path}schema_org_gtex.json"
318
+ subject = described_class.new(input: input, from: 'schema_org')
290
319
  json = JSON.parse(subject.schema_org)
291
- expect(json["@id"]).to eq("https://doi.org/10.25491/d50j-3083")
292
- expect(json["@type"]).to eq("Dataset")
293
- expect(json["identifier"]).to eq("@type"=>"PropertyValue", "propertyID"=>"md5", "value"=>"687610993")
294
- expect(json["url"]).to eq("https://ors.datacite.org/doi:/10.25491/d50j-3083")
295
- expect(json["additionalType"]).to eq("Gene expression matrices")
296
- expect(json["name"]).to eq("Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery")
297
- expect(json["version"]).to eq("v7")
298
- expect(json["author"]).to eq("@type"=>"Organization", "name"=>"The GTEx Consortium")
299
- expect(json["keywords"]).to eq("gtex, annotation, phenotype, gene regulation, transcriptomics")
300
- expect(json["datePublished"]).to eq("2017")
301
- expect(json["contentUrl"]).to eq("https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz")
302
- expect(json["schemaVersion"]).to eq("http://datacite.org/schema/kernel-4")
303
- expect(json["includedInDataCatalog"]).to eq("@type"=>"DataCatalog", "name"=>"GTEx")
304
- expect(json["publisher"]).to eq("@type"=>"Organization", "name"=>"GTEx")
305
- expect(json["funder"]).to eq([{"@id"=>"https://doi.org/10.13039/100000052",
306
- "name"=>"Common Fund of the Office of the Director of the NIH",
307
- "@type"=>"Organization"},
308
- {"@id"=>"https://doi.org/10.13039/100000054",
309
- "name"=>"National Cancer Institute (NCI)",
310
- "@type"=>"Organization"},
311
- {"@id"=>"https://doi.org/10.13039/100000051",
312
- "name"=>"National Human Genome Research Institute (NHGRI)",
313
- "@type"=>"Organization"},
314
- {"@id"=>"https://doi.org/10.13039/100000050",
315
- "name"=>"National Heart, Lung, and Blood Institute (NHLBI)",
316
- "@type"=>"Organization"},
317
- {"@id"=>"https://doi.org/10.13039/100000026",
318
- "name"=>"National Institute on Drug Abuse (NIDA)",
319
- "@type"=>"Organization"},
320
- {"@id"=>"https://doi.org/10.13039/100000025",
321
- "name"=>"National Institute of Mental Health (NIMH)",
322
- "@type"=>"Organization"},
323
- {"@id"=>"https://doi.org/10.13039/100000065",
324
- "name"=>"National Institute of Neurological Disorders and Stroke (NINDS)",
325
- "@type"=>"Organization"}])
326
- expect(json["provider"]).to eq("@type"=>"Organization", "name"=>"DataCite")
320
+ expect(json['@id']).to eq('https://doi.org/10.25491/d50j-3083')
321
+ expect(json['@type']).to eq('Dataset')
322
+ expect(json['identifier']).to eq('@type' => 'PropertyValue', 'propertyID' => 'md5',
323
+ 'value' => '687610993')
324
+ expect(json['url']).to eq('https://ors.datacite.org/doi:/10.25491/d50j-3083')
325
+ expect(json['additionalType']).to eq('Gene expression matrices')
326
+ expect(json['name']).to eq('Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery')
327
+ expect(json['version']).to eq('v7')
328
+ expect(json['author']).to eq('@type' => 'Organization', 'name' => 'The GTEx Consortium')
329
+ expect(json['keywords']).to eq('gtex, annotation, phenotype, gene regulation, transcriptomics')
330
+ expect(json['datePublished']).to eq('2017')
331
+ expect(json['contentUrl']).to eq('https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz')
332
+ expect(json['schemaVersion']).to eq('http://datacite.org/schema/kernel-4')
333
+ expect(json['includedInDataCatalog']).to eq('@type' => 'DataCatalog', 'name' => 'GTEx')
334
+ expect(json['publisher']).to eq('@type' => 'Organization', 'name' => 'GTEx')
335
+ expect(json['funder']).to eq([{ '@id' => 'https://doi.org/10.13039/100000052',
336
+ 'name' => 'Common Fund of the Office of the Director of the NIH',
337
+ '@type' => 'Organization' },
338
+ { '@id' => 'https://doi.org/10.13039/100000054',
339
+ 'name' => 'National Cancer Institute (NCI)',
340
+ '@type' => 'Organization' },
341
+ { '@id' => 'https://doi.org/10.13039/100000051',
342
+ 'name' => 'National Human Genome Research Institute (NHGRI)',
343
+ '@type' => 'Organization' },
344
+ { '@id' => 'https://doi.org/10.13039/100000050',
345
+ 'name' => 'National Heart, Lung, and Blood Institute (NHLBI)',
346
+ '@type' => 'Organization' },
347
+ { '@id' => 'https://doi.org/10.13039/100000026',
348
+ 'name' => 'National Institute on Drug Abuse (NIDA)',
349
+ '@type' => 'Organization' },
350
+ { '@id' => 'https://doi.org/10.13039/100000025',
351
+ 'name' => 'National Institute of Mental Health (NIMH)',
352
+ '@type' => 'Organization' },
353
+ { '@id' => 'https://doi.org/10.13039/100000065',
354
+ 'name' => 'National Institute of Neurological Disorders and Stroke (NINDS)',
355
+ '@type' => 'Organization' }])
356
+ expect(json['provider']).to eq('@type' => 'Organization', 'name' => 'DataCite')
327
357
  end
328
358
 
329
- it "from schema_org topmed" do
330
- input = fixture_path + 'schema_org_topmed.json'
331
- subject = Briard::Metadata.new(input: input, from: "schema_org")
359
+ it 'from schema_org topmed' do
360
+ input = "#{fixture_path}schema_org_topmed.json"
361
+ subject = described_class.new(input: input, from: 'schema_org')
332
362
  json = JSON.parse(subject.schema_org)
333
- expect(json["@id"]).to eq("https://doi.org/10.23725/8na3-9s47")
334
- expect(json["@type"]).to eq("Dataset")
335
- expect(json["identifier"]).to eq(
336
- [{"@type"=>"PropertyValue",
337
- "propertyID"=>"md5",
338
- "value"=>"3b33f6b9338fccab0901b7d317577ea3"},
339
- {"@type"=>"PropertyValue",
340
- "propertyID"=>"minid",
341
- "value"=>"ark:/99999/fk41CrU4eszeLUDe"},
342
- {"@type"=>"PropertyValue",
343
- "propertyID"=>"dataguid",
344
- "value"=>"dg.4503/c3d66dc9-58da-411c-83c4-dd656aa3c4b7"}])
345
- expect(json["url"]).to eq("https://ors.datacite.org/doi:/10.23725/8na3-9s47")
346
- expect(json["additionalType"]).to eq("CRAM file")
347
- expect(json["name"]).to eq("NWD165827.recab.cram")
348
- expect(json["author"]).to eq("@type"=>"Organization", "name"=>"TOPMed IRC")
349
- expect(json["keywords"]).to eq("topmed, whole genome sequencing")
350
- expect(json["datePublished"]).to eq("2017-11-30")
351
- expect(json["contentUrl"]).to eq(["s3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram", "gs://topmed-irc-share/public/NWD165827.recab.cram"])
352
- expect(json["schemaVersion"]).to eq("http://datacite.org/schema/kernel-4")
353
- expect(json["publisher"]).to eq("@type"=>"Organization", "name"=>"TOPMed")
354
- expect(json["citation"]).to eq("@id"=>"https://doi.org/10.23725/2g4s-qv04", "@type"=>"Dataset")
355
- expect(json["funder"]).to eq("@id"=>"https://doi.org/10.13039/100000050", "@type"=>"Organization", "name"=>"National Heart, Lung, and Blood Institute (NHLBI)")
356
- expect(json["provider"]).to eq("@type"=>"Organization", "name"=>"DataCite")
363
+ expect(json['@id']).to eq('https://doi.org/10.23725/8na3-9s47')
364
+ expect(json['@type']).to eq('Dataset')
365
+ expect(json['identifier']).to eq(
366
+ [{ '@type' => 'PropertyValue',
367
+ 'propertyID' => 'md5',
368
+ 'value' => '3b33f6b9338fccab0901b7d317577ea3' },
369
+ { '@type' => 'PropertyValue',
370
+ 'propertyID' => 'minid',
371
+ 'value' => 'ark:/99999/fk41CrU4eszeLUDe' },
372
+ { '@type' => 'PropertyValue',
373
+ 'propertyID' => 'dataguid',
374
+ 'value' => 'dg.4503/c3d66dc9-58da-411c-83c4-dd656aa3c4b7' }]
375
+ )
376
+ expect(json['url']).to eq('https://ors.datacite.org/doi:/10.23725/8na3-9s47')
377
+ expect(json['additionalType']).to eq('CRAM file')
378
+ expect(json['name']).to eq('NWD165827.recab.cram')
379
+ expect(json['author']).to eq('@type' => 'Organization', 'name' => 'TOPMed IRC')
380
+ expect(json['keywords']).to eq('topmed, whole genome sequencing')
381
+ expect(json['datePublished']).to eq('2017-11-30')
382
+ expect(json['contentUrl']).to eq([
383
+ 's3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram', 'gs://topmed-irc-share/public/NWD165827.recab.cram'
384
+ ])
385
+ expect(json['schemaVersion']).to eq('http://datacite.org/schema/kernel-4')
386
+ expect(json['publisher']).to eq('@type' => 'Organization', 'name' => 'TOPMed')
387
+ expect(json['citation']).to eq('@id' => 'https://doi.org/10.23725/2g4s-qv04',
388
+ '@type' => 'Dataset')
389
+ expect(json['funder']).to eq('@id' => 'https://doi.org/10.13039/100000050',
390
+ '@type' => 'Organization', 'name' => 'National Heart, Lung, and Blood Institute (NHLBI)')
391
+ expect(json['provider']).to eq('@type' => 'Organization', 'name' => 'DataCite')
357
392
  end
358
393
 
359
- it "interactive resource without dates" do
360
- input = "https://doi.org/10.34747/g6yb-3412"
361
- subject = Briard::Metadata.new(input: input, from: "datacite")
394
+ it 'interactive resource without dates' do
395
+ input = 'https://doi.org/10.34747/g6yb-3412'
396
+ subject = described_class.new(input: input, from: 'datacite')
362
397
  json = JSON.parse(subject.schema_org)
363
- expect(json["@id"]).to eq("https://doi.org/10.34747/g6yb-3412")
364
- expect(json["@type"]).to eq("CreativeWork")
365
- expect(json["datePublished"]).to eq("2019")
398
+ expect(json['@id']).to eq('https://doi.org/10.34747/g6yb-3412')
399
+ expect(json['@type']).to eq('CreativeWork')
400
+ expect(json['datePublished']).to eq('2019')
366
401
  end
367
402
  end
368
403
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: briard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-18 00:00:00.000000000 Z
11
+ date: 2022-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -528,14 +528,14 @@ dependencies:
528
528
  requirements:
529
529
  - - "~>"
530
530
  - !ruby/object:Gem::Version
531
- version: '0'
531
+ version: '2.0'
532
532
  type: :development
533
533
  prerelease: false
534
534
  version_requirements: !ruby/object:Gem::Requirement
535
535
  requirements:
536
536
  - - "~>"
537
537
  - !ruby/object:Gem::Version
538
- version: '0'
538
+ version: '2.0'
539
539
  - !ruby/object:Gem::Dependency
540
540
  name: rake
541
541
  requirement: !ruby/object:Gem::Requirement