bulk

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Service) error

func SetIndexService

func SetIndexService(is *index.Service) Option

func SetIndexTypes

func SetIndexTypes(indexTypes ...string) Option

type Parser

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

func (*Parser) AppendRDFBulkRequest

func (p *Parser) AppendRDFBulkRequest(req *Request, g *rdf.Graph) error

AppendRDFBulkRequest gathers all the triples from an BulkAction to be inserted in bulk.

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context, r io.Reader) error

func (*Parser) Publish

func (p *Parser) Publish(req *Request) error

func (*Parser) RDFBulkInsert

func (p *Parser) RDFBulkInsert() []error

RDFBulkInsert inserts all triples from the bulkRequest in one SPARQL update statement

type Request

type Request struct {
	HubID         string `json:"hubId"`
	OrgID         string `json:"orgID"`
	DatasetID     string `json:"dataset"`
	LocalID       string `json:"localID"`
	NamedGraphURI string `json:"graphUri"`
	RecordType    string `json:"type"`
	Action        string `json:"action"`
	ContentHash   string `json:"contentHash"`
	Graph         string `json:"graph"`
	GraphMimeType string `json:"graphMimeType"`
	SubjectType   string `json:"subjectType"`
	Revision      int    `json:"revision"`
}

type Service

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

func NewService

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

func (*Service) Handle

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

bulkApi receives bulkActions in JSON form (1 per line) and processes them in ingestion pipeline.

func (*Service) NewParser

func (s *Service) NewParser() *Parser

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 Stats

type Stats struct {
	Spec          string `json:"spec"`
	SpecRevision  uint64 `json:"specRevision"`  // version of the records stored
	TotalReceived uint64 `json:"totalReceived"` // originally json was total_received
	RecordsStored uint64 `json:"recordsStored"` // originally json was records_stored
	JSONErrors    uint64 `json:"jsonErrors"`
	TriplesStored uint64 `json:"triplesStored"`
}

Jump to

Keyboard shortcuts

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