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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionFilter ¶
CollectionFilter allows any record that belongs to a collection, that is listed in Names. TODO(miku): better: MegaCollectionFilter?
func NewCollectionFilter ¶
func NewCollectionFilter(r io.Reader) (CollectionFilter, error)
func (CollectionFilter) Apply ¶
func (f CollectionFilter) Apply(is finc.IntermediateSchema) bool
Apply filter.
func (CollectionFilter) MarshalJSON ¶
func (f CollectionFilter) MarshalJSON() ([]byte, error)
MarshalJSON provides custom serialization.
type DOIFilter ¶
DOIFilter will exclude DOIs, that are listed in Set.
func NewDOIFilter ¶
TODO(miku): Simplify set filters: ISSNFilter, MegaCollectionFilter, DOIFilter, ...
func (DOIFilter) MarshalJSON ¶
MarshalJSON provides custom serialization.
type Filter ¶
type Filter interface {
Apply(finc.IntermediateSchema) bool
}
Filter wraps the decision, whether a given IntermediateSchema record should be attached or not. The decision may be based on record properties, simple ISSN lists or more involved holdings files.
type HoldingFilter ¶
HoldingFilter looks at licensing information from an OVID files. Ref is the reference date for moving wall calculations and Table contains a map from ISSNs to licenses.
func NewHoldingFilter ¶
func NewHoldingFilter(r io.Reader) (HoldingFilter, error)
NewHoldingFilter loads the holdings information for a single institution. Returns a single error, if one or more errors have been encountered.
func (HoldingFilter) Apply ¶
func (f HoldingFilter) Apply(is finc.IntermediateSchema) bool
HoldingFilter compares the (year, volume, issue) of an intermediate schema record with licensing information, including moving walls.
func (HoldingFilter) MarshalJSON ¶
func (f HoldingFilter) MarshalJSON() ([]byte, error)
MarshalJSON provides custom serialization.
type ISILTagger ¶
ISILTagger maps ISILs to one or more Filters. If any of these filters return true, the ISIL shall be attached (therefore order of the filters does not matter).
func (ISILTagger) Tags ¶
func (t ISILTagger) Tags(is finc.IntermediateSchema) []string
Tags returns all ISILs that could be attached to a given intermediate schema record. If an ISIL has multiple filters, each filter is applied in order, if any matches, the ISIL is added. TODO(miku): maybe we need order, like "attach any record, but filter out those, that contain x in field y" or attach all records where x == y, but of those ignore those, that are given in this list, etc.
type ListFilter ¶
ListFilter will include records, whose ISSN is contained in a given set. TODO(miku): The name ListFilter is much too generic for an ISSNFilter.
func NewListFilter ¶
func NewListFilter(r io.Reader) (ListFilter, error)
NewAttachByList reads one record per line from reader. Empty lines are ignored.
func (ListFilter) MarshalJSON ¶
func (f ListFilter) MarshalJSON() ([]byte, error)
MarshalJSON provides custom serialization.
type PackageFilter ¶ added in v0.1.59
DOIFilter will exclude DOIs, that are listed in Set.
func NewPackageFilter ¶ added in v0.1.59
func NewPackageFilter(r io.Reader) (PackageFilter, error)
TODO(miku): Simplify set filters: ISSNFilter, MegaCollectionFilter, DOIFilter, ...
func (PackageFilter) Apply ¶ added in v0.1.59
func (f PackageFilter) Apply(is finc.IntermediateSchema) bool
Apply filter.
func (PackageFilter) MarshalJSON ¶ added in v0.1.59
func (f PackageFilter) MarshalJSON() ([]byte, error)
MarshalJSON provides custom serialization.
type SourceFilter ¶
type SourceFilter struct {
SourceID string
}
SourceFilter allows to attach ISIL on records of a given source.
func (SourceFilter) Apply ¶
func (f SourceFilter) Apply(is finc.IntermediateSchema) bool
Apply filter.
func (SourceFilter) MarshalJSON ¶
func (f SourceFilter) MarshalJSON() ([]byte, error)
MarshalJSON provides custom serialization.