Skip to content

Commit

Permalink
map some additional orcid pub types
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Mar 11, 2022
1 parent db25b83 commit 5829fcf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion lib/orcid/publication_type_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ module Orcid
# Maps work / publication types between ORCID and SUL-PUB.
class PublicationTypeMapper
# Note that this is limited to the work types for which mapping is supported.
# Full list of work types at ORCID: see https://info.orcid.org/faq/what-work-types-does-orcid-support/
PUB_TYPE_TO_WORK_TYPE = {
'article' => 'journal-article',
'book' => 'book',
'caseStudy' => 'research-tool',
'inbook' => 'book-chapter',
'inproceedings' => 'conference-paper'
'inproceedings' => 'conference-paper',
'otherPaper' => 'other',
'technicalReport' => 'report',
'workingPaper' => 'working-paper'
}.freeze

# @return [String] ORCID work type or nil if no matching
Expand Down
12 changes: 6 additions & 6 deletions pub_hash_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ properties:
enum:
- article
- book
- caseStudy # Legacy. Not in current code.
- caseStudy # Potential legacy. Only set via manual pub submission (provenance = CAP)
- inproceedings
- inbook # Legacy. Not in current code.
- otherpaper # Legacy. Not in current code.
- otherPaper # Legacy. Not in current code.
- technicalReport # Legacy. Not in current code.
- workingPaper # Legacy. Not in current code.
- inbook # Potential legacy. Only set via manual pub submission (provenance = CAP)
- otherpaper # Legacy. Likely bad data.
- otherPaper # Potential legacy. Only set via manual pub submission (provenance = CAP)
- technicalReport # Potential legacy. Only set via manual pub submission (provenance = CAP)
- workingPaper # Potential legacy. Only set via manual pub submission (provenance = CAP)
- null # Legacy. Not in current code.
wos_item_id:
type: string
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/orcid/pub_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

context 'when unmappable type' do
let(:pub_hash) do
base_pub_hash.dup.tap { |pub_hash| pub_hash[:type] = 'workingPaper' }
base_pub_hash.dup.tap { |pub_hash| pub_hash[:type] = nil }
end

it 'raises' do
Expand Down

0 comments on commit 5829fcf

Please sign in to comment.