bolognese 1.11.0 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +32 -33
- data/lib/bolognese/metadata.rb +5 -0
- data/lib/bolognese/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/ris_writer.rb +1 -1
- data/lib/bolognese/writers/schema_org_writer.rb +1 -1
- data/spec/fixtures/citeproc.json +4 -2
- data/spec/fixtures/datacite.json +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d900e332741ad66b6b4bc1d0abd62fc7f2f8fff4e3800fa80c9745d5366cce
|
4
|
+
data.tar.gz: 8d646dcaa3e7224387b49bb76102d979e2e8cd89f07e390a4b5ab296b5cbe907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9b9e267bab3ffcbdd4b866867ca98e395b9222ce5bd396ac559a8133736562a31b382d2ddce0d75255ba6099ebcdd203f440a2c83ff20b86fd4072f0eda44e
|
7
|
+
data.tar.gz: 913398d14852b68b6e4c82cb373f288a8746bb39b80586cba43960657ab63dd367efeedb8bb8e507fa68ecd2bdbd4d0a54945e3765a1115bea7e1ea5fe63ee4c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (1.11.
|
4
|
+
bolognese (1.11.2)
|
5
5
|
activesupport (>= 4.2.5)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (>= 5.1.0)
|
@@ -29,7 +29,7 @@ PATH
|
|
29
29
|
GEM
|
30
30
|
remote: https://rubygems.org/
|
31
31
|
specs:
|
32
|
-
activesupport (6.1.7)
|
32
|
+
activesupport (6.1.7.3)
|
33
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
34
|
i18n (>= 1.6, < 2)
|
35
35
|
minitest (>= 5.1)
|
@@ -37,7 +37,6 @@ GEM
|
|
37
37
|
zeitwerk (~> 2.3)
|
38
38
|
addressable (2.8.1)
|
39
39
|
public_suffix (>= 2.0.2, < 6.0)
|
40
|
-
amazing_print (1.4.0)
|
41
40
|
benchmark_methods (0.7)
|
42
41
|
bibtex-ruby (6.0.0)
|
43
42
|
latex-decode (~> 0.0)
|
@@ -48,7 +47,7 @@ GEM
|
|
48
47
|
citeproc (~> 1.0, >= 1.0.9)
|
49
48
|
csl (~> 1.6)
|
50
49
|
colorize (0.8.1)
|
51
|
-
concurrent-ruby (1.
|
50
|
+
concurrent-ruby (1.2.2)
|
52
51
|
crack (0.4.5)
|
53
52
|
rexml
|
54
53
|
crass (1.0.6)
|
@@ -59,17 +58,16 @@ GEM
|
|
59
58
|
csl (~> 1.0)
|
60
59
|
diff-lcs (1.5.0)
|
61
60
|
docile (1.4.0)
|
62
|
-
ebnf (2.3.
|
63
|
-
amazing_print (~> 1.4)
|
61
|
+
ebnf (2.3.3)
|
64
62
|
htmlentities (~> 4.3)
|
65
63
|
rdf (~> 3.2)
|
66
64
|
scanf (~> 1.0)
|
67
65
|
sxp (~> 1.2)
|
68
|
-
unicode-types (~> 1.
|
69
|
-
edtf (3.1.
|
66
|
+
unicode-types (~> 1.8)
|
67
|
+
edtf (3.1.1)
|
70
68
|
activesupport (>= 3.0, < 8.0)
|
71
69
|
excon (0.71.1)
|
72
|
-
faraday (2.6
|
70
|
+
faraday (2.7.6)
|
73
71
|
faraday-net_http (>= 2.0, < 3.1)
|
74
72
|
ruby2_keywords (>= 0.0.4)
|
75
73
|
faraday-encoding (0.0.5)
|
@@ -84,7 +82,7 @@ GEM
|
|
84
82
|
zlib (~> 2.1)
|
85
83
|
faraday-multipart (1.0.4)
|
86
84
|
multipart-post (~> 2)
|
87
|
-
faraday-net_http (3.0.
|
85
|
+
faraday-net_http (3.0.2)
|
88
86
|
gender_detector (0.1.2)
|
89
87
|
unicode_utils (>= 1.3.0)
|
90
88
|
haml (5.2.2)
|
@@ -92,19 +90,19 @@ GEM
|
|
92
90
|
tilt
|
93
91
|
hashdiff (1.0.1)
|
94
92
|
htmlentities (4.3.4)
|
95
|
-
i18n (1.
|
93
|
+
i18n (1.14.1)
|
96
94
|
concurrent-ruby (~> 1.0)
|
97
95
|
iso8601 (0.9.1)
|
98
96
|
json (2.6.2)
|
99
|
-
json-canonicalization (0.3.
|
100
|
-
json-ld (3.2.
|
97
|
+
json-canonicalization (0.3.2)
|
98
|
+
json-ld (3.2.5)
|
101
99
|
htmlentities (~> 4.3)
|
102
|
-
json-canonicalization (~> 0.3)
|
100
|
+
json-canonicalization (~> 0.3, >= 0.3.2)
|
103
101
|
link_header (~> 0.0, >= 0.0.8)
|
104
102
|
multi_json (~> 1.15)
|
105
|
-
rack (
|
106
|
-
rdf (~> 3.2, >= 3.2.
|
107
|
-
json-ld-preloaded (3.2.
|
103
|
+
rack (>= 2.2, < 4)
|
104
|
+
rdf (~> 3.2, >= 3.2.10)
|
105
|
+
json-ld-preloaded (3.2.2)
|
108
106
|
json-ld (~> 3.2)
|
109
107
|
rdf (~> 3.2)
|
110
108
|
jsonlint (0.3.0)
|
@@ -112,9 +110,9 @@ GEM
|
|
112
110
|
optimist (~> 3)
|
113
111
|
latex-decode (0.4.0)
|
114
112
|
link_header (0.0.8)
|
115
|
-
loofah (2.
|
113
|
+
loofah (2.21.3)
|
116
114
|
crass (~> 1.0.2)
|
117
|
-
nokogiri (>= 1.
|
115
|
+
nokogiri (>= 1.12.0)
|
118
116
|
maremma (4.9.9)
|
119
117
|
activesupport (>= 4.2.5)
|
120
118
|
addressable (>= 2.3.6)
|
@@ -131,14 +129,14 @@ GEM
|
|
131
129
|
oj_mimic_json (~> 1.0, >= 1.0.1)
|
132
130
|
matrix (0.4.2)
|
133
131
|
mini_portile2 (2.8.0)
|
134
|
-
minitest (5.
|
132
|
+
minitest (5.18.0)
|
135
133
|
multi_json (1.15.0)
|
136
|
-
multipart-post (2.
|
134
|
+
multipart-post (2.3.0)
|
137
135
|
namae (1.1.1)
|
138
136
|
nokogiri (1.13.9)
|
139
137
|
mini_portile2 (~> 2.8.0)
|
140
138
|
racc (~> 1.4)
|
141
|
-
oj (3.
|
139
|
+
oj (3.14.2)
|
142
140
|
oj_mimic_json (1.0.1)
|
143
141
|
optimist (3.0.1)
|
144
142
|
postrank-uri (1.0.24)
|
@@ -151,18 +149,19 @@ GEM
|
|
151
149
|
rack-test (0.8.3)
|
152
150
|
rack (>= 1.0, < 3)
|
153
151
|
rake (12.3.3)
|
154
|
-
rdf (3.2.
|
152
|
+
rdf (3.2.11)
|
155
153
|
link_header (~> 0.0, >= 0.0.8)
|
156
154
|
rdf-aggregate-repo (3.2.1)
|
157
155
|
rdf (~> 3.2)
|
158
|
-
rdf-rdfa (3.2.
|
159
|
-
haml (
|
156
|
+
rdf-rdfa (3.2.2)
|
157
|
+
haml (>= 5.2, < 7)
|
160
158
|
htmlentities (~> 4.3)
|
161
159
|
rdf (~> 3.2)
|
162
160
|
rdf-aggregate-repo (~> 3.2)
|
163
161
|
rdf-vocab (~> 3.2)
|
164
162
|
rdf-xsd (~> 3.2)
|
165
|
-
rdf-rdfxml (3.2.
|
163
|
+
rdf-rdfxml (3.2.1)
|
164
|
+
haml (~> 5.2)
|
166
165
|
htmlentities (~> 4.3)
|
167
166
|
rdf (~> 3.2)
|
168
167
|
rdf-rdfa (~> 3.2)
|
@@ -170,7 +169,7 @@ GEM
|
|
170
169
|
rdf-turtle (3.2.1)
|
171
170
|
ebnf (~> 2.3)
|
172
171
|
rdf (~> 3.2)
|
173
|
-
rdf-vocab (3.2.
|
172
|
+
rdf-vocab (3.2.6)
|
174
173
|
rdf (~> 3.2, >= 3.2.4)
|
175
174
|
rdf-xsd (3.2.1)
|
176
175
|
rdf (~> 3.2)
|
@@ -199,13 +198,13 @@ GEM
|
|
199
198
|
json (>= 1.8, < 3)
|
200
199
|
simplecov-html (~> 0.10.0)
|
201
200
|
simplecov-html (0.10.2)
|
202
|
-
sxp (1.2.
|
201
|
+
sxp (1.2.4)
|
203
202
|
matrix (~> 0.4)
|
204
203
|
rdf (~> 3.2)
|
205
|
-
temple (0.
|
206
|
-
thor (1.2.
|
207
|
-
tilt (2.0
|
208
|
-
tzinfo (2.0.
|
204
|
+
temple (0.10.2)
|
205
|
+
thor (1.2.2)
|
206
|
+
tilt (2.2.0)
|
207
|
+
tzinfo (2.0.6)
|
209
208
|
concurrent-ruby (~> 1.0)
|
210
209
|
unicode-types (1.8.0)
|
211
210
|
unicode_utils (1.4.0)
|
@@ -214,7 +213,7 @@ GEM
|
|
214
213
|
addressable (>= 2.8.0)
|
215
214
|
crack (>= 0.3.2)
|
216
215
|
hashdiff (>= 0.4.0, < 2.0.0)
|
217
|
-
zeitwerk (2.6.
|
216
|
+
zeitwerk (2.6.8)
|
218
217
|
zlib (2.1.1)
|
219
218
|
|
220
219
|
PLATFORMS
|
data/lib/bolognese/metadata.rb
CHANGED
@@ -156,6 +156,11 @@ module Bolognese
|
|
156
156
|
@descriptions ||= meta.fetch("descriptions", nil)
|
157
157
|
end
|
158
158
|
|
159
|
+
def abstract_description
|
160
|
+
# Fetch the first description with descriptionType "Abstract"
|
161
|
+
@abstract_description ||= descriptions&.find { |d| d["descriptionType"] == "Abstract" }
|
162
|
+
end
|
163
|
+
|
159
164
|
def rights_list
|
160
165
|
@rights_list ||= meta.fetch("rights_list", nil)
|
161
166
|
end
|
data/lib/bolognese/utils.rb
CHANGED
@@ -1021,7 +1021,7 @@ module Bolognese
|
|
1021
1021
|
Array.wrap(element).map do |a|
|
1022
1022
|
if a["literal"].present?
|
1023
1023
|
a["@type"] = "Organization"
|
1024
|
-
a["
|
1024
|
+
a["creatorName"] = a["literal"]
|
1025
1025
|
else
|
1026
1026
|
a["@type"] = "Person"
|
1027
1027
|
a["name"] = [a["given"], a["family"]].compact.join(" ")
|
data/lib/bolognese/version.rb
CHANGED
@@ -11,7 +11,7 @@ module Bolognese
|
|
11
11
|
"AU" => to_ris(creators),
|
12
12
|
"DO" => doi,
|
13
13
|
"UR" => url,
|
14
|
-
"AB" => parse_attributes(
|
14
|
+
"AB" => parse_attributes(abstract_description, content: "description", first: true),
|
15
15
|
"KW" => Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.presence,
|
16
16
|
"PY" => publication_year,
|
17
17
|
"PB" => publisher,
|
@@ -13,7 +13,7 @@ module Bolognese
|
|
13
13
|
"name" => parse_attributes(titles, content: "title", first: true),
|
14
14
|
"author" => to_schema_org_creators(creators),
|
15
15
|
"editor" => to_schema_org_contributors(contributors),
|
16
|
-
"description" => parse_attributes(
|
16
|
+
"description" => parse_attributes(abstract_description, content: "description", first: true),
|
17
17
|
"license" => Array.wrap(rights_list).map { |l| l["rightsUri"] }.compact.unwrap,
|
18
18
|
"version" => version_info,
|
19
19
|
"keywords" => subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.join(", ") : nil,
|
data/spec/fixtures/citeproc.json
CHANGED
data/spec/fixtures/datacite.json
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
}
|
44
44
|
],
|
45
45
|
"dates": [
|
46
|
-
{
|
46
|
+
{
|
47
47
|
"dateType": "Created",
|
48
48
|
"date": "2016-12-20"
|
49
49
|
},
|
@@ -74,10 +74,16 @@
|
|
74
74
|
}
|
75
75
|
],
|
76
76
|
"version": "1.0",
|
77
|
-
"descriptions": [
|
77
|
+
"descriptions": [
|
78
|
+
{
|
79
|
+
"descriptionType": "SeriesInformation",
|
80
|
+
"description": "Volume(1) Series(3)"
|
81
|
+
},
|
82
|
+
{
|
78
83
|
"descriptionType": "Abstract",
|
79
84
|
"description": "Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for..."
|
80
|
-
|
85
|
+
}
|
86
|
+
],
|
81
87
|
"schemaVersion": "http://datacite.org/schema/kernel-4",
|
82
88
|
"agency": "datacite"
|
83
89
|
}
|
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: 1.11.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|