Files
visualizador_instanciados/backend_go/models.go
2026-03-06 15:35:04 -03:00

82 lines
2.1 KiB
Go

package main
type ErrorResponse struct {
Detail string `json:"detail"`
}
type HealthResponse struct {
Status string `json:"status"`
}
type Node struct {
ID int `json:"id"`
TermType string `json:"termType"` // "uri" | "bnode"
IRI string `json:"iri"`
Label *string `json:"label"`
X float64 `json:"x"`
Y float64 `json:"y"`
}
type Edge struct {
Source int `json:"source"`
Target int `json:"target"`
Predicate string `json:"predicate"`
}
type GraphMeta struct {
Backend string `json:"backend"`
TTLPath *string `json:"ttl_path"`
SparqlEndpoint string `json:"sparql_endpoint"`
IncludeBNodes bool `json:"include_bnodes"`
GraphQueryID string `json:"graph_query_id"`
NodeLimit int `json:"node_limit"`
EdgeLimit int `json:"edge_limit"`
Nodes int `json:"nodes"`
Edges int `json:"edges"`
}
type GraphResponse struct {
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
Meta *GraphMeta `json:"meta"`
}
type StatsResponse struct {
Backend string `json:"backend"`
TTLPath *string `json:"ttl_path"`
SparqlEndpoint *string `json:"sparql_endpoint"`
ParsedTriples int `json:"parsed_triples"`
Nodes int `json:"nodes"`
Edges int `json:"edges"`
}
type SparqlQueryRequest struct {
Query string `json:"query"`
}
type NeighborsRequest struct {
SelectedIDs []int `json:"selected_ids"`
NodeLimit *int `json:"node_limit,omitempty"`
EdgeLimit *int `json:"edge_limit,omitempty"`
GraphQueryID *string `json:"graph_query_id,omitempty"`
}
type NeighborsResponse struct {
SelectedIDs []int `json:"selected_ids"`
NeighborIDs []int `json:"neighbor_ids"`
}
type SelectionQueryRequest struct {
QueryID string `json:"query_id"`
SelectedIDs []int `json:"selected_ids"`
NodeLimit *int `json:"node_limit,omitempty"`
EdgeLimit *int `json:"edge_limit,omitempty"`
GraphQueryID *string `json:"graph_query_id,omitempty"`
}
type SelectionQueryResponse struct {
QueryID string `json:"query_id"`
SelectedIDs []int `json:"selected_ids"`
NeighborIDs []int `json:"neighbor_ids"`
}