hub3

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkAction

type BulkAction struct {
	HubID         string `json:"hubId"`
	OrgID         string `json:"orgID"`
	Spec          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"`
	RDF           string `json:"rdf"`
	GraphMimeType string `json:"graphMimeType"`
	SubjectType   string `json:"subjectType"`
	// contains filtered or unexported fields
}

BulkAction is used to unmarshal the information from the BulkAPI

func (BulkAction) CreateRDFBulkRequest

func (action BulkAction) CreateRDFBulkRequest(response *BulkActionResponse, g *r.Graph)

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

func (*BulkAction) ESSave

func (action *BulkAction) ESSave(response *BulkActionResponse, v1StylingIndexing bool) error

ESSave the RDF Record to ElasticSearch

func (BulkAction) Execute

func (action BulkAction) Execute(ctx context.Context, response *BulkActionResponse) error

Execute performs the various BulkActions

func (BulkAction) RDFSave

func (action BulkAction) RDFSave(response *BulkActionResponse) []error

RDFSave save the RDFrecord to the TripleStore. This saves each action individually. You should use RDFBulkInsert instead.

type BulkActionResponse

type BulkActionResponse struct {
	Spec               string                   `json:"spec"`
	SpecRevision       int                      `json:"specRevision"`       // version of the records stored
	TotalReceived      int                      `json:"totalReceived"`      // originally json was total_received
	ContentHashMatches int                      `json:"contentHashMatches"` // originally json was content_hash_matches
	RecordsStored      int                      `json:"recordsStored"`      // originally json was records_stored
	JSONErrors         int                      `json:"jsonErrors"`
	TriplesStored      int                      `json:"triplesStored"`
	SparqlUpdates      []fragments.SparqlUpdate `json:"sparqlUpdates"` // store all the triples here for bulk insert
}

BulkActionResponse is the datastructure where we keep the BulkAction statistics

func ReadActions

func ReadActions(ctx context.Context, r io.Reader, p *elastic.BulkProcessor, wp *workerpool.WorkerPool) (BulkActionResponse, error)

ReadActions reads BulkActions from an io.Reader line by line.

func (*BulkActionResponse) RDFBulkInsert

func (r *BulkActionResponse) RDFBulkInsert() []error

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

Directories

Path Synopsis
cmd
Package namespace provides support for managing namespaces for RDF or XML URIs.
Package namespace provides support for managing namespaces for RDF or XML URIs.
server
grpc/pb/namespacepb
Package namespacepb provides gRPC services and Protocolbuffer definitions for namespaces
Package namespacepb provides gRPC services and Protocolbuffer definitions for namespaces
http/assets
assets.FileSystem can be used as any other http.FileSystem in your program, for example http.Handle("/assets", http.FileServer(assets.FileSystem)) You must run 'go generate ./...' to update the contents of the assets.
assets.FileSystem can be used as any other http.FileSystem in your program, for example http.Handle("/assets", http.FileServer(assets.FileSystem)) You must run 'go generate ./...' to update the contents of the assets.

Jump to

Keyboard shortcuts

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