Expand description
§gremlin-rs
A parser for the Gremlin graph traversal language, generated from
Apache TinkerPop’s official Gremlin.g4 grammar via
antlr-rust-runtime.
Unlike a Gremlin client (which builds traversals programmatically and sends
bytecode to a server), this crate parses Gremlin text — e.g.
g.V().has('name','marko').out('knows').values('name') — into a parse tree
you can walk, translate, lint, or analyze.
Because the parser is generated from the same grammar TinkerPop uses for its JVM and JavaScript language variants, it tracks the official language rather than a hand-maintained approximation.
§Example
use gremlin_rs::parse;
let tree = parse("g.V().has('name','marko').out('knows').values('name')")?;
println!("{}", tree.text());Enums§
- Gremlin
Parse Error - An error produced while parsing Gremlin text.
- Parse
Tree
Functions§
- parse
- Parses a Gremlin query list — one or more
;-separated traversals — the grammar’s top-levelqueryListentry rule. - parse_
query - Parses a single Gremlin query (the grammar’s
queryentry rule) rather than a;-separated list. Use this when you know the input is exactly one traversal or expression.