Skip to main content

uqa_graph/
operators.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Traversal, matching, path, and aggregation operators over graph stores.
8//!
9//! Every operator returns a [`GraphPostingList`] so graph results compose with
10//! document support and payload merge operations.
11
12use std::collections::{BTreeMap, BTreeSet, VecDeque};
13
14use uqa_core::{DocId, Edge, EdgeId, Payload, PostingEntry, PostingList, Value, VertexId};
15use uqa_operators::PathWeightPredicate;
16
17use crate::pattern::{EdgePattern, GraphPattern, VertexPredicate};
18use crate::posting_list::{GraphPayload, GraphPostingList};
19use crate::rpq::{build_nfa, simplify, subset_construction, Dfa, DfaState, RegularPathExpr};
20use crate::store::{GraphStore, GraphStoreError, GraphStoreResult};
21
22mod aggregation;
23mod gmatch;
24mod numeric;
25mod regular_path;
26mod result;
27mod traverse;
28mod vertex_match;
29mod weighted_path;
30
31pub use aggregation::{AggFn, VertexAggregation};
32pub use gmatch::GMatch;
33pub use regular_path::RegularPathQuery;
34pub use traverse::Traverse;
35pub use vertex_match::VertexMatch;
36pub use weighted_path::WeightedPathQuery;
37
38use numeric::value_as_f64;
39use result::{graph_id_value, synthetic_doc_id};
40
41/// Default score lifted into traversal and match payloads.
42pub const DEFAULT_GRAPH_SCORE: f64 = 0.9;