bolognese 2.3.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/Gemfile.lock +1 -1
- data/lib/bolognese/datacite_utils.rb +1 -1
- data/lib/bolognese/readers/crossref_reader.rb +4 -4
- data/lib/bolognese/version.rb +1 -1
- data/spec/datacite_utils_spec.rb +42 -0
- data/spec/fixtures/crossref.xml +0 -18
- data/spec/fixtures/crossref_schema_4.6_values.xml +10 -1
- data/spec/readers/crossref_reader_spec.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a86efd4d59883de399bfae917077f97c5f5e33bd698bc70fc4a3daa40736acc
|
4
|
+
data.tar.gz: da3ac310e177b6ad9733ff56cb9893cfe107c0beb930167b7b8f392dfb2332f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee269b568dd16e08da5c10f00155a3e0b55e9725c1d6aa114c6c3a5020dfe05c2df89388a9bc394a6274e86ca81567f4f756dd31bcaf5faa12dff2a7df275308
|
7
|
+
data.tar.gz: 26245d3b2e4553616ba0708047b542f4092240e4cc251ae578de502010ba69a3d6700a5df48f59cd427b7f0eaf498a15cc043cd78ad799572bd589dfcbad6784
|
data/Gemfile.lock
CHANGED
@@ -128,7 +128,7 @@ module Bolognese
|
|
128
128
|
def insert_resource_type(xml)
|
129
129
|
return xml unless types.is_a?(Hash) && (types["schemaOrg"].present? || types["resourceTypeGeneral"])
|
130
130
|
|
131
|
-
xml.resourceType(types["resourceType"]
|
131
|
+
xml.resourceType(types["resourceType"],
|
132
132
|
'resourceTypeGeneral' => types["resourceTypeGeneral"] || Metadata::SO_TO_DC_TRANSLATIONS[types["schemaOrg"]] || "Other")
|
133
133
|
end
|
134
134
|
|
@@ -373,8 +373,8 @@ module Bolognese
|
|
373
373
|
|
374
374
|
def crossref_has_translation(program_metadata)
|
375
375
|
refs = program_metadata.dig("related_item") if program_metadata.is_a?(Hash)
|
376
|
-
Array.wrap(refs).select { |a| a
|
377
|
-
if c
|
376
|
+
Array.wrap(refs).select { |a| a.dig("intra_work_relation", "relationship_type") == "hasTranslation" }.map do |c|
|
377
|
+
if c.dig("intra_work_relation", "identifier_type") == "doi"
|
378
378
|
{ "relatedIdentifier" => parse_attributes(c["intra_work_relation"]).downcase,
|
379
379
|
"relationType" => "HasTranslation",
|
380
380
|
"relatedIdentifierType" => "DOI" }.compact
|
@@ -386,8 +386,8 @@ module Bolognese
|
|
386
386
|
|
387
387
|
def crossref_is_translation_of(program_metadata)
|
388
388
|
refs = program_metadata.dig("related_item") if program_metadata.is_a?(Hash)
|
389
|
-
Array.wrap(refs).select { |a| a
|
390
|
-
if c
|
389
|
+
Array.wrap(refs).select { |a| a.dig("intra_work_relation", "relationship_type") == "isTranslationOf" }.map do |c|
|
390
|
+
if c.dig("intra_work_relation", "identifier_type") == "doi"
|
391
391
|
{ "relatedIdentifier" => parse_attributes(c["intra_work_relation"]).downcase,
|
392
392
|
"relationType" => "IsTranslationOf",
|
393
393
|
"relatedIdentifierType" => "DOI" }.compact
|
data/lib/bolognese/version.rb
CHANGED
data/spec/datacite_utils_spec.rb
CHANGED
@@ -249,6 +249,48 @@ describe Bolognese::Metadata, vcr: true do
|
|
249
249
|
end
|
250
250
|
end
|
251
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
|
+
|
252
294
|
# Test case to insert Coverage DateType (new dateType in DataCite 4.6).
|
253
295
|
context "insert_dates with Coverage" do
|
254
296
|
it "inserts date with dateType Coverage" do
|
data/spec/fixtures/crossref.xml
CHANGED
@@ -64,16 +64,6 @@
|
|
64
64
|
<surname>Hardtke</surname>
|
65
65
|
<affiliation>Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland</affiliation>
|
66
66
|
</person_name>
|
67
|
-
<person_name contributor_role="editor" sequence="additional">
|
68
|
-
<given_name>Ashwini</given_name>
|
69
|
-
<surname>Sukale</surname>
|
70
|
-
<affiliation>DataCite</affiliation>
|
71
|
-
</person_name>
|
72
|
-
<person_name contributor_role="translator" sequence="additional">
|
73
|
-
<given_name>Cody</given_name>
|
74
|
-
<surname>Ross</surname>
|
75
|
-
<affiliation>DataCite</affiliation>
|
76
|
-
</person_name>
|
77
67
|
</contributors>
|
78
68
|
<jats:abstract xmlns:jats="http://www.ncbi.nlm.nih.gov/JATS1">
|
79
69
|
<jats:p>Among various advantages, their small size makes model organisms preferred subjects of investigation. Yet, even in model systems detailed analysis of numerous developmental processes at cellular level is severely hampered by their scale. For instance, secondary growth of Arabidopsis hypocotyls creates a radial pattern of highly specialized tissues that comprises several thousand cells starting from a few dozen. This dynamic process is difficult to follow because of its scale and because it can only be investigated invasively, precluding comprehensive understanding of the cell proliferation, differentiation, and patterning events involved. To overcome such limitation, we established an automated quantitative histology approach. We acquired hypocotyl cross-sections from tiled high-resolution images and extracted their information content using custom high-throughput image processing and segmentation. Coupled with automated cell type recognition through machine learning, we could establish a cellular resolution atlas that reveals vascular morphodynamics during secondary growth, for example equidistant phloem pole formation.</jats:p>
|
@@ -163,14 +153,6 @@
|
|
163
153
|
<rel:description>Data from: Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth</rel:description>
|
164
154
|
<rel:inter_work_relation identifier-type="doi" relationship-type="isSupplementedBy">10.5061/dryad.b835k</rel:inter_work_relation>
|
165
155
|
</rel:related_item>
|
166
|
-
<rel:related_item>
|
167
|
-
<rel:description>Portuguese translation of an article</rel:description>
|
168
|
-
<rel:intra_work_relation relationship-type="isTranslationOf" identifier-type="doi">10.5555/original_language</rel:intra_work_relation>
|
169
|
-
</rel:related_item>
|
170
|
-
<rel:related_item>
|
171
|
-
<rel:description>Spanish translation of an article</rel:description>
|
172
|
-
<rel:intra_work_relation relationship-type="hasTranslation" identifier-type="doi">10.5555/other_language</rel:intra_work_relation>
|
173
|
-
</rel:related_item>
|
174
156
|
</rel:program>
|
175
157
|
<archive_locations>
|
176
158
|
<archive name="CLOCKSS" />
|
@@ -62,8 +62,17 @@
|
|
62
62
|
<affiliation>Brown University</affiliation>
|
63
63
|
<ORCID authenticated="true">https://orcid.org/0000-0002-1825-0097</ORCID>
|
64
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>
|
65
75
|
</contributors>
|
66
|
-
|
67
76
|
<publication_date media_type="online">
|
68
77
|
<month>08</month>
|
69
78
|
<day>13</day>
|
@@ -1100,7 +1100,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
1100
1100
|
end
|
1101
1101
|
|
1102
1102
|
it "with Schema 4.6 Translator contributor" do
|
1103
|
-
input = fixture_path + '
|
1103
|
+
input = fixture_path + 'crossref_schema_4.6_values.xml'
|
1104
1104
|
subject = Bolognese::Metadata.new(input: input)
|
1105
1105
|
|
1106
1106
|
expect(subject.contributors).to eq([
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -1330,7 +1330,7 @@ homepage: https://github.com/datacite/bolognese
|
|
1330
1330
|
licenses:
|
1331
1331
|
- MIT
|
1332
1332
|
metadata: {}
|
1333
|
-
post_install_message:
|
1333
|
+
post_install_message:
|
1334
1334
|
rdoc_options: []
|
1335
1335
|
require_paths:
|
1336
1336
|
- lib
|
@@ -1346,7 +1346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1346
1346
|
version: '0'
|
1347
1347
|
requirements: []
|
1348
1348
|
rubygems_version: 3.3.26
|
1349
|
-
signing_key:
|
1349
|
+
signing_key:
|
1350
1350
|
specification_version: 4
|
1351
1351
|
summary: Ruby client library for conversion of DOI Metadata
|
1352
1352
|
test_files: []
|