bolognese 1.1.8 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/lib/bolognese/author_utils.rb +2 -2
- data/lib/bolognese/datacite_utils.rb +47 -6
- data/lib/bolognese/metadata.rb +2 -1
- data/lib/bolognese/readers/datacite_reader.rb +2 -2
- data/lib/bolognese/utils.rb +2 -2
- data/lib/bolognese/version.rb +1 -1
- data/resources/kernel-4.2/metadata.xsd +1 -5
- data/resources/kernel-4/metadata.xsd +1 -5
- data/spec/fixtures/aida.json +82 -0
- data/spec/fixtures/datacite-example-geolocation-2.xml +1 -0
- data/spec/readers/datacite_reader_spec.rb +13 -1
- data/spec/readers/schema_org_reader_spec.rb +22 -0
- data/spec/writers/datacite_writer_spec.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a40e4d003bd824575e53ce801d8579333a01d87c868a9fb5f5d2f7d83a285985
|
4
|
+
data.tar.gz: b69f7a90359bddfd9f7f65882e9faeb20651f91bb71d634e3885b8cc33a5d3e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88b0e6943536624a09a0b65a5ad91baaf9e0c92086e5ed081daaa8d3cd9e9c2e84432a15d8292eeb3015883bc2d74e0183ba6bed4493776b2b035760910d95ba
|
7
|
+
data.tar.gz: 4738c206fd36978d43b57e91363efb0608b497341a22bb76b7825a3ecda213d27252f0d7c0e25fb57b2f91003b565ca086872db6fc33f05788f380af238fc1ec
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (1.1.
|
4
|
+
bolognese (1.1.11)
|
5
5
|
activesupport (>= 4.2.5, < 6)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (~> 4.1)
|
@@ -28,12 +28,12 @@ PATH
|
|
28
28
|
GEM
|
29
29
|
remote: https://rubygems.org/
|
30
30
|
specs:
|
31
|
-
activesupport (5.2.
|
31
|
+
activesupport (5.2.3)
|
32
32
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
33
33
|
i18n (>= 0.7, < 2)
|
34
34
|
minitest (~> 5.1)
|
35
35
|
tzinfo (~> 1.1)
|
36
|
-
addressable (2.
|
36
|
+
addressable (2.6.0)
|
37
37
|
public_suffix (>= 2.0.2, < 4.0)
|
38
38
|
benchmark_methods (0.7)
|
39
39
|
bibtex-ruby (4.4.7)
|
@@ -112,12 +112,12 @@ GEM
|
|
112
112
|
nokogiri (1.8.5)
|
113
113
|
mini_portile2 (~> 2.3.0)
|
114
114
|
oj (2.18.5)
|
115
|
-
postrank-uri (1.0.
|
116
|
-
addressable (>= 2.
|
117
|
-
nokogiri (>= 1.
|
115
|
+
postrank-uri (1.0.24)
|
116
|
+
addressable (>= 2.4.0)
|
117
|
+
nokogiri (>= 1.8.0)
|
118
118
|
public_suffix (>= 2.0.0, < 2.1)
|
119
119
|
public_suffix (2.0.5)
|
120
|
-
rack (2.0.
|
120
|
+
rack (2.0.7)
|
121
121
|
rack-test (0.8.3)
|
122
122
|
rack (>= 1.0, < 3)
|
123
123
|
rake (12.3.2)
|
@@ -51,7 +51,7 @@ module Bolognese
|
|
51
51
|
"givenName" => given_name,
|
52
52
|
"familyName" => family_name,
|
53
53
|
"nameIdentifiers" => name_identifiers,
|
54
|
-
"affiliation" => parse_attributes(author.fetch("affiliation", nil)
|
54
|
+
"affiliation" => parse_attributes(author.fetch("affiliation", nil)),
|
55
55
|
"contributorType" => contributor_type }.compact
|
56
56
|
|
57
57
|
return author if family_name.present?
|
@@ -74,7 +74,7 @@ module Bolognese
|
|
74
74
|
"givenName" => given_name,
|
75
75
|
"familyName" => family_name,
|
76
76
|
"nameIdentifiers" => name_identifiers,
|
77
|
-
"affiliation" => parse_attributes(author.fetch("affiliation", nil)
|
77
|
+
"affiliation" => parse_attributes(author.fetch("affiliation", nil)),
|
78
78
|
"contributorType" => contributor_type }.compact
|
79
79
|
else
|
80
80
|
{ "nameType" => name_type, "name" => name }.compact
|
@@ -31,12 +31,13 @@ module Bolognese
|
|
31
31
|
insert_alternate_identifiers(xml)
|
32
32
|
insert_subjects(xml)
|
33
33
|
insert_contributors(xml)
|
34
|
-
insert_funding_references(xml)
|
35
34
|
insert_dates(xml)
|
36
35
|
insert_related_identifiers(xml)
|
37
36
|
insert_version(xml)
|
38
37
|
insert_rights_list(xml)
|
39
38
|
insert_descriptions(xml)
|
39
|
+
insert_geo_locations(xml)
|
40
|
+
insert_funding_references(xml)
|
40
41
|
end
|
41
42
|
|
42
43
|
def insert_identifier(xml)
|
@@ -74,7 +75,9 @@ module Bolognese
|
|
74
75
|
Array.wrap(person["nameIdentifiers"]).each do |ni|
|
75
76
|
xml.nameIdentifier(ni["nameIdentifier"], 'nameIdentifierScheme' => ni["nameIdentifierScheme"], 'schemeURI' => ni["schemeUri"])
|
76
77
|
end
|
77
|
-
|
78
|
+
Array.wrap(person["affiliation"]).each do |affiliation|
|
79
|
+
xml.affiliation(affiliation)
|
80
|
+
end
|
78
81
|
end
|
79
82
|
|
80
83
|
def insert_titles(xml)
|
@@ -214,11 +217,10 @@ module Bolognese
|
|
214
217
|
|
215
218
|
xml.descriptions do
|
216
219
|
if container && container["title"].present?
|
217
|
-
|
218
|
-
|
219
|
-
volume += "(#{container["issue"]})" if container["issue"].present?
|
220
|
+
issue = container["issue"].present? ? "(#{container["issue"]})" : nil
|
221
|
+
volume_issue = container["volume"].present? ? [container["volume"], issue].join("") : nil
|
220
222
|
pages = [container["firstPage"], container["lastPage"]].compact.join("-") if container["firstPage"].present?
|
221
|
-
series_information = [title,
|
223
|
+
series_information = [container["title"], volume_issue, pages].compact.join(", ")
|
222
224
|
xml.description(series_information, 'descriptionType' => "SeriesInformation")
|
223
225
|
end
|
224
226
|
|
@@ -238,6 +240,45 @@ module Bolognese
|
|
238
240
|
end
|
239
241
|
end
|
240
242
|
|
243
|
+
def insert_geo_locations(xml)
|
244
|
+
return xml unless geo_locations.present?
|
245
|
+
|
246
|
+
xml.geoLocations do
|
247
|
+
geo_locations.each do |geo_location|
|
248
|
+
xml.geoLocation do
|
249
|
+
xml.geoLocationPlace(geo_location["geoLocationPlace"]) if geo_location["geoLocationPlace"]
|
250
|
+
|
251
|
+
if geo_location["geoLocationPoint"]
|
252
|
+
xml.geoLocationPoint do
|
253
|
+
xml.pointLatitude(geo_location.dig("geoLocationPoint", "pointLatitude"))
|
254
|
+
xml.pointLongitude(geo_location.dig("geoLocationPoint", "pointLongitude"))
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
if geo_location["geoLocationBox"]
|
259
|
+
xml.geoLocationBox do
|
260
|
+
xml.westBoundLongitude(geo_location.dig("geoLocationBox", "westBoundLongitude"))
|
261
|
+
xml.eastBoundLongitude(geo_location.dig("geoLocationBox", "eastBoundLongitude"))
|
262
|
+
xml.southBoundLatitude(geo_location.dig("geoLocationBox", "southBoundLatitude"))
|
263
|
+
xml.northBoundLatitude(geo_location.dig("geoLocationBox", "northBoundLatitude"))
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
if geo_location["geoLocationPolygon"]
|
268
|
+
xml.geoLocationPolygon do
|
269
|
+
geo_location["geoLocationPolygon"].each do |polygon_point|
|
270
|
+
xml.polygonPoint do
|
271
|
+
xml.pointLatitude(polygon_point["pointLatitude"])
|
272
|
+
xml.pointLongitude(polygon_point["pointLongitude"])
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
241
282
|
def root_attributes
|
242
283
|
{ :'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
243
284
|
:'xsi:schemaLocation' => 'http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd',
|
data/lib/bolognese/metadata.rb
CHANGED
@@ -67,7 +67,6 @@ module Bolognese
|
|
67
67
|
@style = options[:style]
|
68
68
|
@locale = options[:locale]
|
69
69
|
|
70
|
-
@regenerate = options[:regenerate]
|
71
70
|
@sandbox = options[:sandbox]
|
72
71
|
|
73
72
|
# options that come from the datacite database
|
@@ -102,6 +101,8 @@ module Bolognese
|
|
102
101
|
:sizes
|
103
102
|
).compact
|
104
103
|
|
104
|
+
@regenerate = options[:regenerate] || read_options.present?
|
105
|
+
|
105
106
|
# generate name for method to call dynamically
|
106
107
|
@meta = @from.present? ? send("read_" + @from, { string: string, sandbox: options[:sandbox], doi: options[:doi], id: id }.merge(read_options)) : {}
|
107
108
|
end
|
@@ -187,7 +187,7 @@ module Bolognese
|
|
187
187
|
}.compact
|
188
188
|
end
|
189
189
|
end.compact
|
190
|
-
|
190
|
+
|
191
191
|
state = doi.present? || read_options.present? ? "findable" : "not_found"
|
192
192
|
|
193
193
|
{ "id" => id,
|
@@ -198,7 +198,7 @@ module Bolognese
|
|
198
198
|
"titles" => titles,
|
199
199
|
"creators" => get_authors(Array.wrap(meta.dig("creators", "creator"))),
|
200
200
|
"contributors" => get_authors(Array.wrap(meta.dig("contributors", "contributor"))),
|
201
|
-
"container" =>
|
201
|
+
"container" => set_container(meta),
|
202
202
|
"publisher" => parse_attributes(meta.fetch("publisher", nil), first: true).to_s.strip.presence,
|
203
203
|
"agency" => "DataCite",
|
204
204
|
"funding_references" => funding_references,
|
data/lib/bolognese/utils.rb
CHANGED
@@ -550,7 +550,7 @@ module Bolognese
|
|
550
550
|
|
551
551
|
def to_schema_org_creators(element)
|
552
552
|
element = Array.wrap(element).map do |c|
|
553
|
-
c["affiliation"] = { "@type" => "Organization", "name" => c["affiliation"] } if c["affiliation"].present?
|
553
|
+
c["affiliation"] = { "@type" => "Organization", "name" => Array.wrap(c["affiliation"]).first } if c["affiliation"].present?
|
554
554
|
c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil
|
555
555
|
c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil)
|
556
556
|
c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"]
|
@@ -560,7 +560,7 @@ module Bolognese
|
|
560
560
|
|
561
561
|
def to_schema_org_contributors(element)
|
562
562
|
element = Array.wrap(element).map do |c|
|
563
|
-
c["affiliation"] = { "@type" => "Organization", "name" => c["affiliation"] } if c["affiliation"].present?
|
563
|
+
c["affiliation"] = { "@type" => "Organization", "name" => Array.wrap(c["affiliation"]).first } if c["affiliation"].present?
|
564
564
|
c["@type"] = c["nameType"].present? ? c["nameType"][0..-3] : nil
|
565
565
|
c["@id"] = Array.wrap(c["nameIdentifiers"]).first.to_h.fetch("nameIdentifier", nil)
|
566
566
|
c["name"] = c["familyName"].present? ? [c["givenName"], c["familyName"]].join(" ") : c["name"]
|
data/lib/bolognese/version.rb
CHANGED
@@ -329,11 +329,7 @@ Use the complete title of a license and include version information if applicabl
|
|
329
329
|
<xs:complexType mixed="true">
|
330
330
|
<xs:choice>
|
331
331
|
<xs:element name="br" minOccurs="0" maxOccurs="unbounded">
|
332
|
-
<xs:
|
333
|
-
<xs:restriction base="xs:string">
|
334
|
-
<xs:length value="0"/>
|
335
|
-
</xs:restriction>
|
336
|
-
</xs:simpleType>
|
332
|
+
<xs:complexType/>
|
337
333
|
</xs:element>
|
338
334
|
</xs:choice>
|
339
335
|
<xs:attribute name="descriptionType" type="descriptionType" use="required"/>
|
@@ -329,11 +329,7 @@ Use the complete title of a license and include version information if applicabl
|
|
329
329
|
<xs:complexType mixed="true">
|
330
330
|
<xs:choice>
|
331
331
|
<xs:element name="br" minOccurs="0" maxOccurs="unbounded">
|
332
|
-
<xs:
|
333
|
-
<xs:restriction base="xs:string">
|
334
|
-
<xs:length value="0"/>
|
335
|
-
</xs:restriction>
|
336
|
-
</xs:simpleType>
|
332
|
+
<xs:complexType/>
|
337
333
|
</xs:element>
|
338
334
|
</xs:choice>
|
339
335
|
<xs:attribute name="descriptionType" type="descriptionType" use="required"/>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
{
|
2
|
+
"@context": "http://schema.org",
|
3
|
+
"@type": "Dataset",
|
4
|
+
"@id": "https://doi.org/10.23698/aida/drov",
|
5
|
+
"name": "Ovary data from the Visual Sweden project DROID",
|
6
|
+
"about": "Pathology",
|
7
|
+
"url": "https://doi.aida.medtech4health.se/10.23698/aida/drov",
|
8
|
+
"author": [{
|
9
|
+
"@type": "Person",
|
10
|
+
"@id": "https://orcid.org/0000-0003-1298-517X",
|
11
|
+
"givenName": "Karin",
|
12
|
+
"familyName": "Lindman",
|
13
|
+
"name": "Karin Lindman"
|
14
|
+
}, {
|
15
|
+
"@type": "Person",
|
16
|
+
"@id": "https://orcid.org/",
|
17
|
+
"givenName": "Jerónimo",
|
18
|
+
"familyName": "Rose",
|
19
|
+
"name": "Jerónimo F. Rose"
|
20
|
+
}, {
|
21
|
+
"@type": "Person",
|
22
|
+
"@id": "https://orcid.org/",
|
23
|
+
"givenName": "Martin",
|
24
|
+
"familyName": "Lindvall",
|
25
|
+
"name": "Martin Lindvall"
|
26
|
+
}, {
|
27
|
+
"@type": "Person",
|
28
|
+
"@id": "https://orcid.org/0000-0001-7250-234X",
|
29
|
+
"givenName": "Caroline",
|
30
|
+
"familyName": "Bivik Stadler",
|
31
|
+
"name": "Caroline Bivik Stadler"
|
32
|
+
}],
|
33
|
+
"publisher": {
|
34
|
+
"@type": "Organization",
|
35
|
+
"name": "AIDA"
|
36
|
+
},
|
37
|
+
"copyrightYear": 2019,
|
38
|
+
"copyrightHolder": [{
|
39
|
+
"@type": "Organization",
|
40
|
+
"name": "Linköping University",
|
41
|
+
"url": "https://liu.se/"
|
42
|
+
}, {
|
43
|
+
"@type": "Person",
|
44
|
+
"@id": "https://orcid.org/0000-0002-9368-0177",
|
45
|
+
"givenName": "Claes",
|
46
|
+
"familyName": "Lundström",
|
47
|
+
"name": "Claes Lundström"
|
48
|
+
}],
|
49
|
+
"provider": [{
|
50
|
+
"@type": "Person",
|
51
|
+
"@id": "https://orcid.org/0000-0002-0128-870X",
|
52
|
+
"name": "Karin Lindman",
|
53
|
+
"email": "Karin.Lindman@regionostergotland.se"
|
54
|
+
}, {
|
55
|
+
"@type": "Person",
|
56
|
+
"@id": "https://orcid.org/0000-0002-9368-0177",
|
57
|
+
"name": "Claes Lundstrom",
|
58
|
+
"email": "claes.lundstrom@liu.se"
|
59
|
+
}, {
|
60
|
+
"@type": "Person",
|
61
|
+
"@id": "https://orcid.org/0000-0001-7250-234X",
|
62
|
+
"givenName": "Caroline",
|
63
|
+
"familyName": "Bivik Stadler",
|
64
|
+
"name": "Caroline Bivik Stadler"
|
65
|
+
}, {
|
66
|
+
"@type": "Person",
|
67
|
+
"@id": "https://orcid.org/0000-0001-6443-3604",
|
68
|
+
"name": "Joel Hedlund",
|
69
|
+
"email": "joel.hedlund@liu.se"
|
70
|
+
}],
|
71
|
+
"dateCreated": "2019-01-09",
|
72
|
+
"datePublished": "2019-01-09",
|
73
|
+
"dateModified": "2019-01-09",
|
74
|
+
"keywords": "pathology, whole slide imaging, annotated",
|
75
|
+
"version": "1.0",
|
76
|
+
"description": "This dataset consists of 174 WSI ovary whole slide images (WSI): 158\nmalignant and 16 benign. Eight of the most common, histological definable\ntumour types were annotated: high grade serous carcinoma (HGSC), low grade\nserous carcinoma (LGSC), clear cell carcinoma (CC), endometrioid\nadenocarcinoma (EN), metastastic serous carcinoma (MS), metastatic other\n(MO), serous borderline tumor (SB) and mucinous borderline tumor (MB). Also\nnormal ovarian tissue were annotated. 11258 separate annotations were made.\nFor the benign structures only the epithelial structures, stroma and support\ntissue were annotated.\n",
|
77
|
+
"license": {
|
78
|
+
"name": "Restricted access",
|
79
|
+
"id": "https://datasets.aida.medtech4health.se/10.23698/aida/drov#license"
|
80
|
+
},
|
81
|
+
"citation": null
|
82
|
+
}
|
@@ -236,6 +236,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
236
236
|
expect(subject.geo_locations).to eq([{"geoLocationPoint"=>{"pointLatitude"=>"-11.64583333", "pointLongitude"=>"-68.2975"}}])
|
237
237
|
end
|
238
238
|
|
239
|
+
it "geo_location in separate input" do
|
240
|
+
input = fixture_path + 'datacite-geolocation-empty.xml'
|
241
|
+
geo_locations = [{"geoLocationPoint"=>{"pointLatitude"=>"49.0850736", "pointLongitude"=>"-123.3300992"}}]
|
242
|
+
subject = Bolognese::Metadata.new(input: input, geo_locations: geo_locations)
|
243
|
+
expect(subject.valid?).to be true
|
244
|
+
expect(subject.types["schemaOrg"]).to eq("Dataset")
|
245
|
+
expect(subject.geo_locations).to eq(geo_locations)
|
246
|
+
|
247
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
248
|
+
expect(datacite.dig("geoLocations")).to eq("geoLocation"=>{"geoLocationPoint"=>{"pointLatitude"=>"49.0850736", "pointLongitude"=>"-123.3300992"}})
|
249
|
+
end
|
250
|
+
|
239
251
|
it "xml:lang attribute" do
|
240
252
|
input = fixture_path + 'datacite-xml-lang.xml'
|
241
253
|
subject = Bolognese::Metadata.new(input: input)
|
@@ -321,7 +333,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
321
333
|
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.6071/z7wc73", "identifierType"=>"DOI"}])
|
322
334
|
expect(subject.doi).to eq("10.6071/z7wc73")
|
323
335
|
expect(subject.creators.length).to eq(6)
|
324
|
-
expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation" => "UC Merced")
|
336
|
+
expect(subject.creators.first).to eq("familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal", "affiliation" => ["UC Merced", "NSF"])
|
325
337
|
expect(subject.titles).to eq([{"title"=>"Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek\n meteorological data, soil moisture and temperature, snow depth and air\n temperature"}])
|
326
338
|
expect(subject.publisher).to eq("UC Merced")
|
327
339
|
expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
|
@@ -240,6 +240,28 @@ describe Bolognese::Metadata, vcr: true do
|
|
240
240
|
expect(subject.funding_references).to eq([{"funderIdentifier"=>"https://doi.org/10.13039/100000050", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"National Heart, Lung, and Blood Institute (NHLBI)"}])
|
241
241
|
end
|
242
242
|
|
243
|
+
it "aida dataset" do
|
244
|
+
input = fixture_path + 'aida.json'
|
245
|
+
subject = Bolognese::Metadata.new(input: input)
|
246
|
+
|
247
|
+
expect(subject.valid?).to be true
|
248
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.23698/aida/drov", "identifierType"=>"DOI"}])
|
249
|
+
expect(subject.url).to eq("https://doi.aida.medtech4health.se/10.23698/aida/drov")
|
250
|
+
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
251
|
+
# 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"}])
|
252
|
+
expect(subject.titles).to eq([{"title"=>"Ovary data from the Visual Sweden project DROID"}])
|
253
|
+
expect(subject.version_info).to eq("1.0")
|
254
|
+
expect(subject.subjects).to eq([{"subject"=>"pathology"}, {"subject"=>"whole slide imaging"}, {"subject"=>"annotated"}])
|
255
|
+
expect(subject.dates).to eq([{"date"=>"2019-01-09", "dateType"=>"Issued"}, {"date"=>"2019-01-09", "dateType"=>"Created"}, {"date"=>"2019-01-09", "dateType"=>"Updated"}])
|
256
|
+
expect(subject.publication_year).to eq("2019")
|
257
|
+
expect(subject.id).to eq("https://doi.org/10.23698/aida/drov")
|
258
|
+
expect(subject.publisher).to eq("AIDA")
|
259
|
+
puts subject.rights_list
|
260
|
+
expect(subject.rights_list).to eq({"rights"=>"Restricted access", "rightsUri"=>"https://datasets.aida.medtech4health.se/10.23698/aida/drov#license"})
|
261
|
+
expect(subject.id).to eq("https://doi.org/10.23698/aida/drov")
|
262
|
+
end
|
263
|
+
|
264
|
+
|
243
265
|
it "from attributes" do
|
244
266
|
subject = Bolognese::Metadata.new(input: nil,
|
245
267
|
from: "schema_org",
|
@@ -190,7 +190,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
190
190
|
expect(subject.valid?).to be true
|
191
191
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceType"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
192
192
|
expect(subject.creators.length).to eq(6)
|
193
|
-
expect(subject.creators.first).to eq("affiliation"=>"UC Merced", "familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal")
|
193
|
+
expect(subject.creators.first).to eq("affiliation"=>["UC Merced", "NSF"], "familyName"=>"Bales", "givenName"=>"Roger", "name"=>"Bales, Roger", "nameType"=>"Personal")
|
194
194
|
expect(subject.titles).to eq([{"title"=>"Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek\n meteorological data, soil moisture and temperature, snow depth and air\n temperature"}])
|
195
195
|
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.6071/z7wc73", "identifierType"=>"DOI"}])
|
196
196
|
expect(subject.rights_list).to eq([{"rights"=>"Creative Commons Attribution 4.0 International (CC BY 4.0)", "rightsUri"=>"https://creativecommons.org/licenses/by/4.0"}])
|
@@ -202,7 +202,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
202
202
|
|
203
203
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
204
204
|
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
205
|
-
expect(datacite.dig("creators", "creator", 0, "affiliation")).to eq("UC Merced")
|
205
|
+
expect(datacite.dig("creators", "creator", 0, "affiliation")).to eq(["UC Merced", "NSF"])
|
206
206
|
end
|
207
207
|
|
208
208
|
it "with data citation schema.org" do
|
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.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -672,6 +672,7 @@ files:
|
|
672
672
|
- spec/datacite_utils_spec.rb
|
673
673
|
- spec/doi_utils_spec.rb
|
674
674
|
- spec/find_from_format_spec.rb
|
675
|
+
- spec/fixtures/aida.json
|
675
676
|
- spec/fixtures/citeproc-no-categories.json
|
676
677
|
- spec/fixtures/citeproc.json
|
677
678
|
- spec/fixtures/codemeta.json
|