Skip to content

Collection of utilities related to the extraction, validation and normalization of various scholarly identifiers.

License

Notifications You must be signed in to change notification settings

altmetric/identifiers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Identifiers Build Status Gem Version

Collection of utilities related to the extraction, validation and normalization of various scholarly identifiers. The supported list is:

Installation

Add this line to your application's Gemfile:

gem 'identifiers', '~> 0.12'

And then execute:

$ bundle

Or install it yourself as:

$ gem install identifiers

Usage

Identifiers::DOI.extract('example: 10.1234/5678.ABC')
# => ["10.1234/5678.abc"]

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">

A small percentage of DOIs end in trailing .. However, having trailing periods being returned by the default extraction method would possibly return quite a few false positives. DOI.extract accepts a strict option, which can be set to true if we prefer to return DOIs ending in .. By default, this option is set to false, which strips any trailing .:

Identifiers::DOI.extract('example: 10.1234/5678.abc.', strict: true)
# => ["10.1234/5678.abc."]

Identifiers::DOI.extract('example: 10.1234/5678.abc.')
# => ["10.1234/5678.abc"]

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

PHP version

We also maintain a version of this library for PHP.

License

Copyright © 2016-2018 Altmetric LLP

Distributed under the MIT License.

About

Collection of utilities related to the extraction, validation and normalization of various scholarly identifiers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published