Files
knowledge-graph-agent/backend/models/graph.go
T
2026-04-05 15:04:26 +08:00

27 lines
930 B
Go

package models
type Node struct {
ID string `json:"id"`
Label string `json:"label"`
Type string `json:"type,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
Style map[string]interface{} `json:"style,omitempty"`
}
type Edge struct {
ID string `json:"id"`
Source string `json:"source"`
Target string `json:"target"`
Label string `json:"label,omitempty"`
Type string `json:"type,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
Style map[string]interface{} `json:"style,omitempty"`
}
type GraphData struct {
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
}