Identifiers

Collection of utilities related to the extraction, validation and normalization of various scholarly identifiers. The supported list is:
- ADS Bibcodes
- arXiv IDs
- DOIs (including ISBN-As)
- Handles
- ISBNs
- National Clinical Trial IDs
- PubMed IDs
- RePEc IDs
- URNs
- ORCID identifiers
Installation
Add this line to your application's Gemfile:
gem 'identifiers', '~> 0.7'
And then execute:
$ bundle
Or install it yourself as:
$ gem install identifiers
Usage
Identifiers::DOI.extract('example: 10.123/abcd.efghi')
# => ["10.123/abcd.efghi"]
Identifiers::DOI.extract('no DOIs here')
# => []
Identifiers::URN.new('urn:abc:123')
# => #<URN:0x007ff11c13d930 @urn="urn:abc:123", @nid="abc", @nss="123">
Identifiers::URN('urn:abc:123')
# => #<URN:0x007ff11c0ff568 @urn="urn:abc:123", @nid="abc", @nss="123">
By identifier
.extract is a common method that works across all the supported identifiers.
Identifiers::AdsBibcode.extract('')
Identifiers::ArxivId.extract('')
Identifiers::DOI.extract('')
Identifiers::Handle.extract('')
Identifiers::ISBN.extract('')
Identifiers::NationalClinicalTrialId.extract('')
Identifiers::ORCID.extract('')
Identifiers::PubmedId.extract('')
Identifiers::RepecId.extract('')
Identifiers::URN.extract('')
But for some identifiers might have more. Check their implementation to see all the methods available.
For URNs, please check the URN gem documentation to see all the available options.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/altmetric/identifiers.
Contributions
- Thanks to Tom Stuart for cleaning up the ISBN check digit code.
PHP version
We also maintain a version of this library for PHP.
License
Copyright © 2016-2017 Altmetric LLP
Distributed under the MIT License.