bolognese 1.11.3 → 2.2.0
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/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +2 -2
- data/Gemfile.lock +15 -12
- data/bolognese.gemspec +5 -3
- data/lib/bolognese/author_utils.rb +4 -3
- data/lib/bolognese/datacite_utils.rb +18 -10
- data/lib/bolognese/metadata.rb +1 -6
- data/lib/bolognese/metadata_utils.rb +2 -2
- data/lib/bolognese/readers/bibtex_reader.rb +2 -2
- data/lib/bolognese/readers/citeproc_reader.rb +1 -1
- data/lib/bolognese/readers/codemeta_reader.rb +2 -2
- data/lib/bolognese/readers/crosscite_reader.rb +4 -1
- data/lib/bolognese/readers/crossref_reader.rb +3 -4
- data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +19 -3
- data/lib/bolognese/readers/npm_reader.rb +1 -1
- data/lib/bolognese/readers/ris_reader.rb +2 -2
- data/lib/bolognese/readers/schema_org_reader.rb +6 -2
- data/lib/bolognese/utils.rb +23 -6
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +1 -1
- data/lib/bolognese/writers/codemeta_writer.rb +1 -1
- data/lib/bolognese/writers/csv_writer.rb +1 -1
- data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
- data/lib/bolognese/writers/jats_writer.rb +6 -3
- data/lib/bolognese/writers/ris_writer.rb +1 -1
- data/lib/bolognese/writers/schema_org_writer.rb +1 -1
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +2 -0
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +2 -0
- data/resources/kernel-4/metadata.xsd +11 -7
- data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
- data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
- data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.5/include/xml.xsd +286 -0
- data/resources/kernel-4.5/metadata.xsd +711 -0
- data/spec/author_utils_spec.rb +33 -4
- data/spec/datacite_utils_spec.rb +5 -1
- data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +18 -2
- data/spec/fixtures/datacite-example-full-v4.5.xml +255 -0
- data/spec/fixtures/datacite-seriesinformation.xml +7 -2
- data/spec/fixtures/datacite-xml-lang.xml +1 -1
- data/spec/fixtures/datacite_blank_name_identifier.xml +22 -0
- data/spec/fixtures/datacite_blank_publisher.xml +18 -0
- data/spec/fixtures/datacite_journal_article.xml +64 -0
- data/spec/fixtures/schema_org.json +1 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +32 -14
- data/spec/readers/bibtex_reader_spec.rb +2 -0
- data/spec/readers/citeproc_reader_spec.rb +3 -0
- data/spec/readers/codemeta_reader_spec.rb +4 -4
- data/spec/readers/crosscite_reader_spec.rb +2 -0
- data/spec/readers/crossref_reader_spec.rb +41 -41
- data/spec/readers/datacite_json_reader_spec.rb +2 -0
- data/spec/readers/datacite_reader_spec.rb +123 -42
- data/spec/readers/npm_reader_spec.rb +2 -0
- data/spec/readers/ris_reader_spec.rb +3 -0
- data/spec/readers/schema_org_reader_spec.rb +11 -11
- data/spec/spec_helper.rb +1 -0
- data/spec/writers/citation_writer_spec.rb +9 -0
- data/spec/writers/crosscite_writer_spec.rb +7 -0
- data/spec/writers/datacite_json_writer_spec.rb +22 -0
- data/spec/writers/datacite_writer_spec.rb +84 -5
- data/spec/writers/jats_writer_spec.rb +15 -0
- data/spec/writers/rdf_xml_writer_spec.rb +7 -0
- data/spec/writers/schema_org_writer_spec.rb +13 -0
- data/spec/writers/turtle_writer_spec.rb +18 -0
- metadata +60 -22
|
@@ -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
|
|
@@ -46,6 +46,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
46
46
|
expect(crosscite.dig("descriptions", 0, "description")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
47
47
|
expect(crosscite.fetch("creators").count).to eq(5)
|
|
48
48
|
expect(crosscite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar")
|
|
49
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"{eLife} Sciences Organisation, Ltd."})
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -57,6 +58,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
57
58
|
expect(crosscite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
58
59
|
expect(crosscite.dig("descriptions", 0, "description")).to start_with("Eating your own dog food")
|
|
59
60
|
expect(crosscite.fetch("creators")).to eq([{"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin"}])
|
|
61
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
it "rdataone" do
|
|
@@ -67,6 +69,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
67
69
|
expect(crosscite["creators"].length).to eq(3)
|
|
68
70
|
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University Of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
69
71
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
72
|
+
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
70
73
|
end
|
|
71
74
|
|
|
72
75
|
it "rdataone codemeta v2" do
|
|
@@ -77,6 +80,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
77
80
|
expect(crosscite["creators"].length).to eq(3)
|
|
78
81
|
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University Of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
79
82
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
83
|
+
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
80
84
|
end
|
|
81
85
|
|
|
82
86
|
it "datacite database attributes" do
|
|
@@ -91,6 +95,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
91
95
|
expect(crosscite.fetch("publication_year")).to eq("2011")
|
|
92
96
|
expect(crosscite.fetch("provider_id")).to eq("dryad")
|
|
93
97
|
expect(crosscite.fetch("client_id")).to eq("dryad.dryad")
|
|
98
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"Dryad"})
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
it "maremma" do
|
|
@@ -106,6 +111,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
106
111
|
[{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738",
|
|
107
112
|
"nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
108
113
|
"nameType"=>"Personal"}])
|
|
114
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
109
115
|
end
|
|
110
116
|
|
|
111
117
|
it "with data citation schema.org" do
|
|
@@ -117,6 +123,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
117
123
|
expect(crosscite.fetch("related_identifiers").count).to eq(3)
|
|
118
124
|
expect(crosscite.fetch("related_identifiers").first).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
|
|
119
125
|
expect(crosscite.fetch("related_identifiers").last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
|
|
126
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
120
127
|
end
|
|
121
128
|
end
|
|
122
129
|
end
|
|
@@ -18,6 +18,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
18
18
|
"rightsIdentifierScheme"=>"SPDX",
|
|
19
19
|
"rightsUri"=>"https://creativecommons.org/licenses/by/3.0/legalcode",
|
|
20
20
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
21
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"eLife Sciences Publications, Ltd"})
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
it "with ORCID ID" do
|
|
@@ -28,6 +29,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
28
29
|
expect(datacite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
|
29
30
|
expect(datacite.fetch("creators").length).to eq(7)
|
|
30
31
|
expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Thanassi, Wendy", "givenName"=>"Wendy", "familyName"=>"Thanassi", "affiliation" => [{"name"=>"Department of Medicine, Veterans Affairs Palo Alto Health Care System, 3801 Miranda Avenue MC-, Palo Alto, CA 94304-1207, USA"}, {"name"=>"Occupational Health Strategic Health Care Group, Office of Public Health, Veterans Health Administration, Washington, DC 20006, USA"}, {"name"=>"Division of Emergency Medicine, Stanford University School of Medicine, Stanford, CA 94304, USA"}, {"name"=>"War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA"}])
|
|
32
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"Hindawi Limited"})
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
it "Crossref DOI" do
|
|
@@ -39,6 +41,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
39
41
|
expect(datacite.dig("descriptions", 0, "description")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
40
42
|
expect(datacite.fetch("creators").length).to eq(5)
|
|
41
43
|
expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar")
|
|
44
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"{eLife} Sciences Organisation, Ltd."})
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -49,6 +52,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
49
52
|
expect(datacite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
50
53
|
expect(datacite.dig("descriptions", 0, "description")).to start_with("Eating your own dog food")
|
|
51
54
|
expect(datacite.fetch("creators")).to eq([{"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin"}])
|
|
55
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
52
56
|
end
|
|
53
57
|
|
|
54
58
|
it "rdataone" do
|
|
@@ -60,6 +64,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
60
64
|
expect(datacite.fetch("creators").first).to eq("affiliation"=>[{"name"=>"NCEAS"}], "nameType"=>"Personal", "name" => "Jones, Matt",
|
|
61
65
|
"nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "givenName"=>"Matt", "familyName"=>"Jones")
|
|
62
66
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
67
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"https://cran.r-project.org"})
|
|
63
68
|
end
|
|
64
69
|
|
|
65
70
|
it "maremma" do
|
|
@@ -75,6 +80,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
75
80
|
[{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738",
|
|
76
81
|
"nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
77
82
|
"nameType"=>"Personal"}])
|
|
83
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
78
84
|
end
|
|
79
85
|
|
|
80
86
|
it "with data citation schema.org" do
|
|
@@ -85,6 +91,22 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
85
91
|
expect(datacite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
86
92
|
expect(datacite.fetch("relatedIdentifiers").count).to eq(3)
|
|
87
93
|
expect(datacite.fetch("relatedIdentifiers").first).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
|
|
94
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it "DataCite DOI with Schema 4.5 publisher attributes" do
|
|
98
|
+
input = fixture_path + "datacite-example-full-v4.5.xml"
|
|
99
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
100
|
+
datacite = JSON.parse(subject.datacite_json)
|
|
101
|
+
expect(datacite.fetch("publisher")).to eq(
|
|
102
|
+
{
|
|
103
|
+
"name" => "Example Publisher",
|
|
104
|
+
"publisherIdentifier" => "https://ror.org/04z8jg394",
|
|
105
|
+
"publisherIdentifierScheme" => "ROR",
|
|
106
|
+
"schemeUri" => "https://ror.org/",
|
|
107
|
+
"lang" => "en",
|
|
108
|
+
},
|
|
109
|
+
)
|
|
88
110
|
end
|
|
89
111
|
end
|
|
90
112
|
end
|
|
@@ -17,6 +17,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
17
17
|
expect(datacite.dig("rightsList", "rights")).to eq("rightsURI"=>"https://creativecommons.org/licenses/by/3.0/legalcode", "rightsIdentifier"=>"cc-by-3.0", "rightsIdentifierScheme"=>"SPDX", "schemeURI"=>"https://spdx.org/licenses/", "__content__"=>"Creative Commons Attribution 3.0 Unported")
|
|
18
18
|
expect(datacite.dig("fundingReferences", "fundingReference").count).to eq(4)
|
|
19
19
|
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier" => {"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
|
20
|
+
expect(datacite.dig("publisher")).to eq("eLife Sciences Publications, Ltd")
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
it "with ORCID ID" do
|
|
@@ -31,6 +32,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
31
32
|
"givenName" => "Beatriz",
|
|
32
33
|
"affiliation" => ["War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA", "Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA"],
|
|
33
34
|
"nameIdentifier" => {"nameIdentifierScheme"=>"ORCID", "schemeURI"=>"https://orcid.org", "__content__"=>"https://orcid.org/0000-0003-2043-4925"})
|
|
35
|
+
expect(datacite.dig("publisher")).to eq("Hindawi Limited")
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
it "with editor" do
|
|
@@ -39,6 +41,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
39
41
|
expect(subject.valid?).to be true
|
|
40
42
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
41
43
|
expect(datacite.dig("contributors", "contributor")).to eq("contributorName"=>{"__content__"=>"Janbon, Guilhem", "nameType"=>"Personal"}, "contributorType"=>"Editor", "familyName"=>"Janbon", "givenName"=>"Guilhem")
|
|
44
|
+
expect(datacite.dig("publisher")).to eq("Public Library of Science (PLoS)")
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
it "Crossref DOI" do
|
|
@@ -52,6 +55,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
52
55
|
expect(datacite.dig("descriptions", "description", 1, "__content__")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
53
56
|
expect(datacite.dig("creators", "creator").count).to eq(5)
|
|
54
57
|
expect(datacite.dig("creators", "creator").first).to eq("creatorName"=>{"__content__"=>"Sankar, Martial", "nameType"=>"Personal"}, "familyName"=>"Sankar", "givenName"=>"Martial")
|
|
58
|
+
expect(datacite.dig("publisher")).to eq("{eLife} Sciences Organisation, Ltd.")
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -64,6 +68,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
64
68
|
expect(datacite.dig("descriptions", "description").first).to eq("__content__"=>"DataCite Blog", "descriptionType"=>"SeriesInformation")
|
|
65
69
|
expect(datacite.dig("descriptions", "description", 1, "__content__")).to start_with("Eating your own dog food")
|
|
66
70
|
expect(datacite.dig("creators", "creator")).to eq("creatorName"=>"Fenner, Martin", "familyName"=>"Fenner", "givenName"=>"Martin")
|
|
71
|
+
expect(datacite.dig("publisher")).to eq("DataCite")
|
|
67
72
|
end
|
|
68
73
|
|
|
69
74
|
it "rdataone" do
|
|
@@ -88,6 +93,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
88
93
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
89
94
|
{"creatorName"=>{"__content__"=>"University Of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
90
95
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
96
|
+
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
91
97
|
end
|
|
92
98
|
|
|
93
99
|
it "rdataone and codemeta_v2" do
|
|
@@ -112,6 +118,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
112
118
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
113
119
|
{"creatorName"=>{"__content__"=>"University Of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
114
120
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
121
|
+
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
115
122
|
end
|
|
116
123
|
|
|
117
124
|
it "maremma" do
|
|
@@ -121,6 +128,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
121
128
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
122
129
|
expect(datacite.dig("titles", "title")).to eq("Maremma: a Ruby library for simplified network calls")
|
|
123
130
|
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"})
|
|
131
|
+
expect(datacite.dig("publisher")).to eq("DataCite")
|
|
124
132
|
end
|
|
125
133
|
|
|
126
134
|
it "with version" do
|
|
@@ -146,7 +154,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
146
154
|
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
|
147
155
|
expect(subject.publication_year).to eq("2015")
|
|
148
156
|
expect(subject.version_info).to eq("v0.3.2")
|
|
149
|
-
expect(subject.publisher).to eq("Zenodo")
|
|
157
|
+
expect(subject.publisher).to eq({"name"=>"Zenodo"})
|
|
150
158
|
expect(subject.agency).to eq("datacite")
|
|
151
159
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
152
160
|
expect(subject.datacite).to include("<version>v0.3.2</version>")
|
|
@@ -168,7 +176,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
168
176
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
169
177
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "dateType"=>"Created"}, {"date"=>"2017-06-28", "dateType"=>"Updated"}, {"date"=>"2017", "dateType"=>"Issued"}])
|
|
170
178
|
expect(subject.publication_year).to eq("2017")
|
|
171
|
-
expect(subject.publisher).to eq("Figshare")
|
|
179
|
+
expect(subject.publisher).to eq({"name"=>"Figshare"})
|
|
172
180
|
expect(subject.subjects).to eq([{"subject"=>"Information Systems"},
|
|
173
181
|
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
|
174
182
|
"subject"=>"FOS: Computer and information sciences",
|
|
@@ -194,7 +202,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
194
202
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
195
203
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "dateType"=>"Created"}, {"date"=>"2017-06-28", "dateType"=>"Updated"}, {"date"=>"2017", "dateType"=>"Issued"}])
|
|
196
204
|
expect(subject.publication_year).to eq("2017")
|
|
197
|
-
expect(subject.publisher).to eq("Figshare")
|
|
205
|
+
expect(subject.publisher).to eq({"name"=>"Figshare"})
|
|
198
206
|
expect(subject.subjects).to eq([{"subject"=>"Information Systems"},
|
|
199
207
|
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
|
200
208
|
"subject"=>"FOS: Computer and information sciences",
|
|
@@ -223,12 +231,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
223
231
|
expect(subject.related_identifiers.length).to eq(1)
|
|
224
232
|
expect(subject.related_identifiers.last).to eq("relatedIdentifier" => "10.1371/journal.ppat.1000446",
|
|
225
233
|
"relatedIdentifierType" => "DOI","relationType"=>"Cites")
|
|
226
|
-
expect(subject.publisher).to eq("Dryad")
|
|
234
|
+
expect(subject.publisher).to eq({"name"=>"Dryad"})
|
|
227
235
|
expect(subject.agency).to eq("datacite")
|
|
228
236
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
229
237
|
|
|
230
238
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
231
239
|
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
240
|
+
expect(datacite.dig("publisher")).to eq("Dryad")
|
|
232
241
|
end
|
|
233
242
|
|
|
234
243
|
it "Affiliation" do
|
|
@@ -248,13 +257,83 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
248
257
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
249
258
|
expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
|
|
250
259
|
expect(subject.publication_year).to eq("2013")
|
|
251
|
-
expect(subject.publisher).to eq("UC Merced")
|
|
260
|
+
expect(subject.publisher).to eq({"name"=>"UC Merced"})
|
|
252
261
|
expect(subject.agency).to eq("datacite")
|
|
253
262
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
254
263
|
|
|
255
264
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
256
265
|
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
257
266
|
expect(datacite.dig("creators", "creator", 0, "affiliation")).to eq(["UC Merced", "NSF"])
|
|
267
|
+
expect(datacite.dig("publisher")).to eq("UC Merced")
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
it "Schema 4.5 publisher with attributes" do
|
|
271
|
+
input = fixture_path + 'datacite-example-full-v4.5.xml'
|
|
272
|
+
doi = "10.82433/B09Z-4K37"
|
|
273
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
|
274
|
+
expect(subject.valid?).to be true
|
|
275
|
+
|
|
276
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
277
|
+
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
278
|
+
expect(datacite.dig("publisher")).to eq(
|
|
279
|
+
{
|
|
280
|
+
"__content__" => "Example Publisher",
|
|
281
|
+
"publisherIdentifier" => "https://ror.org/04z8jg394",
|
|
282
|
+
"publisherIdentifierScheme" => "ROR",
|
|
283
|
+
"schemeURI" => "https://ror.org/",
|
|
284
|
+
"xml:lang" => "en",
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
it "Geolocations" do
|
|
290
|
+
input = fixture_path + 'datacite-example-full-v4.5.xml'
|
|
291
|
+
doi = "10.82433/B09Z-4K37"
|
|
292
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
|
293
|
+
expect(subject.valid?).to be true
|
|
294
|
+
|
|
295
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
296
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPlace")).to eq("Vancouver, British Columbia, Canada")
|
|
297
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPoint")).to eq(
|
|
298
|
+
{
|
|
299
|
+
"pointLatitude" => "49.2827",
|
|
300
|
+
"pointLongitude" => "-123.1207",
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationBox")).to eq(
|
|
304
|
+
{
|
|
305
|
+
"westBoundLongitude" => "-123.27",
|
|
306
|
+
"eastBoundLongitude" => "-123.02",
|
|
307
|
+
"southBoundLatitude" => "49.195",
|
|
308
|
+
"northBoundLatitude" => "49.315",
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPolygon")).to eq(
|
|
312
|
+
{
|
|
313
|
+
"polygonPoint" => [
|
|
314
|
+
{
|
|
315
|
+
"pointLatitude" => "41.991",
|
|
316
|
+
"pointLongitude" => "-71.032",
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"pointLatitude" => "42.893",
|
|
320
|
+
"pointLongitude" => "-69.622",
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"pointLatitude" => "41.991",
|
|
324
|
+
"pointLongitude" => "-68.211",
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"pointLatitude" => "41.090",
|
|
328
|
+
"pointLongitude" => "-69.622",
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"pointLatitude" => "41.991",
|
|
332
|
+
"pointLongitude" => "-71.032",
|
|
333
|
+
},
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
)
|
|
258
337
|
end
|
|
259
338
|
|
|
260
339
|
it "with data citation schema.org" do
|
|
@@ -11,6 +11,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
11
11
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
12
12
|
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
13
13
|
expect(jats.dig("source")).to eq("eLife")
|
|
14
|
+
expect(jats.dig("publisher_name")).to eq("eLife Sciences Publications, Ltd")
|
|
14
15
|
expect(jats.dig("person_group", "name").length).to eq(5)
|
|
15
16
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
|
16
17
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014-02-11", "__content__"=>"2014")
|
|
@@ -25,6 +26,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
25
26
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
26
27
|
expect(jats.dig("article_title")).to eq("Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
|
27
28
|
expect(jats.dig("source")).to eq("Pulmonary Medicine")
|
|
29
|
+
expect(jats.dig("publisher_name")).to eq("Hindawi Limited")
|
|
28
30
|
expect(jats.dig("person_group", "name").length).to eq(7)
|
|
29
31
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Thanassi", "given_names"=>"Wendy")
|
|
30
32
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2012", "__content__"=>"2012")
|
|
@@ -37,6 +39,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
37
39
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
38
40
|
expect(jats.dig("article_title")).to eq("Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization???Not Catalytic Inactivity???of the Mutant Enzymes")
|
|
39
41
|
expect(jats.dig("source")).to eq("PLoS ONE")
|
|
42
|
+
expect(jats.dig("publisher_name")).to eq("Public Library of Science (PLoS)")
|
|
40
43
|
expect(jats.dig("person_group", 0, "name").length).to eq(5)
|
|
41
44
|
expect(jats.dig("person_group", 0, "name").first).to eq("surname"=>"Ralser", "given_names"=>"Markus")
|
|
42
45
|
expect(jats.dig("person_group", 1, "name")).to eq("surname"=>"Janbon", "given_names"=>"Guilhem")
|
|
@@ -54,6 +57,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
54
57
|
expect(jats.dig("publication_type")).to eq("chapter")
|
|
55
58
|
expect(jats.dig("chapter_title")).to eq("Physical Examinations")
|
|
56
59
|
expect(jats.dig("source")).to eq("Jaypee Brothers Medical Publishing")
|
|
60
|
+
expect(jats.dig("publisher_name")).to eq("Jaypee Brothers Medical Publishing")
|
|
57
61
|
expect(jats.dig("person_group", "name")).to eq("surname"=>"Saha", "given_names"=>"Ashis")
|
|
58
62
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2015", "__content__"=>"2015")
|
|
59
63
|
expect(jats.dig("fpage")).to eq("27")
|
|
@@ -68,6 +72,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
68
72
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
69
73
|
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
70
74
|
expect(jats.dig("source")).to eq("eLife")
|
|
75
|
+
expect(jats.dig("publisher_name")).to eq("{eLife} Sciences Organisation, Ltd.")
|
|
71
76
|
expect(jats.dig("person_group", "name").length).to eq(5)
|
|
72
77
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
|
73
78
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014", "__content__"=>"2014")
|
|
@@ -126,6 +131,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
126
131
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
127
132
|
expect(jats.dig("article_title")).to eq("Recommendation of: ORCID Works Metadata Working Group")
|
|
128
133
|
expect(jats.dig("source")).to eq("Figshare")
|
|
134
|
+
expect(jats.dig("publisher_name")).to eq("Figshare")
|
|
129
135
|
expect(jats.dig("person_group", "name").length).to eq(20)
|
|
130
136
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Paglione", "given_names"=>"Laura")
|
|
131
137
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2017", "__content__"=>"2017")
|
|
@@ -139,6 +145,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
139
145
|
expect(jats.dig("publication_type")).to eq("data")
|
|
140
146
|
expect(jats.dig("data_title")).to eq("Data from: A new malaria agent in African hominids.")
|
|
141
147
|
expect(jats.dig("source")).to eq("Dryad")
|
|
148
|
+
expect(jats.dig("publisher_name")).to eq(nil)
|
|
142
149
|
expect(jats.dig("person_group", "name").length).to eq(8)
|
|
143
150
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Ollomo", "given_names"=>"Benjamin")
|
|
144
151
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2011", "__content__"=>"2011")
|
|
@@ -172,6 +179,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
172
179
|
expect(jats.dig("day")).to be_nil
|
|
173
180
|
expect(jats.dig("pub_id")).to eq("pub_id_type"=>"doi", "__content__"=>"10.34747/g6yb-3412")
|
|
174
181
|
end
|
|
182
|
+
|
|
183
|
+
it "with publisher with language" do
|
|
184
|
+
input = fixture_path + 'datacite-xml-lang.xml'
|
|
185
|
+
subject = Bolognese::Metadata.new(input: input)
|
|
186
|
+
jats = Maremma.from_xml(subject.jats).fetch("element_citation", {})
|
|
187
|
+
expect(jats.dig("publisher_name")).to eq({"xml:lang"=>"en", "__content__"=>"OSI SAF"})
|
|
188
|
+
end
|
|
175
189
|
end
|
|
176
190
|
|
|
177
191
|
context "change metadata as datacite xml" do
|
|
@@ -182,6 +196,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
182
196
|
expect(jats.dig("publication_type")).to eq("journal")
|
|
183
197
|
expect(jats.dig("article_title")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
184
198
|
expect(jats.dig("source")).to eq("eLife")
|
|
199
|
+
expect(jats.dig("publisher_name")).to eq("eLife Sciences Publications, Ltd")
|
|
185
200
|
expect(jats.dig("person_group", "name").length).to eq(5)
|
|
186
201
|
expect(jats.dig("person_group", "name").first).to eq("surname"=>"Sankar", "given_names"=>"Martial")
|
|
187
202
|
expect(jats.dig("year")).to eq("iso_8601_date"=>"2014-02-11", "__content__"=>"2014")
|
|
@@ -12,6 +12,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
12
12
|
expect(rdf_xml.dig("ScholarlyArticle", "rdf:about")).to eq("https://doi.org/10.7554/elife.01567")
|
|
13
13
|
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
14
14
|
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2014-02-11")
|
|
15
|
+
expect(rdf_xml.dig("ScholarlyArticle", "publisher", "Organization", "name")).to eq("eLife Sciences Publications, Ltd")
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
it "with pages" do
|
|
@@ -24,6 +25,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
24
25
|
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2012")
|
|
25
26
|
expect(rdf_xml.dig("ScholarlyArticle", "pageStart")).to eq("1")
|
|
26
27
|
expect(rdf_xml.dig("ScholarlyArticle", "pageEnd")).to eq("7")
|
|
28
|
+
expect(rdf_xml.dig("ScholarlyArticle", "publisher", "Organization", "name")).to eq("Hindawi Limited")
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
it "Crossref DOI" do
|
|
@@ -36,6 +38,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
36
38
|
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
|
37
39
|
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2014")
|
|
38
40
|
expect(rdf_xml.dig("ScholarlyArticle", "periodical", "Journal", "name")).to eq("eLife")
|
|
41
|
+
expect(rdf_xml.dig("ScholarlyArticle", "publisher", "Organization", "name")).to eq("{eLife} Sciences Organisation, Ltd.")
|
|
39
42
|
end
|
|
40
43
|
|
|
41
44
|
it "BlogPosting" do
|
|
@@ -47,6 +50,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
47
50
|
expect(rdf_xml.dig("ScholarlyArticle", "name")).to eq("Eating your own Dog Food")
|
|
48
51
|
expect(rdf_xml.dig("ScholarlyArticle", "keywords")).to eq("datacite, doi, metadata, FOS: Computer and information sciences, FOS: Computer and information sciences")
|
|
49
52
|
expect(rdf_xml.dig("ScholarlyArticle", "datePublished", "__content__")).to eq("2016-12-20")
|
|
53
|
+
expect(rdf_xml.dig("ScholarlyArticle", "publisher", "Organization", "name")).to eq("DataCite")
|
|
50
54
|
end
|
|
51
55
|
|
|
52
56
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -56,6 +60,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
56
60
|
expect(rdf_xml.dig("BlogPosting", "rdf:about")).to eq("https://doi.org/10.5438/4k3m-nyvg")
|
|
57
61
|
expect(rdf_xml.dig("BlogPosting", "name")).to eq("Eating your own Dog Food")
|
|
58
62
|
expect(rdf_xml.dig("BlogPosting", "datePublished", "__content__")).to eq("2016-12-20")
|
|
63
|
+
expect(rdf_xml.dig("BlogPosting", "publisher", "Organization", "name")).to eq("DataCite")
|
|
59
64
|
end
|
|
60
65
|
|
|
61
66
|
it "maremma" do
|
|
@@ -68,6 +73,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
68
73
|
expect(rdf_xml.dig("SoftwareSourceCode", "name")).to eq("Maremma: a Ruby library for simplified network calls")
|
|
69
74
|
expect(rdf_xml.dig("SoftwareSourceCode", "keywords")).to eq("faraday, excon, net/http")
|
|
70
75
|
expect(rdf_xml.dig("SoftwareSourceCode", "datePublished", "__content__")).to eq("2017-02-24")
|
|
76
|
+
expect(rdf_xml.dig("SoftwareSourceCode", "publisher", "Organization", "name")).to eq("DataCite")
|
|
71
77
|
end
|
|
72
78
|
|
|
73
79
|
it "BlogPosting schema.org" do
|
|
@@ -81,6 +87,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
81
87
|
expect(rdf_xml.dig("BlogPosting", "name")).to eq("Eating your own Dog Food")
|
|
82
88
|
expect(rdf_xml.dig("BlogPosting", "keywords")).to eq("datacite, doi, metadata, featured")
|
|
83
89
|
expect(rdf_xml.dig("BlogPosting", "datePublished", "__content__")).to eq("2016-12-20")
|
|
90
|
+
expect(rdf_xml.dig("BlogPosting", "publisher", "Organization", "name")).to eq("DataCite")
|
|
84
91
|
end
|
|
85
92
|
end
|
|
86
93
|
end
|
|
@@ -365,5 +365,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
365
365
|
expect(json["@type"]).to eq("CreativeWork")
|
|
366
366
|
expect(json["datePublished"]).to eq("2019")
|
|
367
367
|
end
|
|
368
|
+
|
|
369
|
+
it "from Schema 4.5 with publisher attributes" do
|
|
370
|
+
input = fixture_path + 'datacite-example-full-v4.5.xml'
|
|
371
|
+
subject = Bolognese::Metadata.new(input: input)
|
|
372
|
+
json = JSON.parse(subject.schema_org)
|
|
373
|
+
expect(json["publisher"]).to eq(
|
|
374
|
+
{
|
|
375
|
+
"@type" => "Organization",
|
|
376
|
+
"@id" => "https://ror.org/04z8jg394",
|
|
377
|
+
"name" => "Example Publisher"
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
end
|
|
368
381
|
end
|
|
369
382
|
end
|
|
@@ -10,6 +10,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
10
10
|
ttl = subject.turtle.split("\n")
|
|
11
11
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
12
12
|
expect(ttl[2]).to eq("<https://doi.org/10.7554/elife.01567> a schema:ScholarlyArticle;")
|
|
13
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
14
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"{eLife} Sciences Organisation, Ltd.\"")
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
it "Dataset" do
|
|
@@ -19,6 +21,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
19
21
|
ttl = subject.turtle.split("\n")
|
|
20
22
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
21
23
|
expect(ttl[2]).to eq("<https://doi.org/10.5061/dryad.8515> a schema:Dataset;")
|
|
24
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
25
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"Dryad\"")
|
|
22
26
|
end
|
|
23
27
|
|
|
24
28
|
it "BlogPosting" do
|
|
@@ -28,6 +32,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
28
32
|
ttl = subject.turtle.split("\n")
|
|
29
33
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
30
34
|
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:ScholarlyArticle;")
|
|
35
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
36
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"DataCite\"")
|
|
31
37
|
end
|
|
32
38
|
|
|
33
39
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -36,6 +42,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
36
42
|
ttl = subject.turtle.split("\n")
|
|
37
43
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
38
44
|
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:BlogPosting;")
|
|
45
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
46
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"DataCite\"")
|
|
39
47
|
end
|
|
40
48
|
|
|
41
49
|
it "BlogPosting DataCite JSON" do
|
|
@@ -44,6 +52,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
44
52
|
ttl = subject.turtle.split("\n")
|
|
45
53
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
46
54
|
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:ScholarlyArticle;")
|
|
55
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
56
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"DataCite\"")
|
|
47
57
|
end
|
|
48
58
|
|
|
49
59
|
it "BlogPosting schema.org" do
|
|
@@ -53,6 +63,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
53
63
|
ttl = subject.turtle.split("\n")
|
|
54
64
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
55
65
|
expect(ttl[2]).to eq("<https://doi.org/10.5438/4k3m-nyvg> a schema:BlogPosting;")
|
|
66
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
67
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"DataCite\"")
|
|
56
68
|
end
|
|
57
69
|
|
|
58
70
|
it "DataONE" do
|
|
@@ -61,6 +73,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
61
73
|
ttl = subject.turtle.split("\n")
|
|
62
74
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
63
75
|
expect(ttl[2]).to eq("<https://doi.org/10.5063/f1m61h5x> a schema:SoftwareSourceCode;")
|
|
76
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
77
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"https://cran.r-project.org\"")
|
|
64
78
|
end
|
|
65
79
|
|
|
66
80
|
it "journal article" do
|
|
@@ -70,6 +84,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
70
84
|
ttl = subject.turtle.split("\n")
|
|
71
85
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
72
86
|
expect(ttl[2]).to eq("<https://doi.org/10.7554/elife.01567> a schema:ScholarlyArticle;")
|
|
87
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
88
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"eLife Sciences Publications, Ltd\"")
|
|
73
89
|
end
|
|
74
90
|
|
|
75
91
|
it "with pages" do
|
|
@@ -79,6 +95,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
79
95
|
ttl = subject.turtle.split("\n")
|
|
80
96
|
expect(ttl[0]).to eq("@prefix schema: <http://schema.org/> .")
|
|
81
97
|
expect(ttl[2]).to eq("<https://doi.org/10.1155/2012/291294> a schema:ScholarlyArticle;")
|
|
98
|
+
publisher_line = ttl.find_index(' schema:publisher [') + 2
|
|
99
|
+
expect(ttl[publisher_line]).to eq(" schema:name \"Hindawi Limited\"")
|
|
82
100
|
end
|
|
83
101
|
end
|
|
84
102
|
end
|