smollerGraph 0.20.2
A small graph database, from scratch
Loading...
Searching...
No Matches
graph.h File Reference
#include <array>
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>
#include "absl/status/status.h"
#include "smollergraph/name_index.h"
#include "smollergraph/record_file.h"
#include "smollergraph/token_store.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  smollergraph::NodeRecord
 A node on disk: its name, its label's token, which says what kind of node it is, the first of the relationships that start at it, the first of those that end at it, and the first of its properties. More...
 
struct  smollergraph::RelationshipRecord
 A relationship on disk: its type's token, the nodes it joins, the next relationship that starts at from and the next that ends at to, so it's in a chain of each of its nodes, then the first of its properties. More...
 
struct  smollergraph::PropertyRecord
 A property on disk: its key, its value, and the next property of the node or relationship it belongs to, so their properties form a chain too. More...
 
struct  smollergraph::Hop
 A step from a node along one of its relationships: the relationship, and the node at its other end. More...
 
struct  smollergraph::Property
 
class  smollergraph::Graph
 A graph kept in three files of records, one for nodes, one for relationships and one for their properties, with an index that finds a node by its name, and a store each for the tokens of labels and types. More...
 

Namespaces

namespace  smollergraph
 

Typedefs

using smollergraph::NodeId = uint32_t
 
using smollergraph::RelationshipId = uint32_t
 
using smollergraph::PropertyId = uint32_t
 
using smollergraph::Embedding = std::array< float, kEmbeddingSize >
 A node's embedding: a vector of numbers that stands for where the node is in the graph, so that nodes with similar neighbourhoods get vectors that point in similar directions.
 
using smollergraph::Value = std::variant< int64_t, std::string >
 A property's value, as the graph hands it out: a whole number or a string.
 

Enumerations

enum class  smollergraph::ValueType : uint8_t { smollergraph::kInteger , smollergraph::kString }
 
enum class  smollergraph::Direction { smollergraph::kOut , smollergraph::kIn , smollergraph::kBoth }
 A node and a property take 64 bytes, and a relationship 24, so a page holds 170 relationships, with 16 bytes left at its end. More...
 

Functions

Direction smollergraph::Reversed (Direction direction)
 The direction to follow a relationship in from its other end: out becomes in, in becomes out, and both stays both.
 
Value smollergraph::ValueOf (const PropertyRecord &record)
 Reads the value a property's record holds.
 

Variables

constexpr RelationshipId smollergraph::kNoRelationship = UINT32_MAX
 The ids at the end of a chain, where there's no next relationship, or no next property.
 
constexpr PropertyId smollergraph::kNoProperty = UINT32_MAX
 
constexpr size_t smollergraph::kEmbeddingSize = 256
 How many numbers a node's embedding has.