bolognese 0.9.24 → 0.9.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/bolognese/utils.rb +3 -3
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml +94 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml +94 -0
- data/spec/utils_spec.rb +12 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc915e15f8cc67f07df97f07940c1fd42f36bfde
|
4
|
+
data.tar.gz: e5f7a9fcb0c71a382c108f46dd8b8e928ef27c2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a3c57841b12442ff12941e27122290ee4d0662b6d636ded7b11883caa1635580f4c15946133bb4d520f9e82078e85e054a2bd239c46b4652b6e87018f923e2
|
7
|
+
data.tar.gz: 3c316919e69e2a937cfedbca564326e6d2c4a1f9eb21704bffa80848ce2772f329718c08441af570a7d8a6fe593f47b4496d13e886b425f9c5045e8b96fd82fa
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (0.9.
|
4
|
+
bolognese (0.9.25)
|
5
5
|
activesupport (>= 4.2.5, < 6)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (~> 4.1)
|
@@ -177,4 +177,4 @@ DEPENDENCIES
|
|
177
177
|
webmock (~> 1.22, >= 1.22.3)
|
178
178
|
|
179
179
|
BUNDLED WITH
|
180
|
-
1.
|
180
|
+
1.15.1
|
data/lib/bolognese/utils.rb
CHANGED
@@ -264,15 +264,15 @@ module Bolognese
|
|
264
264
|
end
|
265
265
|
|
266
266
|
def orcid_from_url(url)
|
267
|
-
Array(/\
|
267
|
+
Array(/\A:(http|https)\/\/orcid\.org\/(.+)/.match(url)).last
|
268
268
|
end
|
269
269
|
|
270
270
|
def orcid_as_url(orcid)
|
271
|
-
"
|
271
|
+
"https://orcid.org/#{orcid}" if orcid.present?
|
272
272
|
end
|
273
273
|
|
274
274
|
def validate_orcid(orcid)
|
275
|
-
orcid = Array(/\A(?:http:\/\/orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\z/.match(orcid)).last
|
275
|
+
orcid = Array(/\A(?:(http|https):\/\/(www\.)?orcid\.org\/)?(\d{4}[[:space:]-]\d{4}[[:space:]-]\d{4}[[:space:]-]\d{3}[0-9X]+)\z/.match(orcid)).last
|
276
276
|
orcid.gsub(/[[:space:]]/, "-") if orcid.present?
|
277
277
|
end
|
278
278
|
|
data/lib/bolognese/version.rb
CHANGED
@@ -0,0 +1,94 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.crossref.org/openurl/?format=unixref&id=doi:10.1101/097196&noredirect=true&pid=tech@datacite.org
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- text/xml
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
Crossref-Deployment-Name:
|
22
|
+
- qs4-1
|
23
|
+
Content-Type:
|
24
|
+
- text/xml;charset=UTF-8
|
25
|
+
Content-Language:
|
26
|
+
- en-US
|
27
|
+
Date:
|
28
|
+
- Tue, 20 Jun 2017 07:51:55 GMT
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<doi_records>\r\n <doi_record
|
34
|
+
owner=\"10.1101\" timestamp=\"2016-12-29 01:10:20\">\r\n <crossref>\r\n
|
35
|
+
\ <posted_content type=\"preprint\" language=\"en\" metadata_distribution_opts=\"any\">\r\n
|
36
|
+
\ <group_title>Scientific Communication and Education</group_title>\r\n
|
37
|
+
\ <contributors>\r\n <person_name contributor_role=\"author\"
|
38
|
+
sequence=\"first\">\r\n <given_name>Martin</given_name>\r\n <surname>Fenner</surname>\r\n
|
39
|
+
\ <ORCID>http://orcid.org/0000-0003-1419-2405</ORCID>\r\n </person_name>\r\n
|
40
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
41
|
+
\ <given_name>Merc?</given_name>\r\n <surname>Crosas</surname>\r\n
|
42
|
+
\ <ORCID>http://orcid.org/0000-0003-1304-1939</ORCID>\r\n </person_name>\r\n
|
43
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
44
|
+
\ <given_name>Jeffrey</given_name>\r\n <surname>Grethe</surname>\r\n
|
45
|
+
\ <ORCID>http://orcid.org/0000-0001-5212-7052</ORCID>\r\n </person_name>\r\n
|
46
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
47
|
+
\ <given_name>David</given_name>\r\n <surname>Kennedy</surname>\r\n
|
48
|
+
\ <ORCID>http://orcid.org/0000-0002-9377-0797</ORCID>\r\n </person_name>\r\n
|
49
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
50
|
+
\ <given_name>Henning</given_name>\r\n <surname>Hermjakob</surname>\r\n
|
51
|
+
\ <ORCID>http://orcid.org/0000-0001-8479-0262</ORCID>\r\n </person_name>\r\n
|
52
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
53
|
+
\ <given_name>Philippe</given_name>\r\n <surname>Rocca-Serra</surname>\r\n
|
54
|
+
\ <ORCID>http://orcid.org/0000-0001-9853-5668</ORCID>\r\n </person_name>\r\n
|
55
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
56
|
+
\ <given_name>Robin</given_name>\r\n <surname>Berjon</surname>\r\n
|
57
|
+
\ <ORCID>http://orcid.org/0000-0002-1731-5346</ORCID>\r\n </person_name>\r\n
|
58
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
59
|
+
\ <given_name>Sebastian</given_name>\r\n <surname>Karcher</surname>\r\n
|
60
|
+
\ <ORCID>http://orcid.org/0000-0001-8249-7388</ORCID>\r\n </person_name>\r\n
|
61
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
62
|
+
\ <given_name>Maryann</given_name>\r\n <surname>Martone</surname>\r\n
|
63
|
+
\ <ORCID>http://orcid.org/0000-0002-8406-3871</ORCID>\r\n </person_name>\r\n
|
64
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
65
|
+
\ <given_name>Timothy</given_name>\r\n <surname>Clark</surname>\r\n
|
66
|
+
\ <ORCID>http://orcid.org/0000-0003-4060-7360</ORCID>\r\n </person_name>\r\n
|
67
|
+
\ </contributors>\r\n <titles>\r\n <title>A Data Citation
|
68
|
+
Roadmap for Scholarly Data Repositories</title>\r\n </titles>\r\n <posted_date>\r\n
|
69
|
+
\ <month>12</month>\r\n <day>28</day>\r\n <year>2016</year>\r\n
|
70
|
+
\ </posted_date>\r\n <acceptance_date>\r\n <month>12</month>\r\n
|
71
|
+
\ <day>28</day>\r\n <year>2016</year>\r\n </acceptance_date>\r\n
|
72
|
+
\ <institution>\r\n <institution_name>bioRxiv</institution_name>\r\n
|
73
|
+
\ </institution>\r\n <item_number item_number_type=\"pisa\">biorxiv;097196v1</item_number>\r\n
|
74
|
+
\ <abstract>\r\n <p>This article presents a practical roadmap
|
75
|
+
for scholarly data repositories to implement data citation in accordance with
|
76
|
+
the Joint Declaration of Data Citation Principles (Data Citation Synthesis
|
77
|
+
Group, 2014), a synopsis and harmonization of the recommendations of major
|
78
|
+
science policy bodies. The roadmap was developed by the Repositories Early
|
79
|
+
Adopters Expert Group, part of the Data Citation Implementation Pilot (DCIP)
|
80
|
+
project (FORCE11, 2015), an initiative of FORCE11.org and the NIH BioCADDIE
|
81
|
+
(2016) program. The roadmap makes 11 specific recommendations, grouped into
|
82
|
+
three phases of implementation: a) required steps needed to support the Joint
|
83
|
+
Declaration of Data Citation Principles, b) recommended steps that facilitate
|
84
|
+
article/data publication workflows, and c) optional steps that further improve
|
85
|
+
data citation support provided by data repositories.</p>\r\n </abstract>\r\n
|
86
|
+
\ <doi_data>\r\n <doi>10.1101/097196</doi>\r\n <timestamp>2016122822100649000</timestamp>\r\n
|
87
|
+
\ <resource>http://biorxiv.org/lookup/doi/10.1101/097196</resource>\r\n
|
88
|
+
\ <collection property=\"crawler-based\">\r\n <item crawler=\"iParadigms\">\r\n
|
89
|
+
\ <resource>https://syndication.highwire.org/content/doi/10.1101/097196</resource>\r\n
|
90
|
+
\ </item>\r\n </collection>\r\n </doi_data>\r\n
|
91
|
+
\ </posted_content>\r\n </crossref>\r\n </doi_record>\r\n</doi_records>"
|
92
|
+
http_version:
|
93
|
+
recorded_at: Tue, 20 Jun 2017 06:48:35 GMT
|
94
|
+
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,94 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.crossref.org/openurl/?format=unixref&id=doi:10.1101/097196&noredirect=true&pid=tech@datacite.org
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Maremma - https://github.com/datacite/maremma
|
12
|
+
Accept:
|
13
|
+
- text/xml
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Server:
|
20
|
+
- Apache-Coyote/1.1
|
21
|
+
Crossref-Deployment-Name:
|
22
|
+
- qs3-1
|
23
|
+
Content-Type:
|
24
|
+
- text/xml;charset=UTF-8
|
25
|
+
Content-Language:
|
26
|
+
- en-US
|
27
|
+
Date:
|
28
|
+
- Tue, 20 Jun 2017 06:48:34 GMT
|
29
|
+
Connection:
|
30
|
+
- close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<doi_records>\r\n <doi_record
|
34
|
+
owner=\"10.1101\" timestamp=\"2016-12-29 01:10:20\">\r\n <crossref>\r\n
|
35
|
+
\ <posted_content type=\"preprint\" language=\"en\" metadata_distribution_opts=\"any\">\r\n
|
36
|
+
\ <group_title>Scientific Communication and Education</group_title>\r\n
|
37
|
+
\ <contributors>\r\n <person_name contributor_role=\"author\"
|
38
|
+
sequence=\"first\">\r\n <given_name>Martin</given_name>\r\n <surname>Fenner</surname>\r\n
|
39
|
+
\ <ORCID>http://orcid.org/0000-0003-1419-2405</ORCID>\r\n </person_name>\r\n
|
40
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
41
|
+
\ <given_name>Merc?</given_name>\r\n <surname>Crosas</surname>\r\n
|
42
|
+
\ <ORCID>http://orcid.org/0000-0003-1304-1939</ORCID>\r\n </person_name>\r\n
|
43
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
44
|
+
\ <given_name>Jeffrey</given_name>\r\n <surname>Grethe</surname>\r\n
|
45
|
+
\ <ORCID>http://orcid.org/0000-0001-5212-7052</ORCID>\r\n </person_name>\r\n
|
46
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
47
|
+
\ <given_name>David</given_name>\r\n <surname>Kennedy</surname>\r\n
|
48
|
+
\ <ORCID>http://orcid.org/0000-0002-9377-0797</ORCID>\r\n </person_name>\r\n
|
49
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
50
|
+
\ <given_name>Henning</given_name>\r\n <surname>Hermjakob</surname>\r\n
|
51
|
+
\ <ORCID>http://orcid.org/0000-0001-8479-0262</ORCID>\r\n </person_name>\r\n
|
52
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
53
|
+
\ <given_name>Philippe</given_name>\r\n <surname>Rocca-Serra</surname>\r\n
|
54
|
+
\ <ORCID>http://orcid.org/0000-0001-9853-5668</ORCID>\r\n </person_name>\r\n
|
55
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
56
|
+
\ <given_name>Robin</given_name>\r\n <surname>Berjon</surname>\r\n
|
57
|
+
\ <ORCID>http://orcid.org/0000-0002-1731-5346</ORCID>\r\n </person_name>\r\n
|
58
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
59
|
+
\ <given_name>Sebastian</given_name>\r\n <surname>Karcher</surname>\r\n
|
60
|
+
\ <ORCID>http://orcid.org/0000-0001-8249-7388</ORCID>\r\n </person_name>\r\n
|
61
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
62
|
+
\ <given_name>Maryann</given_name>\r\n <surname>Martone</surname>\r\n
|
63
|
+
\ <ORCID>http://orcid.org/0000-0002-8406-3871</ORCID>\r\n </person_name>\r\n
|
64
|
+
\ <person_name contributor_role=\"author\" sequence=\"additional\">\r\n
|
65
|
+
\ <given_name>Timothy</given_name>\r\n <surname>Clark</surname>\r\n
|
66
|
+
\ <ORCID>http://orcid.org/0000-0003-4060-7360</ORCID>\r\n </person_name>\r\n
|
67
|
+
\ </contributors>\r\n <titles>\r\n <title>A Data Citation
|
68
|
+
Roadmap for Scholarly Data Repositories</title>\r\n </titles>\r\n <posted_date>\r\n
|
69
|
+
\ <month>12</month>\r\n <day>28</day>\r\n <year>2016</year>\r\n
|
70
|
+
\ </posted_date>\r\n <acceptance_date>\r\n <month>12</month>\r\n
|
71
|
+
\ <day>28</day>\r\n <year>2016</year>\r\n </acceptance_date>\r\n
|
72
|
+
\ <institution>\r\n <institution_name>bioRxiv</institution_name>\r\n
|
73
|
+
\ </institution>\r\n <item_number item_number_type=\"pisa\">biorxiv;097196v1</item_number>\r\n
|
74
|
+
\ <abstract>\r\n <p>This article presents a practical roadmap
|
75
|
+
for scholarly data repositories to implement data citation in accordance with
|
76
|
+
the Joint Declaration of Data Citation Principles (Data Citation Synthesis
|
77
|
+
Group, 2014), a synopsis and harmonization of the recommendations of major
|
78
|
+
science policy bodies. The roadmap was developed by the Repositories Early
|
79
|
+
Adopters Expert Group, part of the Data Citation Implementation Pilot (DCIP)
|
80
|
+
project (FORCE11, 2015), an initiative of FORCE11.org and the NIH BioCADDIE
|
81
|
+
(2016) program. The roadmap makes 11 specific recommendations, grouped into
|
82
|
+
three phases of implementation: a) required steps needed to support the Joint
|
83
|
+
Declaration of Data Citation Principles, b) recommended steps that facilitate
|
84
|
+
article/data publication workflows, and c) optional steps that further improve
|
85
|
+
data citation support provided by data repositories.</p>\r\n </abstract>\r\n
|
86
|
+
\ <doi_data>\r\n <doi>10.1101/097196</doi>\r\n <timestamp>2016122822100649000</timestamp>\r\n
|
87
|
+
\ <resource>http://biorxiv.org/lookup/doi/10.1101/097196</resource>\r\n
|
88
|
+
\ <collection property=\"crawler-based\">\r\n <item crawler=\"iParadigms\">\r\n
|
89
|
+
\ <resource>https://syndication.highwire.org/content/doi/10.1101/097196</resource>\r\n
|
90
|
+
\ </item>\r\n </collection>\r\n </doi_data>\r\n
|
91
|
+
\ </posted_content>\r\n </crossref>\r\n </doi_record>\r\n</doi_records>"
|
92
|
+
http_version:
|
93
|
+
recorded_at: Tue, 20 Jun 2017 06:48:35 GMT
|
94
|
+
recorded_with: VCR 3.0.3
|
data/spec/utils_spec.rb
CHANGED
@@ -38,12 +38,24 @@ describe Bolognese::Metadata, vcr: true do
|
|
38
38
|
expect(response).to eq("0000-0002-2590-225X")
|
39
39
|
end
|
40
40
|
|
41
|
+
it "validate_orcid https" do
|
42
|
+
orcid = "https://orcid.org/0000-0002-2590-225X"
|
43
|
+
response = subject.validate_orcid(orcid)
|
44
|
+
expect(response).to eq("0000-0002-2590-225X")
|
45
|
+
end
|
46
|
+
|
41
47
|
it "validate_orcid id" do
|
42
48
|
orcid = "0000-0002-2590-225X"
|
43
49
|
response = subject.validate_orcid(orcid)
|
44
50
|
expect(response).to eq("0000-0002-2590-225X")
|
45
51
|
end
|
46
52
|
|
53
|
+
it "validate_orcid www" do
|
54
|
+
orcid = "http://www.orcid.org/0000-0002-2590-225X"
|
55
|
+
response = subject.validate_orcid(orcid)
|
56
|
+
expect(response).to eq("0000-0002-2590-225X")
|
57
|
+
end
|
58
|
+
|
47
59
|
it "validate_orcid with spaces" do
|
48
60
|
orcid = "0000 0002 1394 3097"
|
49
61
|
response = subject.validate_orcid(orcid)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
@@ -684,9 +684,11 @@ files:
|
|
684
684
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/sanitize/should_remove_a_tags.yml
|
685
685
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/to_schema_org/with_id.yml
|
686
686
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid.yml
|
687
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_https.yml
|
687
688
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_id.yml
|
688
689
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_with_spaces.yml
|
689
690
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_wrong_id.yml
|
691
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_www.yml
|
690
692
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/DOI.yml
|
691
693
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/ISSN.yml
|
692
694
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_url/URL.yml
|