bolognese 1.0.3 → 1.0.4
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 +4 -4
- data/Gemfile.lock +4 -4
- data/lib/bolognese/datacite_utils.rb +31 -8
- data/lib/bolognese/readers/bibtex_reader.rb +3 -3
- data/lib/bolognese/readers/citeproc_reader.rb +3 -3
- data/lib/bolognese/readers/codemeta_reader.rb +3 -3
- data/lib/bolognese/readers/crossref_reader.rb +4 -8
- data/lib/bolognese/readers/datacite_reader.rb +6 -6
- data/lib/bolognese/readers/ris_reader.rb +2 -2
- data/lib/bolognese/readers/schema_org_reader.rb +2 -2
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/codemeta_writer.rb +1 -1
- data/spec/fixtures/crosscite.json +5 -3
- data/spec/fixtures/datacite.json +5 -3
- data/spec/readers/bibtex_reader_spec.rb +5 -5
- data/spec/readers/citeproc_reader_spec.rb +2 -2
- data/spec/readers/codemeta_reader_spec.rb +8 -8
- data/spec/readers/crosscite_reader_spec.rb +4 -4
- data/spec/readers/crossref_reader_spec.rb +15 -15
- data/spec/readers/datacite_json_reader_spec.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +42 -42
- data/spec/readers/ris_reader_spec.rb +4 -4
- data/spec/readers/schema_org_reader_spec.rb +13 -13
- data/spec/writers/crosscite_writer_spec.rb +10 -10
- data/spec/writers/datacite_json_writer_spec.rb +9 -9
- data/spec/writers/datacite_writer_spec.rb +6 -6
- metadata +2 -2
@@ -10,14 +10,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
10
10
|
crosscite = JSON.parse(subject.crosscite)
|
11
11
|
expect(crosscite.fetch("url")).to eq("https://elifesciences.org/articles/01567")
|
12
12
|
expect(crosscite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resource_type"=>"JournalArticle", "resource_type_general"=>"Text", "ris"=>"JOUR", "type"=>"ScholarlyArticle")
|
13
|
-
expect(crosscite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
13
|
+
expect(crosscite.fetch("title")).to eq([{"text"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
|
14
14
|
expect(crosscite.fetch("related_identifiers").length).to eq(27)
|
15
15
|
expect(crosscite.fetch("related_identifiers").first).to eq("id"=>"2050-084X", "related_identifier_type"=>"ISSN", "relation_type"=>"IsPartOf", "title"=>"eLife", "type"=>"Periodical")
|
16
16
|
expect(crosscite.fetch("related_identifiers").last).to eq( +"id" => "10.1038/ncb2764",
|
17
17
|
"related_identifier_type" => "DOI",
|
18
18
|
"relation_type" => "References",
|
19
19
|
"title" => "A screen for morphological complexity identifies regulators of switch-like transitions between discrete cell shapes")
|
20
|
-
expect(crosscite.fetch("rights")).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
20
|
+
expect(crosscite.fetch("rights")).to eq([{"id"=>"http://creativecommons.org/licenses/by/3.0"}])
|
21
21
|
end
|
22
22
|
|
23
23
|
it "with ORCID ID" do
|
@@ -41,8 +41,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
41
41
|
subject = Bolognese::Metadata.new(input: input, from: "bibtex")
|
42
42
|
crosscite = JSON.parse(subject.crosscite)
|
43
43
|
expect(crosscite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resource_type"=>"JournalArticle", "resource_type_general"=>"Text", "ris"=>"JOUR", "type"=>"ScholarlyArticle")
|
44
|
-
expect(crosscite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
45
|
-
expect(crosscite.dig("description", "text")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
44
|
+
expect(crosscite.fetch("title")).to eq([{"text"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
|
45
|
+
expect(crosscite.dig("description", 0, "text")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
46
46
|
expect(crosscite.fetch("creator").count).to eq(5)
|
47
47
|
expect(crosscite.fetch("creator").first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
|
48
48
|
end
|
@@ -53,8 +53,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
53
53
|
expect(subject.valid?).to be true
|
54
54
|
crosscite = JSON.parse(subject.crosscite)
|
55
55
|
expect(crosscite["types"]).to eq("bibtex"=>"article", "citeproc"=>"post-weblog", "resource_type_general"=>"Text", "ris"=>"GEN", "type"=>"BlogPosting")
|
56
|
-
expect(crosscite.fetch("title")).to eq("Eating your own Dog Food")
|
57
|
-
expect(crosscite.dig("description", "text")).to start_with("Eating your own dog food")
|
56
|
+
expect(crosscite.fetch("title")).to eq([{"text"=>"Eating your own Dog Food"}])
|
57
|
+
expect(crosscite.dig("description", 0, "text")).to start_with("Eating your own dog food")
|
58
58
|
expect(crosscite.fetch("creator")).to eq("type"=>"Person", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
59
59
|
end
|
60
60
|
|
@@ -62,7 +62,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
62
62
|
input = fixture_path + 'codemeta.json'
|
63
63
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
64
64
|
crosscite = JSON.parse(subject.crosscite)
|
65
|
-
expect(crosscite["title"]).to eq("R Interface to the DataONE REST API")
|
65
|
+
expect(crosscite["title"]).to eq([{"text"=>"R Interface to the DataONE REST API"}])
|
66
66
|
expect(crosscite["creator"].length).to eq(3)
|
67
67
|
expect(crosscite["creator"].last).to eq("type"=>"Organization", "name"=>"University Of California, Santa Barbara")
|
68
68
|
expect(crosscite["version"]).to eq("2.0.0")
|
@@ -73,7 +73,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
73
73
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
74
74
|
crosscite = JSON.parse(subject.crosscite)
|
75
75
|
expect(crosscite.fetch("url")).to eq("http://datadryad.org/resource/doi:10.5061/dryad.8515")
|
76
|
-
expect(crosscite.fetch("title")).to eq("Data from: A new malaria agent in African hominids.")
|
76
|
+
expect(crosscite.fetch("title")).to eq([{"text"=>"Data from: A new malaria agent in African hominids."}])
|
77
77
|
expect(crosscite.fetch("creator").length).to eq(8)
|
78
78
|
expect(crosscite.fetch("creator").first).to eq("type"=>"Person", "familyName" => "Ollomo", "givenName" => "Benjamin", "name" => "Benjamin Ollomo")
|
79
79
|
expect(crosscite.fetch("dates")).to eq([{"date"=>"2011", "date_type"=>"Issued"}])
|
@@ -86,7 +86,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
86
86
|
input = "https://github.com/datacite/maremma"
|
87
87
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
88
88
|
crosscite = JSON.parse(subject.crosscite)
|
89
|
-
expect(crosscite.fetch("title")).to eq("Maremma: a Ruby library for simplified network calls")
|
89
|
+
expect(crosscite.fetch("title")).to eq( [{"text"=>"Maremma: a Ruby library for simplified network calls"}])
|
90
90
|
expect(crosscite.fetch("creator")).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
91
91
|
end
|
92
92
|
|
@@ -95,7 +95,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
95
95
|
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
96
96
|
expect(subject.valid?).to be true
|
97
97
|
crosscite = JSON.parse(subject.crosscite)
|
98
|
-
expect(crosscite.fetch("title")).to eq("Eating your own Dog Food")
|
98
|
+
expect(crosscite.fetch("title")).to eq([{"text"=>"Eating your own Dog Food"}])
|
99
99
|
expect(crosscite.fetch("related_identifiers").count).to eq(3)
|
100
100
|
expect(crosscite.fetch("related_identifiers").first).to eq("id"=>"10.5438/0000-00ss", "related_identifier_type"=>"DOI", "relation_type"=>"IsPartOf", "resource_type_general"=>"Text", "title"=>"DataCite Blog")
|
101
101
|
expect(crosscite.fetch("related_identifiers").last).to eq("id"=>"10.5438/55e5-t5c0", "related_identifier_type"=>"DOI", "relation_type"=>"References")
|
@@ -10,10 +10,10 @@ describe Bolognese::Metadata, vcr: true do
|
|
10
10
|
datacite = JSON.parse(subject.datacite_json)
|
11
11
|
expect(datacite.fetch("url")).to eq("https://elifesciences.org/articles/01567")
|
12
12
|
expect(datacite.fetch("resource-type-general")).to eq("Text")
|
13
|
-
expect(datacite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
13
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
|
14
14
|
expect(datacite.fetch("related-identifiers").length).to eq(27)
|
15
15
|
expect(datacite.fetch("related-identifiers").first).to eq("id"=>"2050-084X", "related_identifier_type"=>"ISSN", "relation_type"=>"IsPartOf", "title"=>"eLife", "type"=>"Periodical")
|
16
|
-
expect(datacite.fetch("rights")).to eq("id"=>"http://creativecommons.org/licenses/by/3.0")
|
16
|
+
expect(datacite.fetch("rights")).to eq([{"id"=>"http://creativecommons.org/licenses/by/3.0"}])
|
17
17
|
end
|
18
18
|
|
19
19
|
it "with ORCID ID" do
|
@@ -31,8 +31,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
31
31
|
subject = Bolognese::Metadata.new(input: input, from: "bibtex")
|
32
32
|
datacite = JSON.parse(subject.datacite_json)
|
33
33
|
expect(datacite.fetch("resource-type-general")).to eq("Text")
|
34
|
-
expect(datacite.fetch("title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
35
|
-
expect(datacite.dig("description", "text")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
34
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth"}])
|
35
|
+
expect(datacite.dig("description", 0, "text")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
36
36
|
expect(datacite.fetch("creator").length).to eq(5)
|
37
37
|
expect(datacite.fetch("creator").first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
|
38
38
|
end
|
@@ -42,8 +42,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
42
42
|
subject = Bolognese::Metadata.new(input: input, from: "citeproc")
|
43
43
|
datacite = JSON.parse(subject.datacite_json)
|
44
44
|
expect(datacite.fetch("resource-type-general")).to eq("Text")
|
45
|
-
expect(datacite.fetch("title")).to eq("Eating your own Dog Food")
|
46
|
-
expect(datacite.dig("description", "text")).to start_with("Eating your own dog food")
|
45
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"Eating your own Dog Food"}])
|
46
|
+
expect(datacite.dig("description", 0, "text")).to start_with("Eating your own dog food")
|
47
47
|
expect(datacite.fetch("creator")).to eq("type"=>"Person", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
48
48
|
end
|
49
49
|
|
@@ -51,7 +51,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
51
51
|
input = fixture_path + 'codemeta.json'
|
52
52
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
53
53
|
datacite = JSON.parse(subject.datacite_json)
|
54
|
-
expect(datacite.fetch("title")).to eq("R Interface to the DataONE REST API")
|
54
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"R Interface to the DataONE REST API"}])
|
55
55
|
expect(datacite.fetch("creator").length).to eq(3)
|
56
56
|
expect(datacite.fetch("creator").first).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Matt Jones", "givenName"=>"Matt", "familyName"=>"Jones")
|
57
57
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
@@ -61,7 +61,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
61
61
|
input = "https://github.com/datacite/maremma"
|
62
62
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
63
63
|
datacite = JSON.parse(subject.datacite_json)
|
64
|
-
expect(datacite.fetch("title")).to eq("Maremma: a Ruby library for simplified network calls")
|
64
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"Maremma: a Ruby library for simplified network calls"}])
|
65
65
|
expect(datacite.fetch("creator")).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-0077-4738", "name"=>"Martin Fenner", "givenName"=>"Martin", "familyName"=>"Fenner")
|
66
66
|
end
|
67
67
|
|
@@ -70,7 +70,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
70
70
|
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
71
71
|
expect(subject.valid?).to be true
|
72
72
|
datacite = JSON.parse(subject.datacite_json)
|
73
|
-
expect(datacite.fetch("title")).to eq("Eating your own Dog Food")
|
73
|
+
expect(datacite.fetch("title")).to eq([{"text"=>"Eating your own Dog Food"}])
|
74
74
|
expect(datacite.fetch("related-identifiers").count).to eq(3)
|
75
75
|
expect(datacite.fetch("related-identifiers").first).to eq("id"=>"10.5438/0000-00ss", "related_identifier_type"=>"DOI", "relation_type"=>"IsPartOf", "resource_type_general"=>"Text", "title"=>"DataCite Blog")
|
76
76
|
end
|
@@ -106,8 +106,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
106
106
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resource_type"=>"Paper", "resource_type_general"=>"Text", "ris"=>"RPRT", "type"=>"ScholarlyArticle")
|
107
107
|
expect(subject.creator.length).to eq(20)
|
108
108
|
expect(subject.creator.first).to eq("type"=>"Person", "familyName" => "Paglione", "givenName" => "Laura", "id" => "https://orcid.org/0000-0003-3188-6273", "name" => "Laura Paglione")
|
109
|
-
expect(subject.title).to eq("Recommendation of: ORCID Works Metadata Working Group")
|
110
|
-
expect(subject.rights).to eq("id"=>"https://creativecommons.org/publicdomain/zero/1.0", "name"=>"CC-0")
|
109
|
+
expect(subject.title).to eq([{"text"=>"Recommendation of: ORCID Works Metadata Working Group"}])
|
110
|
+
expect(subject.rights).to eq([{"id"=>"https://creativecommons.org/publicdomain/zero/1.0", "name"=>"CC-0"}])
|
111
111
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "date_type"=>"Created"}, {"date"=>"2017-06-28", "date_type"=>"Updated"}, {"date"=>"2017", "date_type"=>"Issued"}])
|
112
112
|
expect(subject.publication_year).to eq("2017")
|
113
113
|
expect(subject.publisher).to eq("Figshare")
|
@@ -124,8 +124,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
124
124
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resource_type"=>"Paper", "resource_type_general"=>"Text", "ris"=>"RPRT", "type"=>"ScholarlyArticle")
|
125
125
|
expect(subject.creator.length).to eq(20)
|
126
126
|
expect(subject.creator.first).to eq("type"=>"Person", "familyName" => "Paglione", "givenName" => "Laura", "id" => "https://orcid.org/0000-0003-3188-6273", "name" => "Laura Paglione")
|
127
|
-
expect(subject.title).to eq("Recommendation of: ORCID Works Metadata Working Group")
|
128
|
-
expect(subject.rights).to eq("id"=>"https://creativecommons.org/publicdomain/zero/1.0", "name"=>"CC-0")
|
127
|
+
expect(subject.title).to eq([{"text"=>"Recommendation of: ORCID Works Metadata Working Group"}])
|
128
|
+
expect(subject.rights).to eq([{"id"=>"https://creativecommons.org/publicdomain/zero/1.0", "name"=>"CC-0"}])
|
129
129
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "date_type"=>"Created"}, {"date"=>"2017-06-28", "date_type"=>"Updated"}, {"date"=>"2017", "date_type"=>"Issued"}])
|
130
130
|
expect(subject.publication_year).to eq("2017")
|
131
131
|
expect(subject.publisher).to eq("Figshare")
|
@@ -142,9 +142,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
142
142
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resource_type"=>"DataPackage", "resource_type_general"=>"Dataset", "ris"=>"DATA", "type"=>"Dataset")
|
143
143
|
expect(subject.creator.length).to eq(8)
|
144
144
|
expect(subject.creator.first).to eq("type"=>"Person", "name"=>"Benjamin Ollomo", "givenName"=>"Benjamin", "familyName"=>"Ollomo")
|
145
|
-
expect(subject.title).to eq("Data from: A new malaria agent in African hominids.")
|
145
|
+
expect(subject.title).to eq([{"text"=>"Data from: A new malaria agent in African hominids."}])
|
146
146
|
expect(subject.alternate_identifiers).to eq("type"=>"citation", "name"=>"Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.")
|
147
|
-
expect(subject.rights).to eq("id"=>"http://creativecommons.org/publicdomain/zero/1.0")
|
147
|
+
expect(subject.rights).to eq([{"id"=>"http://creativecommons.org/publicdomain/zero/1.0"}])
|
148
148
|
expect(subject.dates).to eq([{"date"=>"2011", "date_type"=>"Issued"}])
|
149
149
|
expect(subject.publication_year).to eq("2011")
|
150
150
|
expect(subject.related_identifiers.length).to eq(6)
|
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|