ror

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ror converts ROR (Research Organization Registry) metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

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

Write writes ROR metadata to InvenioRDM YAML format.

func WriteAll

func WriteAll(list []ROR, input string) (string, error)

WriteAll writes a list of ROR metadata to 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"`
	Admin         struct {
		Created struct {
			Date          string `json:"date"`
			SchemaVersion string `json:"schema_version"`
		}
		LastModified struct {
			Date          string `json:"date"`
			SchemaVersion string `json:"schema_version"`
		}
	}
}

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

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