Documentation ¶
Index ¶
- Variables
- func AskSPARQL(orgID, query string) (bool, error)
- func CloseStorm()
- func CountGraphsBySpec(orgID, spec string) (int, error)
- func DeleteAllGraphsBySpec(orgID, spec string) (bool, error)
- func DeleteDataSet(orgID, spec string, ctx context.Context) error
- func DeleteGraphsOrphansBySpec(orgID, spec string, revision int) (bool, error)
- func NewDataSetHistogram(orgID string) ([]*elastic.AggregationBucketHistogramItem, error)
- func ORM() *storm.DB
- func PrepareAsk(uri string) (string, error)
- func ResetEADCache()
- func ResetStorm()
- func SparqlRepo(orgID string) *sparql.Repo
- func SparqlUpdateRepo(orgID string) *sparql.Repo
- type Access
- type DaoStats
- type DataSet
- func (ds DataSet) Delete(ctx context.Context, wp *wp.WorkerPool) error
- func (ds DataSet) DropAll(ctx context.Context, wp *wp.WorkerPool) (bool, error)
- func (ds DataSet) DropOrphans(ctx context.Context, p *elastic.BulkProcessor, wp *wp.WorkerPool) (bool, error)
- func (ds DataSet) DropRecords(ctx context.Context, wp *wp.WorkerPool) (bool, error)
- func (ds *DataSet) IncrementRevision() (*DataSet, error)
- func (ds DataSet) Save() error
- type DataSetCounter
- type DataSetRevisions
- type DataSetStats
- type IndexStats
- type LODFragmentStats
- type NarthexStats
- type RDFStoreStats
- type VocabularyEnrichmentStats
- type WebResourceStats
Constants ¶
This section is empty.
Variables ¶
var (
ErrUnexpectedResponse = errors.New("expected response != nil")
)
Functions ¶
func CountGraphsBySpec ¶
CountGraphsBySpec counts all the named graphs for a spec
func DeleteAllGraphsBySpec ¶
DeleteAllGraphsBySpec issues an SPARQL Update query to delete all graphs for a DataSet from the triple store
func DeleteDataSet ¶ added in v0.2.0
DeleteDataset deletes a set.
func DeleteGraphsOrphansBySpec ¶
DeleteGraphsOrphansBySpec issues an SPARQL Update query to delete all orphaned graphs for a DataSet from the triple store.
func NewDataSetHistogram ¶
func NewDataSetHistogram(orgID string) ([]*elastic.AggregationBucketHistogramItem, error)
NewDataSetHistogram returns a histogram for dates that items in the index are modified
func PrepareAsk ¶
PrepareAsk takes an a string and returns a valid SPARQL ASK query
func ResetEADCache ¶ added in v0.1.4
func ResetEADCache()
func ResetStorm ¶
func ResetStorm()
func SparqlRepo ¶
func SparqlUpdateRepo ¶
Types ¶
type Access ¶
type Access struct { OAIPMH bool `json:"oaipmh"` Search bool `json:"search"` LOD bool `json:"lod"` }
Access determines the 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"` // Old field replaced with ErrorsPerInventory. Needs to be kept or else breaks the gob decoder when reading older data. UniqueLinks uint64 `json:"uniqueLinks"` DuplicateLinks map[string]int `json:"duplicateLinks"` ErrorsPerInventory map[string]string `json:"errorsPerInventory"` }
DaoStats holds the stats for EAD digital objects extracted from METS links.
type DataSet ¶
type DataSet struct { // MapToPrefix string `json:"mapToPrefix"` Spec string `json:"spec" storm:"id,index,unique"` URI string `json:"uri" storm:"unique,index"` 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"` OrgID string `json:"orgID"` Access `json:"access" storm:"inline"` Tags []string `json:"tags"` RecordType string `json:"recordType"` // Label string `json:"label"` Owner string `json:"owner"` Abstract []string `json:"abstract"` Period []string `json:"period"` Length string `json:"length"` Files string `json:"files"` Language string `json:"language"` Material string `json:"material"` ArchiveCreator []string `json:"archiveCreator"` MetsFiles int `json:"metsFiles"` Description string `json:"description"` Clevels int `json:"clevels"` DaoStats `json:"daoStats" storm:"inline"` Fingerprint string `json:"fingerPrint"` }
DataSet contains all the known informantion for a hub3 metadata dataset
func CreateDataSet ¶
CreateDataSet creates and returns a DataSet
func GetDataSet ¶
GetDataSet returns a DataSet object when found
func GetOrCreateDataSet ¶
GetOrCreateDataSet returns a DataSet object from the Storm ORM. If none is present it will create one
func ListDataSets ¶
ListDataSets returns an array of Datasets stored in Storm ORM
func NewDataset ¶
NewDataset creates a new instance of a DataSet
func (DataSet) DropAll ¶
DropAll drops the dataset from the Hub3 storages completely (BoltDB, Triple Store, Search Index)
func (DataSet) DropOrphans ¶
func (ds DataSet) DropOrphans(ctx context.Context, p *elastic.BulkProcessor, wp *wp.WorkerPool) (bool, error)
DropOrphans removes all records of different revision that the current from the attached datastores
func (DataSet) DropRecords ¶
DropRecords Drops all records linked to the dataset from the storage layers
func (*DataSet) IncrementRevision ¶
IncrementRevision bumps the latest revision of the DataSet
type DataSetCounter ¶
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
func CountRevisionsBySpec ¶
func CountRevisionsBySpec(orgID, spec string) ([]DataSetRevisions, error)
CountRevisionsBySpec counts each revision available in the spec
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
func CreateDataSetStats ¶
func CreateDataSetStats(ctx context.Context, orgID, spec string) (DataSetStats, error)
CreateDataSetStats returns DataSetStats that contain all relevant counts from the storage layer
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 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 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