bolognese 1.5.3 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +658 -0
- data/Gemfile.lock +4 -4
- data/bolognese.gemspec +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/schema_org_writer.rb +1 -1
- data/spec/datacite_utils_spec.rb +0 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_references.yml +95 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_version.yml +64 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml +55 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_Citeproc_JSON.yml +146 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml +250 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/Crossref_DOI.yml +146 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/journal_article.yml +194 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/maremma.yml +216 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/with_pages.yml +191 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting.yml +55 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml +111 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/journal_article.yml +51 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/with_pages.yml +48 -0
- data/spec/readers/datacite_reader_spec.rb +27 -3
- data/spec/writers/bibtex_writer_spec.rb +1 -1
- data/spec/writers/datacite_writer_spec.rb +28 -0
- data/spec/writers/rdf_xml_writer_spec.rb +78 -89
- data/spec/writers/turtle_writer_spec.rb +46 -46
- metadata +23 -3
@@ -254,8 +254,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
254
254
|
"funderIdentifierType"=>"Crossref Funder ID",
|
255
255
|
"funderName"=>"European Commission"}],
|
256
256
|
types: { "resourceTypeGeneral" => "Dataset", "schemaOrg" => "Dataset" })
|
257
|
-
|
258
|
-
puts subject.errors
|
259
257
|
|
260
258
|
expect(subject.valid?).to be true
|
261
259
|
expect(subject.doi).to eq("10.5281/zenodo.1239")
|
@@ -958,7 +956,6 @@ describe Bolognese::Metadata, vcr: true do
|
|
958
956
|
it "ancient-dates" do
|
959
957
|
input = fixture_path + "datacite-example-ancientdates-v4.3.xml"
|
960
958
|
subject = Bolognese::Metadata.new(input: input)
|
961
|
-
puts subject.errors
|
962
959
|
#expect(subject.valid?).to be true
|
963
960
|
expect(subject.dates).to eq([{"date"=>"-0024/-0022", "dateInformation"=>"from 25 BC to 23 BC", "dateType"=>"Created"}, {"date"=>"2010", "dateType"=>"Issued"}])
|
964
961
|
end
|
@@ -1033,6 +1030,33 @@ describe Bolognese::Metadata, vcr: true do
|
|
1033
1030
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-3")
|
1034
1031
|
end
|
1035
1032
|
|
1033
|
+
it "funding references" do
|
1034
|
+
input = "10.26102/2310-6018/2019.24.1.006"
|
1035
|
+
subject = Bolognese::Metadata.new(input: input)
|
1036
|
+
expect(subject.valid?).to be true
|
1037
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.26102/2310-6018/2019.24.1.006", "identifierType"=>"DOI"}])
|
1038
|
+
expect(subject.types["resourceTypeGeneral"]).to eq("Text")
|
1039
|
+
expect(subject.types["resourceType"]).to eq("Journal Article")
|
1040
|
+
expect(subject.types["schemaOrg"]).to eq("ScholarlyArticle")
|
1041
|
+
expect(subject.types["bibtex"]).to eq("article")
|
1042
|
+
expect(subject.types["citeproc"]).to eq("article-journal")
|
1043
|
+
expect(subject.creators.length).to eq(2)
|
1044
|
+
expect(subject.creators.first).to eq("affiliation" => [{"name"=>"Тверская государственная сельскохозяйственная академия"}],
|
1045
|
+
"familyName" => "Ганичева",
|
1046
|
+
"givenName" => "А.В.",
|
1047
|
+
"name" => "Ганичева, А.В.",
|
1048
|
+
"nameIdentifiers" => [],
|
1049
|
+
"nameType" => "Personal")
|
1050
|
+
expect(subject.titles.last).to eq("title"=>"MODEL OF SYSTEM DYNAMICS OF PROCESS OF TRAINING", "titleType"=>"TranslatedTitle")
|
1051
|
+
expect(subject.dates).to eq([{"date"=>"2019-02-09", "dateType"=>"Issued"}])
|
1052
|
+
expect(subject.publication_year).to eq("2019")
|
1053
|
+
expect(subject.publisher).to eq("МОДЕЛИРОВАНИЕ, ОПТИМИЗАЦИЯ И ИНФОРМАЦИОННЫЕ ТЕХНОЛОГИИ")
|
1054
|
+
expect(subject.funding_references.count).to eq(1)
|
1055
|
+
expect(subject.funding_references.first).to eq("awardNumber"=>"проект № 170100728", "funderName"=>"РФФИ")
|
1056
|
+
expect(subject.agency).to eq("DataCite")
|
1057
|
+
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
1058
|
+
end
|
1059
|
+
|
1036
1060
|
it "DOI in with related id system" do
|
1037
1061
|
input = "https://doi.org/10.4121/uuid:3926db30-f712-4394-aebc-75976070e91f"
|
1038
1062
|
subject = Bolognese::Metadata.new(input: input)
|
@@ -162,7 +162,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
162
162
|
end
|
163
163
|
|
164
164
|
it "dataset neurophysiology" do
|
165
|
-
input =
|
165
|
+
input = fixture_path + 'datacite-schema-2.2.xml'
|
166
166
|
subject = Bolognese::Metadata.new(input: input)
|
167
167
|
expect(subject.valid?).to be true
|
168
168
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
@@ -123,6 +123,34 @@ describe Bolognese::Metadata, vcr: true do
|
|
123
123
|
expect(datacite.dig("creators", "creator")).to eq("affiliation"=>"DataCite", "creatorName"=> {"__content__"=>"Fenner, Martin", "nameType"=>"Personal"}, "givenName"=>"Martin", "familyName"=>"Fenner", "nameIdentifier"=>{"__content__"=>"https://orcid.org/0000-0003-0077-4738", "nameIdentifierScheme"=>"ORCID", "schemeURI"=>"https://orcid.org"})
|
124
124
|
end
|
125
125
|
|
126
|
+
it "with version" do
|
127
|
+
input = "https://doi.org/10.5281/zenodo.28518"
|
128
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
129
|
+
expect(subject.valid?).to be true
|
130
|
+
expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5281/zenodo.28518", "identifierType"=>"DOI"}, {"identifier"=>"https://zenodo.org/record/28518", "identifierType"=>"URL"}])
|
131
|
+
expect(subject.types).to eq("bibtex" => "misc",
|
132
|
+
"citeproc" => "article",
|
133
|
+
"resourceTypeGeneral" => "Software",
|
134
|
+
"ris" => "COMP",
|
135
|
+
"schemaOrg" => "SoftwareSourceCode")
|
136
|
+
expect(subject.creators.length).to eq(2)
|
137
|
+
expect(subject.creators.first).to eq("affiliation" => [{"name"=>"University of Washington"}],
|
138
|
+
"familyName" => "Vanderplas",
|
139
|
+
"givenName" => "Jake",
|
140
|
+
"name" => "Vanderplas, Jake",
|
141
|
+
"nameIdentifiers" => [],
|
142
|
+
"nameType" => "Personal")
|
143
|
+
expect(subject.titles).to eq([{"title"=>"Supersmoother: Minor Bug Fix Release"}])
|
144
|
+
expect(subject.rights_list).to eq([{"rights"=>"Open Access", "rightsUri"=>"info:eu-repo/semantics/openAccess"}])
|
145
|
+
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
146
|
+
expect(subject.publication_year).to eq("2015")
|
147
|
+
expect(subject.version_info).to eq("v0.3.2")
|
148
|
+
expect(subject.publisher).to eq("Zenodo")
|
149
|
+
expect(subject.agency).to eq("DataCite")
|
150
|
+
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
151
|
+
expect(subject.datacite).to include("<version>v0.3.2</version>")
|
152
|
+
end
|
153
|
+
|
126
154
|
it "Text pass-thru" do
|
127
155
|
input = "https://doi.org/10.23640/07243.5153971"
|
128
156
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
@@ -4,97 +4,86 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Bolognese::Metadata, vcr: true do
|
6
6
|
context "write metadata as rdf xml" do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
7
|
+
it "journal article" do
|
8
|
+
input = "10.7554/eLife.01567"
|
9
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
10
|
+
expect(subject.valid?).to be true
|
11
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
12
|
+
expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.7554/elife.01567")
|
13
|
+
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
14
|
+
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2014-02-11")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "with pages" do
|
18
|
+
input = "https://doi.org/10.1155/2012/291294"
|
19
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
20
|
+
expect(subject.valid?).to be true
|
21
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
22
|
+
expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.1155/2012/291294")
|
23
|
+
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
24
|
+
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2012")
|
25
|
+
expect(rdf_xml.dig("ScholarlyArticle", "pageStart")).to eq("1")
|
26
|
+
expect(rdf_xml.dig("ScholarlyArticle", "pageEnd")).to eq("7")
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.7554/elife.01567")
|
34
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
35
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2014")
|
36
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "isPartOf", "Periodical", "name")).to eq("eLife")
|
37
|
-
# end
|
38
|
-
#
|
39
|
-
# it "BlogPosting" do
|
40
|
-
# input = "https://doi.org/10.5438/4K3M-NYVG"
|
41
|
-
# subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
42
|
-
# expect(subject.valid?).to be true
|
43
|
-
# rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
44
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
45
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "rdf:about")).to eq("http://orcid.org/0000-0003-1419-2405")
|
46
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "name")).to eq("Fenner, Martin")
|
47
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Eating your own Dog Food")
|
48
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "keywords")).to eq("datacite, doi, metadata")
|
49
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2016-12-20")
|
50
|
-
# end
|
51
|
-
#
|
52
|
-
# it "BlogPosting Citeproc JSON" do
|
53
|
-
# input = fixture_path + "citeproc.json"
|
54
|
-
# subject = Bolognese::Metadata.new(input: input, from: "citeproc")
|
55
|
-
# rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
56
|
-
# expect(rdf_xml.dig("BlogPosting", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
57
|
-
# expect(rdf_xml.dig("BlogPosting", "author", "Person", "name")).to eq("Martin Fenner")
|
58
|
-
# expect(rdf_xml.dig("BlogPosting", "name")).to eq("Eating your own Dog Food")
|
59
|
-
# expect(rdf_xml.dig("BlogPosting", "datePublished", "__content__")).to eq("2016-12-20")
|
60
|
-
# end
|
61
|
-
#
|
62
|
-
# it "maremma" do
|
63
|
-
# input = "https://github.com/datacite/maremma"
|
64
|
-
# subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
65
|
-
# rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
66
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "rdf:about")).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
67
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "author", "Person", "rdf:about")).to eq("http://orcid.org/0000-0003-0077-4738")
|
68
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "author", "Person", "name")).to eq("Martin Fenner")
|
69
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "name")).to eq("Maremma: a Ruby library for simplified network calls")
|
70
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "keywords")).to eq("faraday, excon, net/http")
|
71
|
-
# expect(rdf_xml.dig("SoftwareSourceCode", "datePublished", "__content__")).to eq("2017-02-24")
|
72
|
-
# end
|
29
|
+
it "Crossref DOI" do
|
30
|
+
input = fixture_path + "crossref.bib"
|
31
|
+
subject = Bolognese::Metadata.new(input: input, from: "bibtex")
|
32
|
+
expect(subject.valid?).to be true
|
33
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
73
34
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
80
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "rdf:about")).to eq("http://orcid.org/0000-0003-1419-2405")
|
81
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "name")).to eq("Fenner, Martin")
|
82
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Eating your own Dog Food")
|
83
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "keywords")).to eq("datacite, doi, metadata")
|
84
|
-
# expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2016-12-20")
|
85
|
-
# end
|
35
|
+
expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.7554/elife.01567")
|
36
|
+
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
37
|
+
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2014")
|
38
|
+
expect(rdf_xml.dig("ScholarlyArticle", "periodical", "Journal", "name")).to eq("eLife")
|
39
|
+
end
|
86
40
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
41
|
+
it "BlogPosting" do
|
42
|
+
input = "https://doi.org/10.5438/4K3M-NYVG"
|
43
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
44
|
+
expect(subject.valid?).to be true
|
45
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
46
|
+
expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
47
|
+
expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "rdf:about")).to eq("https://orcid.org/0000-0003-1419-2405")
|
48
|
+
expect(rdf_xml.dig("ScholarlyArticle", "author", "Person", "name")).to eq("Martin Fenner")
|
49
|
+
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Eating your own Dog Food")
|
50
|
+
expect(rdf_xml.dig("ScholarlyArticle", "keywords")).to eq("datacite, doi, metadata")
|
51
|
+
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2016-12-20")
|
52
|
+
end
|
53
|
+
|
54
|
+
it "BlogPosting Citeproc JSON" do
|
55
|
+
input = fixture_path + "citeproc.json"
|
56
|
+
subject = Bolognese::Metadata.new(input: input, from: "citeproc")
|
57
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
58
|
+
expect(rdf_xml.dig("BlogPosting", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
59
|
+
expect(rdf_xml.dig("BlogPosting", "author", "Person", "name")).to eq("Martin Fenner")
|
60
|
+
expect(rdf_xml.dig("BlogPosting", "name")).to eq("Eating your own Dog Food")
|
61
|
+
expect(rdf_xml.dig("BlogPosting", "datePublished", "__content__")).to eq("2016-12-20")
|
62
|
+
end
|
63
|
+
|
64
|
+
it "maremma" do
|
65
|
+
input = "https://github.com/datacite/maremma"
|
66
|
+
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
67
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
68
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "rdf:about")).to eq("https://doi.org/10.5438/qeg0-3gm3")
|
69
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "author", "Person", "rdf:about")).to eq("https://orcid.org/0000-0003-0077-4738")
|
70
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "author", "Person", "name")).to eq("Martin Fenner")
|
71
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "name")).to eq("Maremma: a Ruby library for simplified network calls")
|
72
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "keywords")).to eq("faraday, excon, net/http")
|
73
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "datePublished", "__content__")).to eq("2017-02-24")
|
74
|
+
end
|
75
|
+
|
76
|
+
it "BlogPosting schema.org" do
|
77
|
+
input = "https://blog.datacite.org/eating-your-own-dog-food/"
|
78
|
+
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
79
|
+
expect(subject.valid?).to be true
|
80
|
+
rdf_xml = Maremma.from_xml(subject.rdf_xml).fetch("RDF", {})
|
81
|
+
expect(rdf_xml.dig("BlogPosting", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
82
|
+
expect(rdf_xml.dig("BlogPosting", "author", "Person", "rdf:about")).to eq("https://orcid.org/0000-0003-1419-2405")
|
83
|
+
expect(rdf_xml.dig("BlogPosting", "author", "Person", "name")).to eq("Martin Fenner")
|
84
|
+
expect(rdf_xml.dig("BlogPosting", "name")).to eq("Eating your own Dog Food")
|
85
|
+
expect(rdf_xml.dig("BlogPosting", "keywords")).to eq("datacite, doi, metadata, featured")
|
86
|
+
expect(rdf_xml.dig("BlogPosting", "datePublished", "__content__")).to eq("2016-12-20")
|
87
|
+
end
|
99
88
|
end
|
100
89
|
end
|
@@ -21,14 +21,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
21
21
|
expect(ttl[2]).to eq("<https://doi.org/10.1371/journal.ppat.1000446> a schema:ScholarlyArticle;")
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
it "BlogPosting" do
|
25
|
+
input= "https://doi.org/10.5438/4K3M-NYVG"
|
26
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
27
|
+
expect(subject.valid?).to be true
|
28
|
+
ttl = subject.turtle.split("\n")
|
29
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
30
|
+
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:ScholarlyArticle;")
|
31
|
+
end
|
32
32
|
|
33
33
|
it "BlogPosting Citeproc JSON" do
|
34
34
|
input = fixture_path + "citeproc.json"
|
@@ -38,47 +38,47 @@ describe Bolognese::Metadata, vcr: true do
|
|
38
38
|
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:BlogPosting;")
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
it "BlogPosting DataCite JSON" do
|
42
|
+
input = fixture_path + "datacite.json"
|
43
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite_json")
|
44
|
+
ttl = subject.turtle.split("\n")
|
45
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
46
|
+
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:ScholarlyArticle;")
|
47
|
+
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
it "BlogPosting schema.org" do
|
50
|
+
input = "https://blog.datacite.org/eating-your-own-dog-food/"
|
51
|
+
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
52
|
+
expect(subject.valid?).to be true
|
53
|
+
ttl = subject.turtle.split("\n")
|
54
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
55
|
+
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:BlogPosting;")
|
56
|
+
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
58
|
+
it "DataONE" do
|
59
|
+
input = fixture_path + 'codemeta.json'
|
60
|
+
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
61
|
+
ttl = subject.turtle.split("\n")
|
62
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
63
|
+
expect(ttl[2]).to eq("<https://doi.org/10.5063/f1m61h5x> a schema:SoftwareSourceCode;")
|
64
|
+
end
|
65
65
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
it "journal article" do
|
67
|
+
input = "10.7554/eLife.01567"
|
68
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
69
|
+
expect(subject.valid?).to be true
|
70
|
+
ttl = subject.turtle.split("\n")
|
71
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
72
|
+
expect(ttl[2]).to eq("<https://doi.org/10.7554/elife.01567> a schema:ScholarlyArticle;")
|
73
|
+
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
75
|
+
it "with pages" do
|
76
|
+
input = "https://doi.org/10.1155/2012/291294"
|
77
|
+
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
78
|
+
expect(subject.valid?).to be true
|
79
|
+
ttl = subject.turtle.split("\n")
|
80
|
+
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
81
|
+
expect(ttl[2]).to eq("<https://doi.org/10.1155/2012/291294> a schema:ScholarlyArticle;")
|
82
|
+
end
|
83
83
|
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
@@ -268,14 +268,20 @@ dependencies:
|
|
268
268
|
requirements:
|
269
269
|
- - "~>"
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version: '3.
|
271
|
+
version: '3.1'
|
272
|
+
- - ">="
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
version: 3.1.1
|
272
275
|
type: :runtime
|
273
276
|
prerelease: false
|
274
277
|
version_requirements: !ruby/object:Gem::Requirement
|
275
278
|
requirements:
|
276
279
|
- - "~>"
|
277
280
|
- !ruby/object:Gem::Version
|
278
|
-
version: '3.
|
281
|
+
version: '3.1'
|
282
|
+
- - ">="
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
version: 3.1.1
|
279
285
|
- !ruby/object:Gem::Dependency
|
280
286
|
name: jsonlint
|
281
287
|
requirement: !ruby/object:Gem::Requirement
|
@@ -554,6 +560,7 @@ extra_rdoc_files:
|
|
554
560
|
- README.md
|
555
561
|
files:
|
556
562
|
- ".gitignore"
|
563
|
+
- ".rubocop.yml"
|
557
564
|
- ".travis.yml"
|
558
565
|
- CITATION
|
559
566
|
- Gemfile
|
@@ -925,6 +932,7 @@ files:
|
|
925
932
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/dissertation.yml
|
926
933
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/doi_with_sign.yml
|
927
934
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/empty_subject.yml
|
935
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_references.yml
|
928
936
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/funding_schema_version_3.yml
|
929
937
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/is_identical_to.yml
|
930
938
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_datacite_metadata/keywords_with_attributes.yml
|
@@ -1116,6 +1124,7 @@ files:
|
|
1116
1124
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation.yml
|
1117
1125
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_data_citation_schema_org.yml
|
1118
1126
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_editor.yml
|
1127
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_datacite_xml/with_version.yml
|
1119
1128
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Dataset_in_schema_4_0.yml
|
1120
1129
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/Text_pass-thru.yml
|
1121
1130
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/book_chapter.yml
|
@@ -1124,6 +1133,13 @@ files:
|
|
1124
1133
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation.yml
|
1125
1134
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_data_citation_schema_org.yml
|
1126
1135
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_jats_xml/with_editor.yml
|
1136
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting.yml
|
1137
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_Citeproc_JSON.yml
|
1138
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/BlogPosting_schema_org.yml
|
1139
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/Crossref_DOI.yml
|
1140
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/journal_article.yml
|
1141
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/maremma.yml
|
1142
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_rdf_xml/with_pages.yml
|
1127
1143
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting.yml
|
1128
1144
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/BlogPosting_schema_org.yml
|
1129
1145
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_ris/Dataset.yml
|
@@ -1145,9 +1161,13 @@ files:
|
|
1145
1161
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/series_information.yml
|
1146
1162
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme.yml
|
1147
1163
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_schema_org/subject_scheme_multiple_keywords.yml
|
1164
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting.yml
|
1148
1165
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_Citeproc_JSON.yml
|
1166
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/BlogPosting_schema_org.yml
|
1149
1167
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Crossref_DOI.yml
|
1150
1168
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/Dataset.yml
|
1169
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/journal_article.yml
|
1170
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_turtle/with_pages.yml
|
1151
1171
|
- spec/fixtures/vivli.xml
|
1152
1172
|
- spec/metadata_spec.rb
|
1153
1173
|
- spec/readers/bibtex_reader_spec.rb
|