ror

package
v0.17.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ror converts ROR (Research Organization Registry) metadata.

Index

Constants

This section is empty.

Variables

View Source
var RORVersions = map[string]string{
	"v1.50": "2024-07-29",
	"v1.51": "2024-08-21",
	"v1.52": "2024-09-16",
	"v1.53": "2023-10-14",
	"v1.54": "2024-10-21",
	"v1.55": "2024-10-31",
	"v1.56": "2024-11-19",
	"v1.58": "2024-12-11",
	"v1.59": "2025-01-23",
	"v1.60": "2025-02-27",
	"v1.61": "2025-03-18",
	"v1.62": "2025-03-27",
	"v1.63": "2025-04-03",
}

RORVersions contains the ROR versions and their release dates, published on Zenodo. The ROR version is the first part of the filename, e.g., v1.63-2025-04-03-ror-data_schema_v2.json Beginning with release v1.45 on 11 April 2024, data releases contain JSON and CSV files formatted according to both schema v1 and schema v2. Version 2 files have _schema_v2 appended to the end of the filename, e.g., v1.45-2024-04-11-ror-data_schema_v2.json.

Functions

func ExtractAll added in v0.17.1

func ExtractAll(content []commonmeta.Data) ([]byte, error)

ExtractAll extracts ROR metadata from a JSON file in commonmeta format.

func Write

func Write(data ROR) ([]byte, error)

Write writes ROR metadata to InvenioRDM YAML format.

func WriteAll

func WriteAll(list []ROR, to string) ([]byte, error)

WriteAll writes a list of ROR metadata in InvenioRDM YAML format.

Types

type Content

type Content struct {
	*ROR
	Locations     []Location     `json:"locations"`
	Established   int            `json:"established"`
	ExternalIDs   []ExternalID   `json:"external_ids"`
	Links         []Link         `json:"links"`
	Relationships []Relationship `json:"relationships"`
	Status        string         `json:"status"`
	Types         []string       `json:"types"`
}

Content represents the full ROR metadata record.

type ExternalID

type ExternalID struct {
	Type      string   `json:"type"`
	All       []string `json:"all"`
	Preferred string   `json:"preferred"`
}

type GeonamesDetails

type GeonamesDetails struct {
	ContinentCode          string  `json:"continent_code"`
	ContinentName          string  `json:"continent_name"`
	CountryCode            string  `json:"country_code"`
	CountryName            string  `json:"country_name"`
	CountrySubdivisionCode string  `json:"country_subdivision_code"`
	CountrySubdivisionName string  `json:"country_subdivision_name"`
	Lat                    float64 `json:"lat"`
	Lng                    float64 `json:"lng"`
	Name                   string  `json:"name"`
}

type Identifier

type Identifier struct {
	Identifier string `json:"identifier"`
	Scheme     string `json:"scheme"`
}

type InvenioRDM

type InvenioRDM struct {
	ID          string       `json:"id"`
	Identifiers []Identifier `json:"identifiers"`
	Name        string       `json:"name"`
}

InvenioRDM represents the ROR metadata record in InvenioRDM format.

func Convert

func Convert(data ROR) (InvenioRDM, error)

Convert converts ROR metadata into InvenioRDM format.

type Link struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type Location

type Location struct {
	GeonamesID      int             `json:"geonames_id"`
	GeonamesDetails GeonamesDetails `json:"geonames_details"`
}

type Name

type Name struct {
	Value string   `json:"value"`
	Types []string `json:"types"`
	Lang  string   `json:"lang"`
}

type ROR

type ROR struct {
	ID    string `json:"id"`
	Names []Name `json:"names"`
	Admin struct {
		Created struct {
			Date          string `json:"date"`
			SchemaVersion string `json:"schema_version"`
		} `json:"created"`
		LastModified struct {
			Date          string `json:"date"`
			SchemaVersion string `json:"schema_version"`
		} `json:"last_modified"`
	}
}

ROR represents the minimal ROR metadata record.

func LoadAll

func LoadAll(filename string) ([]ROR, error)

LoadAll loads the metadata for a list of organizations from a ROR JSON file

func Read

func Read(content Content) (ROR, error)

Read reads ROR full metadata and converts it into ROR minimal metadata.

func ReadAll

func ReadAll(content []Content) ([]ROR, error)

ReadAll reads a list of ROR JSON organizations

type Relationship

type Relationship struct {
	Type  string `json:"type"`
	Label string `json:"label"`
	ID    string `json:"id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL