bolognese 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 203ba60bc9015a61d36b192605c09751a257aa36624b9ca3c9783d002586e95a
4
- data.tar.gz: f4c9492d40eb359a0fe4f512b32de63c4821a0cd657aa57d1e8509a6e58f8df3
3
+ metadata.gz: 8296c7a9f608bbe97118a1a993bf905cee81d663a2396c440a0ce80f854764d4
4
+ data.tar.gz: 8a3941325fb8008f4e8f3e74850f4530a070a27c1d5914aa4c98bc27b2060fe2
5
5
  SHA512:
6
- metadata.gz: 7360e5e52615f86f15b041e0e19851f19b8183e6be624977061b994d05f20fb9b4c7519e8531a59fbd4d91f79a8d04cc89424a60b976d7ff7959d08900a8874e
7
- data.tar.gz: 2306f371bc57ea87c828f7c22c0fcd1141b5330d2aac4e30e19adb2a95d91f0a5ba5525546d58039273bc7f039363668edf190aa0b41c44d428e2cd3cef17cee
6
+ metadata.gz: df84f7fadb870dba674b86277fa192ae004f964de314efd97f36776ec080aeb6cfb77981e7186d534a89712fb97bbbe0f499818d058c2cd239c543fbb17e7312
7
+ data.tar.gz: 5eac09c64a52c84ec6d38b7a46f271bc462ba7e21290bc8d93464b8df2a34ee5619b488872300258025627ee72b6e832f8059dc7211452d0e22ff5e89ab9141d
@@ -61,7 +61,10 @@ module Bolognese
61
61
  "ris" => Bolognese::Utils::SO_TO_RIS_TRANSLATIONS[resource_type_general.to_s.dasherize] || "GEN"
62
62
  }.compact
63
63
  authors = meta.fetch("author", nil) || meta.fetch("creator", nil)
64
- creators = get_authors(from_schema_org_creators(Array.wrap(authors)))
64
+ # Authors should be an object, if it's just a plain string don't try and parse it.
65
+ if not authors.is_a?(String)
66
+ creators = get_authors(from_schema_org_creators(Array.wrap(authors)))
67
+ end
65
68
  contributors = get_authors(from_schema_org_contributors(Array.wrap(meta.fetch("editor", nil))))
66
69
  publisher = parse_attributes(meta.fetch("publisher", nil), content: "name", first: true)
67
70
 
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.1.12"
2
+ VERSION = "1.1.13"
3
3
  end
@@ -0,0 +1,25 @@
1
+ {
2
+ "@context": "http://schema.org",
3
+ "@type": "DataSet",
4
+ "name": "Bulk density (GRA)",
5
+ "description": "Hole U1480A GRA - Bulk density (GRA) for Expedition 362 Hole U1480A",
6
+ "includedInDataCatalog": {
7
+ "@type": "DataCatalog",
8
+ "name": "web.iodp.tamu.edu/publish"
9
+ },
10
+ "author": "McNeill, L.C., Dugan, B., Petronotis, K.E., Backman, J., Bourlange, S., Chemale, F., Chen, W., Colson, T.A., Frederik, M.C.G., Guèrin, G., Hamahashi, M., Henstock, T., House, B.M., Hüpers, A., Jeppson, T.N., Kachovich, S., Kenigsberg, A.R., Kuranaga, M., Kutterolf, S., Milliken, K.L., Mitchison, F.L., Mukoyoshi, H., Nair, N., Owari, S., Pickering, K.T., Pouderoux, H.F.A., Yehua, S., Song, I., Torres, M.E., Vannucchi, P., Vrolijk, P.J., Yang, T., and Zhao, X.",
11
+ "keywords": "International Ocean Discovery Program, IODP, JOIDES Resolution, Expedition 362, Site U1480, Hole U1480A, Bulk density (GRA), Sumatra Seismogenic Zone",
12
+ "encodingFormat": "text/csv",
13
+ "issn": "World Wide Web: 2377-3189",
14
+ "license": "https://creativecommons.org/licenses/by/4.0/",
15
+ "dateCreated": "2019.04.10.11.16.32",
16
+ "datePublished": "2019.04.10",
17
+ "spatialCoverage": {
18
+ "@type": "Place",
19
+ "geo": {
20
+ "@type": "GeoCoordinates",
21
+ "latitude": "91.60580166666666",
22
+ "longitude": "3.0340783333333334"
23
+ }
24
+ }
25
+ }
@@ -177,6 +177,12 @@ describe Bolognese::Metadata, vcr: true do
177
177
  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)"}])
178
178
  end
179
179
 
180
+ it "tdl_iodp dataset" do
181
+ input = fixture_path + 'schema_org_tdl_iodp_invalid_authors.json'
182
+ subject = Bolognese::Metadata.new(input: input)
183
+ expect(subject.valid?).to be false
184
+ end
185
+
180
186
  it "geolocation" do
181
187
  input = fixture_path + 'schema_org_geolocation.json'
182
188
  subject = Bolognese::Metadata.new(input: input)
@@ -278,7 +284,7 @@ describe Bolognese::Metadata, vcr: true do
278
284
  "funderIdentifierType"=>"Crossref Funder ID",
279
285
  "funderName"=>"European Commission"}],
280
286
  types: { "resourceTypeGeneral" => "Dataset", "schemaOrg" => "Dataset" })
281
-
287
+
282
288
  expect(subject.valid?).to be true
283
289
  expect(subject.doi).to eq("10.5281/zenodo.1239")
284
290
  expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5281/zenodo.1239", "identifierType"=>"DOI"}])
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.12
4
+ version: 1.1.13
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-04-15 00:00:00.000000000 Z
11
+ date: 2019-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -716,6 +716,7 @@ files:
716
716
  - spec/fixtures/schema_org_geoshape.json
717
717
  - spec/fixtures/schema_org_gtex.json
718
718
  - spec/fixtures/schema_org_list.json
719
+ - spec/fixtures/schema_org_tdl_iodp_invalid_authors.json
719
720
  - spec/fixtures/schema_org_topmed.json
720
721
  - spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/default.yml
721
722
  - spec/fixtures/vcr_cassettes/Bolognese_CLI/convert_from_id/crossref/to_bibtex.yml