kg

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fact

type Fact struct {
	ID        int    `json:"id"`
	Subject   string `json:"subject"`
	Predicate string `json:"predicate"`
	Object    string `json:"object"`
	ValidFrom string `json:"valid_from,omitempty"`
	ValidTo   string `json:"valid_to,omitempty"`
	Source    string `json:"source,omitempty"`
}

type FactPromotionAssessment

type FactPromotionAssessment struct {
	StoreAsFact     bool     `json:"store_as_fact"`
	KeepAsEntry     bool     `json:"keep_as_entry"`
	Confidence      string   `json:"confidence"`
	PredicateFamily string   `json:"predicate_family,omitempty"`
	Subject         string   `json:"subject,omitempty"`
	Predicate       string   `json:"predicate,omitempty"`
	Object          string   `json:"object,omitempty"`
	Reasons         []string `json:"reasons"`
}

func AssessFactPromotion

func AssessFactPromotion(text string) FactPromotionAssessment

type Snapshot

type Snapshot struct {
	NextID int    `json:"next_id"`
	Facts  []Fact `json:"facts"`
}

type Store

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

func New

func New(path string) *Store

func (*Store) Add

func (s *Store) Add(subject, predicate, object, validFrom, source string) (Fact, error)

func (*Store) Invalidate

func (s *Store) Invalidate(subject, predicate, object, ended string) error

func (*Store) Query

func (s *Store) Query(entity, asOf, direction string) ([]Fact, error)

func (*Store) Stats

func (s *Store) Stats() (map[string]any, error)

func (*Store) Timeline

func (s *Store) Timeline(entity string) ([]Fact, error)

Jump to

Keyboard shortcuts

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