bolognese 2.0.1 → 2.0.2

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: df7445354dfea2520078a43cc8eec9128c91c67759e4d4ffe0378223eba52750
4
- data.tar.gz: 6673463c01a3a114bdeff5e8ed2f6af7c25f565d0d1e39c35c6e1d1a5b7c5d57
3
+ metadata.gz: a2147a3c32ec026e4c0ce722966ec41f3c0e01438327aaba531145783c6a05c5
4
+ data.tar.gz: 30784c9ba1c00c6a32b99776344acae20013825d2f83f47ccc6c90c787271131
5
5
  SHA512:
6
- metadata.gz: e7ea1cab22c2a8e6e26979547c6a8a87f83c2e6bb346bad254154087d70534735b53d4fa89798db7688ddecf3945cf11e23ddcedda295154304c3f7ff55ca24a
7
- data.tar.gz: 29aee296393f1338d5ab048a10abd4ad760a82dff8abe3a2b5d9a006149b34e1251ab8b883a7205b1eb25f0ded55fb1b476830d6214cff904b26cec81fd8a469
6
+ metadata.gz: 9e44e0aa498541fa0b906e4251748cd6efd8920f087fff13c46da45d31c863bf1dedcfe60808b9abf6e177610c55af95edb5b725ba07c9686c5c15535d55beec
7
+ data.tar.gz: d6895acf2c12a883160082a06d80256fd3c73c03b02b5675eb311aedd12a4dbfc975bd42daea9c43ad051577a3951954ee26ac5c40a31345c63349dd1331a9b5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (2.0.1)
4
+ bolognese (2.0.2)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -30,20 +30,20 @@ module Bolognese
30
30
  name_type = parse_attributes(author.fetch("creatorName", nil), content: "nameType", first: true) || parse_attributes(author.fetch("contributorName", nil), content: "nameType", first: true)
31
31
 
32
32
  name_identifiers = Array.wrap(author.fetch("nameIdentifier", nil)).map do |ni|
33
- ni["__content__"] = ni["__content__"].strip
33
+ name_identifier = ni["__content__"].strip if ni["__content__"].present?
34
34
  if ni["nameIdentifierScheme"] == "ORCID"
35
35
  {
36
- "nameIdentifier" => normalize_orcid(ni["__content__"]),
36
+ "nameIdentifier" => normalize_orcid(name_identifier),
37
37
  "schemeUri" => "https://orcid.org",
38
38
  "nameIdentifierScheme" => "ORCID" }.compact
39
39
  elsif ni["nameIdentifierScheme"] == "ROR"
40
40
  {
41
- "nameIdentifier" => normalize_ror(ni["__content__"]),
41
+ "nameIdentifier" => normalize_ror(name_identifier),
42
42
  "schemeUri" => "https://ror.org",
43
43
  "nameIdentifierScheme" => "ROR" }.compact
44
44
  else
45
45
  {
46
- "nameIdentifier" => ni["__content__"],
46
+ "nameIdentifier" => name_identifier,
47
47
  "schemeUri" => ni.fetch("schemeURI", nil),
48
48
  "nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://schema.datacite.org/meta/kernel-4.3/metadata.xsd">
3
+ <identifier identifierType="DOI">10.15148/3b68dac4-7688-4fbb-ba64-5f9b3bbab954</identifier>
4
+ <creators>
5
+ <creator>
6
+ <creatorName>SNO KARST</creatorName>
7
+ <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="https://orcid.org"/>
8
+ </creator>
9
+ </creators>
10
+ <publisher>OSU OREME</publisher>
11
+ <titles>
12
+ <title>Time series of type chemistry in Le Tarn basin - PARC NATIONAL CEVENNES observatory - KARST observatory network - OZCAR Critical Zone network Research Infrastructure</title>
13
+ </titles>
14
+ <publicationYear>2023</publicationYear>
15
+ <contributors>
16
+ <contributor contributorType="ProjectMember">
17
+ <contributorName>Manche, Yannick</contributorName>
18
+ <nameIdentifier schemeURI="http://orcid.org/" nameIdentifierScheme="ORCID"></nameIdentifier>
19
+ </contributor>
20
+ </contributors>
21
+ <resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
22
+ </resource>
@@ -1759,4 +1759,46 @@ describe Bolognese::Metadata, vcr: true do
1759
1759
  )
1760
1760
  end
1761
1761
  end
1762
+
1763
+ it "blank nameIdentifier" do
1764
+ input = fixture_path + "datacite_blank_name_identifier.xml"
1765
+ subject = Bolognese::Metadata.new(input: input)
1766
+ expect(subject.creators).to eq(
1767
+ [
1768
+ {
1769
+ "nameType" => "Personal",
1770
+ "name" => "KARST, SNO",
1771
+ "givenName" => "SNO",
1772
+ "familyName" => "KARST",
1773
+ "nameIdentifiers" =>
1774
+ [
1775
+ {
1776
+ "schemeUri" => "https://orcid.org",
1777
+ "nameIdentifierScheme" => "ORCID"
1778
+ }
1779
+ ],
1780
+ "affiliation" => []
1781
+ }
1782
+ ]
1783
+ )
1784
+ expect(subject.contributors).to eq(
1785
+ [
1786
+ {
1787
+ "nameType" => "Personal",
1788
+ "name" => "Manche, Yannick",
1789
+ "givenName" => "Yannick",
1790
+ "familyName" => "Manche",
1791
+ "nameIdentifiers" =>
1792
+ [
1793
+ {
1794
+ "schemeUri" => "https://orcid.org",
1795
+ "nameIdentifierScheme" => "ORCID"
1796
+ }
1797
+ ],
1798
+ "affiliation" => [],
1799
+ "contributorType" => "ProjectMember"
1800
+ }
1801
+ ]
1802
+ )
1803
+ end
1762
1804
  end
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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-05 00:00:00.000000000 Z
11
+ date: 2023-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -828,6 +828,7 @@ files:
828
828
  - spec/fixtures/datacite-xml-lang.xml
829
829
  - spec/fixtures/datacite.json
830
830
  - spec/fixtures/datacite.xml
831
+ - spec/fixtures/datacite_blank_name_identifier.xml
831
832
  - spec/fixtures/datacite_dataset.xml
832
833
  - spec/fixtures/datacite_malformed_creator.xml
833
834
  - spec/fixtures/datacite_missing_creator.xml