etl

package
v0.0.0-...-0d6871a Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Overview

package etl

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorporationFromAuthority

func CorporationFromAuthority(rec marc.Record) (sirkulator.Resource, error)

func PersonFromAuthority

func PersonFromAuthority(rec marc.Record) (sirkulator.Resource, error)

Types

type FileFetch

type FileFetch struct {
	ResourceID string
	URL        string
}

type HarvestNBLinksJob

type HarvestNBLinksJob struct {
	DB *sqlitex.Pool
}

func (*HarvestNBLinksJob) Name

func (h *HarvestNBLinksJob) Name() string

func (*HarvestNBLinksJob) Run

type HarvestSNLDescriptions

type HarvestSNLDescriptions struct {
	DB *sqlitex.Pool
}

func (*HarvestSNLDescriptions) Name

func (h *HarvestSNLDescriptions) Name() string

func (*HarvestSNLDescriptions) Run

type HarvestSNLLinksJob

type HarvestSNLLinksJob struct {
	DB *sqlitex.Pool
}

func (*HarvestSNLLinksJob) Name

func (h *HarvestSNLLinksJob) Name() string

func (*HarvestSNLLinksJob) Run

type HarvestWikipediaLinks struct {
	DB *sqlitex.Pool
}

func (*HarvestWikipediaLinks) Name

func (h *HarvestWikipediaLinks) Name() string

func (*HarvestWikipediaLinks) Run

type HarvestWikipediaSummaries

type HarvestWikipediaSummaries struct {
	DB *sqlitex.Pool
}

func (*HarvestWikipediaSummaries) Name

func (*HarvestWikipediaSummaries) Run

type ImportEntry

type ImportEntry struct {
	Source    string // bibsys, openlibrary, discogs etc
	Exists    bool   // allready in local DB
	Error     string // not found, unable to map to local metadata, insuficcient data etc
	Resources []sirkulator.SimpleResource
}

type Ingestion

type Ingestion struct {
	Resources []sirkulator.Resource
	Relations []sirkulator.Relation
	Covers    []FileFetch
}

type Ingestor

type Ingestor struct {

	// Options
	UseRemote     bool // if true, use external sources in additin to local
	ImageDownload bool // if true, download images found in imported records
	ImageAsync    bool // if true, download images after IngestISBN has returned
	ImageWidth    int  // scale to this with, calculating width to preserve aspect ratio
	// contains filtered or unexported fields
}

func NewIngestor

func NewIngestor(db *sqlitex.Pool, idx *search.Index) *Ingestor

func NewPreviewIngestor

func NewPreviewIngestor(db *sqlitex.Pool) *Ingestor

func (*Ingestor) Ingest

func (ig *Ingestor) Ingest(ctx context.Context, data Ingestion, persist bool) ([]sirkulator.SimpleResource, error)

Ingest will merge the ingestion with locally matching resources before storing the data to db and trigger indexing of documents. if persist=false, nothing is persisted, and the returnet results represents a preview of which resources would have been stored if persist=true.

func (*Ingestor) IngestISBN

func (ig *Ingestor) IngestISBN(ctx context.Context, id string, persist bool) ImportEntry

IngestISBN will try to ingest a publication and related resources given an ISBN-number, optionally persisting it to DB. TODO refactor to remove duplication

type UpdateSNLDescriptions

type UpdateSNLDescriptions struct {
	DB *sqlitex.Pool
}

func (*UpdateSNLDescriptions) Name

func (u *UpdateSNLDescriptions) Name() string

func (*UpdateSNLDescriptions) Run

Jump to

Keyboard shortcuts

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