Documentation
¶
Index ¶
- Variables
- func ApplyPostHookJob(ph *PostHookJob)
- func AskSPARQL(query string) (bool, error)
- func CloseStorm()
- func CountGraphsBySpec(spec string) (int, error)
- func CountRDFRecords(spec string) int
- func CreateDeletePostHooks(ctx context.Context, q elastic.Query, wp *w.WorkerPool) error
- func DeleteAllGraphsBySpec(spec string) (bool, error)
- func DeleteGraphsOrphansBySpec(spec string, revision int) (bool, error)
- func DescribeSPARQL(uri string) (map[string][]rdf.Term, error)
- func NewDataSetHistogram() ([]*elastic.AggregationBucketHistogramItem, error)
- func ORM() *storm.DB
- func PrepareAsk(uri string) (string, error)
- func ProcessSpec(spec string) bool
- func ResetStorm()
- type Access
- type DaoStats
- type DataSet
- func (ds DataSet) Delete(ctx context.Context, wp *w.WorkerPool) error
- func (ds DataSet) DropAll(ctx context.Context, wp *w.WorkerPool) (bool, error)
- func (ds DataSet) DropOrphans(ctx context.Context, p *elastic.BulkProcessor, wp *w.WorkerPool) (bool, error)
- func (ds DataSet) DropRecords(ctx context.Context, wp *w.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 PostHookJob
- type PostHookJobFactory
- type RDFRecord
- type RDFStoreStats
- type ResourceSortOrder
- type VocabularyEnrichmentStats
- type WebResourceStats
Constants ¶
This section is empty.
Variables ¶
var SparqlQueryURL string
SparqlQueryURL is the fully qualified URI to the SPARQL endpoint
var SparqlRepo *sparql.Repo
SparqlRepo is the repository used for querying
var SparqlUpdateRepo *sparql.Repo
SparqlUpdateRepo is the repository used for updating the TripleStore
var SparqlUpdateURL string
SparqlUpdateURL is the fully qualified URI to the SPARQL Update endpoint
Functions ¶
func ApplyPostHookJob ¶
func ApplyPostHookJob(ph *PostHookJob)
ApplyPostHookJob applies the PostHookJob to all the configured URLs
func CountGraphsBySpec ¶
CountGraphsBySpec counts all the named graphs for a spec
func CountRDFRecords ¶
CountRDFRecords returns an int with the records count for spec. If the spec is empty it should return a count for all
func CreateDeletePostHooks ¶
CreateDeletePostHooks scrolls through the elasticsearch index and adds entries to be delete to the PostHook workerpool.
func DeleteAllGraphsBySpec ¶
DeleteAllGraphsBySpec issues an SPARQL Update query to delete all graphs for a DataSet from the triple store
func DeleteGraphsOrphansBySpec ¶
DeleteGraphsOrphansBySpec issues an SPARQL Update query to delete all orphaned graphs for a DataSet from the triple store.
func DescribeSPARQL ¶
DescribeSPARQL creates a describe query for a given URI.
func NewDataSetHistogram ¶
func NewDataSetHistogram() ([]*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 ProcessSpec ¶
ProcessSpec determines if a PostHookJob should be applied for a specific spec
func ResetStorm ¶
func ResetStorm()
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"`
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 {
//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 *w.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(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, 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 PostHookJob ¶
type PostHookJob struct {
Graph *fragments.SortedGraph
Spec string
Deleted bool
Subject string
}
PostHookJob holds the info for building a crea
func NewPostHookJob ¶
func NewPostHookJob(sg *fragments.SortedGraph, spec string, delete bool, subject, hubID string) *PostHookJob
NewPostHookJob creates a new PostHookJob and populates the rdf2go Graph
func (PostHookJob) Bytes ¶
func (ph PostHookJob) Bytes() (bytes.Buffer, error)
Bytes returns the PostHookJob as an JSON-LD bytes.Buffer
func (PostHookJob) Post ¶
func (ph PostHookJob) Post(url string) error
Post sends json-ld to the specified endpointt
func (PostHookJob) String ¶
func (ph PostHookJob) String() (string, error)
Bytes returns the PostHookJob as an JSON-LD string
func (PostHookJob) Valid ¶
func (ph PostHookJob) Valid() bool
Valid determines if the posthok is valid to apply.
type PostHookJobFactory ¶
type PostHookJobFactory struct {
Spec string
// contains filtered or unexported fields
}
PostHookJobFactory can be used to fire off PostHookJob jobs
type RDFRecord ¶
type RDFRecord struct {
HubID string `json:"hubId" storm:"id,index"`
ContentHash string `json:"contentHash"`
Spec string `json:"spec" storm:"index"`
Graph string `json:"graph"`
NamedGraphURI string `json:"NamedGraphURI" storm:"unique"`
Modified time.Time `json:"modified" storm:"index"`
Created time.Time `json:"created"`
// the revision is used to mark records as orphans. it is autoincremented on each full save of the dataset
Revision int `json:"revision" storm:"index"`
// Deleted marks a record as an orphan
Deleted bool `json:"deleted"`
}
RDFRecord contains all the information about a grouping of RDF triples that are considered a single search record. RDFRecord can be stored in various backends. The default is a Boltdb database
func GetOrCreateRDFRecord ¶
GetOrCreateRDFRecord returns a RDFRecord object from the Storm ORM. If none is present it will create one
func NewRDFRecord ¶
NewRDFRecord creates a new RDFRecord
func (RDFRecord) ExtractHubID ¶
ExtractHubID extracts the orgId, spec and localId from the HubID
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 ResourceSortOrder ¶
ResourceSortOrder holds information to sort RDF:type webresources based on their nave:resourceSortOrder key
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