Documentation ¶
Overview ¶
Copyright 2015 by Leipzig University Library, http://ub.uni-leipzig.de The Finc Authors, http://finc.info Martin Czygan, <martin.czygan@uni-leipzig.de>
This file is part of some open source application.
Some open source application is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Some open source application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>.
@license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
Index ¶
Constants ¶
const (
// Internal bookkeeping.
SourceID = "49"
)
Variables ¶
var ( DefaultFormat = "ElectronicArticle" // Load assets Formats = assetutil.MustLoadStringMap("assets/crossref/formats.json") Genres = assetutil.MustLoadStringMap("assets/crossref/genres.json") RefTypes = assetutil.MustLoadStringMap("assets/crossref/reftypes.json") // AuthorReplacer is a special cleaner for author names. AuthorReplacer = strings.NewReplacer("#", "", "--", "", "*", "", "|", "", "&NA;", "", "\u0026NA;", "", "\u0026", "") // ArticleTitleBlocker will trigger skips, if article title matches exactly. ArticleTitleBlocker = []string{"Titelei", "Front Matter", "Advertisement", "Advertisement:"} // ArticleTitleCleanerPatterns removes matching parts. ArticleTitleCleanerPatterns = []*regexp.Regexp{ regexp.MustCompile(`[?]{6,}`), } // Future ends soon. Future = time.Now().Add(time.Hour * 24 * 365 * 2) )
Functions ¶
This section is empty.
Types ¶
type BulkResponse ¶
type BulkResponse struct { Status string `json:"status"` MessageType string `json:"message-type"` MessageVersion string `json:"message-version"` Message struct { NextCursor string `json:"next-cursor"` TotalResults int `json:"total-results"` Items []Document `json:"items"` } `json:"message"` }
BulkResponse for a bulk request containing multiple items.
type DateField ¶
type DateField struct { DateParts []DatePart `json:"date-parts"` Timestamp int64 `json:"timestamp"` }
DateField contains two representations of one value.
type DatePart ¶
type DatePart []int
DatePart consists of up to three int, representing year, month, day.
type Document ¶
type Document struct { Author []struct { Family string `json:"family"` Given string `json:"given"` } `json:"author"` ContainerTitle []string `json:"container-title"` Deposited DateField `json:"deposited"` DOI string `json:"DOI"` Indexed DateField `json:"indexed"` ISSN []string `json:"ISSN"` Issue string `json:"issue"` Issued DateField `json:"issued"` Member string `json:"member"` Page string `json:"page"` Prefix string `json:"prefix"` PublishedPrint DateField `json:"published-print"` Publisher string `json:"publisher"` ReferenceCount int `json:"reference-count"` Score float64 `json:"score"` Source string `json:"source"` Subjects []string `json:"subject"` Subtitle []string `json:"subtitle"` Title []string `json:"title"` Type string `json:"type"` URL string `json:"URL"` Volume string `json:"volume"` }
Document is a example 'works' API response - message part only.
func (*Document) CombinedTitle ¶
CombinedTitle returns a longish title.
func (*Document) ID ¶
ID is of the form <kind>-<source-id>-<id-base64-unpadded> We simple map any primary key of the source (preferably a URL) to a safer alphabet. Since the base64 part is not meant to be decoded we drop the padding. It is simple enough to recover the original value.
func (*Document) PageInfo ¶
PageInfo parses a page specfication in a best effort manner into a PageInfo struct.
func (*Document) ShortTitle ¶
ShortTitle returns the first main title only.
func (*Document) ToIntermediateSchema ¶
func (doc *Document) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema converts a crossref document into IS.