IDUtils.Schemes.ROR (id_utils v0.1.0)

Copy Markdown View Source

ROR (Research Organization Registry) scheme.

See https://ror.readme.io/docs/identifier

Summary

Functions

Builds a URI for the given ROR.

Checks whether a string is a ROR.

Normalizes a ROR.

Functions

build_uri(ror)

Builds a URI for the given ROR.

Examples

iex> IDUtils.Schemes.ROR.build_uri("02feahw73")
{:ok, %URI{scheme: "https", host: "ror.org", path: "/02feahw73", port: 443}}

match?(string)

Checks whether a string is a ROR.

Examples

iex> IDUtils.Schemes.ROR.match?("00a8p0m24")
true

iex> IDUtils.Schemes.ROR.match?("https://ror.org/03prydq77")
true

iex> IDUtils.Schemes.ROR.match?("03prydq78")
false

normalize(string)

Normalizes a ROR.

Examples

iex> IDUtils.Schemes.ROR.normalize("019WHTA54")
{:ok, "019whta54"}

iex> IDUtils.Schemes.ROR.normalize("https://ror.org/02s376052")
{:ok, "02s376052"}

iex> IDUtils.Schemes.ROR.normalize("not-a-ror")
{:error, :invalid_identifier}