smollerGraph 0.20.2
A small graph database, from scratch
Loading...
Searching...
No Matches
parser.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.

Classes

struct  smollergraph::NodePattern
 A node in a pattern, such as (a:Animal {name: 'Red fox'}). More...
 
struct  smollergraph::RelationshipPattern
 A relationship from a node in a pattern to the next one, such as -[:EATS]->, or -[:EATS*2]->, which is two of them in a row. More...
 
struct  smollergraph::PropertyLookup
 A variable's property, such as a.name or b.weight_g. More...
 
struct  smollergraph::Comparison
 A comparison in WHERE, such as b.weight_g < 1000: a property, an operator, which is one of = <> < <= > >=, and a value. More...
 
struct  smollergraph::ReturnItem
 What a query returns in a column: a variable's property, such as b.name, or with no key, a path's variable, such as p, which returns the path, or a function of the path: length(p), how many relationships it has, or cost(p), what its weights add up to. More...
 
struct  smollergraph::Query
 A query in our subset of Cypher, such as MATCH (a {name: 'Red fox'})-[:EATS]->(b) WHERE b.weight_g < 1000 RETURN DISTINCT b.name with EXPLAIN in front of it to ask for its plan. More...
 

Namespaces

namespace  smollergraph
 

Functions

absl::StatusOr< Query > smollergraph::Parse (std::string_view text)
 Reads a query.
 
absl::StatusOr< std::vector< Property > > smollergraph::ParseProperties (std::string_view text)
 Reads properties as Cypher writes them, in braces, such as {legs: 4, diet: 'omnivore'}, with a string or a whole number for each key.
 

Variables

constexpr int smollergraph::kAnyHops = 0
 The hops of a relationship written with a star and no number, such as -[:KNOWS*]-, which stands for any number of them.