Skip to main content

Module cypher

Module cypher 

Source
Expand description

Cypher-inspired query language for SQLiteGraph.

Supports:

  • MATCH (n:Label) — node pattern
  • MATCH (a)-[:REL]->(b) — outgoing edge pattern
  • MATCH (a)<-[:REL]-(b) — incoming edge pattern
  • MATCH (a)-[:REL]-(b) — undirected edge pattern
  • MATCH (a)-[:X]->(b)-[:Y]->(c) — multi-hop chain
  • MATCH (a)-[:X*1..3]->(b) — variable-depth traversal
  • WHERE n.field = "value" AND m.field = "x" — multi-predicate
  • WHERE n.field =~ "pattern" — regex match
  • WHERE n.field > 5 — numeric comparison
  • WHERE n.f = "x" OR n.f = "y" — disjunction
  • RETURN a.name, b.name — projection
  • LIMIT N — result cap (applied after filtering)
  • CREATE (n:Label {prop: "val"}) — insert a node
  • CREATE (1)-[:REL]->(2) — insert an edge between node IDs
  • MATCH (n) WHERE ... SET n.prop = "val" — update a property
  • MATCH (n) WHERE ... DELETE n — remove a node

Structs§

CypherQuery
A parsed Cypher-inspired query.
EdgeLeg
One step in a multi-hop pattern: (from)-[:rel]->(to).
NodePattern
A node pattern within a MATCH clause.
WhereClause
A single WHERE clause predicate.

Enums§

EdgeDirection
Direction of an edge in a MATCH pattern.
Pattern
A graph pattern — node scan, edge traversal, multi-hop chain, or variable-depth traversal.
Statement
Top-level statement kind. Match is the default for read queries.
WhereOp
Comparison operator used inside a WHERE clause.

Functions§

execute
Execute a parsed CypherQuery against a SQLite-backed graph.
parse
Parse a Cypher-inspired query string.