1#ifndef SMOLLERGRAPH_API_H_
2#define SMOLLERGRAPH_API_H_
8#include "absl/status/statusor.h"
24std::string
ErrorJson(std::string_view message);
35absl::StatusOr<std::string>
NodeJson(
const Graph& graph, std::string_view
id);
49 std::string_view
text);
A graph kept in three files of records, one for nodes, one for relationships and one for their proper...
std::vector< Property > properties
std::string PropertiesJson(const std::vector< Property > &properties)
Returns properties as a JSON object, with a field for each key.
absl::StatusOr< std::string > SimilarJson(const Graph &graph, std::string_view id)
Returns the kSimilar nodes whose embeddings are most like node id's, the most alike first,...
absl::StatusOr< std::string > QueryJson(const Graph &graph, std::string_view text)
absl::StatusOr< std::string > NodeJson(const Graph &graph, std::string_view id)
Returns node id's record as it's kept on disk: its label, its page, its offset in the page and its by...
constexpr size_t kSimilar
How many of the most similar nodes the page draws.
std::string ErrorJson(std::string_view message)
Returns an error's message as JSON, for the UI to show.
std::string JsonString(std::string_view text)
What sg serve answers with, as JSON.
constexpr size_t kMaxDrawn
std::string NamesJson(const Graph &graph, std::string_view prefix)
Returns a few of the graph's names that start with prefix, in order, for the UI to suggest.
constexpr size_t kMaxRows
Parses, plans and runs a query in our subset of Cypher, from a request.