bolognese 2.0.0 → 2.0.3

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: 23ccf372b59b7d9c8919ec7ad7137eef6e99512eed488977e847f938f389aa2f
4
- data.tar.gz: 390e56023d57e637a52776a98dcd0bea4fa0acd8b8459ced05cbc6785f69fe0a
3
+ metadata.gz: fc718876c65857d9b07af2752b4ce8ed8bda05b5e3f7dae983530a414262b9e6
4
+ data.tar.gz: 997f406aa28447acf4507aad0c2ffb0f4e4e42da4028dbe2210d027b438dea09
5
5
  SHA512:
6
- metadata.gz: 3a7364a75d69846ada1320bc0e8954b72695216d2807ec39ab1694ac4d120d97806addb9ceed8b9da8c1eb06ae28740cf6d2c118cb76a05e15ca993bf81ad470
7
- data.tar.gz: 6281527f6b312d398a96b9f1df9be55de991f6ac939417131633b24ddaa24741c3b86c3b2e4e73408ca1350e0b17addf9439ae30dff998bc6dda07e8c4459db7
6
+ metadata.gz: e5692d0fa4a116b0c3f32ae2be26f916f282860a69daed4564fa7b8e91823d8648eddf958fc1fdd9c9c86ab2fcf81f108b334da57b8b9c6ce7fd79b94c009262
7
+ data.tar.gz: d1a74bd310e4ad4a7e8f34c218685cf3d76183d063feffab36c926e4d449e46a0792b2d279d4aeb6540ad74c441cabda0d242053eb96a01f5c6598112a1848e2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (2.0.0)
4
+ bolognese (2.0.3)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -95,10 +95,10 @@ GEM
95
95
  concurrent-ruby (~> 1.0)
96
96
  iso8601 (0.9.1)
97
97
  json (2.6.2)
98
- json-canonicalization (0.3.2)
99
- json-ld (3.2.5)
98
+ json-canonicalization (0.3.1)
99
+ json-ld (3.2.4)
100
100
  htmlentities (~> 4.3)
101
- json-canonicalization (~> 0.3, >= 0.3.2)
101
+ json-canonicalization (~> 0.3)
102
102
  link_header (~> 0.0, >= 0.0.8)
103
103
  multi_json (~> 1.15)
104
104
  rack (>= 2.2, < 4)
@@ -225,6 +225,7 @@ DEPENDENCIES
225
225
  bundler (>= 1.0)
226
226
  byebug
227
227
  hashdiff (>= 1.0.0.beta1, < 2.0.0)
228
+ json-canonicalization (= 0.3.1)
228
229
  rack-test (~> 0)
229
230
  rake (~> 12.0)
230
231
  rspec (~> 3.4)
data/bolognese.gemspec CHANGED
@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
50
50
  s.add_development_dependency 'simplecov', '0.17.1'
51
51
  s.add_development_dependency 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']
52
52
  s.add_development_dependency 'byebug'
53
+ s.add_development_dependency 'json-canonicalization', '0.3.1'
53
54
 
54
55
  s.require_paths = ["lib"]
55
56
  s.files = `git ls-files`.split($/)
@@ -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
@@ -96,7 +96,7 @@ module Bolognese
96
96
  if container.present?
97
97
  container["title"]
98
98
  elsif types["citeproc"] == "article-journal"
99
- publisher
99
+ publisher["name"] if publisher.present?
100
100
  else
101
101
  nil
102
102
  end
@@ -101,7 +101,7 @@ module Bolognese
101
101
  { "name" => r.strip }
102
102
  elsif r.is_a?(Hash)
103
103
  {
104
- "name" => r["__content__"].strip,
104
+ "name" => r["__content__"].present? ? r["__content__"].strip : nil,
105
105
  "publisherIdentifier" => r["publisherIdentifierScheme"] == "ROR" ? normalize_ror(r["publisherIdentifier"]) : r["publisherIdentifier"],
106
106
  "publisherIdentifierScheme" => r["publisherIdentifierScheme"],
107
107
  "schemeUri" => r["schemeURI"],
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.3"
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>
@@ -0,0 +1,18 @@
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://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
3
+ <identifier identifierType="DOI">10.81360/4DVP-KR57</identifier>
4
+ <creators>
5
+ <creator>
6
+ <creatorName nameType="Personal">Møller, Jørgen</creatorName>
7
+ <givenName>Jørgen</givenName>
8
+ <familyName>Møller</familyName>
9
+ </creator>
10
+ </creators>
11
+ <titles>
12
+ <title xml:lang="en">Economic Crisis and Democratic Breakdown in the Interwar Years: A Reassessment</title>
13
+ <title xml:lang="de">Wirtschaftskrise und demokratischer Zusammenbruch in der Zwischenkriegszeit: Eine Neubewertung</title>
14
+ </titles>
15
+ <publisher publisherIdentifier="https://ror.org/04wxnsj81"></publisher>
16
+ <publicationYear>2015</publicationYear>
17
+ <resourceType resourceTypeGeneral="JournalArticle"/>
18
+ </resource>
@@ -0,0 +1,64 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
5
+ <identifier identifierType="DOI">10.60843/5EGY-VC42</identifier>
6
+ <creators>
7
+ <creator>
8
+ <creatorName nameType="Personal">Feldman, Heidi Li</creatorName>
9
+ <givenName>Heidi Li</givenName>
10
+ <familyName>Feldman</familyName>
11
+ <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="https://orcid.org">https://orcid.org/0000-0003-1905-2698</nameIdentifier>
12
+ </creator>
13
+ </creators>
14
+ <titles>
15
+ <title xml:lang="en">Science and Uncertainty in Mass Exposure Litigation</title>
16
+ <title xml:lang="en">Science and Uncertainty in Mass Exposure Litigation, 74 Tex. L. Rev. 1 (1995)</title>
17
+ </titles>
18
+ <publisher>Texas Law Review</publisher>
19
+ <publicationYear>1995</publicationYear>
20
+ <resourceType resourceTypeGeneral="JournalArticle">Article</resourceType>
21
+ <subjects>
22
+ <subject subjectScheme="Fields of Science and Technology (FOS)" schemeURI="http://www.oecd.org/science/inno/38235147.pdf" classificationCode="5.5">FOS: Law</subject>
23
+ </subjects>
24
+ <contributors>
25
+ <contributor contributorType="HostingInstitution">
26
+ <contributorName nameType="Organizational">Georgetown Law Library</contributorName>
27
+ <nameIdentifier nameIdentifierScheme="" schemeURI=""/>
28
+ <affiliation affiliationIdentifier="https://ror.org/05vzafd60" affiliationIdentifierScheme="ROR" schemeURI="https://ror.org">Georgetown University</affiliation>
29
+ </contributor>
30
+ </contributors>
31
+ <dates>
32
+ <date dateType="Issued">1995-11</date>
33
+ <date dateType="Collected">2016-04-25</date>
34
+ </dates>
35
+ <language>en</language>
36
+ <relatedIdentifiers>
37
+ <relatedIdentifier relatedIdentifierType="ISSN" relationType="IsPublishedIn" resourceTypeGeneral="Journal">0040-4411</relatedIdentifier>
38
+ </relatedIdentifiers>
39
+ <relatedItems>
40
+ <relatedItem relatedItemType="Journal" relationType="IsSourceOf">
41
+ <relatedItemIdentifier relatedItemIdentifierType="ISSN">0040-4411</relatedItemIdentifier>
42
+ <creators>
43
+ <creator>
44
+ <creatorName>University of Texas School of Law</creatorName>
45
+ </creator>
46
+ </creators>
47
+ <titles>
48
+ <title>Texas Law Review</title>
49
+ </titles>
50
+ <publicationYear>1995</publicationYear>
51
+ <volume>74</volume>
52
+ <issue>1</issue>
53
+ </relatedItem>
54
+ </relatedItems>
55
+ <sizes/>
56
+ <formats>
57
+ <format>text/html</format>
58
+ <format>application/pdf</format>
59
+ </formats>
60
+ <version/>
61
+ <descriptions>
62
+ <description xml:lang="en" descriptionType="Abstract">Critics of the tort system have condemned courts for their alleged leniency in admitting scientific expert testimony, especially in mass exposure litigation. Claiming that this has resulted in an epidemic of "junk science" in the courtroom, these commentators have urged a more scientific approach to admissibility, intimating that employing more scientific standards would exclude scientific evidence favorable to plaintiffs, thereby demonstrating to factfinders that litigated substances are in fact safe or at least not unsafe.</description>
63
+ </descriptions>
64
+ </resource>
@@ -1759,4 +1759,54 @@ 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
1804
+
1805
+ it "blank publisher" do
1806
+ input = fixture_path + "datacite_blank_publisher.xml"
1807
+ subject = Bolognese::Metadata.new(input: input)
1808
+ expect(subject.publisher).to eq(
1809
+ { "publisherIdentifier" => "https://ror.org/04wxnsj81" }
1810
+ )
1811
+ end
1762
1812
  end
@@ -48,5 +48,14 @@ describe Bolognese::Metadata, vcr: true do
48
48
  expect(subject.locale).to eq("en-US")
49
49
  expect(subject.citation).to eq("Clark, D. (2019). <i>Exploring the \"Many analysts, one dataset\" project from COS</i>. Gigantum, Inc. https://doi.org/10.34747/g6yb-3412")
50
50
  end
51
+
52
+ it "journal article with container title" do
53
+ input = fixture_path + "datacite_journal_article.xml"
54
+ subject = Bolognese::Metadata.new(input: input, from: "datacite")
55
+ expect(subject.types["citeproc"]).to eq("article-journal")
56
+ expect(subject.style).to eq("apa")
57
+ expect(subject.locale).to eq("en-US")
58
+ expect(subject.citation).to eq('Feldman, H. L. (1995). Science and Uncertainty in Mass Exposure Litigation. <i>Texas Law Review</i>. https://doi.org/10.60843/5egy-vc42')
59
+ end
51
60
  end
52
61
  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.0
4
+ version: 2.0.3
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-04 00:00:00.000000000 Z
11
+ date: 2023-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -556,6 +556,20 @@ dependencies:
556
556
  - - ">="
557
557
  - !ruby/object:Gem::Version
558
558
  version: '0'
559
+ - !ruby/object:Gem::Dependency
560
+ name: json-canonicalization
561
+ requirement: !ruby/object:Gem::Requirement
562
+ requirements:
563
+ - - '='
564
+ - !ruby/object:Gem::Version
565
+ version: 0.3.1
566
+ type: :development
567
+ prerelease: false
568
+ version_requirements: !ruby/object:Gem::Requirement
569
+ requirements:
570
+ - - '='
571
+ - !ruby/object:Gem::Version
572
+ version: 0.3.1
559
573
  description: Ruby gem and command-line utility for conversion of DOI metadata from
560
574
  and to different metadata formats, including schema.org.
561
575
  email: mfenner@datacite.org
@@ -814,7 +828,10 @@ files:
814
828
  - spec/fixtures/datacite-xml-lang.xml
815
829
  - spec/fixtures/datacite.json
816
830
  - spec/fixtures/datacite.xml
831
+ - spec/fixtures/datacite_blank_name_identifier.xml
832
+ - spec/fixtures/datacite_blank_publisher.xml
817
833
  - spec/fixtures/datacite_dataset.xml
834
+ - spec/fixtures/datacite_journal_article.xml
818
835
  - spec/fixtures/datacite_malformed_creator.xml
819
836
  - spec/fixtures/datacite_missing_creator.xml
820
837
  - spec/fixtures/datacite_schema_3.xml