Documentation
¶
Overview ¶
Package graph provides entity resolution and graph traversal over the SQLite index.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConfidenceLevel = map[string]int{
"low": 1,
"medium": 2,
"high": 3,
}
ConfidenceLevel maps confidence label to numeric rank (higher = more confident).
Functions ¶
func MeetsConfidence ¶
MeetsConfidence reports whether edgeConf satisfies the minConf threshold. An edge meets confidence if its level is >= the minimum required level.
Types ¶
type InLink ¶
type InLink struct {
SourceID string `json:"source_id"`
SourceTitle string `json:"source_title,omitempty"`
SourcePath string `json:"source_path,omitempty"`
EdgeType string `json:"edge_type"`
Confidence string `json:"confidence"`
Origin string `json:"origin,omitempty"`
Resolved bool `json:"resolved"`
}
InLink represents a single inbound edge (for links in).
type Match ¶
type Match struct {
ID string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
Path string `json:"path"`
Status *string `json:"status,omitempty"`
}
Match holds one candidate note from a resolution attempt.
type OutLink ¶
type OutLink struct {
TargetID *string `json:"target_id"`
TargetTitle string `json:"target_title,omitempty"`
TargetPath string `json:"target_path,omitempty"`
TargetRaw string `json:"target_raw,omitempty"`
EdgeType string `json:"edge_type"`
Confidence string `json:"confidence"`
Origin string `json:"origin,omitempty"`
Resolved bool `json:"resolved"`
}
OutLink represents a single outbound edge (for links out).
type ResolveResult ¶
type ResolveResult struct {
Resolved bool `json:"resolved"`
Ambiguous bool `json:"ambiguous"`
Input string `json:"input"`
ResolutionTier *string `json:"resolution_tier"`
Matches []Match `json:"matches"`
}
ResolveResult is the full output of entity resolution.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver performs 5-tier entity resolution against the SQLite index.
func NewResolver ¶
NewResolver creates a Resolver backed by the given database.
func (*Resolver) Resolve ¶
func (r *Resolver) Resolve(input string) (*ResolveResult, error)
Resolve runs the full resolution cascade for the given input string. Priority: path shortcut → id → title → alias → normalized → unresolved.
func (*Resolver) Traverse ¶
func (r *Resolver) Traverse(cfg TraverseConfig) (*TraverseResult, error)
Traverse performs a BFS from cfg.StartID up to cfg.MaxDepth hops, respecting cfg.MinConfidence and cfg.MaxNodes limits. Both outbound and inbound resolved edges are followed (bidirectional).
type TraverseConfig ¶
TraverseConfig holds parameters for a BFS traversal.
type TraverseEdge ¶
type TraverseEdge struct {
SourceID string `json:"source_id"`
EdgeType string `json:"edge_type"`
Confidence string `json:"confidence"`
Weight float64 `json:"weight"`
}
TraverseEdge describes the edge by which a node was reached.
type TraverseNode ¶
type TraverseNode struct {
ID string `json:"id"`
Distance int `json:"distance"`
EdgeFrom *TraverseEdge `json:"edge_from,omitempty"`
}
TraverseNode represents a node in the BFS result.
type TraverseResult ¶
type TraverseResult struct {
StartID string `json:"start_id"`
Nodes []TraverseNode `json:"nodes"`
MaxNodesReached bool `json:"max_nodes_reached"`
}
TraverseResult is the full output of a BFS traversal.