Documentation
¶
Overview ¶
Package doaj maps DOAJ metadata to intermediate schema.
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
- Variables
- type ArticleV1
- type BibJSON
- type Document
- type Index
- type Record
- func (record Record) Authors() (authors []finc.Author)
- func (record Record) DOI() string
- func (record Record) Date() (time.Time, error)
- func (record Record) EndPage() string
- func (record Record) ISSN() (issn []string)
- func (record Record) Identifier() string
- func (record Record) Issue() string
- func (record Record) JournalTitle() string
- func (record Record) Links() (links []string)
- func (record Record) Pages() string
- func (record Record) StartPage() string
- func (record Record) Subjects() []string
- func (record Record) ToIntermediateSchema() (*finc.IntermediateSchema, error)
- func (record Record) Volume() string
- type Response
Constants ¶
const ( SourceIdentifier = "28" Collection = "DOAJ Directory of Open Access Journals" Format = "ElectronicArticle" Genre = "article" // Default ris.type DefaultRefType = "EJOUR" )
Variables ¶
var ( LCCPatterns = assetutil.MustLoadRegexpMap("assets/finc/lcc.json") LanguageMap = assetutil.MustLoadStringMap("assets/doaj/language-iso-639-3.json") DOIPattern = regexp.MustCompile(`10[.][a-zA-Z0-9]+/[\S]*$`) )
Functions ¶
This section is empty.
Types ¶
type ArticleV1 ¶ added in v0.1.256
type ArticleV1 struct {
Bibjson struct {
Abstract string `json:"abstract"`
Author []struct {
Name string `json:"name"`
} `json:"author"`
EndPage string `json:"end_page"`
Identifier []struct {
Id string `json:"id"`
Type string `json:"type"`
} `json:"identifier"`
Journal struct {
Country string `json:"country"`
Issns []string `json:"issns"`
Language []string `json:"language"`
License []struct {
OpenAccess bool `json:"open_access"`
Title string `json:"title"`
Type string `json:"type"`
Url string `json:"url"`
} `json:"license"`
Number string `json:"number"`
Publisher string `json:"publisher"`
Title string `json:"title"`
Volume string `json:"volume"`
} `json:"journal"`
Keywords []string `json:"keywords"`
Link []struct {
Type string `json:"type"`
Url string `json:"url"`
} `json:"link"`
Month string `json:"month"`
StartPage string `json:"start_page"`
Subject []struct {
Code string `json:"code"`
Scheme string `json:"scheme"`
Term string `json:"term"`
} `json:"subject"`
Title string `json:"title"`
Year string `json:"year"`
} `json:"bibjson"`
CreatedDate string `json:"created_date"`
Id string `json:"id"`
LastUpdated string `json:"last_updated"`
}
ArticleV1 represents an API v1 response.
func (ArticleV1) ToIntermediateSchema ¶ added in v0.1.256
func (doc ArticleV1) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema converts a doaj document to intermediate schema. For now any record, that has no usable date will be skipped.
type BibJSON ¶
type BibJSON struct {
Abstract string `json:"abstract"`
Author []struct {
Name string `json:"name"`
} `json:"author"`
EndPage string `json:"end_page"`
Identifier []struct {
ID string `json:"id"`
Type string `json:"type"`
} `json:"identifier"`
Journal struct {
Country string `json:"country"`
Language []string `json:"language"`
License []struct {
Title string `json:"title"`
Type string `json:"type"`
OpenAccess bool `json:"open_access"`
URL string `json:"url"`
} `json:"license"`
Number string `json:"number"`
Publisher string `json:"publisher"`
Title string `json:"title"`
Volume string `json:"volume"`
} `json:"journal"`
Link []struct {
Type string `json:"type"`
URL string `json:"url"`
} `json:"link"`
Month string `json:"month"`
StartPage string `json:"start_page"`
Subject []struct {
Code string `json:"code"`
Scheme string `json:"scheme"`
Term string `json:"term"`
} `json:"subject"`
Title string `json:"title"`
Year string `json:"year"`
}
BibJSON contains bibliographic data.
type Document ¶
type Document struct {
BibJSON BibJSON `json:"bibjson"`
Created string `json:"created_date"`
ID string `json:"id"`
Index Index `json:"index"`
Updated string `json:"last_updated"`
Type string // make Response.Type available here
}
Document metadata.
func (Document) Date ¶
Date return the document date. Journals entries usually have no date, so they will err.
func (Document) ToIntermediateSchema ¶
func (doc Document) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema converts a doaj document to intermediate schema. For now any record, that has no usable date will be skipped.
type Index ¶
type Index struct {
Classification []string `json:"classification"`
Country string `json:"country"`
Date string `json:"date"`
ISSN []string `json:"issn"`
Language []string `json:"language"`
License []string `json:"license"`
SchemaCode []string `json:"schema_code"`
SchemaSubjects []string `json:"schema_subjects"`
Subjects []string `json:"subject"`
}
Index metadata.
type Record ¶ added in v0.1.284
type Record struct {
XMLName xml.Name `xml:"record"`
Text string `xml:",chardata"`
Header struct {
Text string `xml:",chardata"`
Status string `xml:"status,attr"`
Identifier string `xml:"identifier"` // oai:doaj.org/article:72a8...
Datestamp string `xml:"datestamp"` // 2017-12-31T23:00:18Z, 201...
SetSpec []string `xml:"setSpec"` // TENDOk1lZGljYWwgcGh5c2ljc...
} `xml:"header"`
Metadata struct {
Text string `xml:",chardata"`
Dc struct {
Text string `xml:",chardata"`
SchemaLocation string `xml:"schemaLocation,attr"`
Title string `xml:"title"` // Diffusion Tensor Metric M...
Identifier []string `xml:"identifier"` // 1178-623X, 10.4137/MRI.S1...
Date string `xml:"date"` // 2012-01-01T00:00:00Z, 201...
Relation []string `xml:"relation"` // https://doi.org/10.4137/M...
Description string `xml:"description"` // MRI and Monte Carlo simul...
Creator []string `xml:"creator"` // Jonathan D. Thiessen, Tre...
Publisher string `xml:"publisher"` // SAGE Publishing, Tripoli ...
Type string `xml:"type"` // article
Subject []struct {
Text string `xml:",chardata"` // Medical physics. Medical ...
Type string `xml:"type,attr"`
} `xml:"subject"`
Language []string `xml:"language"` // EN
Provenance string `xml:"provenance"` // Journal Licence: CC BY-NC...
Source string `xml:"source"` // Magnetic Resonance Insigh...
} `xml:"dc"`
} `xml:"metadata"`
About string `xml:"about"`
}
Record was generated 2019-03-07 22:40:57 by tir on hayiti.
func (Record) Identifier ¶ added in v0.1.284
Identifier returns the DOAJ identifier, e.g. ce5cbc9701d14155b0b9a45373027d67.
func (Record) JournalTitle ¶ added in v0.1.284
JournalTitle returns journal title.
func (Record) Links ¶ added in v0.1.284
Links returns any URL associated with this record. There are more links in the dataset, just use the DOI for now, refs #8709, #6634.
func (Record) Subjects ¶ added in v0.1.284
Subjects returns a mapped (https://git.io/fjesG) list of LCSH subjects.
func (Record) ToIntermediateSchema ¶ added in v0.1.284
func (record Record) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema converts OAI record to intermediate schema.
func (Record) Volume ¶ added in v0.1.284
Volume parses volume from dc:source, https://git.io/fjekV.
type Response ¶
type Response struct {
ID string `json:"_id"`
Index string `json:"_index"`
Source Document `json:"_source"`
Type string `json:"_type"`
}
Response from elasticsearch.
func (*Response) ToIntermediateSchema ¶
func (resp *Response) ToIntermediateSchema() (*finc.IntermediateSchema, error)
ToIntermediateSchema returns an intermediate schema from a DOAJ elasticsearch response.