Documentation ¶
Index ¶
- func ParseData(container DataContainer, out chan Crossref) error
- type Affiliation
- type Author
- type ContentDomain
- type Crossref
- type DataContainer
- type DateParts
- type Format
- type Indexed
- type IssnType
- type JournalIssue
- type License
- type Link
- type Primary
- type Reference
- type Relation
- type Resource
- type SimplifiedPublication
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseData ¶
func ParseData(container DataContainer, out chan Crossref) error
ParseData reads the data described in the container and passes it via the out channel
Types ¶
type Affiliation ¶
type Affiliation struct {
Name string `json:"name"`
}
type Author ¶
type Author struct { Given *string `json:"given"` Family *string `json:"family"` Sequence *string `json:"sequence"` Affiliation *[]Affiliation `json:"affiliation"` }
type ContentDomain ¶
type Crossref ¶
type Crossref struct { Abstract *string `json:"abstract"` // Gap Author []Author `json:"author"` ContainerTitle []string `json:"container-title"` ContentDomain ContentDomain `json:"content-domain"` Created Indexed `json:"created"` Deposited Indexed `json:"deposited"` Doi string `json:"DOI"` Indexed Indexed `json:"indexed"` IsReferencedByCount int `json:"is-referenced-by-count"` Issn []string `json:"ISSN"` IssnType []IssnType `json:"issn-type"` Issue string `json:"issue"` Issued DateParts `json:"issued"` JournalIssue *JournalIssue `json:"journal-issue"` // Gap Language *string `json:"language"` // Gap Link *[]Link `json:"link"` // Gap Member string `json:"member"` OriginalTitle *[]any `json:"original-title"` // 2021 Page string `json:"page"` Prefix string `json:"prefix"` Published *DateParts `json:"published"` // Gap PublishedOnline *DateParts `json:"published-online"` // Gap PublishedOther *DateParts `json:"published-other"` // Gap PublishedPrint *DateParts `json:"published-print"` Publisher string `json:"publisher"` Reference *[]Reference `json:"reference"` // Gap ReferenceCount int `json:"reference-count"` ReferencesCount int `json:"references-count"` Relation *Relation `json:"relation"` // 2021 Resource Resource `json:"resource"` Score float64 `json:"score"` ShortContainerTitle *[]string `json:"short-container-title"` // 2021 ShortTitle *[]any `json:"short-title"` // 2021 Source string `json:"source"` Subject []string `json:"subject"` Subtitle *[]any `json:"subtitle"` // 2021 Title []string `json:"title"` Type string `json:"type"` URL string `json:"URL"` UpdatePolicy *string `json:"update-policy"` // Gap Volume string `json:"volume"` License []License `json:"license"` AlternativeID []string `json:"alternative-id"` }
Reference and value semantics reflect required and optional value in json
type DataContainer ¶
type DataContainer struct { Data io.Reader // The data to index if passed by stdin or similar Path string // Path to the file to read Format Format // Format of the file, either "json" or "ndjson" Compression string // The kind of compression. Currently only supports "none" or "gzip" }
func Load ¶
func Load( logger *zap.SugaredLogger, path, dir string, format Format, compression string, data io.Reader, ) ([]DataContainer, error)
Load structures the data that should be indexed. It returns a slice of items to be processed.
func (*DataContainer) Valid ¶
func (d *DataContainer) Valid() error
type JournalIssue ¶
type Reference ¶
type Reference struct { Key string `json:"key"` VolumeTitle string `json:"volume-title,omitempty"` Author string `json:"author"` Year string `json:"year"` FirstPage string `json:"first-page,omitempty"` ArticleTitle string `json:"article-title,omitempty"` DoiAssertedBy string `json:"doi-asserted-by,omitempty"` Doi string `json:"DOI,omitempty"` Volume string `json:"volume,omitempty"` JournalTitle string `json:"journal-title,omitempty"` Issue string `json:"issue,omitempty"` Unstructured *string `json:"unstructured,omitempty"` }
type SimplifiedPublication ¶
type SimplifiedPublication struct { Title []string `json:"title"` DOI string `json:"DOI"` FirstPage string `json:"first_page"` Journal []string `json:"journal"` AbbreviatedJournal []string `json:"abbreviated_journal"` Volume string `json:"volume"` Issue string `json:"issue"` Year int `json:"year"` Bibliographic string `json:"bibliographic"` }
func ToSimplifiedPublication ¶
func ToSimplifiedPublication(pub *Crossref) SimplifiedPublication
Click to show internal directories.
Click to hide internal directories.