bolognese 0.10.20 → 0.10.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/bolognese/author_utils.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/datacite_malformed_creator.xml +52 -0
- data/spec/fixtures/gtex.xml +1 -0
- data/spec/readers/datacite_reader_spec.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2233cdf85f7a47f0fa6f92ea880af3c4f565ad0c4b98308aa939940c27a6d7f7
|
4
|
+
data.tar.gz: 7f1a426c3c54522173c39cd1c333429c55e2fff2348759646f8f5ea8fda6d808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 585fd910b3e5e6175888b1cdcdadc7d37967f57f9ec4f316d70d8343d96f1cff5fa875308e38712916d9cf87a56c55288ba2cc0b00f2e3b28766c84d6428f059
|
7
|
+
data.tar.gz: e2403467fe285adaa8237dd13f3bd16600648e969ddf27618b1803977bea07335aad2d4116646468b9398d6d13f7ad310569fafb27738ecd6e490e53728db743
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (0.10.
|
4
|
+
bolognese (0.10.21)
|
5
5
|
activesupport (>= 4.2.5, < 6)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (~> 4.1)
|
@@ -78,7 +78,7 @@ GEM
|
|
78
78
|
loofah (2.2.2)
|
79
79
|
crass (~> 1.0.2)
|
80
80
|
nokogiri (>= 1.5.9)
|
81
|
-
maremma (4.0.
|
81
|
+
maremma (4.0.10)
|
82
82
|
activesupport (>= 4.2.5, < 6)
|
83
83
|
addressable (>= 2.3.6)
|
84
84
|
builder (~> 3.2, >= 3.2.2)
|
@@ -94,7 +94,7 @@ GEM
|
|
94
94
|
multi_json (1.13.1)
|
95
95
|
multipart-post (2.0.0)
|
96
96
|
namae (0.11.3)
|
97
|
-
nokogiri (1.8.
|
97
|
+
nokogiri (1.8.3)
|
98
98
|
mini_portile2 (~> 2.3.0)
|
99
99
|
oj (2.18.5)
|
100
100
|
postrank-uri (1.0.23)
|
@@ -11,7 +11,10 @@ module Bolognese
|
|
11
11
|
}
|
12
12
|
|
13
13
|
def get_one_author(author)
|
14
|
-
if author.fetch("
|
14
|
+
if author.fetch("creatorName", nil).is_a?(Array)
|
15
|
+
# malformed XML
|
16
|
+
return nil
|
17
|
+
elsif author.fetch("type", nil).present?
|
15
18
|
type = author.fetch("type").titleize
|
16
19
|
elsif author.fetch("creatorName", nil).is_a?(Hash)
|
17
20
|
type = author.dig("creatorName", "nameType") == "Organizational" ? "Organization" : "Person"
|
@@ -109,7 +109,7 @@ module Bolognese
|
|
109
109
|
"url" => options.fetch(:url, nil),
|
110
110
|
"title" => title,
|
111
111
|
"alternate_name" => alternate_name,
|
112
|
-
"author" => get_authors(meta.dig("creators", "creator")),
|
112
|
+
"author" => get_authors(Array.wrap(meta.dig("creators", "creator"))),
|
113
113
|
"editor" => get_authors(Array.wrap(meta.dig("contributors", "contributor")).select { |r| r["contributorType"] == "Editor" }),
|
114
114
|
"container_title" => container_title,
|
115
115
|
"publisher" => meta.fetch("publisher", nil),
|
data/lib/bolognese/version.rb
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<resource xmlns="http://datacite.org/schema/kernel-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd">
|
3
|
+
<identifier identifierType="DOI">10.25670/oi2018-001on</identifier>
|
4
|
+
<titles>
|
5
|
+
<title xml:lang="sl">Učinkovitost kanabinoidov pri zdravljenju raka</title>
|
6
|
+
<title xml:lang="sl" titleType="Subtitle">mit ali resnica</title>
|
7
|
+
<title xml:lang="en" titleType="TranslatedTitle">Therapeutic Efficacy of Cannabinoids in Cancer Treatment</title>
|
8
|
+
<title xml:lang="en" titleType="Subtitle">Myth or Fact</title>
|
9
|
+
</titles>
|
10
|
+
<creators>
|
11
|
+
<creator>
|
12
|
+
<creatorName nameType="Personal">Grošelj, Blaž</creatorName>
|
13
|
+
<givenName>Blaž</givenName>
|
14
|
+
<familyName>Grošelj</familyName>
|
15
|
+
<affiliation>Onkološki inštitut Ljubljana</affiliation>
|
16
|
+
<creatorName nameType="Personal">Oražem, Miha </creatorName>
|
17
|
+
<givenName>Miha</givenName>
|
18
|
+
<familyName>Oražem</familyName>
|
19
|
+
<affiliation>Onkološki inštitut Ljubljana</affiliation>
|
20
|
+
<creatorName nameType="Personal">Kovač, Viljem</creatorName>
|
21
|
+
<givenName>Viljem</givenName>
|
22
|
+
<familyName>Kovač</familyName>
|
23
|
+
<affiliation>Onkološki inštitut Ljubljana</affiliation>
|
24
|
+
</creator>
|
25
|
+
</creators>
|
26
|
+
<publisher>Onkološki inštitut Ljubljana</publisher>
|
27
|
+
<publicationYear>2018</publicationYear>
|
28
|
+
<resourceType resourceTypeGeneral="Text">Journal Article</resourceType>
|
29
|
+
<subjects>
|
30
|
+
<subject subjectScheme="DDC">610 Medical sciences; Medicine</subject>
|
31
|
+
<subject xml:lang="en">cancer</subject>
|
32
|
+
<subject xml:lang="en">cannabinoids</subject>
|
33
|
+
</subjects>
|
34
|
+
<dates>
|
35
|
+
<date dateType="Issued">2018-06-20</date>
|
36
|
+
</dates>
|
37
|
+
<relatedIdentifiers>
|
38
|
+
<relatedIdentifier relatedIdentifierType="ISSN" relationType="IsPartOf">1581-3215</relatedIdentifier>
|
39
|
+
</relatedIdentifiers>
|
40
|
+
<descriptions>
|
41
|
+
<description xml:lang="en" descriptionType="Other">The use of cannabis derivatives (cannabinoids) in oncology is sometimes indicated in the symptomatic treatment of nausea and vomiting, in pain management and in some neuropsychiatric disorders. In the recent years, there has been a growing interest in determining the anticancer effects of cannabinoids. Based on our clinical experience, we know that many patients use cannabinoids, among them also those with the aim of curing their disease. But despite the extensive and convincing data on the anticancer properties of cannabinoids from in vitro studies on cell cultures and studies on animal models, these properties have not (yet) been confirmed in a clinical trial. This paper summarises the currently available data on the potential of cannabinoid use in the clinical practice of oncology.</description>
|
42
|
+
<description descriptionType="SeriesInformation" xml:lang="sl">Onkologija, leto XXII, št. 1, junij 2018</description>
|
43
|
+
<description descriptionType="SeriesInformation" xml:lang="en">Onkologija, Volume XXII, No. 1, June 2018</description>
|
44
|
+
</descriptions>
|
45
|
+
<language>sl</language>
|
46
|
+
<formats>
|
47
|
+
<format>pdf</format>
|
48
|
+
</formats>
|
49
|
+
<rightsList>
|
50
|
+
<rights rightsURI="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International license (CC BY 4.0)</rights>
|
51
|
+
</rightsList>
|
52
|
+
</resource>
|
data/spec/fixtures/gtex.xml
CHANGED
@@ -57,6 +57,7 @@
|
|
57
57
|
<relatedIdentifier relationType="Documents" relatedIdentifierType="URL">http://identifiers.org/dbgap:phs000424.v7.p2</relatedIdentifier>
|
58
58
|
<relatedIdentifier relationType="IsDocumentedBy" relatedIdentifierType="DOI">https://doi.org/10.1038/nature24277</relatedIdentifier>
|
59
59
|
<relatedIdentifier relationType="IsSupplementTo" relatedIdentifierType="DOI">https://doi.org/10.1038/nmeth.4407</relatedIdentifier>
|
60
|
+
<relatedIdentifier relationType="IsPartOf" relatedIdentifierType="URL">https://www.ebi.ac.uk/miriam/main/datatypes/MIR:00000663</relatedIdentifier>
|
60
61
|
</relatedIdentifiers>
|
61
62
|
<sizes>
|
62
63
|
<size>15.7M</size>
|
@@ -435,6 +435,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
435
435
|
expect(subject.errors).to eq("4:0: ERROR: Element '{http://datacite.org/schema/kernel-4}creators': Missing child element(s). Expected is ( {http://datacite.org/schema/kernel-4}creator ).")
|
436
436
|
end
|
437
437
|
|
438
|
+
it "malformed creator" do
|
439
|
+
input = fixture_path + "datacite_malformed_creator.xml"
|
440
|
+
subject = Bolognese::Metadata.new(input: input, regenerate: false)
|
441
|
+
expect(subject.author).to be_nil
|
442
|
+
expect(subject.valid?).to be false
|
443
|
+
expect(subject.errors).to eq("16:0: ERROR: Element '{http://datacite.org/schema/kernel-4}creatorName': This element is not expected. Expected is ( {http://datacite.org/schema/kernel-4}affiliation ).")
|
444
|
+
end
|
445
|
+
|
438
446
|
it "dissertation" do
|
439
447
|
input = "10.3204/desy-2014-01645"
|
440
448
|
subject = Bolognese::Metadata.new(input: input)
|
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: 0.10.
|
4
|
+
version: 0.10.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -555,6 +555,7 @@ files:
|
|
555
555
|
- spec/fixtures/datacite.json
|
556
556
|
- spec/fixtures/datacite.xml
|
557
557
|
- spec/fixtures/datacite_dataset.xml
|
558
|
+
- spec/fixtures/datacite_malformed_creator.xml
|
558
559
|
- spec/fixtures/datacite_missing_creator.xml
|
559
560
|
- spec/fixtures/datacite_software.json
|
560
561
|
- spec/fixtures/datacite_software_missing_comma.json
|