bolognese 1.0.3 → 1.0.4

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: 101bd48af59219c102771f24b66e6b19d1be7a533cbdf4a1f1ce49919769be35
4
- data.tar.gz: 2e1ec013d5ab433476452390f535c0bb675e611b4c8e0a94d13d6cb9984150f7
3
+ metadata.gz: 6d95db6e5bbb36dfe35b17b59d550c461313081f73d53e905ab2b3ef8ca51406
4
+ data.tar.gz: 12c67ecc1909f2b666cbc39a939bbfeba069e720c459edac0261b7da85bd8830
5
5
  SHA512:
6
- metadata.gz: 92561676aae45f01727f68080a316343b8dc8eb4112562965504d571add5337024a882da16b6370e58c89b491c9bd82fb24a6e2bd161cdd67c5247073650b8a5
7
- data.tar.gz: 490cadbec75e93b049b067ab6297aa5ffde7f9965c3d08e79a3752b39d1a913c268130c817a2d74d03a3c4ca5b5bae2470cb989fe823fbf2d095bd1716d92e1c
6
+ metadata.gz: 7b312da3d75d11246151383fe98c220c507d35a3de421d0241ef21c2c8a77fff95d16554a8e815cf95ed62e1489fc0b9eae737d656215432cc7f818476de4de8
7
+ data.tar.gz: adfd9ce65312058e16341122109bc0636ad73048ca96577e1013c8628ca14b539447edbc141434c887be45a42cb256898df74df582d7b02958fa81a116f6cf8d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.0.3)
4
+ bolognese (1.0.4)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -117,11 +117,11 @@ GEM
117
117
  nokogiri (>= 1.6.1, < 1.9)
118
118
  public_suffix (>= 2.0.0, < 2.1)
119
119
  public_suffix (2.0.5)
120
- rack (2.0.5)
120
+ rack (2.0.6)
121
121
  rack-test (0.8.3)
122
122
  rack (>= 1.0, < 3)
123
123
  rake (12.3.1)
124
- rdf (3.0.5)
124
+ rdf (3.0.6)
125
125
  hamster (~> 3.0)
126
126
  link_header (~> 0.0, >= 0.0.8)
127
127
  rdf-aggregate-repo (2.2.1)
@@ -167,7 +167,7 @@ GEM
167
167
  sxp (1.0.1)
168
168
  rdf (>= 2.2, < 4.0)
169
169
  temple (0.8.0)
170
- thor (0.20.0)
170
+ thor (0.20.3)
171
171
  thread_safe (0.3.6)
172
172
  tilt (2.0.8)
173
173
  trollop (2.9.9)
@@ -76,12 +76,18 @@ module Bolognese
76
76
 
77
77
  def insert_titles(xml)
78
78
  xml.titles do
79
- insert_title(xml)
80
- end
81
- end
79
+ Array.wrap(title).each do |tit|
80
+ if tit.is_a?(Hash)
81
+ t = tit
82
+ else
83
+ t = {}
84
+ t["text"] = tit
85
+ end
82
86
 
83
- def insert_title(xml)
84
- xml.title(title)
87
+ attributes = { 'lang' => t["lang"], 'titleType' => t["title_type"] }.compact
88
+ xml.title(t["text"], attributes)
89
+ end
90
+ end
85
91
  end
86
92
 
87
93
  def insert_publisher(xml)
@@ -146,7 +152,20 @@ module Bolognese
146
152
 
147
153
  xml.subjects do
148
154
  keywords.each do |subject|
149
- xml.subject(subject)
155
+ if subject.is_a?(String) then
156
+ # If we've been read from somewhere that it was just a string output that
157
+ xml.subject(subject)
158
+ else
159
+ # Otherwise we'll assume a hash and therefore find/add attributes as appropriate
160
+ subject_node = xml.subject(subject['text'])
161
+ if subject["subject_scheme"].present? then
162
+ subject_node['subjectScheme'] = subject["subject_scheme"]
163
+ end
164
+
165
+ if subject["scheme_uri"].present? then
166
+ subject_node['schemeURI'] = subject["scheme_uri"]
167
+ end
168
+ end
150
169
  end
151
170
  end
152
171
  end
@@ -184,7 +203,9 @@ module Bolognese
184
203
  l["id"] = normalize_id(lic)
185
204
  end
186
205
 
187
- xml.rights(l["name"], { 'rightsURI' => l["id"] }.compact)
206
+ attributes = { 'rightsURI' => l["id"] }.compact
207
+
208
+ xml.rights(l["name"], attributes)
188
209
  end
189
210
  end
190
211
  end
@@ -206,7 +227,9 @@ module Bolognese
206
227
  d["type"] = "Abstract"
207
228
  end
208
229
 
209
- xml.description(d["text"], 'descriptionType' => d["type"] || "Abstract")
230
+ attributes = { 'lang' => d["lang"], 'descriptionType' => d["type"] || "Abstract" }.compact
231
+
232
+ xml.description(d["text"], attributes)
210
233
  end
211
234
  end
212
235
  end
@@ -79,7 +79,7 @@ module Bolognese
79
79
  "types" => types,
80
80
  "doi" => doi,
81
81
  "url" => meta.try(:url).to_s,
82
- "title" => meta.try(:title).to_s,
82
+ "title" => [{ "text" => meta.try(:title).to_s }],
83
83
  "creator" => author,
84
84
  "periodical" => periodical,
85
85
  "publisher" => meta.try(:publisher).to_s.presence,
@@ -89,8 +89,8 @@ module Bolognese
89
89
  "volume" => meta.try(:volume).to_s.presence,
90
90
  "page_first" => page_first,
91
91
  "page_last" => page_last,
92
- "description" => { "text" => meta.try(:abstract) && sanitize(meta.abstract.to_s).presence },
93
- "rights" => { "id" => meta.try(:copyright).to_s.presence },
92
+ "description" => [{ "text" => meta.try(:abstract) && sanitize(meta.abstract.to_s).presence }],
93
+ "rights" => [{ "id" => meta.try(:copyright).to_s.presence }.compact],
94
94
  "state" => state
95
95
  }
96
96
  end
@@ -54,7 +54,7 @@ module Bolognese
54
54
  end
55
55
  publication_year = get_date_from_date_parts(meta.fetch("issued", nil)).to_s[0..3]
56
56
  rights = if meta.fetch("copyright", nil)
57
- { "id" => normalize_url(meta.fetch("copyright")) }.compact
57
+ [{ "id" => normalize_url(meta.fetch("copyright")) }.compact]
58
58
  else
59
59
  nil
60
60
  end
@@ -81,7 +81,7 @@ module Bolognese
81
81
  "types" => types,
82
82
  "doi" => doi_from_url(doi),
83
83
  "url" => normalize_id(meta.fetch("URL", nil)),
84
- "title" => meta.fetch("title", nil),
84
+ "title" => [{ "text" => meta.fetch("title", nil) }],
85
85
  "creator" => creator,
86
86
  "periodical" => periodical,
87
87
  "publisher" => meta.fetch("publisher", nil),
@@ -90,7 +90,7 @@ module Bolognese
90
90
  "publication_year" => publication_year,
91
91
  "volume" => meta.fetch("volume", nil),
92
92
  #{}"pagination" => meta.pages.to_s.presence,
93
- "description" => meta.fetch("abstract", nil).present? ? { "text" => sanitize(meta.fetch("abstract")) } : nil,
93
+ "description" => meta.fetch("abstract", nil).present? ? [{ "text" => sanitize(meta.fetch("abstract")) }] : [],
94
94
  "rights" => rights,
95
95
  "version" => meta.fetch("version", nil),
96
96
  "keywords" => meta.fetch("categories", nil),
@@ -45,15 +45,15 @@ module Bolognese
45
45
  "identifier" => identifier,
46
46
  "doi" => validate_doi(id),
47
47
  "url" => normalize_id(meta.fetch("codeRepository", nil)),
48
- "title" => meta.fetch("title", nil),
48
+ "title" => [{ "text" => meta.fetch("title", nil) }],
49
49
  "creator" => author,
50
50
  "editor" => editor,
51
51
  "publisher" => publisher,
52
52
  #{}"is_part_of" => is_part_of,
53
53
  "dates" => dates,
54
54
  "publication_year" => publication_year,
55
- "description" => meta.fetch("description", nil).present? ? { "text" => sanitize(meta.fetch("description")) } : nil,
56
- "rights" => { "id" => meta.fetch("license", nil) },
55
+ "description" => meta.fetch("description", nil).present? ? [{ "text" => sanitize(meta.fetch("description")) }] : nil,
56
+ "rights" => [{ "id" => meta.fetch("license", nil) }.compact],
57
57
  "version" => meta.fetch("version", nil),
58
58
  "keywords" => meta.fetch("tags", nil),
59
59
  "state" => state
@@ -106,7 +106,7 @@ module Bolognese
106
106
  "types" => types,
107
107
  "doi" => doi,
108
108
  "url" => bibliographic_metadata.dig("doi_data", "resource"),
109
- "title" => parse_attributes(bibliographic_metadata.dig("titles", "title")),
109
+ "title" => [{ "text" => parse_attributes(bibliographic_metadata.dig("titles", "title")) }],
110
110
  "alternate_identifiers" => crossref_alternate_identifiers(bibliographic_metadata),
111
111
  "creator" => crossref_people(bibliographic_metadata, "author"),
112
112
  "editor" => crossref_people(bibliographic_metadata, "editor"),
@@ -146,14 +146,10 @@ module Bolognese
146
146
  end
147
147
 
148
148
  description = Array.wrap(bibliographic_metadata.dig("description")).map do |r|
149
- if abstract.present?
150
- { "text" => sanitize(parse_attributes(r)) }.compact
151
- else
152
- sanitize(parse_attributes(r))
153
- end
149
+ { "type" => "Other", "text" => sanitize(parse_attributes(r)) }.compact
154
150
  end
155
151
 
156
- (abstract + description).unwrap
152
+ (abstract + description)
157
153
  end
158
154
 
159
155
  def crossref_license(program_metadata)
@@ -161,7 +157,7 @@ module Bolognese
161
157
  if access_indicator.present?
162
158
  Array.wrap(access_indicator["license_ref"]).map do |license|
163
159
  { "id" => normalize_url(parse_attributes(license)) }
164
- end.uniq.unwrap
160
+ end.uniq
165
161
  else
166
162
  nil
167
163
  end
@@ -54,7 +54,7 @@ module Bolognese
54
54
  schema_version = Array.wrap(ns).last || "http://datacite.org/schema/kernel-4"
55
55
  doc.remove_namespaces!
56
56
  string = doc.to_xml(:indent => 2)
57
-
57
+
58
58
  meta = Maremma.from_xml(string).to_h.fetch("resource", {})
59
59
 
60
60
  # validate only when option is set, as this step is expensive and
@@ -86,21 +86,21 @@ module Bolognese
86
86
 
87
87
  title = Array.wrap(meta.dig("titles", "title")).map do |r|
88
88
  if r.is_a?(String)
89
- sanitize(r)
89
+ { "text" => sanitize(r) }
90
90
  else
91
91
  { "title_type" => r["titleType"], "lang" => r["lang"], "text" => sanitize(r["__content__"]) }.compact
92
92
  end
93
- end.unwrap
93
+ end
94
94
 
95
95
  alternate_identifiers = Array.wrap(meta.dig("alternateIdentifiers", "alternateIdentifier")).map do |r|
96
96
  { "type" => r["alternateIdentifierType"], "name" => r["__content__"] }
97
97
  end.unwrap
98
98
  description = Array.wrap(meta.dig("descriptions", "description")).select { |r| r["descriptionType"] != "SeriesInformation" }.map do |r|
99
- { "type" => r["descriptionType"], "text" => sanitize(r["__content__"]) }.compact
100
- end.unwrap
99
+ { "type" => r["descriptionType"], "lang" => r["lang"], "text" => sanitize(r["__content__"]) }.compact
100
+ end
101
101
  rights = Array.wrap(meta.dig("rightsList", "rights")).map do |r|
102
102
  { "id" => normalize_url(r["rightsURI"]), "name" => r["__content__"] }.compact
103
- end.unwrap
103
+ end
104
104
  keywords = Array.wrap(meta.dig("subjects", "subject")).map do |k|
105
105
  if k.nil?
106
106
  nil
@@ -75,14 +75,14 @@ module Bolognese
75
75
  "types" => types,
76
76
  "doi" => doi,
77
77
  "url" => meta.fetch("UR", nil),
78
- "title" => meta.fetch("T1", nil),
78
+ "title" => meta.fetch("T1", nil).present? ? [{ "text" => meta.fetch("T1", nil) }] : nil,
79
79
  "creator" => get_authors(author),
80
80
  "publisher" => meta.fetch("PB", "(:unav)"),
81
81
  "periodical" => periodical,
82
82
  "related_identifiers" => related_identifiers,
83
83
  "dates" => dates,
84
84
  "publication_year" => publication_year,
85
- "description" => meta.fetch("AB", nil).present? ? { "text" => sanitize(meta.fetch("AB")) } : nil,
85
+ "description" => meta.fetch("AB", nil).present? ? [{ "text" => sanitize(meta.fetch("AB")) }] : nil,
86
86
  "volume" => meta.fetch("VL", nil),
87
87
  "issue" => meta.fetch("IS", nil),
88
88
  "first_page" => meta.fetch("SP", nil),
@@ -134,7 +134,7 @@ module Bolognese
134
134
  "content_url" => Array.wrap(meta.fetch("contentUrl", nil)).unwrap,
135
135
  "size" => meta.fetch("contenSize", nil),
136
136
  "formats" => Array.wrap(meta.fetch("encodingFormat", nil) || meta.fetch("fileFormat", nil)).unwrap,
137
- "title" => meta.fetch("name", nil),
137
+ "title" => meta.fetch("name", nil).present? ? [{ "text" => meta.fetch("name", nil) }] : nil,
138
138
  "creator" => author,
139
139
  "editor" => editor,
140
140
  "publisher" => publisher,
@@ -143,7 +143,7 @@ module Bolognese
143
143
  "related_identifiers" => related_identifiers,
144
144
  "publication_year" => publication_year,
145
145
  "dates" => dates,
146
- "description" => meta.fetch("description", nil).present? ? { "text" => sanitize(meta.fetch("description")) } : nil,
146
+ "description" => meta.fetch("description", nil).present? ? [{ "text" => sanitize(meta.fetch("description")) }] : nil,
147
147
  "rights" => rights,
148
148
  "version" => meta.fetch("version", nil),
149
149
  "keywords" => meta.fetch("keywords", nil).to_s.split(", "),
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -12,7 +12,7 @@ module Bolognese
12
12
  "@id" => identifier,
13
13
  "identifier" => identifier,
14
14
  "codeRepository" => url,
15
- "title" => title,
15
+ "title" => parse_attributes(title, content: "text", first: true),
16
16
  "agents" => creator,
17
17
  "description" => parse_attributes(description, content: "text", first: true),
18
18
  "version" => version,
@@ -15,7 +15,9 @@
15
15
  "givenName": "Kristian",
16
16
  "familyName": "Garza"
17
17
  },
18
- "title": "Analysis Tools for Crossover Experiment of UI using Choice Architecture",
18
+ "title": [{
19
+ "text": "Analysis Tools for Crossover Experiment of UI using Choice Architecture"
20
+ }],
19
21
  "publisher": "Zenodo",
20
22
  "keywords": ["choice architecture", "crossover experiment", "hci"],
21
23
  "dates": {
@@ -35,10 +37,10 @@
35
37
  "name": "Creative Commons Attribution-NonCommercial-ShareAlike"
36
38
  }
37
39
  ],
38
- "description": {
40
+ "description": [{
39
41
  "type": "Abstract",
40
42
  "text": "This tools are used to analyse the data produced by the Crosssover Experiment I designed to test Choice Architecture techniques as UI interventions in a SEEk4Science data catalogue. It contains:\n\n- Data structures for the experimental data.<br>\n- Visualisation functions<br>\n- Analysis functions\n\n## Installation\n\n- R<br>\n- python<br>\n- ipython 4\n\nClone and use.\n\n## Usage\n\n<br>\n```python<br>\nsource('parallel_plot.r')<br>\nwith(z, parallelset(trt,response, freq=count, alpha=0.2))<br>\n```\n\n<br>\n## Contributing\n\n1. Fork it!<br>\n2. Create your feature branch: `git checkout -b my-new-feature`<br>\n3. Commit your changes: `git commit -am 'Add some feature'`<br>\n4. Push to the branch: `git push origin my-new-feature`<br>\n5. Submit a pull request :D\n\n<br>\n## License\n\nThis work supports my PhD Thesis at University of Manchester."
41
- },
43
+ }],
42
44
  "schema_version": "http://datacite.org/schema/kernel-4",
43
45
  "provider": "DataCite",
44
46
  "state": "findable"
@@ -16,7 +16,9 @@
16
16
  "givenName": "Martin",
17
17
  "familyName": "Fenner"
18
18
  },
19
- "title": "Eating your own Dog Food",
19
+ "title": [{
20
+ "text": "Eating your own Dog Food"
21
+ }],
20
22
  "publisher": "DataCite",
21
23
  "publication-year": "2016",
22
24
  "subject": [
@@ -62,10 +64,10 @@
62
64
  }
63
65
  ],
64
66
  "version": "1.0",
65
- "description": {
67
+ "description": [{
66
68
  "type": "Abstract",
67
69
  "text": "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for..."
68
- },
70
+ }],
69
71
  "schema-version": "http://datacite.org/schema/kernel-4",
70
72
  "provider": "DataCite"
71
73
  }
@@ -33,9 +33,9 @@ describe Bolognese::Metadata, vcr: true do
33
33
  expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
34
34
  expect(subject.creator.length).to eq(5)
35
35
  expect(subject.creator.first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
36
- expect(subject.title).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
37
- expect(subject.description["text"]).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
38
- expect(subject.rights["id"]).to eq("http://creativecommons.org/licenses/by/3.0/")
36
+ expect(subject.title).to eq([{"text"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
37
+ expect(subject.description.first["text"]).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
38
+ expect(subject.rights.first["id"]).to eq("http://creativecommons.org/licenses/by/3.0/")
39
39
  expect(subject.dates).to eq([{"date"=>"2014", "date_type"=>"Issued"}])
40
40
  expect(subject.publication_year).to eq("2014")
41
41
  expect(subject.related_identifiers).to eq([{"id"=>"2050-084X", "related_identifier_type"=>"ISSN", "relation_type"=>"IsPartOf", "title"=>"eLife", "type"=>"Periodical"}])
@@ -50,8 +50,8 @@ describe Bolognese::Metadata, vcr: true do
50
50
  expect(subject.identifier).to eq("https://doi.org/10.7554/elife.01567")
51
51
  expect(subject.types).to eq("bibtex"=>"phdthesis", "citeproc"=>"thesis", "resource_type"=>"Dissertation", "resource_type_general"=>"Text", "ris"=>"THES", "type"=>"Thesis")
52
52
  expect(subject.creator).to eq([{"type"=>"Person", "name"=>"Y. Toparlar", "givenName"=>"Y.", "familyName"=>"Toparlar"}])
53
- expect(subject.title).to eq("A multiscale analysis of the urban heat island effect: from city averaged temperatures to the energy demand of individual buildings")
54
- expect(subject.description["text"]).to start_with("Designing the climates of cities")
53
+ expect(subject.title).to eq([{"text"=>"A multiscale analysis of the urban heat island effect: from city averaged temperatures to the energy demand of individual buildings"}])
54
+ expect(subject.description.first["text"]).to start_with("Designing the climates of cities")
55
55
  expect(subject.dates).to eq([{"date"=>"2018", "date_type"=>"Issued"}])
56
56
  expect(subject.publication_year).to eq("2018")
57
57
  end
@@ -20,8 +20,8 @@ describe Bolognese::Metadata, vcr: true do
20
20
  expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
21
21
  expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"post-weblog", "resource_type_general"=>"Text", "ris"=>"GEN", "type"=>"BlogPosting")
22
22
  expect(subject.creator).to eq("type"=>"Person", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
23
- expect(subject.title).to eq("Eating your own Dog Food")
24
- expect(subject.description["text"]).to start_with("Eating your own dog food")
23
+ expect(subject.title).to eq([{"text"=>"Eating your own Dog Food"}])
24
+ expect(subject.description.first["text"]).to start_with("Eating your own dog food")
25
25
  expect(subject.dates).to eq([{"date"=>"2016-12-20", "date_type"=>"Issued"}])
26
26
  expect(subject.publication_year).to eq("2016")
27
27
  end
@@ -22,8 +22,8 @@ describe Bolognese::Metadata, vcr: true do
22
22
  expect(subject.url).to eq("https://github.com/datacite/maremma")
23
23
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resource_type_general"=>"Software", "ris"=>"COMP", "type"=>"SoftwareSourceCode")
24
24
  expect(subject.creator).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
25
- expect(subject.title).to eq("Maremma: a Ruby library for simplified network calls")
26
- expect(subject.description["text"]).to start_with("Ruby utility library for network requests")
25
+ expect(subject.title).to eq([{"text"=>"Maremma: a Ruby library for simplified network calls"}])
26
+ expect(subject.description.first["text"]).to start_with("Ruby utility library for network requests")
27
27
  expect(subject.keywords).to eq(["faraday", "excon", "net/http"])
28
28
  expect(subject.dates).to eq([{"date"=>"2017-02-24", "date_type"=>"Issued"}, {"date"=>"2015-11-28", "date_type"=>"Created"}, {"date"=>"2017-02-24", "date_type"=>"Updated"}])
29
29
  expect(subject.publication_year).to eq("2017")
@@ -47,8 +47,8 @@ describe Bolognese::Metadata, vcr: true do
47
47
  "givenName"=>"Peter",
48
48
  "familyName"=>"Slaughter"},
49
49
  {"type"=>"Organization", "name"=>"University Of California, Santa Barbara"}])
50
- expect(subject.title).to eq("R Interface to the DataONE REST API")
51
- expect(subject.description["text"]).to start_with("Provides read and write access to data and metadata")
50
+ expect(subject.title).to eq([{"text"=>"R Interface to the DataONE REST API"}])
51
+ expect(subject.description.first["text"]).to start_with("Provides read and write access to data and metadata")
52
52
  expect(subject.keywords).to eq(["data sharing", "data repository", "DataONE"])
53
53
  expect(subject.version).to eq("2.0.0")
54
54
  expect(subject.dates).to eq([{"date"=>"2016-05-27", "date_type"=>"Issued"}, {"date"=>"2016-05-27", "date_type"=>"Created"}, {"date"=>"2016-05-27", "date_type"=>"Updated"}])
@@ -64,8 +64,8 @@ describe Bolognese::Metadata, vcr: true do
64
64
  expect(subject.url).to eq("https://github.com/datacite/maremma")
65
65
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resource_type_general"=>"Software", "ris"=>"COMP", "type"=>"SoftwareSourceCode")
66
66
  expect(subject.creator).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
67
- expect(subject.title).to eq("Maremma: a Ruby library for simplified network calls")
68
- expect(subject.description["text"]).to start_with("Simplifies network calls")
67
+ expect(subject.title).to eq([{"text"=>"Maremma: a Ruby library for simplified network calls"}])
68
+ expect(subject.description.first["text"]).to start_with("Simplifies network calls")
69
69
  expect(subject.keywords).to eq(["faraday", "excon", "net/http"])
70
70
  expect(subject.dates).to eq([{"date"=>"2017-02-24", "date_type"=>"Issued"}, {"date"=>"2015-11-28", "date_type"=>"Created"}, {"date"=>"2017-02-24", "date_type"=>"Updated"}])
71
71
  expect(subject.publication_year).to eq("2017")
@@ -81,8 +81,8 @@ describe Bolognese::Metadata, vcr: true do
81
81
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"article-journal", "resource_type_general"=>"Software", "ris"=>"COMP", "type"=>"SoftwareSourceCode")
82
82
  expect(subject.creator.size).to eq(4)
83
83
  expect(subject.creator.last).to eq("type"=>"Person", "id"=>"https://orcid.org/0000-0001-8135-3489", "name"=>"Lars Holm Nielsen", "givenName"=>"Lars Holm", "familyName"=>"Nielsen")
84
- expect(subject.title).to eq("DOI Registrations for Software")
85
- expect(subject.description["text"]).to start_with("Analysis of DataCite DOIs registered for software")
84
+ expect(subject.title).to eq([{"text"=>"DOI Registrations for Software"}])
85
+ expect(subject.description.first["text"]).to start_with("Analysis of DataCite DOIs registered for software")
86
86
  expect(subject.keywords).to eq(["doi", "software", "codemeta"])
87
87
  expect(subject.dates).to eq([{"date"=>"2018-05-17", "date_type"=>"Issued"}, {"date"=>"2018-03-09", "date_type"=>"Created"}, {"date"=>"2018-05-17", "date_type"=>"Updated"}])
88
88
  expect(subject.publication_year).to eq("2018")
@@ -20,8 +20,8 @@ describe Bolognese::Metadata, vcr: true do
20
20
  expect(subject.identifier).to eq("https://doi.org/10.5281/zenodo.48440")
21
21
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"other", "resource_type"=>"Software", "resource_type_general"=>"Software", "ris"=>"COMP", "type"=>"SoftwareSourceCode")
22
22
  expect(subject.creator).to eq("type"=>"Person", "familyName" => "Garza", "givenName" => "Kristian", "name" => "Kristian Garza")
23
- expect(subject.title).to eq("Analysis Tools for Crossover Experiment of UI using Choice Architecture")
24
- expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
23
+ expect(subject.title).to eq([{"text"=>"Analysis Tools for Crossover Experiment of UI using Choice Architecture"}])
24
+ expect(subject.description.first["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
25
25
  expect(subject.dates).to eq("date"=>"2016-03-27", "date-type"=>"Issued")
26
26
  expect(subject.publication_year).to eq("2016")
27
27
  end
@@ -33,8 +33,8 @@ describe Bolognese::Metadata, vcr: true do
33
33
  expect(subject.identifier).to eq("https://doi.org/10.5281/zenodo.48440")
34
34
  expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"other", "resource_type"=>"Software", "resource_type_general"=>"Software", "ris"=>"COMP", "type"=>"SoftwareSourceCode")
35
35
  expect(subject.creator).to eq("type"=>"Person", "familyName" => "Garza", "givenName" => "Kristian", "name" => "Kristian Garza")
36
- expect(subject.title).to eq("Analysis Tools for Crossover Experiment of UI using Choice Architecture")
37
- expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
36
+ expect(subject.title).to eq([{"text"=>"Analysis Tools for Crossover Experiment of UI using Choice Architecture"}])
37
+ expect(subject.description.first["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
38
38
  expect(subject.dates).to eq("date"=>"2016-03-27", "date-type"=>"Issued")
39
39
  expect(subject.publication_year).to eq("2016")
40
40
  end