1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright The Lance Authors
//! 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
//! - A CSR (compressed sparse row) adjacency index for multi-hop traversal
//!
//! # Example
//!
//! [`CypherEngine`] registers datasets once, optionally builds the CSR, and serves
//! many queries. See [`engine`] for the full API and `examples/embedded_query.rs`
//! for a runnable program.
//!
//! ```no_run
//! use std::collections::HashMap;
//! use lance_csr::{CypherEngine, EngineSource, GraphConfig, Result};
//!
//! # async fn example() -> Result<()> {
//! let config = GraphConfig::builder()
//! .node_table("Person", "person_id")
//! .rel_table("KNOWS", "Person", "Person", "src_person_id", "dst_person_id")
//! .build()?;
//! let sources = HashMap::from([
//! ("Person".to_string(), EngineSource::open_lance("person.lance", None, HashMap::new()).await?),
//! ("KNOWS".to_string(), EngineSource::open_lance("knows.lance", None, HashMap::new()).await?),
//! ]);
//! let engine = CypherEngine::new(config, sources, true).await?;
//! let batch = engine
//! .execute("MATCH (p:Person) WHERE p.age > 30 RETURN p.name", HashMap::new())
//! .await?;
//! # Ok(())
//! # }
//! ```
/// Maximum allowed hops for variable-length relationship expansion (e.g., *1..N)
pub const MAX_VARIABLE_LENGTH_HOPS: u32 = 20;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use VectorSearch;
pub use ;
pub use SqlQuery;