VIAF (Virtual International Authority File) scheme.
Summary
Functions
Builds a URI for the given VIAF ID.
Checks whether a string is a VIAF ID.
Normalizes a VIAF ID.
Checks whether a string starts with a VIAF prefix.
Functions
Builds a URI for the given VIAF ID.
Examples
iex> IDUtils.Schemes.VIAF.build_uri("238999862")
{:ok, %URI{scheme: "https", host: "viaf.org", path: "/viaf/238999862", port: 443}}
Checks whether a string is a VIAF ID.
Examples
iex> IDUtils.Schemes.VIAF.match?("http://viaf.org/viaf/9972147907520779210008")
true
iex> IDUtils.Schemes.VIAF.match?("24609378")
true
iex> IDUtils.Schemes.VIAF.match?("not-a-viaf-id")
false
Normalizes a VIAF ID.
Examples
iex> IDUtils.Schemes.VIAF.normalize("http://viaf.org/viaf/2736702")
{:ok, "2736702"}
iex> IDUtils.Schemes.VIAF.normalize("VIAF:70596852")
{:ok, "70596852"}
iex> IDUtils.Schemes.VIAF.normalize("not-a-viaf-id")
{:error, :invalid_identifier}
Checks whether a string starts with a VIAF prefix.
Examples
iex> IDUtils.Schemes.VIAF.prefix?("http://viaf.org/viaf/24609378")
true
iex> IDUtils.Schemes.VIAF.prefix?("viaf:24609378")
true
iex> IDUtils.Schemes.VIAF.prefix?("24609378")
false