Expand description
Lance Graph Query Engine
This crate provides graph query capabilities for Lance datasets using Cypher syntax. It interprets Lance datasets as property graphs and translates Cypher queries into DataFusion SQL queries for execution.
§Features
- Cypher query parsing and AST representation
- Graph pattern matching on columnar data
- Property graph interpretation of Lance datasets
- Translation to optimized SQL via DataFusion
- Support for nodes, relationships, and properties
§Example
use lance_graph::{CypherQuery, GraphConfig, Result};
let config = GraphConfig::builder()
.with_node_label("Person", "person_id")
.with_relationship("KNOWS", "src_person_id", "dst_person_id")
.build()?;
let query = CypherQuery::new("MATCH (p:Person) WHERE p.age > 30 RETURN p.name")?
.with_config(config);
// Execute against a dataset (would need actual dataset integration)
// let results = query.execute(&dataset).await?;Re-exports§
pub use config::GraphConfig;pub use config::NodeMapping;pub use config::RelationshipMapping;pub use error::GraphError;pub use error::Result;pub use lance_vector_search::VectorSearch;pub use query::CypherQuery;pub use query::ExecutionStrategy;pub use sql_query::SqlQuery;pub use table_readers::DeltaTableReader;pub use table_readers::default_table_readers;pub use table_readers::ParquetTableReader;
Modules§
- ast
- Abstract Syntax Tree for Cypher queries
- case_
insensitive - Case-insensitive string utilities
- config
- Graph configuration for mapping Lance datasets to property graphs
- datafusion_
planner - DataFusion-based physical planner for graph queries
- error
- Error types for the Lance graph query engine
- lance_
native_ planner - Lance Native physical planner (placeholder)
- lance_
vector_ search - Lance Vector Search API for lance-graph
- logical_
plan - Logical planning for graph queries
- parameter_
substitution - parser
- Cypher query parser
- query
- High-level Cypher query interface for Lance datasets
- semantic
- Semantic analysis for graph queries
- sql_
catalog - Bridge between catalog connectors and the SQL query engine.
- sql_
query - Direct SQL query interface for Lance datasets
- table_
readers - Built-in
TableReaderimplementations for common data formats.
Structs§
- Catalog
Info - Metadata about a catalog (top-level namespace).
- Column
Info - Metadata about a column in a table.
- Connector
- Bundles a
CatalogProviderwithTableReaders for convenient use. - DirNamespace
- A namespace that resolves table names relative to a base directory or URI.
- InMemory
Catalog - A simple in-memory catalog useful for tests and bootstrap wiring.
- Schema
Info - Metadata about a schema (second-level namespace within a catalog).
- Simple
Table Source - A trivial logical table source with a fixed schema.
- Table
Info - Full table metadata including columns and storage information.
- Unity
Catalog Config - Configuration for connecting to a Unity Catalog server.
- Unity
Catalog Provider - Unity Catalog REST API client.
Enums§
- Catalog
Error - Errors that can occur during catalog operations.
- Data
Source Format - Data format of the underlying storage.
- Table
Type - Type of table (managed vs external).
Constants§
- MAX_
VARIABLE_ LENGTH_ HOPS - Maximum allowed hops for variable-length relationship expansion (e.g., *1..N)
Traits§
- Catalog
Provider - Abstract trait for browsing an external catalog.
- Graph
Source Catalog - A minimal catalog to resolve node labels and relationship types to logical table sources.
- Table
Reader - Reads table data in a specific format and registers it into a DataFusion
SessionContext.