smollerGraph 0.20.2
A small graph database, from scratch
Loading...
Searching...
No Matches
api.h File Reference
#include <string>
#include <string_view>
#include <vector>
#include "absl/status/statusor.h"
#include "smollergraph/graph.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  smollergraph
 

Functions

std::string smollergraph::JsonString (std::string_view text)
 What sg serve answers with, as JSON.
 
std::string smollergraph::PropertiesJson (const std::vector< Property > &properties)
 Returns properties as a JSON object, with a field for each key.
 
std::string smollergraph::ErrorJson (std::string_view message)
 Returns an error's message as JSON, for the UI to show.
 
std::string smollergraph::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.
 
absl::StatusOr< std::string > smollergraph::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 bytes, then its chains of relationships out and in, newest first, each with its properties, the node at its other end and where it's kept, and its chain of properties, newest first, each with where it's kept.
 
absl::StatusOr< std::string > smollergraph::QueryJson (const Graph &graph, std::string_view text)
 
absl::StatusOr< std::string > smollergraph::SimilarJson (const Graph &graph, std::string_view id)
 Returns the kSimilar nodes whose embeddings are most like node id's, the most alike first, each with its name, its label and its cosine.
 

Variables

constexpr size_t smollergraph::kMaxRows = 1000
 Parses, plans and runs a query in our subset of Cypher, from a request.
 
constexpr size_t smollergraph::kSimilar = 10
 How many of the most similar nodes the page draws.
 
constexpr size_t smollergraph::kMaxDrawn = 500