dataset

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataSetNotFound = errors.New("dataset not found")
)

Functions

This section is empty.

Types

type Access

type Access struct {
	OAIPMH bool `json:"oaipmh"`
	Search bool `json:"search"`
	LOD    bool `json:"lod"`
}

Access determines which types of access are enabled for this dataset

type DaoStats

type DaoStats struct {
	ExtractedLinks uint64         `json:"extractedLinks"`
	RetrieveErrors uint64         `json:"retrieveErrors"`
	DigitalObjects uint64         `json:"digitalObjects"`
	Errors         []string       `json:"errors"`
	UniqueLinks    uint64         `json:"uniqueLinks"`
	DuplicateLinks map[string]int `json:"duplicateLinks"`
}

DaoStats holds the stats for EAD digital objects extracted from METS links.

type DataSet

type DataSet struct {
	OrgID            string    `json:"orgID"`
	Spec             string    `json:"spec" storm:"id,index,unique"`
	URI              string    `json:"uri" storm:"unique"`
	Revision         int       `json:"revision"` // revision is used to mark the latest version of ingested RDFRecords
	FragmentRevision int       `json:"fragmentRevision"`
	Modified         time.Time `json:"modified" storm:"index"`
	Created          time.Time `json:"created"`
	Deleted          bool      `json:"deleted"`
	Tags             []string  `json:"tags"`
	RecordType       string    `json:"recordType"`
	Owner            string    `json:"owner"`
	Access           `json:"access" storm:"inline"`
	EAD              `json:"ead" storm:"inline"`
}

DataSet contains all the known informantion for a hub3 metadata dataset

func NewDataset

func NewDataset(org *domain.Organization, spec string) DataSet

NewDataset creates a new instance of a DataSet

type DataSetCounter

type DataSetCounter struct {
	Value    string `json:"value"`
	DocCount int    `json:"docCount"`
}

DataSetCounter holds value counters for statistics overviews

type DataSetRevisions

type DataSetRevisions struct {
	Number      int `json:"revisionNumber"`
	RecordCount int `json:"recordCount"`
}

DataSetRevisions holds the type-frequency data for each revision

type DataSetStats

type DataSetStats struct {
	Spec                      string `json:"spec"`
	CurrentRevision           int    `json:"currentRevision"`
	IndexStats                `json:"index"`
	RDFStoreStats             `json:"rdfStore"`
	LODFragmentStats          `json:"lodFragmentStats"`
	DaoStats                  `json:"daoStats"`
	WebResourceStats          `json:"webResourceStats"`
	NarthexStats              `json:"narthexStats"`
	VocabularyEnrichmentStats `json:"vocabularyEnrichmentStats"`
}

DataSetStats holds all gather statistics for a DataSet

type EAD

type EAD struct {
	Abstract       []string `json:"abstract"`
	ArchiveCreator []string `json:"archiveCreator"`
	Clevels        int      `json:"clevels"`
	DaoStats       `json:"daoStats" storm:"inline"`
	Description    string   `json:"description"`
	Files          string   `json:"files"`
	Fingerprint    string   `json:"fingerPrint"`
	Label          string   `json:"label"`
	Language       string   `json:"language"`
	Length         string   `json:"length"`
	Material       string   `json:"material"`
	MetsFiles      int      `json:"metsFiles"`
	Period         []string `json:"period"`
}

type IndexStats

type IndexStats struct {
	Enabled        bool               `json:"enabled"`
	Revisions      []DataSetRevisions `json:"revisions"`
	IndexedRecords int                `json:"indexedRecords"`
	Tags           []DataSetCounter   `json:"tags"`
	ContentTags    []DataSetCounter   `json:"contentTags"`
}

IndexStats hold all Index Statistics for this dataset

type LODFragmentStats

type LODFragmentStats struct {
	Enabled         bool               `json:"enabled"`
	Revisions       []DataSetRevisions `json:"revisions"`
	StoredFragments int                `json:"storedFragments"`
	DataType        []DataSetCounter   `json:"dataType"`
	Language        []DataSetCounter   `json:"language"`
	Tags            []DataSetCounter   `json:"tags"`
}

LODFragmentStats hold all the LODFragment stats for this dataset

type NarthexStats

type NarthexStats struct {
	Enabled        bool `json:"enabled"`
	SourceRecords  int  `json:"sourceRecords"`
	ValidRecords   int  `json:"validRecords"`
	InvalidRecords int  `json:"invalidRecords"`
}

NarthexStats gathers all the record statistics from Narthex

type Option

type Option func(*Service) error

type RDFStoreStats

type RDFStoreStats struct {
	Revisions    []DataSetRevisions `json:"revisions"`
	StoredGraphs int                `json:"storedGraphs"`
	Enabled      bool               `json:"enabled"`
}

RDFStoreStats hold all the RDFStore Statistics for this dataset

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(options ...Option) (*Service, error)

func (*Service) CreateDataSetStats

func (s *Service) CreateDataSetStats(ctx context.Context, orgID, datasetID string) error

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, ds *DataSet) error

Delete removes the DataSet from the DataSet storage

TODO(kiivihal): make sure delete also removes the dataset from all underlying storage

func (*Service) DropResources

func (s *Service) DropResources(ctx context.Context, datasetID string) error

func (*Service) GetDataSet

func (s *Service) GetDataSet(ctx context.Context, orgID, datasetID string) (*DataSet, error)

GetDataSet returns a DataSet from the store. An ErrDataSetNotFound error is returned when no DataSet is found.

func (*Service) GetOrCreateDataSet

func (s *Service) GetOrCreateDataSet(ctx context.Context, orgID, datasetID string) (*DataSet, bool, error)

GetOrCreateDataSet returns a DataSet or creates one if it is not found in the store.

func (*Service) List

func (s *Service) List(ctx context.Context) ([]*DataSet, error)

List returns a DataSet list

TODO(kiivihal): add filter and pagination options later

func (*Service) Save

func (s *Service) Save(ctx context.Context, ds *DataSet) error

Save stored the DataSet in the storage.

The underlying storage returns an error when the DataSet cannot be saved.

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

type Store

type Store interface {
	// Delete a DataSet
	Delete(ctx context.Context, ds *DataSet) error
	// List all datasets
	List(ctx context.Context) ([]*DataSet, error)
	// Get one dataset
	One(ctx context.Context, orgID, datasetID string) (*DataSet, error)
	// delete all records
	Reset(ctx context.Context) error
	// Save a DataSet
	Save(ctx context.Context, ds *DataSet) error
	// TODO(kiivihal): decide on update field
	Shutdown(ctx context.Context) error
}

type VocabularyEnrichmentStats

type VocabularyEnrichmentStats struct {
	LiteralFields        []string `json:"literalFields"`
	TotalConceptsMapped  int      `json:"totalConceptsMapped"`
	UniqueConceptsMapped int      `json:"uniqueConceptsMapped"`
	VocabularyLinked     []string `json:"vocabularyLinked"`
}

VocabularyEnrichmentStats gathers all counters for the SKOS based enrichment

type WebResourceStats

type WebResourceStats struct {
	Enabled           bool `json:"enabled"`
	SourceItems       int  `json:"sourceItems"`
	ThumbnailsCreated int  `json:"thumbnailsCreated"`
	DeepZoomsCreated  int  `json:"deepZoomsCreated"`
	Missing           int  `json:"missing"`
}

WebResourceStats gathers all the MediaManager information for this DataSet

Jump to

Keyboard shortcuts

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