Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEntityContext ¶
GetEntityContext returns description for an entity (for Zozi's context)
func GetRelationships ¶
GetRelationships returns all relationships for an entity
func IngestEntities ¶
func IngestEntities(db *sql.DB, graph *EntityGraph) error
IngestEntities loads entities.yaml into the database
Types ¶
type AliasMatch ¶
AliasMatch represents a found alias and its canonical entity
func ExpandQuery ¶
ExpandQuery replaces aliases with canonical names and adds context. Sorts matches by alias length (longest first) to prevent partial corruption (e.g., "the tree" must be replaced before "tree" gets a chance).
func LookupAliases ¶
func LookupAliases(db *sql.DB, query string) ([]AliasMatch, error)
LookupAliases finds all entity aliases mentioned in the query. Uses word boundaries for ASCII aliases to prevent substring false positives (e.g., alias "AB" must not match inside "ABC").
type Entity ¶
type Entity struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Aliases []string `yaml:"aliases"`
Description string `yaml:"description"`
}
Entity represents a person, part, animal, or concept in Alice's world
type EntityGraph ¶
type EntityGraph struct {
Entities []Entity `yaml:"entities"`
Relationships []Relationship `yaml:"relationships"`
}
EntityGraph holds the complete ground truth map
func LoadEntityGraph ¶
func LoadEntityGraph(path string) (*EntityGraph, error)
LoadEntityGraph reads and parses entities.yaml
type EntityStats ¶
type EntityStats struct {
TotalEntities int
TotalAliases int
TotalRelationships int
ByType map[string]int
}
EntityStats returns counts for reporting
func GetEntityStats ¶
func GetEntityStats(db *sql.DB) (*EntityStats, error)