View Source ROR.Name (ROR v0.1.0)

Functions for extracting and using Name data from a ROR Organization record

Summary

Functions

Extracts a list of Name structs from the decoded JSON of a ROR Organization record

Lists the allowed terms or types for this data structure, as atoms.

Types

t()

@type t() :: %ROR.Name{lang: boolean(), types: [atom()], value: binary()}

Functions

extract(data)

@spec extract(data :: map()) :: [t()]

Extracts a list of Name structs from the decoded JSON of a ROR Organization record

If you are retrieving records via the ROR module and the REST API you will not need to use this function yourself.

Example

iex> record = File.read!("test/support/static/example_org.json") |> Jason.decode!()
...> ROR.Name.extract(record)
[
  %ROR.Name{lang: "en", types: [:acronym], value: "UC"},
  %ROR.Name{lang: "en", types: [:alias], value: "UC System"},
  %ROR.Name{
    lang: "en",
    types: [:ror_display, :label],
    value: "University of California System"
  },
  %ROR.Name{lang: "fr", types: [:label], value: "Université de Californie"}
]

vocab()

@spec vocab() :: [atom()]

Lists the allowed terms or types for this data structure, as atoms.