jsonfeed

package
v0.6.24 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var FOSKeyMappings = map[string]string{
	"naturalSciences":                          "Natural sciences",
	"mathematics":                              "Mathematics",
	"computerAndInformationSciences":           "Computer and information sciences",
	"physicalSciences":                         "Physical sciences",
	"chemicalSciences":                         "Chemical sciences",
	"earthAndRelatedEnvironmentalSciences":     "Earth and related environmental sciences",
	"biologicalSciences":                       "Biological sciences",
	"otherNaturalSciences":                     "Other natural sciences",
	"engineeringAndTechnology":                 "Engineering and technology",
	"civilEngineering":                         "Civil engineering",
	"electricalEngineering":                    "Electrical engineering, electronic engineering, information engineering",
	"mechanicalEngineering":                    "Mechanical engineering",
	"chemicalEngineering":                      "Chemical engineering",
	"materialsEngineering":                     "Materials engineering",
	"medicalEngineering":                       "Medical engineering",
	"environmentalEngineering":                 "Environmental engineering",
	"environmentalBiotechnology":               "Environmental biotechnology",
	"industrialBiotechnology":                  "Industrial biotechnology",
	"nanoTechnology":                           "Nano technology",
	"otherEngineeringAndTechnologies":          "Other engineering and technologies",
	"medicalAndHealthSciences":                 "Medical and health sciences",
	"basicMedicine":                            "Basic medicine",
	"clinicalMedicine":                         "Clinical medicine",
	"healthSciences":                           "Health sciences",
	"healthBiotechnology":                      "Health biotechnology",
	"otherMedicalSciences":                     "Other medical sciences",
	"agriculturalSciences":                     "Agricultural sciences",
	"agricultureForestryAndFisheries":          "Agriculture, forestry, and fisheries",
	"animalAndDairyScience":                    "Animal and dairy science",
	"veterinaryScience":                        "Veterinary science",
	"agriculturalBiotechnology":                "Agricultural biotechnology",
	"otherAgriculturalSciences":                "Other agricultural sciences",
	"socialScience":                            "Social science",
	"psychology":                               "Psychology",
	"economicsAndBusiness":                     "Economics and business",
	"educationalSciences":                      "Educational sciences",
	"sociology":                                "Sociology",
	"law":                                      "Law",
	"politicalScience":                         "Political science",
	"socialAndEconomicGeography":               "Social and economic geography",
	"mediaAndCommunications":                   "Media and communications",
	"otherSocialSciences":                      "Other social sciences",
	"humanities":                               "Humanities",
	"historyAndArchaeology":                    "History and archaeology",
	"languagesAndLiterature":                   "Languages and literature",
	"philosophyEthicsAndReligion":              "Philosophy, ethics and religion",
	"artsArtsHistoryOfArtsPerformingArtsMusic": "Arts (arts, history of arts, performing arts, music)",
	"otherHumanities":                          "Other humanities",
}

FOSKeyMappings maps OECD FOS keys to OECD FOS strings

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 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 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 {
	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     Funding `json:"funding"`
	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"`
}

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"`
	ContentText   string      `json:"content_text"`
	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"`
	Summary       string      `json:"summary"`
	Title         string      `json:"title"`
	UpdatedAt     int64       `json:"updated_at"`
	URL           string      `json:"url"`
}

Content represents the JSON Feed metadata.

func Get added in v0.2.1

func Get(id string) (Content, error)

Get retrieves JSON Feed metadata.

type Funding added in v0.2.14

type Funding struct {
	AwardNumber string `json:"award_number"`
	AwardURI    string `json:"award_uri"`
	FunderID    string `json:"funder_id"`
	FunderName  string `json:"funder_name"`
}

type Reference added in v0.2.14

type Reference struct {
	Key             string `json:"key"`
	ID              string `json:"id"`
	PublicationYear string `json:"publicationYear"`
	Title           string `json:"title"`
}

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