Add filter, add READMES
This commit is contained in:
81
backend_go/models.go
Normal file
81
backend_go/models.go
Normal file
@@ -0,0 +1,81 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user