doaj

package
v0.1.268 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

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

View Source
const (
	SourceIdentifier = "28"
	Collection       = "DOAJ Directory of Open Access Journals"
	Format           = "ElectronicArticle"
	Genre            = "article" // Default ris.type
	DefaultRefType   = "EJOUR"
)

Variables

View Source
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) Authors added in v0.1.256

func (doc ArticleV1) Authors() (authors []finc.Author)

Authors returns a list of authors.

func (ArticleV1) DOI added in v0.1.256

func (doc ArticleV1) DOI() string

DOI returns the DOI or the empty string.

func (ArticleV1) Date added in v0.1.256

func (doc ArticleV1) Date() (time.Time, error)

Date return the document date.

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) Authors

func (doc Document) Authors() (authors []finc.Author)

Authors returns a list of authors.

func (Document) DOI

func (doc Document) DOI() string

DOI returns the DOI or the empty string.

func (Document) Date

func (doc Document) Date() (time.Time, error)

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 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.

Jump to

Keyboard shortcuts

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