bolognese 1.10.0 → 2.3.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 +4 -4
- data/.github/workflows/build.yml +0 -14
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +2 -12
- data/CHANGELOG.md +2 -2
- data/Gemfile.lock +69 -53
- data/bolognese.gemspec +6 -4
- data/lib/bolognese/author_utils.rb +17 -4
- data/lib/bolognese/datacite_utils.rb +19 -11
- data/lib/bolognese/metadata.rb +1 -1
- data/lib/bolognese/metadata_utils.rb +3 -2
- data/lib/bolognese/readers/bibtex_reader.rb +2 -2
- data/lib/bolognese/readers/citeproc_reader.rb +7 -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 +40 -7
- data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +25 -9
- 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 +27 -4
- data/lib/bolognese/utils.rb +36 -14
- 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 +2 -2
- data/lib/bolognese/writers/schema_org_writer.rb +6 -2
- data/resources/kernel-4/include/datacite-contributorType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-dateType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +5 -2
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +9 -3
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +7 -1
- data/resources/kernel-4/include/datacite-titleType-v4.xsd +1 -1
- data/resources/kernel-4/metadata.xsd +12 -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/resources/kernel-4.6/include/datacite-contributorType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-dateType-v4.xsd +27 -0
- data/resources/kernel-4.6/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.6/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.6/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.6/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.6/include/datacite-relatedIdentifierType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-relationType-v4.xsd +57 -0
- data/resources/kernel-4.6/include/datacite-resourceType-v4.xsd +49 -0
- data/resources/kernel-4.6/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.6/include/xml.xsd +286 -0
- data/resources/kernel-4.6/metadata.xsd +712 -0
- data/spec/author_utils_spec.rb +59 -6
- data/spec/datacite_utils_spec.rb +156 -2
- data/spec/fixtures/citeproc.json +7 -1
- data/spec/fixtures/crossref_schema_4.6_values.xml +183 -0
- data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +24 -1
- data/spec/fixtures/datacite-example-full-v4.5.xml +255 -0
- data/spec/fixtures/datacite-example-full-v4.6.xml +114 -0
- data/spec/fixtures/datacite-example-relateditems-with-attributes.xml +61 -0
- data/spec/fixtures/datacite-seriesinformation.xml +7 -2
- data/spec/fixtures/datacite-xml-lang.xml +1 -1
- data/spec/fixtures/datacite.json +9 -3
- 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/schema_org_4.6_attributes.json +108 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors_Translator/supports_Translator_contributorType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates_with_Coverage/inserts_date_with_dateType_Coverage.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_CSTR/supports_CSTR_relatedIdentifierType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_HasTranslation/supports_HasTranslation_relationType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_RRID/supports_RRID_relatedIdentifierType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type_with_Award/supports_Award_as_resourceTypeGeneral.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type_with_Project/supports_Project_as_resourceTypeGeneral.yml +71 -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 +4 -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 +72 -41
- data/spec/readers/datacite_json_reader_spec.rb +2 -0
- data/spec/readers/datacite_reader_spec.rb +209 -44
- 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 +38 -11
- data/spec/spec_helper.rb +1 -0
- data/spec/writers/citation_writer_spec.rb +9 -0
- data/spec/writers/citeproc_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 +155 -5
- data/spec/writers/jats_writer_spec.rb +16 -1
- data/spec/writers/rdf_xml_writer_spec.rb +7 -0
- data/spec/writers/schema_org_writer_spec.rb +49 -0
- data/spec/writers/turtle_writer_spec.rb +18 -0
- metadata +84 -37
data/spec/author_utils_spec.rb
CHANGED
|
@@ -163,15 +163,68 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
163
163
|
it "has ROR nameIdentifiers" do
|
|
164
164
|
input = fixture_path + 'datacite-example-ROR-nameIdentifiers.xml'
|
|
165
165
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
166
|
-
expect(subject.creators[
|
|
167
|
-
expect(subject.creators[
|
|
168
|
-
expect(subject.creators[
|
|
169
|
-
expect(subject.creators[
|
|
170
|
-
expect(subject.creators[
|
|
166
|
+
expect(subject.creators[2]).to eq("nameType"=>"Organizational", "name"=>"Gump South Pacific Research Station", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04sk0et52", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
167
|
+
expect(subject.creators[3]).to eq("nameType"=>"Organizational", "name"=>"University Of Vic", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/006zjws59", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
168
|
+
expect(subject.creators[4]).to eq("nameType"=>"Organizational", "name"=>"University Of Kivu", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/01qfhxr31", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
169
|
+
expect(subject.creators[5]).to eq("nameType"=>"Organizational", "name"=>"សាកលវិទ្យាល័យកម្ពុជា", "nameIdentifiers"=> [{"nameIdentifier"=>"http://ror.org/025e3rc84", "nameIdentifierScheme"=>"RORS"}], "affiliation"=>[])
|
|
170
|
+
expect(subject.creators[6]).to eq("nameType"=>"Organizational", "name"=>"جامعة زاخۆ", "nameIdentifiers"=> [{"nameIdentifier"=>"05sd1pz50", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"RORS"}], "affiliation"=>[])
|
|
171
|
+
expect(subject.creators[9]).to eq("nameType"=>"Organizational", "name"=>"Gump South Pacific Research Station", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04sk0et52", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
171
172
|
expect(subject.contributors.first).to eq("nameType"=>"Organizational", "name"=>" Nawroz University ", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04gp75d48", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[], "contributorType"=>"Producer")
|
|
172
173
|
expect(subject.contributors.last).to eq("nameType"=>"Organizational", "name"=>"University Of Greenland (Https://Www.Uni.Gl/)", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/00t5j6b61", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}],"affiliation"=>[], "contributorType"=>"Sponsor")
|
|
173
174
|
end
|
|
174
175
|
|
|
176
|
+
context "affiliationIdentifier/nameIdentifier" do
|
|
177
|
+
let(:input) { fixture_path + 'datacite-example-ROR-nameIdentifiers.xml' }
|
|
178
|
+
subject { Bolognese::Metadata.new(input: input, from: "datacite") }
|
|
179
|
+
|
|
180
|
+
it "should normalize ROR affiliationIdentifier with and without URL" do
|
|
181
|
+
# without URL inside affiliationIdentifier="05bp8ka77"
|
|
182
|
+
ror_affiliater0 = subject.creators[0]["affiliation"].select { |r| r["affiliationIdentifierScheme"] == "ROR" }
|
|
183
|
+
expect(ror_affiliater0[0]["affiliationIdentifier"]).to eq("https://ror.org/05bp8ka77")
|
|
184
|
+
# with URL "affiliationIdentifier"=>"https://ror.org/05bp8ka05"
|
|
185
|
+
ror_affiliater1 = subject.creators[1]["affiliation"].select { |r| r["affiliationIdentifierScheme"] == "ROR" }
|
|
186
|
+
expect(ror_affiliater1[0]["affiliationIdentifier"]).to eq("https://ror.org/05bp8ka05")
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
it "should normalize the valid ORCID nameIdentifier to URL with schemeURI" do
|
|
190
|
+
# with "schemeURI"
|
|
191
|
+
# ORICD normalization 0000-0001-9998-0117 => https://orcid.org/0000-0001-9998-0117
|
|
192
|
+
expect(subject.creators[0]["nameIdentifiers"]).to eq([{"nameIdentifier"=>"https://orcid.org/0000-0001-9998-0117", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}])
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
it "should normalize the valid ORCID nameIdentifier to URL without schemeURI" do
|
|
196
|
+
# without "schemeURI"
|
|
197
|
+
# ORICD normalization 0000-0001-9998-0117 => https://orcid.org/0000-0001-9998-0117
|
|
198
|
+
expect(subject.creators[7]["nameIdentifiers"]).to eq([{"nameIdentifier"=>"https://orcid.org/0000-0001-9998-0117", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}])
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
it "should keep nameIdentifier URL after normalization" do
|
|
202
|
+
# ORICD normalization https://orcid.org/0000-0001-9998-0114 => https://orcid.org/0000-0001-9998-0114
|
|
203
|
+
expect(subject.creators[1]["nameIdentifiers"]).to eq([{"nameIdentifier"=>"https://orcid.org/0000-0001-9998-0114", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}])
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
it "should sanitize valid ORCID id/URL before normalization" do
|
|
207
|
+
#" 0000-0001-9998-0118 ", # Valid ORCID with leading/trailing spaces
|
|
208
|
+
expect(subject.creators[8]["nameIdentifiers"]).to eq([{"nameIdentifier"=>"https://orcid.org/0000-0001-9998-0118", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}])
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
it "should normalize valid ORCID nameIdentifier with trailing slash" do
|
|
212
|
+
#" 0000-0001-9998-0118 ", # Valid ORCID with leading/trailing spaces
|
|
213
|
+
expect(subject.creators[10]["nameIdentifiers"]).to eq([{"nameIdentifier"=>"https://orcid.org/0000-0001-9998-0117", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}])
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
it "should parse non ROR schema's without normalizing them" do
|
|
217
|
+
input = fixture_path + 'datacite-example-ROR-nameIdentifiers.xml'
|
|
218
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
219
|
+
# without "schemeURI"
|
|
220
|
+
grid_affiliater0 = subject.creators[0]["affiliation"].select { |r| r["affiliationIdentifierScheme"] == "GRID" }
|
|
221
|
+
expect(grid_affiliater0[0]["affiliationIdentifier"]).to eq("grid.268117.b")
|
|
222
|
+
# with "schemeURI"=>"https://grid.ac/institutes/"
|
|
223
|
+
grid_affiliater1 = subject.creators[1]["affiliation"].select { |r| r["affiliationIdentifierScheme"] == "GRID" }
|
|
224
|
+
expect(grid_affiliater1[0]["affiliationIdentifier"]).to eq("https://grid.ac/institutes/grid.268117.b")
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
175
228
|
context "authors_as_string" do
|
|
176
229
|
let(:author_with_organization) { [{"type"=>"Person",
|
|
177
230
|
"id"=>"http://orcid.org/0000-0003-0077-4738",
|
|
@@ -203,4 +256,4 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
203
256
|
expect(response).to eq("Matt Jones and Peter Slaughter and {University of California, Santa Barbara}")
|
|
204
257
|
end
|
|
205
258
|
end
|
|
206
|
-
end
|
|
259
|
+
end
|
data/spec/datacite_utils_spec.rb
CHANGED
|
@@ -99,9 +99,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
99
99
|
|
|
100
100
|
context "insert_subjects" do
|
|
101
101
|
it "insert" do
|
|
102
|
+
input = "https://doi.org/10.5878/xyad-9f70"
|
|
103
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
102
104
|
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_subjects(xml) }.to_xml
|
|
103
105
|
response = Maremma.from_xml(xml)
|
|
104
|
-
|
|
106
|
+
# It should preserve the classificationCode
|
|
107
|
+
expect(response.dig("subjects", "subject")[0]["classificationCode"]).to eq("a046a1ec-a4d1-4777-8705-3a17548f1969")
|
|
108
|
+
expect(response.dig("subjects", "subject")[0]).to eq({"subjectScheme"=>"ELSST", "valueURI"=>"https://elsst.cessda.eu/id/a046a1ec-a4d1-4777-8705-3a17548f1969", "classificationCode"=>"a046a1ec-a4d1-4777-8705-3a17548f1969", "xml:lang"=>"en", "__content__"=>"decision making"})
|
|
105
109
|
end
|
|
106
110
|
end
|
|
107
111
|
|
|
@@ -200,4 +204,154 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
200
204
|
)
|
|
201
205
|
end
|
|
202
206
|
end
|
|
203
|
-
|
|
207
|
+
|
|
208
|
+
### New DataCite 4.6 Features Tests ###
|
|
209
|
+
|
|
210
|
+
context "insert_resource_type with Project" do
|
|
211
|
+
it "supports Project as resourceTypeGeneral" do
|
|
212
|
+
# Mock the `types` hash to include Project
|
|
213
|
+
subject.instance_variable_set(:@types, {
|
|
214
|
+
"resourceTypeGeneral" => "Project",
|
|
215
|
+
"resourceType" => "Research Project"
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
# Generate XML using the insert_resource_type method
|
|
219
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
220
|
+
|
|
221
|
+
response = Maremma.from_xml(xml)
|
|
222
|
+
|
|
223
|
+
# Expect `Project` in resourceTypeGeneral and `Research Project` as the content
|
|
224
|
+
expect(response["resourceType"]).to eq(
|
|
225
|
+
"resourceTypeGeneral" => "Project",
|
|
226
|
+
"__content__" => "Research Project"
|
|
227
|
+
)
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
context "insert_resource_type with Award" do
|
|
232
|
+
it "supports Award as resourceTypeGeneral" do
|
|
233
|
+
# Mock the `types` hash to include Award
|
|
234
|
+
subject.instance_variable_set(:@types, {
|
|
235
|
+
"resourceTypeGeneral" => "Award",
|
|
236
|
+
"resourceType" => "Nobel Prize"
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
# Generate XML using the insert_resource_type method
|
|
240
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
241
|
+
|
|
242
|
+
response = Maremma.from_xml(xml)
|
|
243
|
+
|
|
244
|
+
# Expect `Award` in resourceTypeGeneral and `Nobel Prize` as the content
|
|
245
|
+
expect(response["resourceType"]).to eq(
|
|
246
|
+
"resourceTypeGeneral" => "Award",
|
|
247
|
+
"__content__" => "Nobel Prize"
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
context "insert_resource_type when resourceType is available, but using schemaOrg (via SO_TO_DC_TRANSLATIONS) when resourceTypeGeneral is unavailable" do
|
|
253
|
+
it "supports schemaOrg value as resourceTypeGeneral" do
|
|
254
|
+
# Mock the `types` hash to include the necessary values
|
|
255
|
+
subject.instance_variable_set(:@types, {
|
|
256
|
+
"schemaOrg" => "BlogPosting",
|
|
257
|
+
"resourceType" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
# Generate XML using the insert_resource_type method
|
|
261
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
262
|
+
|
|
263
|
+
response = Maremma.from_xml(xml)
|
|
264
|
+
|
|
265
|
+
# Expect `Text` in resourceTypeGeneral (via SO_TP_DC_TRANSLATIONS) and `This dataset contains all projects funded...` as the content
|
|
266
|
+
expect(response["resourceType"]).to eq(
|
|
267
|
+
"resourceTypeGeneral" => "Text",
|
|
268
|
+
"__content__" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
269
|
+
)
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
context "insert_resource_type when resourceType is available, 'OTHER' when schemaOrg has no valid translations, and 'resourceTypeGeneral is unavailable" do
|
|
274
|
+
it "supports Other as resourceTypeGeneral" do
|
|
275
|
+
# Mock the `types` hash to include the necessary values
|
|
276
|
+
subject.instance_variable_set(:@types, {
|
|
277
|
+
"schemaOrg" => "Invalid_SO_Value",
|
|
278
|
+
"resourceType" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
# Generate XML using the insert_resource_type method
|
|
282
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
283
|
+
|
|
284
|
+
response = Maremma.from_xml(xml)
|
|
285
|
+
|
|
286
|
+
# Expect `Text` in resourceTypeGeneral (via SO_TP_DC_TRANSLATIONS) and `This dataset contains all projects funded...` as the content
|
|
287
|
+
expect(response["resourceType"]).to eq(
|
|
288
|
+
"resourceTypeGeneral" => "Other",
|
|
289
|
+
"__content__" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Test case to insert Coverage DateType (new dateType in DataCite 4.6).
|
|
295
|
+
context "insert_dates with Coverage" do
|
|
296
|
+
it "inserts date with dateType Coverage" do
|
|
297
|
+
subject.dates = [{ "date" => "2021-01-01", "dateType" => "Coverage" }]
|
|
298
|
+
|
|
299
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_dates(xml) }.to_xml
|
|
300
|
+
response = Maremma.from_xml(xml)
|
|
301
|
+
dates = response.dig("dates", "date")
|
|
302
|
+
expect(dates).to eq("__content__" => "2021-01-01", "dateType" => "Coverage")
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Test case to insert Translator contributor (new contributorType in DataCite 4.6)
|
|
307
|
+
context "insert_contributors Translator" do
|
|
308
|
+
it "supports Translator contributorType" do
|
|
309
|
+
subject.contributors = [
|
|
310
|
+
{ "contributorName" => "John Translator", "contributorType" => "Translator" }
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_contributors(xml) }.to_xml
|
|
314
|
+
response = Maremma.from_xml(xml)
|
|
315
|
+
expect(response.dig("contributors", "contributor", "contributorType")).to eq("Translator")
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Test case for RRID (new relatedIdentifierType in DataCite 4.6)
|
|
320
|
+
context "insert_related_identifiers RRID" do
|
|
321
|
+
it "supports RRID relatedIdentifierType" do
|
|
322
|
+
subject.related_identifiers = [
|
|
323
|
+
{ "relatedIdentifier" => "RRID:AB_90755", "relatedIdentifierType" => "RRID", "relationType" => "References" }
|
|
324
|
+
]
|
|
325
|
+
|
|
326
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_related_identifiers(xml) }.to_xml
|
|
327
|
+
response = Maremma.from_xml(xml)
|
|
328
|
+
expect(response.dig("relatedIdentifiers", "relatedIdentifier")).to eq("__content__" => "RRID:AB_90755", "relatedIdentifierType" => "RRID", "relationType" => "References")
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
### Test case #2 for adding CSTR ###
|
|
333
|
+
context "insert_related_identifiers CSTR" do
|
|
334
|
+
it "supports CSTR relatedIdentifierType" do
|
|
335
|
+
subject.related_identifiers = [
|
|
336
|
+
{ "relatedIdentifier" => "CSTR:AB_12345", "relatedIdentifierType" => "CSTR", "relationType" => "References" }
|
|
337
|
+
]
|
|
338
|
+
|
|
339
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_related_identifiers(xml) }.to_xml
|
|
340
|
+
response = Maremma.from_xml(xml)
|
|
341
|
+
expect(response.dig("relatedIdentifiers", "relatedIdentifier")).to eq("__content__" => "CSTR:AB_12345", "relatedIdentifierType" => "CSTR", "relationType" => "References")
|
|
342
|
+
end
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Test case for HasTranslation (new relationType in DataCite 4.6)
|
|
346
|
+
context "insert_related_identifiers HasTranslation" do
|
|
347
|
+
it "supports HasTranslation relationType" do
|
|
348
|
+
subject.related_identifiers = [
|
|
349
|
+
{ "relatedIdentifier" => "10.1234/translated-version", "relatedIdentifierType" => "DOI", "relationType" => "HasTranslation" }
|
|
350
|
+
]
|
|
351
|
+
|
|
352
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_related_identifiers(xml) }.to_xml
|
|
353
|
+
response = Maremma.from_xml(xml)
|
|
354
|
+
expect(response.dig("relatedIdentifiers", "relatedIdentifier")).to eq("__content__" => "10.1234/translated-version", "relatedIdentifierType" => "DOI", "relationType" => "HasTranslation")
|
|
355
|
+
end
|
|
356
|
+
end
|
|
357
|
+
end
|
data/spec/fixtures/citeproc.json
CHANGED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<crossref_result xmlns="http://www.crossref.org/qrschema/3.0" version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/qrschema/3.0 http://www.crossref.org/schemas/crossref_query_output3.0.xsd">
|
|
3
|
+
<query_result>
|
|
4
|
+
<head>
|
|
5
|
+
<doi_batch_id>none</doi_batch_id>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<query status="resolved">
|
|
9
|
+
<doi type="journal_article">10.7554/eLife.01567</doi>
|
|
10
|
+
<crm-item name="publisher-name" type="string">eLife Sciences Publications, Ltd</crm-item>
|
|
11
|
+
<crm-item name="prefix-name" type="string">eLife Sciences Publications, Ltd.</crm-item>
|
|
12
|
+
<crm-item name="member-id" type="number">4374</crm-item>
|
|
13
|
+
<crm-item name="citation-id" type="number">67124617</crm-item>
|
|
14
|
+
<crm-item name="journal-id" type="number">189365</crm-item>
|
|
15
|
+
<crm-item name="deposit-timestamp" type="number">20180823133646</crm-item>
|
|
16
|
+
<crm-item name="owner-prefix" type="string">10.7554</crm-item>
|
|
17
|
+
<crm-item name="last-update" type="date">2018-08-23T13:41:49Z</crm-item>
|
|
18
|
+
<crm-item name="created" type="date">2014-02-11T16:29:04Z</crm-item>
|
|
19
|
+
<crm-item name="citedby-count" type="number">13</crm-item>
|
|
20
|
+
<doi_record>
|
|
21
|
+
<crossref xmlns="http://www.crossref.org/xschema/1.1" xsi:schemaLocation="http://www.crossref.org/xschema/1.1 http://doi.crossref.org/schemas/unixref1.1.xsd">
|
|
22
|
+
<journal>
|
|
23
|
+
<journal_metadata language="en">
|
|
24
|
+
<full_title>Journal of Metadata Perfection</full_title>
|
|
25
|
+
<abbrev_title>JOMPer</abbrev_title>
|
|
26
|
+
<doi_data>
|
|
27
|
+
<doi>10.32013/487529</doi>
|
|
28
|
+
<resource>https://www.crossref.org/jomper</resource>
|
|
29
|
+
</doi_data>
|
|
30
|
+
</journal_metadata>
|
|
31
|
+
<journal_issue>
|
|
32
|
+
<publication_date media_type="online">
|
|
33
|
+
<month>08</month>
|
|
34
|
+
<day>13</day>
|
|
35
|
+
<year>2008</year>
|
|
36
|
+
</publication_date>
|
|
37
|
+
<publication_date media_type="print">
|
|
38
|
+
<month>08</month>
|
|
39
|
+
<day>14</day>
|
|
40
|
+
<year>2008</year>
|
|
41
|
+
</publication_date>
|
|
42
|
+
<journal_volume>
|
|
43
|
+
<volume>5</volume>
|
|
44
|
+
</journal_volume>
|
|
45
|
+
<issue>11</issue>
|
|
46
|
+
</journal_issue>
|
|
47
|
+
<journal_article publication_type="full_text">
|
|
48
|
+
<titles>
|
|
49
|
+
<title>Quand vos meilleures métadonnées ne suffisent pas: travailler avec une spécification imparfaite</title>
|
|
50
|
+
<original_language_title language="en">When your best metadata isn't good enough: working with an imperfect specification </original_language_title>
|
|
51
|
+
</titles>
|
|
52
|
+
<contributors>
|
|
53
|
+
<person_name sequence="first" contributor_role="author">
|
|
54
|
+
<given_name>Minerva</given_name>
|
|
55
|
+
<surname>Housecat</surname>
|
|
56
|
+
<affiliation>Crossref University</affiliation>
|
|
57
|
+
<ORCID authenticated="true">https://orcid.org/0000-0002-4011-3590</ORCID>
|
|
58
|
+
</person_name>
|
|
59
|
+
<person_name sequence="additional" contributor_role="author">
|
|
60
|
+
<given_name>Josiah</given_name>
|
|
61
|
+
<surname>Carberry</surname>
|
|
62
|
+
<affiliation>Brown University</affiliation>
|
|
63
|
+
<ORCID authenticated="true">https://orcid.org/0000-0002-1825-0097</ORCID>
|
|
64
|
+
</person_name>
|
|
65
|
+
<person_name contributor_role="editor" sequence="additional">
|
|
66
|
+
<given_name>Ashwini</given_name>
|
|
67
|
+
<surname>Sukale</surname>
|
|
68
|
+
<affiliation>DataCite</affiliation>
|
|
69
|
+
</person_name>
|
|
70
|
+
<person_name contributor_role="translator" sequence="additional">
|
|
71
|
+
<given_name>Cody</given_name>
|
|
72
|
+
<surname>Ross</surname>
|
|
73
|
+
<affiliation>DataCite</affiliation>
|
|
74
|
+
</person_name>
|
|
75
|
+
</contributors>
|
|
76
|
+
<publication_date media_type="online">
|
|
77
|
+
<month>08</month>
|
|
78
|
+
<day>13</day>
|
|
79
|
+
<year>2018</year>
|
|
80
|
+
</publication_date>
|
|
81
|
+
<publication_date media_type="print">
|
|
82
|
+
<month>08</month>
|
|
83
|
+
<day>14</day>
|
|
84
|
+
<year>2018</year>
|
|
85
|
+
</publication_date>
|
|
86
|
+
<acceptance_date>
|
|
87
|
+
<month>05</month>
|
|
88
|
+
<day>21</day>
|
|
89
|
+
<year>2018</year>
|
|
90
|
+
</acceptance_date>
|
|
91
|
+
<pages>
|
|
92
|
+
<first_page>1</first_page>
|
|
93
|
+
<last_page>3</last_page>
|
|
94
|
+
</pages>
|
|
95
|
+
<publisher_item>
|
|
96
|
+
<item_number item_number_type="article_number">2347854-0</item_number>
|
|
97
|
+
</publisher_item>
|
|
98
|
+
<program xmlns="http://www.crossref.org/relations.xsd">
|
|
99
|
+
<related_item>
|
|
100
|
+
<description>English language version</description>
|
|
101
|
+
<intra_work_relation relationship-type="hasTranslation" identifier-type="doi"
|
|
102
|
+
>10.32013/zLl10OQ</intra_work_relation>
|
|
103
|
+
</related_item>
|
|
104
|
+
<related_item>
|
|
105
|
+
<description>Portuguese translation of an article</description>
|
|
106
|
+
<intra_work_relation relationship-type="isTranslationOf" identifier-type="doi">10.5555/original_language</intra_work_relation>
|
|
107
|
+
</related_item>
|
|
108
|
+
</program>
|
|
109
|
+
<archive_locations>
|
|
110
|
+
<archive name="CLOCKSS"/>
|
|
111
|
+
<archive name="Internet Archive"/>
|
|
112
|
+
<archive name="Portico"/>
|
|
113
|
+
<archive name="KB"/>
|
|
114
|
+
</archive_locations>
|
|
115
|
+
<doi_data>
|
|
116
|
+
<doi>10.32013/4859104</doi>
|
|
117
|
+
<resource>https://www.crossref.org/xml-samples/</resource>
|
|
118
|
+
<collection property="crawler-based">
|
|
119
|
+
<item crawler="iParadigms">
|
|
120
|
+
<resource>https://www.crossref.org/faqs.html</resource>
|
|
121
|
+
</item>
|
|
122
|
+
</collection>
|
|
123
|
+
<collection property="text-mining">
|
|
124
|
+
<item>
|
|
125
|
+
<resource content_version="vor" mime_type="text/xml"
|
|
126
|
+
>https://www.crossref.org/example.xml</resource>
|
|
127
|
+
</item>
|
|
128
|
+
</collection>
|
|
129
|
+
<collection property="link-header">
|
|
130
|
+
<item link_header_relationship="dul">
|
|
131
|
+
<resource>http://www.crossref.org/exampleDULendpoint</resource>
|
|
132
|
+
</item>
|
|
133
|
+
</collection>
|
|
134
|
+
</doi_data>
|
|
135
|
+
<citation_list>
|
|
136
|
+
<citation key="ref1">
|
|
137
|
+
<doi>10.1101/144147</doi>
|
|
138
|
+
<unstructured_citation>BioSharing: Harnessing Metadata Standards For The
|
|
139
|
+
Data Commons. Susanna-Assunta Sansone, Alejandra Gonzalez-Beltran,
|
|
140
|
+
Philippe Rocca-Serra, PeterMcQuilton, Massimiliano Izzo, Allyson Lister,
|
|
141
|
+
Milo Thurston. bioRxiv 144147</unstructured_citation>
|
|
142
|
+
</citation>
|
|
143
|
+
<citation key="ref2">
|
|
144
|
+
<doi>10.1515/jdis-2017-0012</doi>
|
|
145
|
+
<unstructured_citation>Greenberg, J. (2017). Big Metadata, Smart Metadata,
|
|
146
|
+
and Metadata Capital: Toward Greater Synergy Between Data Science and
|
|
147
|
+
Metadata, Journal of Data and Information Science, 2(3), 19-36.
|
|
148
|
+
</unstructured_citation>
|
|
149
|
+
</citation>
|
|
150
|
+
<citation key="ref3">
|
|
151
|
+
<doi>10.32013/s4947892</doi>
|
|
152
|
+
</citation>
|
|
153
|
+
<citation key="ref4">
|
|
154
|
+
<doi>10.1108/LHTN-12-2016-0059</doi>
|
|
155
|
+
<unstructured_citation>Jung ran Park, Yuji Tosaka, (2017) “Emerging
|
|
156
|
+
information standards and technologies: cataloging and metadata
|
|
157
|
+
professionals’ perspectives", Library Hi Tech News, Vol. 34 Issue: 4,
|
|
158
|
+
pp.22-26</unstructured_citation>
|
|
159
|
+
</citation>
|
|
160
|
+
<citation key="ref5">
|
|
161
|
+
<journal_title>Information Technology and Libraries</journal_title>
|
|
162
|
+
<author>Park</author>
|
|
163
|
+
<volume>29</volume>
|
|
164
|
+
<issue>3</issue>
|
|
165
|
+
<first_page>104</first_page>
|
|
166
|
+
<cYear>2010</cYear>
|
|
167
|
+
<doi>10.6017/ital.v29i3.3136</doi>
|
|
168
|
+
<article_title>Metadata creation practices in digital repositories and collections: Schemata, selection criteria, and interoperability</article_title>
|
|
169
|
+
</citation>
|
|
170
|
+
<citation key="ref6">
|
|
171
|
+
<unstructured_citation>Riley, J. (2017). Understanding metadata.
|
|
172
|
+
Bethesda,MD: NISO Press.</unstructured_citation>
|
|
173
|
+
</citation>
|
|
174
|
+
</citation_list>
|
|
175
|
+
</journal_article>
|
|
176
|
+
</journal>
|
|
177
|
+
|
|
178
|
+
</crossref>
|
|
179
|
+
</doi_record>
|
|
180
|
+
</query>
|
|
181
|
+
</body>
|
|
182
|
+
</query_result>
|
|
183
|
+
</crossref_result>
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-%s http://schema.datacite.org/meta/kernel-4/metadata.xsd">
|
|
4
4
|
<identifier identifierType="DOI">10.48321/D1Z60Q</identifier>
|
|
5
5
|
<creators>
|
|
6
|
+
<creator>
|
|
7
|
+
<creatorName nameType="Personal">Ashwini Sukale</creatorName>
|
|
8
|
+
<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID">0000-0001-9998-0117</nameIdentifier>
|
|
9
|
+
<affiliation affiliationIdentifier="05bp8ka77" affiliationIdentifierScheme="ROR"> Metadata Game Changers </affiliation>
|
|
10
|
+
<affiliation affiliationIdentifier="grid.268117.b" affiliationIdentifierScheme="GRID">Wesleyan University</affiliation>
|
|
11
|
+
</creator>
|
|
6
12
|
<creator>
|
|
7
13
|
<creatorName nameType="Personal">Erin Robinson</creatorName>
|
|
8
|
-
<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID">
|
|
14
|
+
<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID">https://orcid.org/0000-0001-9998-0114</nameIdentifier>
|
|
9
15
|
<affiliation schemeURI="https://ror.org" affiliationIdentifier="https://ror.org/05bp8ka05" affiliationIdentifierScheme="ROR"> Metadata Game Changers </affiliation>
|
|
16
|
+
<affiliation affiliationIdentifier="grid.268117.b" affiliationIdentifierScheme="GRID" schemeURI="https://grid.ac/institutes/">Wesleyan University</affiliation>
|
|
10
17
|
</creator>
|
|
11
18
|
<creator>
|
|
12
19
|
<creatorName nameType="Organizational">Gump South Pacific Research Station</creatorName>
|
|
@@ -28,6 +35,22 @@
|
|
|
28
35
|
<creatorName nameType="Organizational">جامعة زاخۆ</creatorName>
|
|
29
36
|
<nameIdentifier nameIdentifierScheme="RORS" schemeURI="https://ror.org">05sd1pz50</nameIdentifier>
|
|
30
37
|
</creator>
|
|
38
|
+
<creator>
|
|
39
|
+
<creatorName nameType="Personal">Ashwini S</creatorName>
|
|
40
|
+
<nameIdentifier nameIdentifierScheme="ORCID">0000-0001-9998-0117</nameIdentifier>
|
|
41
|
+
</creator>
|
|
42
|
+
<creator>
|
|
43
|
+
<creatorName nameType="Personal">Mike B</creatorName>
|
|
44
|
+
<nameIdentifier nameIdentifierScheme="ORCID"> 0000-0001-9998-0118 </nameIdentifier>
|
|
45
|
+
</creator>
|
|
46
|
+
<creator>
|
|
47
|
+
<creatorName nameType="Organizational">Gump South Pacific Research Station</creatorName>
|
|
48
|
+
<nameIdentifier nameIdentifierScheme="ROR" schemeURI="https://ror.org/">https://ror.org/04sk0et52/</nameIdentifier>
|
|
49
|
+
</creator>
|
|
50
|
+
<creator>
|
|
51
|
+
<creatorName nameType="Personal">Ashwini Sukale</creatorName>
|
|
52
|
+
<nameIdentifier schemeURI="https://orcid.org/" nameIdentifierScheme="ORCID">https://orcid.org/0000-0001-9998-0117/</nameIdentifier>
|
|
53
|
+
</creator>
|
|
31
54
|
</creators>
|
|
32
55
|
<titles>
|
|
33
56
|
<title xml:lang="en-US">Genomic Standards Consortium (GSC) Island Sampling Day: Moorea Reef to Ridges Genomic Transect</title>
|