Documentation
¶
Index ¶
- type Cache
- type Cluster
- type ConnectionResult
- type GapInfo
- type Graph
- func (g *Graph) FindConnections(from, to string, maxDepth int) ConnectionResult
- func (g *Graph) InDegree(name string) int
- func (g *Graph) KnowledgeGaps() GapInfo
- func (g *Graph) OriginalName(key string) string
- func (g *Graph) OutDegree(name string) int
- func (g *Graph) Overview() OverviewStats
- func (g *Graph) TopicClusters() []Cluster
- func (g *Graph) TotalDegree(name string) int
- type OverviewStats
- type PageStat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v0.4.0
type Cache struct {
// contains filtered or unexported fields
}
Cache holds a recently built graph to avoid rebuilding on every analyze call.
func (*Cache) Invalidate ¶ added in v0.4.0
func (c *Cache) Invalidate()
Invalidate forces the next Get to rebuild.
type Cluster ¶
type Cluster struct {
ID int `json:"id"`
Size int `json:"size"`
Pages []string `json:"pages"`
Hub string `json:"hub"`
}
Cluster is a group of densely connected pages.
type ConnectionResult ¶
type ConnectionResult struct {
From string `json:"from"`
To string `json:"to"`
DirectlyLinked bool `json:"directlyLinked"`
Paths [][]string `json:"paths"`
}
ConnectionResult describes how two pages are connected.
type GapInfo ¶
type GapInfo struct {
OrphanPages []string `json:"orphanPages"`
DeadEndPages []string `json:"deadEndPages"`
WeaklyLinked []PageStat `json:"weaklyLinked"`
SingletonTags []string `json:"singletonTags,omitempty"`
}
GapInfo describes a knowledge gap or sparse area.
type Graph ¶
type Graph struct {
// Forward links: page name (lowercase) → set of linked page names (original case)
Forward map[string]map[string]bool
// Backward links: page name (lowercase) → set of pages that link to it
Backward map[string]map[string]bool
// Pages: lowercase name → PageEntity
Pages map[string]types.PageEntity
// BlockCounts: lowercase name → total block count
BlockCounts map[string]int
}
Graph is an in-memory representation of the knowledge graph's link structure.
func (*Graph) FindConnections ¶
func (g *Graph) FindConnections(from, to string, maxDepth int) ConnectionResult
FindConnections finds how two pages are connected.
func (*Graph) KnowledgeGaps ¶
KnowledgeGaps finds sparse areas in the graph.
func (*Graph) OriginalName ¶
OriginalName returns the display name for a page.
func (*Graph) Overview ¶
func (g *Graph) Overview() OverviewStats
Overview computes global graph statistics.
func (*Graph) TopicClusters ¶
TopicClusters finds connected components in the undirected link graph.
func (*Graph) TotalDegree ¶
TotalDegree returns outgoing + incoming link count for a page.
type OverviewStats ¶
type OverviewStats struct {
TotalPages int `json:"totalPages"`
TotalBlocks int `json:"totalBlocks"`
TotalLinks int `json:"totalLinks"`
JournalPages int `json:"journalPages"`
OrphanPages int `json:"orphanPages"`
MostConnected []PageStat `json:"mostConnected"`
MostLinkedTo []PageStat `json:"mostLinkedTo"`
Namespaces map[string]int `json:"namespaces"`
}
OverviewStats contains global graph statistics.