jsonfeed

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package jsonfeed converts JSON Feed metadata to/from the commonmeta metadata format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch added in v0.2.14

func Fetch(str string) (commonmeta.Data, error)

Fetch fetches JSON Feed metadata and returns Commonmeta metadata.

func FetchAll added in v0.6.73

func FetchAll(number int, page int, community string, archived bool) ([]commonmeta.Data, error)

FetchAll fetches a list of JSON Feed metadata and returns Commonmeta metadata.

func GetContributors added in v0.2.14

func GetContributors(contrib Authors) ([]commonmeta.Contributor, error)

func GetFundingReferences added in v0.2.14

func GetFundingReferences(content Content) []commonmeta.FundingReference

GetFundingReferences returns the funding references from the JSON Feed metadata. Either provided by the blog metadata or via HasAward relationships

func Load added in v0.2.14

func Load(filename string) (commonmeta.Data, error)

Load loads the metadata for a single work from a JSON file

func LoadAll added in v0.2.14

func LoadAll(filename string) ([]commonmeta.Data, error)

LoadAll loads the metadata for a list of works from a JSON file and converts it to the Commonmeta format

func QueryURL added in v0.6.73

func QueryURL(number int, page int, community string, archived bool) string

QueryURL returns the URL for the Rogue Scholar API query

func Read added in v0.2.1

func Read(content Content) (commonmeta.Data, error)

Read reads JSON Feed metadata and converts it into Commonmeta metadata.

func ReadAll added in v0.2.14

func ReadAll(content []Content) ([]commonmeta.Data, error)

ReadAll reads a list of JSON Feed responses and returns a list of works in Commonmeta format

Types

type Affiliation added in v0.2.14

type Affiliation struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Affiliation represents an affiliation in the JSON Feed item.

type Authors added in v0.2.14

type Authors []struct {
	Given       string        `json:"given"`
	Family      string        `json:"family"`
	Name        string        `json:"name"`
	URL         string        `json:"url"`
	Affiliation []Affiliation `json:"affiliation"`
}

Authors represents the authors in the JSON Feed item.

type Blog added in v0.2.14

type Blog struct {
	ID          string           `json:"id"`
	Category    string           `json:"category"`
	Description string           `json:"description"`
	Favicon     string           `json:"favicon"`
	Funding     FundingReference `json:"funding"`
	Generator   string           `json:"generator"`
	HomePageURL string           `json:"home_page_url"`
	ISSN        string           `json:"issn"`
	Language    string           `json:"language"`
	License     string           `json:"license"`
	Prefix      string           `json:"prefix"`
	Slug        string           `json:"slug"`
	Status      string           `json:"status"`
	Title       string           `json:"title"`
	DOIReg      bool             `json:"doi_reg"`
}

type Content

type Content struct {
	ID                string             `json:"id"`
	DOI               string             `json:"doi"`
	GUID              string             `json:"guid"`
	RID               string             `json:"rid"`
	Abstract          string             `json:"abstract"`
	ArchiveURL        string             `json:"archive_url"`
	Authors           Authors            `json:"authors"`
	Blog              Blog               `json:"blog"`
	BlogName          string             `json:"blog_name"`
	BlogSlug          string             `json:"blog_slug"`
	ContentHTML       string             `json:"content_html"`
	FeatureImage      string             `json:"image"`
	IndexedAt         int64              `json:"indexed_at"`
	Language          string             `json:"language"`
	PublishedAt       int64              `json:"published_at"`
	Relationships     []Relation         `json:"relationships"`
	Reference         []Reference        `json:"reference"`
	FundingReferences []FundingReference `json:"funding_references"`
	Summary           string             `json:"summary"`
	Tags              []string           `json:"tags"`
	Title             string             `json:"title"`
	UpdatedAt         int64              `json:"updated_at"`
	URL               string             `json:"url"`
	Version           string             `json:"version"`
}

Content represents the JSON Feed metadata.

func Get added in v0.2.1

func Get(id string) (Content, error)

Get retrieves JSON Feed metadata.

func GetAll added in v0.6.73

func GetAll(number int, page int, community string, archived bool) ([]Content, error)

GetAll retrieves JSON Feed metadata for all records in a community.

type FundingReference added in v0.13.0

type FundingReference struct {
	FunderIdentifier     string `json:"funderIdentifier,omitempty"`
	FunderIdentifierType string `json:"funderIdentifierType,omitempty"`
	FunderName           string `json:"funderName,omitempty"`
	AwardNumber          string `json:"awardNumber,omitempty"`
	AwardTitle           string `json:"awardTitle,omitempty"`
	AwardURI             string `json:"awardUri,omitempty"`
}

FundingReference represents the funding reference of a publication, defined in the commonmeta JSON Schema.

type Query added in v0.6.73

type Query struct {
	Items        []Content `json:"items"`
	TotalResults int       `json:"total-results"`
}

Query represents the InvenioRDM JSON API query.

type Reference added in v0.2.14

type Reference struct {
	Key          string `json:"key,omitempty"`
	ID           string `json:"id,omitempty"`
	Type         string `json:"type,omitempty"`
	Unstructured string `json:"unstructured,omitempty"`
}

Reference represents a reference in the JSON Feed item.

type Relation added in v0.2.14

type Relation struct {
	Type string   `json:"type"`
	Urls []string `json:"urls"`
}

Relation represents a relation in the JSON Feed item.

Jump to

Keyboard shortcuts

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