orcid_client 0.3.3 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +5 -5
  2. data/.env.example +1 -1
  3. data/Gemfile.lock +85 -81
  4. data/lib/orcid_client/api.rb +1 -1
  5. data/lib/orcid_client/base.rb +3 -2
  6. data/lib/orcid_client/external_identifier.rb +1 -1
  7. data/lib/orcid_client/notification.rb +1 -1
  8. data/lib/orcid_client/version.rb +1 -1
  9. data/lib/orcid_client/work.rb +6 -5
  10. data/orcid_client.gemspec +3 -3
  11. data/resources/README.md +131 -0
  12. data/resources/{common_2.0/common-2.0.xsd → common_2.1/common-2.1.xsd} +2 -2
  13. data/resources/{common_2.0/samples/common-2.0.xml → common_2.1/samples/common-2.1.xml} +2 -2
  14. data/resources/{notification_2.0 → notification_2.1}/README.md +10 -10
  15. data/resources/{notification_2.0/notification-custom-2.0.xsd → notification_2.1/notification-custom-2.1.xsd} +1 -1
  16. data/resources/{notification_2.0/notification-permission-2.0.xsd → notification_2.1/notification-permission-2.1.xsd} +3 -3
  17. data/resources/{notification_2.0/samples/notification-custom-2.0.xml → notification_2.1/samples/notification-custom-2.1.xml} +2 -2
  18. data/resources/{notification_2.0/samples/notification-permission-2.0.xml → notification_2.1/samples/notification-permission-2.1.xml} +2 -2
  19. data/resources/orcid-error-1.0.xsd +69 -0
  20. data/resources/{record_2.0 → record_2.1}/README.md +154 -155
  21. data/resources/{record_2.0/activities-2.0.xsd → record_2.1/activities-2.1.xsd} +6 -6
  22. data/resources/{record_2.0/address-2.0.xsd → record_2.1/address-2.1.xsd} +1 -1
  23. data/resources/{record_2.0/bulk-2.0.xsd → record_2.1/bulk-2.1.xsd} +2 -2
  24. data/resources/{record_2.0/education-2.0.xsd → record_2.1/education-2.1.xsd} +1 -1
  25. data/resources/{record_2.0/email-2.0.xsd → record_2.1/email-2.1.xsd} +1 -1
  26. data/resources/{record_2.0/employment-2.0.xsd → record_2.1/employment-2.1.xsd} +1 -1
  27. data/resources/{record_2.0/error-2.0.xsd → record_2.1/error-2.1.xsd} +0 -0
  28. data/resources/{record_2.0/funding-2.0.xsd → record_2.1/funding-2.1.xsd} +1 -1
  29. data/resources/{record_2.0/history-2.0.xsd → record_2.1/history-2.1.xsd} +1 -1
  30. data/resources/{record_2.0/keyword-2.0.xsd → record_2.1/keyword-2.1.xsd} +1 -1
  31. data/resources/{record_2.0/other-name-2.0.xsd → record_2.1/other-name-2.1.xsd} +1 -1
  32. data/resources/{record_2.0/peer-review-2.0.xsd → record_2.1/peer-review-2.1.xsd} +2 -2
  33. data/resources/{record_2.0/peer-review-guide-v2.0.md → record_2.1/peer-review-guide-v2.1.md} +17 -17
  34. data/resources/{record_2.0/person-2.0.xsd → record_2.1/person-2.1.xsd} +9 -9
  35. data/resources/{record_2.0/person-external-identifier-2.0.xsd → record_2.1/person-external-identifier-2.1.xsd} +1 -1
  36. data/resources/{record_2.0/personal-details-2.0.xsd → record_2.1/personal-details-2.1.xsd} +3 -3
  37. data/resources/{record_2.0/preferences-2.0.xsd → record_2.1/preferences-2.1.xsd} +1 -1
  38. data/resources/{record_2.0/record-2.0.xsd → record_2.1/record-2.1.xsd} +11 -11
  39. data/resources/{record_2.0/researcher-url-2.0.xsd → record_2.1/researcher-url-2.1.xsd} +1 -1
  40. data/resources/{record_2.0/samples/read_samples/activities-2.0.xml → record_2.1/samples/read_samples/activities-2.1.xml} +12 -12
  41. data/resources/{record_2.0/samples/read_samples/address-2.0.xml → record_2.1/samples/read_samples/address-2.1.xml} +2 -2
  42. data/resources/{record_2.0/samples/read_samples/addresses-2.0.xml → record_2.1/samples/read_samples/addresses-2.1.xml} +3 -3
  43. data/resources/{record_2.0/samples/read_samples/biography-2.0.xml → record_2.1/samples/read_samples/biography-2.1.xml} +2 -2
  44. data/resources/{record_2.0 → record_2.1}/samples/read_samples/bulk-work-error.xml +2 -2
  45. data/resources/{record_2.0/samples/read_samples/credit-name-2.0.xml → record_2.1/samples/read_samples/credit-name-2.1.xml} +1 -1
  46. data/resources/{record_2.0/samples/read_samples/education-2.0.xml → record_2.1/samples/read_samples/education-2.1.xml} +2 -2
  47. data/resources/{record_2.0/samples/read_samples/education-full-2.0.xml → record_2.1/samples/read_samples/education-full-2.1.xml} +2 -2
  48. data/resources/{record_2.0/samples/read_samples/educations-2.0.xml → record_2.1/samples/read_samples/educations-2.1.xml} +4 -4
  49. data/resources/{record_2.0/samples/read_samples/email-2.0.xml → record_2.1/samples/read_samples/email-2.1.xml} +2 -2
  50. data/resources/{record_2.0/samples/read_samples/emails-2.0.xml → record_2.1/samples/read_samples/emails-2.1.xml} +3 -3
  51. data/resources/{record_2.0/samples/read_samples/employment-2.0.xml → record_2.1/samples/read_samples/employment-2.1.xml} +2 -2
  52. data/resources/{record_2.0/samples/read_samples/employment-full-2.0.xml → record_2.1/samples/read_samples/employment-full-2.1.xml} +2 -2
  53. data/resources/{record_2.0/samples/read_samples/employments-2.0.xml → record_2.1/samples/read_samples/employments-2.1.xml} +4 -4
  54. data/resources/{record_2.0/samples/read_samples/error-2.0.xml → record_2.1/samples/read_samples/error-2.1.xml} +1 -1
  55. data/resources/{record_2.0/samples/read_samples/external-identifier-2.0.xml → record_2.1/samples/read_samples/external-identifier-2.1.xml} +2 -2
  56. data/resources/{record_2.0/samples/read_samples/external-identifiers-2.0.xml → record_2.1/samples/read_samples/external-identifiers-2.1.xml} +3 -3
  57. data/resources/{record_2.0/samples/read_samples/funding-2.0.xml → record_2.1/samples/read_samples/funding-2.1.xml} +3 -3
  58. data/resources/{record_2.0/samples/read_samples/funding-full-2.0.xml → record_2.1/samples/read_samples/funding-full-2.1.xml} +3 -3
  59. data/resources/{record_2.0/samples/read_samples/fundings-2.0.xml → record_2.1/samples/read_samples/fundings-2.1.xml} +4 -4
  60. data/resources/{record_2.0/samples/read_samples/history-2.0.xml → record_2.1/samples/read_samples/history-2.1.xml} +2 -2
  61. data/resources/{record_2.0/samples/read_samples/keyword-2.0.xml → record_2.1/samples/read_samples/keyword-2.1.xml} +2 -2
  62. data/resources/{record_2.0/samples/read_samples/keywords-2.0.xml → record_2.1/samples/read_samples/keywords-2.1.xml} +3 -3
  63. data/resources/{record_2.0/samples/read_samples/name-2.0.xml → record_2.1/samples/read_samples/name-2.1.xml} +1 -1
  64. data/resources/{record_2.0/samples/read_samples/other-name-2.0.xml → record_2.1/samples/read_samples/other-name-2.1.xml} +2 -2
  65. data/resources/{record_2.0/samples/read_samples/other-names-2.0.xml → record_2.1/samples/read_samples/other-names-2.1.xml} +3 -3
  66. data/resources/{record_2.0/samples/read_samples/peer-review-2.0.xml → record_2.1/samples/read_samples/peer-review-2.1.xml} +2 -2
  67. data/resources/{record_2.0/samples/read_samples/peer-review-full-2.0.xml → record_2.1/samples/read_samples/peer-review-full-2.1.xml} +2 -2
  68. data/resources/{record_2.0/samples/read_samples/peer-reviews-2.0.xml → record_2.1/samples/read_samples/peer-reviews-2.1.xml} +2 -2
  69. data/resources/{record_2.0/samples/read_samples/person-2.0.xml → record_2.1/samples/read_samples/person-2.1.xml} +7 -7
  70. data/resources/{record_2.0/samples/read_samples/personal-details-2.0.xml → record_2.1/samples/read_samples/personal-details-2.1.xml} +3 -3
  71. data/resources/{record_2.0/samples/read_samples/preferences-2.0.xml → record_2.1/samples/read_samples/preferences-2.1.xml} +1 -1
  72. data/resources/{record_2.0/samples/read_samples/record-2.0.xml → record_2.1/samples/read_samples/record-2.1.xml} +14 -14
  73. data/resources/{record_2.0/samples/read_samples/researcher-url-2.0.xml → record_2.1/samples/read_samples/researcher-url-2.1.xml} +2 -2
  74. data/resources/{record_2.0/samples/read_samples/researcher-urls-2.0.xml → record_2.1/samples/read_samples/researcher-urls-2.1.xml} +2 -2
  75. data/resources/{record_2.0/samples/read_samples/search-2.0.xml → record_2.1/samples/read_samples/search-2.1.xml} +2 -2
  76. data/resources/{record_2.0/samples/read_samples/work-2.0.xml → record_2.1/samples/read_samples/work-2.1.xml} +3 -3
  77. data/resources/{record_2.0/samples/read_samples/work-full-2.0.xml → record_2.1/samples/read_samples/work-full-2.1.xml} +3 -3
  78. data/resources/{record_2.0/samples/read_samples/works-2.0.xml → record_2.1/samples/read_samples/works-2.1.xml} +4 -4
  79. data/resources/{record_2.0/samples/write_sample/address-2.0.xml → record_2.1/samples/write_samples/address-2.1.xml} +1 -1
  80. data/resources/{record_2.0/samples/write_sample/bulk-work-2.0.json → record_2.1/samples/write_samples/bulk-work-2.1.json} +0 -0
  81. data/resources/{record_2.0/samples/write_sample/bulk-work-2.0.xml → record_2.1/samples/write_samples/bulk-work-2.1.xml} +1 -1
  82. data/resources/{record_2.0/samples/write_sample/education-2.0.xml → record_2.1/samples/write_samples/education-2.1.xml} +1 -1
  83. data/resources/{record_2.0/samples/write_sample/employment-2.0.xml → record_2.1/samples/write_samples/employment-2.1.xml} +1 -1
  84. data/resources/{record_2.0/samples/write_sample/external-identifier-2.0.xml → record_2.1/samples/write_samples/external-identifier-2.1.xml} +1 -1
  85. data/resources/{record_2.0/samples/write_sample/funding-2.0.xml → record_2.1/samples/write_samples/funding-2.1.xml} +1 -1
  86. data/resources/{record_2.0/samples/write_sample/keyword-2.0.xml → record_2.1/samples/write_samples/keyword-2.1.xml} +1 -1
  87. data/resources/{record_2.0/samples/write_sample/other-name-2.0.xml → record_2.1/samples/write_samples/other-name-2.1.xml} +1 -1
  88. data/resources/{record_2.0/samples/write_sample/peer-review-full-2.0.xml → record_2.1/samples/write_samples/peer-review-full-2.1.xml} +1 -1
  89. data/resources/{record_2.0/samples/write_sample/peer-review-simple-2.0.xml → record_2.1/samples/write_samples/peer-review-simple-2.1.xml} +1 -1
  90. data/resources/{record_2.0/samples/write_sample/researcher-url-2.0.xml → record_2.1/samples/write_samples/researcher-url-2.1.xml} +1 -1
  91. data/resources/{record_2.0/samples/write_sample/work-full-2.0.xml → record_2.1/samples/write_samples/work-full-2.1.xml} +2 -2
  92. data/resources/{record_2.0/samples/write_sample/work-simple-2.0.xml → record_2.1/samples/write_samples/work-simple-2.1.xml} +1 -1
  93. data/resources/{record_2.0/search-2.0.xsd → record_2.1/search-2.1.xsd} +1 -1
  94. data/resources/{record_2.0/work-2.0.xsd → record_2.1/work-2.1.xsd} +2 -2
  95. data/resources/xml.xsd +286 -0
  96. data/spec/api_spec.rb +9 -9
  97. data/spec/author_spec.rb +1 -1
  98. data/spec/external_identifier_spec.rb +2 -2
  99. data/spec/fixtures/external_identifier.xml +1 -1
  100. data/spec/fixtures/vcr_cassettes/OrcidClient/external_identifier/delete/should_delete_external_identifier.yml +6 -6
  101. data/spec/fixtures/vcr_cassettes/OrcidClient/external_identifier/post/should_create_external_identifier.yml +8 -8
  102. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/delete/should_delete_notification.yml +11 -15
  103. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/get/should_get_notification.yml +10 -15
  104. data/spec/fixtures/vcr_cassettes/OrcidClient/notifications/post/should_create_notification.yml +48 -57
  105. data/spec/fixtures/vcr_cassettes/OrcidClient/works/delete/should_delete_work.yml +6 -6
  106. data/spec/fixtures/vcr_cassettes/OrcidClient/works/get/should_get_works.yml +6 -614
  107. data/spec/fixtures/vcr_cassettes/OrcidClient/works/post/should_create_work.yml +48 -55
  108. data/spec/fixtures/vcr_cassettes/OrcidClient/works/put/should_update_work.yml +51 -62
  109. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/data.yml +41 -52
  110. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_data.yml +41 -50
  111. data/spec/fixtures/vcr_cassettes/OrcidClient_Notification/schema/validates_item_type_work.yml +51 -52
  112. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/literal.yml +41 -52
  113. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/multiple_titles.yml +51 -52
  114. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/valid.yml +41 -52
  115. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/contributors/with_ORCID_IDs.yml +55 -52
  116. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/data.yml +41 -52
  117. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/publication_date.yml +41 -52
  118. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_ORCID_IDs_for_contributors.yml +55 -52
  119. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_data.yml +41 -52
  120. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_from_DataCite_test_system.yml +41 -60
  121. data/spec/fixtures/vcr_cassettes/OrcidClient_Work/schema/validates_work_type_data-set.yml +51 -52
  122. data/spec/fixtures/work.xml +1 -1
  123. data/spec/notification_spec.rb +3 -3
  124. data/spec/work_spec.rb +16 -17
  125. metadata +100 -103
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4fe2358b8ada64c780b263571714a74aeef4ba91
4
- data.tar.gz: 78701a53e235101d70cab1e48eb9a3ae27067efc
2
+ SHA256:
3
+ metadata.gz: 59481495c710df2ed1a634fd0a355b73187767cb3b6bd7ebce7442e087db559b
4
+ data.tar.gz: 43c60864e1dd8fe3bb4a0d810d9b275f8905d320e9180cd307dbd7dd685bc94f
5
5
  SHA512:
6
- metadata.gz: a2f9b14146e93959b3acabe80329ed3374f55b5f8211f48dda3d9adb5699cec060a0a499102c558dcb25cf3138a783491014ed9a3d9f2edea6dde575d58a48a7
7
- data.tar.gz: a2b96e5069a1a0e9acb845f39c97a9be3a5d08e6689d3050b1e6e236b5b7232c6e65d5db38d283a6186300d7f640e24ae476a22bb0c28c52dfee9eb36cf409f5
6
+ metadata.gz: 92ce725ede978a6575ce215620f2b28eedb404ae60b4bfa7fb9ba02cb952cd270166912971fe2c114c9eb736e47ef205cd595906690d7aad11d6a38dfd59ba8b
7
+ data.tar.gz: a3b9133205206e113ae0b08d70c108273e41e19e0be338f023384554f41c64c047fdcee756ac977cb3b6645cb02ca1578b2767aab277335076a921daf4755427
@@ -1,5 +1,5 @@
1
1
  ORCID_API_URL=
2
- SEARCH_URL=
2
+ SOLR_URL=
3
3
 
4
4
  # needed to post works
5
5
  ACCESS_TOKEN=
@@ -1,41 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orcid_client (0.3.3)
4
+ orcid_client (0.4.1)
5
5
  activesupport (>= 4.2.5, < 6)
6
- bolognese (~> 0.9.28)
6
+ bolognese (~> 0.9.93)
7
7
  builder (~> 3.2, >= 3.2.2)
8
8
  dotenv (~> 2.1, >= 2.1.1)
9
- maremma (~> 3.5, >= 3.5.7)
9
+ maremma (>= 3.5.7, < 5)
10
10
  namae (~> 0.11.3)
11
- nokogiri (~> 1.6, >= 1.6.8)
11
+ nokogiri (~> 1.8.1)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activesupport (5.1.1)
16
+ activesupport (5.2.0)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (~> 0.7)
18
+ i18n (>= 0.7, < 2)
19
19
  minitest (~> 5.1)
20
20
  tzinfo (~> 1.1)
21
- addressable (2.5.1)
22
- public_suffix (~> 2.0, >= 2.0.2)
21
+ addressable (2.5.2)
22
+ public_suffix (>= 2.0.2, < 4.0)
23
23
  benchmark_methods (0.7)
24
- bibtex-ruby (4.4.3)
24
+ bibtex-ruby (4.4.6)
25
25
  latex-decode (~> 0.0)
26
- bolognese (0.9.28)
26
+ bolognese (0.9.93)
27
27
  activesupport (>= 4.2.5, < 6)
28
28
  benchmark_methods (~> 0.7)
29
29
  bibtex-ruby (~> 4.1)
30
30
  builder (~> 3.2, >= 3.2.2)
31
31
  colorize (~> 0.8.1)
32
32
  gender_detector (~> 0.1.2)
33
+ iso8601 (~> 0.9.1)
33
34
  json-ld (~> 2.1, >= 2.1.2)
34
35
  jsonlint (~> 0.2.0)
35
36
  loofah (~> 2.0, >= 2.0.3)
36
- maremma (~> 3.5, >= 3.5.7)
37
+ maremma (>= 3.5.7, < 5)
37
38
  namae (~> 0.11.3)
38
- nokogiri (~> 1.6, >= 1.6.8)
39
+ nokogiri (~> 1.8.1)
40
+ oj (>= 2.8.3)
39
41
  postrank-uri (~> 1.0, >= 1.0.18)
40
42
  rdf-rdfxml (~> 2.0)
41
43
  rdf-turtle (~> 2.2)
@@ -47,122 +49,124 @@ GEM
47
49
  concurrent-ruby (1.0.5)
48
50
  crack (0.4.3)
49
51
  safe_yaml (~> 1.0.0)
52
+ crass (1.0.4)
50
53
  diff-lcs (1.3)
51
54
  docile (1.1.5)
52
- dotenv (2.2.1)
53
- ebnf (1.1.0)
54
- rdf (~> 2.0)
55
+ dotenv (2.2.2)
56
+ ebnf (1.1.2)
57
+ rdf (>= 2.2, < 4.0)
55
58
  sxp (~> 1.0)
56
- excon (0.45.4)
57
- faraday (0.9.2)
59
+ excon (0.62.0)
60
+ faraday (0.14.0)
58
61
  multipart-post (>= 1.2, < 3)
59
62
  faraday-encoding (0.0.4)
60
63
  faraday
61
- faraday_middleware (0.10.1)
64
+ faraday_middleware (0.12.2)
62
65
  faraday (>= 0.7.4, < 1.0)
63
66
  gender_detector (0.1.2)
64
67
  unicode_utils (>= 1.3.0)
65
- haml (5.0.1)
68
+ haml (5.0.4)
66
69
  temple (>= 0.8.0)
67
70
  tilt
68
71
  hamster (3.0.0)
69
72
  concurrent-ruby (~> 1.0)
70
- hashdiff (0.3.4)
73
+ hashdiff (0.3.7)
71
74
  htmlentities (4.3.4)
72
- i18n (0.8.4)
75
+ i18n (1.0.0)
76
+ concurrent-ruby (~> 1.0)
77
+ iso8601 (0.9.1)
73
78
  json (2.1.0)
74
- json-ld (2.1.4)
79
+ json-ld (2.2.1)
75
80
  multi_json (~> 1.12)
76
- rdf (~> 2.2)
81
+ rdf (>= 2.2.8, < 4.0)
77
82
  jsonlint (0.2.0)
78
83
  oj (~> 2)
79
84
  trollop (~> 2)
80
- latex-decode (0.2.2)
81
- unicode (~> 0.4)
85
+ latex-decode (0.3.1)
82
86
  link_header (0.0.8)
83
- loofah (2.0.3)
87
+ loofah (2.2.2)
88
+ crass (~> 1.0.2)
84
89
  nokogiri (>= 1.5.9)
85
- maremma (3.5.8)
86
- activesupport (>= 4.2.5)
90
+ maremma (4.0.5)
91
+ activesupport (>= 4.2.5, < 6)
87
92
  addressable (>= 2.3.6)
88
93
  builder (~> 3.2, >= 3.2.2)
89
- excon (~> 0.45.0)
90
- faraday (~> 0.9.2)
91
- faraday-encoding (~> 0.0.1)
92
- faraday_middleware (~> 0.10.0)
94
+ excon (~> 0.60)
95
+ faraday (~> 0.14)
96
+ faraday-encoding (~> 0.0.4)
97
+ faraday_middleware (~> 0.12.0)
93
98
  multi_json (~> 1.12)
94
- nokogiri (~> 1.6, >= 1.6.8)
95
- oj (~> 2.18, >= 2.18.1)
96
- mini_portile2 (2.1.0)
97
- minitest (5.10.2)
98
- multi_json (1.12.1)
99
+ nokogiri (~> 1.8.1)
100
+ oj (>= 2.8.3)
101
+ mini_portile2 (2.3.0)
102
+ minitest (5.11.3)
103
+ multi_json (1.13.1)
99
104
  multipart-post (2.0.0)
100
105
  namae (0.11.3)
101
- nokogiri (1.7.2)
102
- mini_portile2 (~> 2.1.0)
106
+ nokogiri (1.8.2)
107
+ mini_portile2 (~> 2.3.0)
103
108
  oj (2.18.5)
104
- postrank-uri (1.0.22)
109
+ postrank-uri (1.0.23)
105
110
  addressable (>= 2.3.0, < 2.6)
106
- nokogiri (>= 1.6.1, < 1.8)
111
+ nokogiri (>= 1.6.1, < 1.9)
107
112
  public_suffix (>= 2.0.0, < 2.1)
108
113
  public_suffix (2.0.5)
109
- rack (2.0.3)
110
- rack-test (0.6.3)
111
- rack (>= 1.0)
112
- rake (12.0.0)
113
- rdf (2.2.6)
114
+ rack (2.0.4)
115
+ rack-test (0.8.3)
116
+ rack (>= 1.0, < 3)
117
+ rake (12.3.1)
118
+ rdf (3.0.2)
114
119
  hamster (~> 3.0)
115
120
  link_header (~> 0.0, >= 0.0.8)
116
- rdf-aggregate-repo (2.2.0)
117
- rdf (~> 2.0)
118
- rdf-rdfa (2.2.2)
121
+ rdf-aggregate-repo (2.2.1)
122
+ rdf (>= 2.2, < 4.0)
123
+ rdf-rdfa (3.0.1)
119
124
  haml (~> 5.0)
120
125
  htmlentities (~> 4.3)
121
- rdf (~> 2.2)
122
- rdf-aggregate-repo (~> 2.2)
123
- rdf-xsd (~> 2.1)
124
- rdf-rdfxml (2.0.0)
126
+ rdf (~> 3.0)
127
+ rdf-aggregate-repo (>= 2.2, < 4.0)
128
+ rdf-xsd (~> 3.0)
129
+ rdf-rdfxml (2.2.1)
125
130
  htmlentities (~> 4.3)
126
- rdf (~> 2.0)
127
- rdf-rdfa (~> 2.0)
128
- rdf-xsd (~> 2.0)
129
- rdf-turtle (2.2.0)
131
+ rdf (>= 2.2, < 4.0)
132
+ rdf-rdfa (>= 2.2, < 4.0)
133
+ rdf-xsd (>= 2.2, < 4.0)
134
+ rdf-turtle (2.2.2)
130
135
  ebnf (~> 1.1)
131
- rdf (~> 2.2)
132
- rdf-xsd (2.2.0)
133
- rdf (~> 2.1)
134
- rspec (3.6.0)
135
- rspec-core (~> 3.6.0)
136
- rspec-expectations (~> 3.6.0)
137
- rspec-mocks (~> 3.6.0)
138
- rspec-core (3.6.0)
139
- rspec-support (~> 3.6.0)
140
- rspec-expectations (3.6.0)
136
+ rdf (>= 2.2, < 4.0)
137
+ rdf-xsd (3.0.0)
138
+ rdf (~> 3.0)
139
+ rspec (3.7.0)
140
+ rspec-core (~> 3.7.0)
141
+ rspec-expectations (~> 3.7.0)
142
+ rspec-mocks (~> 3.7.0)
143
+ rspec-core (3.7.1)
144
+ rspec-support (~> 3.7.0)
145
+ rspec-expectations (3.7.0)
141
146
  diff-lcs (>= 1.2.0, < 2.0)
142
- rspec-support (~> 3.6.0)
143
- rspec-mocks (3.6.0)
147
+ rspec-support (~> 3.7.0)
148
+ rspec-mocks (3.7.0)
144
149
  diff-lcs (>= 1.2.0, < 2.0)
145
- rspec-support (~> 3.6.0)
146
- rspec-support (3.6.0)
150
+ rspec-support (~> 3.7.0)
151
+ rspec-support (3.7.1)
147
152
  safe_yaml (1.0.4)
148
153
  simplecov (0.13.0)
149
154
  docile (~> 1.1.0)
150
155
  json (>= 1.8, < 3)
151
156
  simplecov-html (~> 0.10.0)
152
- simplecov-html (0.10.1)
153
- sxp (1.0.0)
154
- rdf (~> 2.0)
157
+ simplecov-html (0.10.2)
158
+ sxp (1.0.1)
159
+ rdf (>= 2.2, < 4.0)
155
160
  temple (0.8.0)
156
- thor (0.19.4)
161
+ thor (0.20.0)
157
162
  thread_safe (0.3.6)
158
- tilt (2.0.7)
163
+ tilt (2.0.8)
159
164
  trollop (2.1.2)
160
- tzinfo (1.2.3)
165
+ tzinfo (1.2.5)
161
166
  thread_safe (~> 0.1)
162
- unicode (0.4.4.4)
163
167
  unicode_utils (1.4.0)
164
- vcr (3.0.3)
165
- webmock (3.0.1)
168
+ vcr (4.0.0)
169
+ webmock (3.3.0)
166
170
  addressable (>= 2.3.6)
167
171
  crack (>= 0.3.2)
168
172
  hashdiff
@@ -182,4 +186,4 @@ DEPENDENCIES
182
186
  webmock (~> 3.0, >= 3.0.1)
183
187
 
184
188
  BUNDLED WITH
185
- 1.12.5
189
+ 1.16.1
@@ -2,7 +2,7 @@ require "uri"
2
2
 
3
3
  module OrcidClient
4
4
  module Api
5
- API_VERSION = "2.0"
5
+ API_VERSION = "2.1"
6
6
 
7
7
  def get_works(options={})
8
8
  return OpenStruct.new(body: { "errors" => [{ "title" => "Access token missing" }] }) unless access_token.present?
@@ -10,8 +10,9 @@ module OrcidClient
10
10
  # load ENV variables from container environment if json file exists
11
11
  # see https://github.com/phusion/baseimage-docker#envvar_dumps
12
12
  env_json_file = "/etc/container_environment.json"
13
- if File.exist?(env_json_file)
14
- env_vars = JSON.parse(File.read(env_json_file))
13
+ json = File.exist?(env_json_file) ? File.read(env_json_file) : ""
14
+ if json.length >= 2
15
+ env_vars = JSON.parse(json)
15
16
  env_vars.each { |k, v| ENV[k] = v }
16
17
  end
17
18
 
@@ -45,7 +45,7 @@ module OrcidClient
45
45
  { :'put-code' => put_code,
46
46
  :'visibility' => 'public',
47
47
  :'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
48
- :'xsi:schemaLocation' => 'http://www.orcid.org/ns/external-identifier ../person-external-identifier-2.0.xsd',
48
+ :'xsi:schemaLocation' => 'http://www.orcid.org/ns/external-identifier ../person-external-identifier-2.1.xsd',
49
49
  :'xmlns:common' => 'http://www.orcid.org/ns/common',
50
50
  :'xmlns:external-identifier' => 'http://www.orcid.org/ns/external-identifier' }.compact
51
51
  end
@@ -107,7 +107,7 @@ module OrcidClient
107
107
 
108
108
  def root_attributes
109
109
  { :'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
110
- :'xsi:schemaLocation' => 'http://www.orcid.org/ns/notification ../notification-permission-2.0.xsd',
110
+ :'xsi:schemaLocation' => 'http://www.orcid.org/ns/notification ../notification-permission-2.1.xsd',
111
111
  :'xmlns:common' => 'http://www.orcid.org/ns/common',
112
112
  :'xmlns:notification' => 'http://www.orcid.org/ns/notification' }
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module OrcidClient
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -17,30 +17,31 @@ module OrcidClient
17
17
 
18
18
  include Bolognese::Utils
19
19
 
20
- attr_reader :doi, :orcid, :schema, :access_token, :search_url, :put_code, :validation_errors, :name_detector
20
+ attr_reader :doi, :orcid, :schema, :access_token, :sandbox, :put_code, :validation_errors, :name_detector
21
21
 
22
22
  def initialize(doi:, orcid:, access_token:, **options)
23
23
  @doi = doi
24
24
  @orcid = orcid
25
25
  @access_token = access_token
26
- @search_url = options.fetch(:search_url, nil) || ENV['SOLR_URL']
26
+ @sandbox = options.fetch(:sandbox, nil) || ENV['SOLR_URL'] == "https://search.test.datacite.org/api"
27
27
  @put_code = options.fetch(:put_code, nil)
28
28
  end
29
29
 
30
30
  SCHEMA = File.expand_path("../../../resources/record_#{API_VERSION}/work-#{API_VERSION}.xsd", __FILE__)
31
+
31
32
  # recognize given name. Can be loaded once as ::NameDetector, e.g. in a Rails initializer
32
33
  def name_detector
33
34
  @name_detector ||= defined?(::NameDetector) ? ::NameDetector : GenderDetector.new
34
35
  end
35
36
 
36
37
  def metadata
37
- @metadata ||= Bolognese::Metadata.new(input: doi, search_url: search_url)
38
+ @metadata ||= Bolognese::Metadata.new(input: doi, sandbox: sandbox)
38
39
  end
39
40
 
40
41
  def contributors
41
42
  Array.wrap(metadata.author).map do |contributor|
42
43
  orcid = validate_orcid(contributor.fetch('id', nil))
43
- orcid = "http://orcid.org/#{orcid}" if orcid.present?
44
+ orcid = "https://orcid.org/#{orcid}" if orcid.present?
44
45
 
45
46
  { orcid: orcid,
46
47
  credit_name: contributor.fetch('name', nil),
@@ -179,7 +180,7 @@ module OrcidClient
179
180
  { :'put-code' => put_code,
180
181
  :'visibility' => 'public',
181
182
  :'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
182
- :'xsi:schemaLocation' => 'http://www.orcid.org/ns/work ../work-2.0.xsd',
183
+ :'xsi:schemaLocation' => 'http://www.orcid.org/ns/work ../work-2.1.xsd',
183
184
  :'xmlns:common' => 'http://www.orcid.org/ns/common',
184
185
  :'xmlns:work' => 'http://www.orcid.org/ns/work' }.compact
185
186
  end
@@ -19,9 +19,9 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # Declary dependencies here, rather than in the Gemfile
22
- s.add_dependency 'maremma', '~> 3.5', '>= 3.5.7'
23
- s.add_dependency 'bolognese', '~> 0.9.28'
24
- s.add_dependency 'nokogiri', '~> 1.6', '>= 1.6.8'
22
+ s.add_dependency 'maremma', '>= 3.5.7', '< 5'
23
+ s.add_dependency 'nokogiri', '~> 1.8.1'
24
+ s.add_dependency 'bolognese', '~> 0.9.93'
25
25
  s.add_dependency 'builder', '~> 3.2', '>= 3.2.2'
26
26
  s.add_dependency 'namae', '~> 0.11.3'
27
27
  s.add_dependency 'activesupport', '>= 4.2.5', '< 6'
@@ -0,0 +1,131 @@
1
+ ## ORCID Message (XSD) Readme
2
+
3
+ **Contents**
4
+
5
+ * [XSD Information](#orcid-xsd-information)
6
+ * [Active Versions & Base URLs](#active-xsd-versions-and-base-urls)
7
+ * [About XSD Updates and Versioning](#about-xsd-updates-and-versioning)
8
+ * [Staying Informed](#staying-informed)
9
+ * [Using XSD Versions](#using-xsd-versions)
10
+ * [ORCID-Message XSD Versions Table](#orcid-message-xsd-versions)
11
+ * [Getting Help](#getting-help)
12
+
13
+ ---
14
+
15
+ # ORCID XSD information
16
+
17
+ ##Active XSD versions and base URLs
18
+
19
+ #### XSD release version
20
+
21
+ * **[ORCID Message 2.0](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0)** - [Documentation](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/record_2.0/README.md), [Change log from 1.2](https://members.orcid.org/api/news/xsd-20-update)
22
+ * API Base URLs - PRODUCTION
23
+ * Public API: https://pub.orcid.org/v2.0/
24
+ * Member API: https://api.orcid.org/v2.0/
25
+ * API Base URLs - SANDBOX
26
+ * Public API: https://pub.sandbox.orcid.org/v2.0/
27
+ * Member API: https://api.sandbox.orcid.org/v2.0/
28
+
29
+ #### XSD release candidate(s)
30
+
31
+ * **[ORCID Message 2.0_rc4](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc4)** - _Contains: Minor corrections and updates_ <br/>
32
+ * **[ORCID Message 2.0_rc3](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc3)** - _Contains: bulk works, activities section endpoints_ <br/>
33
+ * **[ORCID Message 2.0_rc2](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc2)** - _Contains: Person section, migrates all identifiers to external-identifier_ <br/>
34
+ * **[ORCID Message 2.0_rc1](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc1)** - _Contains: Peer-review, new format XSD for activities_ <br/><br/>
35
+ * API Base URLs - PRODUCTION (replace 'X' in the URL with the rc version)
36
+ * Public API: https://pub.orcid.org/v2.0_rcX/
37
+ * Member API: https://api.orcid.org/v2.0_rcX/
38
+ * API Base URLs - SANDBOX
39
+ * Public API: https://pub.sandbox.orcid.org/v2.0_rcX/
40
+ * Member API: https://api.sandbox.orcid.org/v2.0_rcX/
41
+
42
+ #### XSD deprecated versions
43
+
44
+ * **[ORCID Message 1.2](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2.xsd)**
45
+ * API Base URLs - PRODUCTION
46
+ * Public API: https://pub.orcid.org/v1.2/
47
+ * Member API: https://api.orcid.org/v1.2/
48
+ * API Base URLs - SANDBOX
49
+ * Public API: https://pub.sandbox.orcid.org/v1.2/
50
+ * Member API: https://api.sandbox.orcid.org/v1.2/
51
+
52
+
53
+ #### Sunset versions (unavailable, unsupported, should not be used)
54
+
55
+ * **Version 1.0.x (includes versions 1.0.1 through 1.0.23)** <br>_Sunset Date: March 1, 2014_
56
+ * **[ORCID Message 1.1](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.1.xsd)** <br>_Sunset Date: April 1, 2015_
57
+
58
+ _NOTE:<br />API calls for member to ORCID iD holder authorization using OAuth are not affected by XSD versions. Regardless of the XSD version used, the OAuth endpoints are:_
59
+
60
+ * _[http://orcid.org/oauth/authorize](http://support.orcid.org/knowledgebase/articles/120107)_
61
+ * _[https://orcid.org/oauth/token](http://support.orcid.org/knowledgebase/articles/119985)_
62
+
63
+
64
+ # About XSD Updates and Versioning
65
+
66
+
67
+ At any one time there may be several available versions of the XSD available for use:
68
+
69
+ * _Deprecated Version(s)_ - past version(s) of the XSD. While deprecated versions may still work, developers should be migrating to a current release version. New development should not be done against deprecated versions.
70
+ * _Release Version(s)_ - the XSD version you should be actively migrating to in order to take advantage of either improvements or new functionality.
71
+ * _One or more Release Candidates_ - these versions of the XSD contain in-progress improvements and functionality. They are made available to enable API users to take advantage of new functionality faster than waiting for the next Release Version. These versions are subject to change at any time.
72
+
73
+ _Which XSD version should I be using?_
74
+
75
+ The XSD version you should use depends on what you are trying to do. Most developers will use a current Release Version, or be actively migrating to one. However, if you are developing an integration that takes advantage of new functionality or improvement, you likely will need to use one of the Release Candidates.
76
+
77
+ ## Staying informed
78
+
79
+ You can stay informed of updates to the XSD and API by subscribing to our [API Users Group](https://groups.google.com/forum/?fromgroups#!forum/orcid-api-users) mailing list and forum.
80
+
81
+ ## Using XSD versions
82
+
83
+ ### <a name="deprecatedVersion"></a>Deprecated version(s)
84
+
85
+ The deprecated version(s) of the XSD are former versions of the XSD. If you are using a deprecated version, you should be planning a migration to move to a release version. Other things of note about deprecated versions:
86
+
87
+ * An XSD that has changed to deprecated status will not be removed immediately, though we are actively encouraging all developers to move to the current release version.
88
+ * Developers on deprecated versions should refer to the migration notes to assist in moving to the latest release version.
89
+ * Future functionality will not be supported in deprecated versions.
90
+ * Future versions may not be backward compatible with deprecated versions.
91
+ * Deprecated versions will have a “sunset date”, after which they will no longer be supported. Developers experiencing problems with deprecated versions will be directed to move to the release version.
92
+
93
+ ### <a name="releaseVersion"></a>Release version(s)
94
+
95
+ Release versions of the XSD are fully documented, tested, supported and encouraged for use. Of note about release versions:
96
+
97
+ * Our intent is for release versions of the XSD to have longer lifespans than the very fast pace of ORCID new development.
98
+ * When feasible, we will provide estimates of when the next release version is likely to be available, and what it is likely to contain.
99
+ * While more than one release version may be available at any time, we highly recommend that developers update to the latest release version at least once per year to enjoy optimal XSD stability.
100
+
101
+ ### <a name="releaseCandidate"></a>Release candidate(s)
102
+
103
+ Release candidate versions of the XSD contain elements and data structures for future functionality, potential changes and other enhancements. Of note about release candidates:
104
+
105
+ * The version number of release candidates will contain ‘rc’ to indicate that they are release candidates (for example, version 1.2_rc1). The first two numbers indicate the target release version for the candidate. For example, the changes and enhancements in version 1.2_rc1 are being considered for inclusion with release version 1.2.
106
+ * Release candidates are generally unsupported, and have limited documentation.
107
+ * Elements and data structure within a release candidate XSD could change at any time based on development needs and feedback from early adopters.
108
+ * We welcome feedback from any developers working with current release candidates.
109
+
110
+
111
+ # ORCID-message XSD versions
112
+
113
+ | Version/link | Release Date | Sunset date | Notes | Who should be using this version |
114
+ | ------------ | ------------ | ----------- | ----- | -------------------------------- |
115
+ | [ORCID XSD 2.0](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0) | Feb 13, 2017 | | **[Release version](#releaseVersion)**<br><br>CURRENT SUPPORTED VERSION<br/>[Change log from 1.2](https://members.orcid.org/api/news/xsd-20-update) |This is the preferred version. All developers should be using or migrating to this version. [Documentation](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/record_2.0/README.md)|
116
+ | [ORCID XSD 2.0_rc4](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc4) | Jan 24, 2017 | | **[Release candidate version](#releaseCandidate)**<br><br/>_minor fixes and corrections_ | |
117
+ | [ORCID XSD 2.0_rc3](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc3) | Nov 18, 2016 | | **[Release candidate version](#releaseCandidate)**<br><br/>_adds bulk works_ | |
118
+ | [ORCID XSD 2.0_rc2](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc2) | Jul 20, 2016 | | **[Release candidate version](#releaseCandidate)**<br><br/>_adds person section_ | |
119
+ | [ORCID XSD 2.0_rc1](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources/record_2.0_rc1) | Jul 01, 2015 | | **[Release candidate version](#releaseCandidate)**<br><br/>_adds peer-review section, reformats XSD for activities_ | |
120
+ | [ORCID XSD 1.2](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2.xsd) | Jan 12, 2015 | Late 2017 | **[Deprecated version](#deprecatedVersion)**<br/><br/> | All developers on this version should migrate to version 2.0 |
121
+ | XSD 1.2_rcX | throughout 2014 | Apr 1, 2015 | **[Deprecated versions](#deprecatedVersion)**<br/><br/>[XSD 1.2_rc1](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc1.xsd): _adds elements for education or employment affiliations_<br/>[XSD 1.2_rc2](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc2.xsd): _updates the options for the creation-method field, and adds elements needed for funding_<br/>[XSD 1.2_rc3](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc3.xsd): _restricts the valid language codes to those supported by ORCID, and removes patents as a separate element (included under the works element)_<br/>[XSD 1.2_rc4](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc4.xsd): _provides more details about existing elements, email verification info, organization details that create an ORCID record, and funding agency details for funding element_<br/>[XSD 1.2_rc5](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc5.xsd): _clarifies elements for data provenance - the data source, creation date and modification date; work external IDs are required_<br/>[XSD 1.2_rc6](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.2_rc6.xsd): _adds more work types_ | These versions were sunset as of Apr 1, 2015. They are no longer available and should not be used. |
122
+ | [ORCID XSD 1.1](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/orcid-message-1.1.xsd) | Nov 25, 2013 | Apr 1, 2015 | **[Deprecated version](#deprecatedVersion)**<br><br> | This version was sunset as of Apr 1, 2015. It is no longer available and should not be used. |
123
+ | [ORCID XSD 1.0.x](https://github.com/ORCID/ORCID-Source/tree/master/orcid-model/src/main/resources) | various | Mar 1, 2014 | **Sunset version** | These versions were sunset as of March 1, 2014. They are no longer available and should not be used. _(Versions 1.0.1 - 1.0.23)_ |
124
+
125
+ # Getting help
126
+
127
+ Technical documentation is included with the read-me file for each version. [Current release documentation](https://github.com/ORCID/ORCID-Source/blob/master/orcid-model/src/main/resources/record_2.0/README.md)
128
+
129
+ The [ORCID Member Support Site](https://members.orcid.org) has additional documentation, tutorials and guides, as well as contact for our support team.
130
+
131
+ We also invite you to submit questions to the [API Users Group](https://groups.google.com/forum/?fromgroups#!forum/orcid-api-users) mailing list and forum.