storage

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package storage provides type definition for managing OBO graphs in a persistent storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	// SaveOboGraphInfo perist OBO graphs metadata in the storage
	SaveOboGraphInfo(graph.OboGraph) error
	// UpdateOboGraphInfo update OBO graph metadata in the storage
	UpdateOboGraphInfo(graph.OboGraph) error
	// ExistOboGraph checks for existence of a particular OBO graph
	ExistsOboGraph(graph.OboGraph) bool
	// SaveTerms persist all terms in the storage
	SaveTerms(graph.OboGraph) (int, error)
	// UpdateTerms update existing terms in the storage
	UpdateTerms(graph.OboGraph) (int, error)
	// SaveorUpdateTerms either insert and update terms in the storage
	SaveOrUpdateTerms(graph.OboGraph) (*Stats, error)
	// SaveRelationships persist all relationships in the storage
	SaveRelationships(graph.OboGraph) (int, error)
	// SaveNewRelationships skips the existing one and saves only the new relationships
	SaveNewRelationships(graph.OboGraph) (int, error)
}

DataSource represents interface for storing and retrieving OBO graphs.

type Stats added in v1.1.0

type Stats struct {
	Created int
	Updated int
	Deleted int
}

Stats provides statistics about terms.

type UploadInformation added in v1.4.0

type UploadInformation struct {
	// IsCreated indicates whether the obo information is created or updated
	IsCreated bool
	// RelationStats gives no of relationships that are created
	RelationStats int
	// TermStats gives information about uploaded terms
	TermStats *Stats
}

UploadInformation gives information about obo upload.

func LoadOboJSONFromDataSource added in v1.4.0

func LoadOboJSONFromDataSource(r io.Reader, dsr DataSource) (*UploadInformation, error)

LoadOboJSONFromDataSource loads obojson from a given reader and datasource for storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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