Expand description
Property graphs and their posting representation.
Defines GraphStore (trait + in-memory implementation), the
GraphPostingList extension of uqa_core::PostingList, and the
lossless Phi codec for carrying graph metadata through ordinary posting
storage. Graph-result merges expose their subgraph collision policy
separately from ordinary posting payload merges.
Re-exports§
pub use adapters::GraphPostingCodec;pub use adapters::PostingToGraphAdapter;pub use adapters::TextTfScoreNormalizer;
Modules§
- adapters
- Explicit adapters between posting representations.
- age_
names - Apache AGE graph and label name validation.
- agtype
- Canonical Apache AGE
agtypevalue model and text rendering. - cypher
- openCypher subset: lexer, AST, recursive-descent parser. The compiler that lowers AST onto graph operators lives in a separate slice; this module is the front-end only.
Structs§
- Betweenness
Centrality - Betweenness centrality via Brandes algorithm.
- Cypher
Query Operator CypherQueryOperator— execute a parsed openCypher query against a named graph and project the resulting(start, end)vertex pairs into a posting list for downstream operator composition.- Dfa
- Document
- A simple document representation for
ToGraph/TextToGraph. - Edge
Pattern (E_P)— an edge between two vertex variables, with an optional label and per-property constraints.negated == trueflips it into a “must not exist” pattern, matched after positive edges resolve.- GMatch
GMatch_P(Definition 2.2.2 / 5.2.2): subgraph-isomorphism pattern matching via backtracking with arc-consistency candidate pruning, MRV (minimum remaining values) variable ordering, and a negated-edge post-filter. Each match maps each pattern variable to a vertex id; the result is aGraphPostingListkeyed on a synthetic 1-based match id, with the assignment carried as payload fields.- Graph
Delta - Records add / remove vertex / edge operations (Section 9.3, Paper 2).
- Graph
Embedding - Graph
Label Info - One
ag_labelcatalog entry of a graph. - Graph
Label Registry - Per-graph AGE label registry: label name -> label id plus the per-label id sequences. Serializable so engines can persist it in catalog metadata and restore deterministic id allocation.
- Graph
Pattern - Subgraph pattern:
P = (V_P, E_P, C_V, C_E). - Graph
Payload - Auxiliary payload for graph posting list entries: the subgraph each matched entry refers to, plus a graph-name tag and a score override.
- Graph
Posting List - Posting list paired with a
(doc_id -> GraphPayload)map. The invariants of the underlyingPostingList(sorted, unique doc ids) hold here as well. - HITS
HITScentrality (hub / authority mutual reinforcement).- Incremental
Pattern Matcher - Label
Index - Memory
Graph Store - Message
Passing - Nfa
- NfaTransition
- NFA transition target.
Some(label)is a labeled edge consumed by matching that label;Noneis an epsilon transition. - Page
Rank PageRankcentrality (power iteration with damping).- Path
Index - Pre-indexed reachable
(start, end)pairs for fixed label sequences. Lookup is keyed by the slash-joined sequence so the RPQ operator can lift aLabel / Label / ...expression into a direct hit without running NFA simulation. - Regular
Path Query RPQ_R(Definition 5.1.2): evaluate a regular path expression over a graph. The expression is simplified, compiled to an NFA via Thompson’s construction, then converted to a DFA and simulated by a BFS over(vertex, dfa-state)configurations.- SQLite
Graph Store - Semantic
Graph Search Traversefollowed by a vector-similarity filter: keep only the vertices whosevector_fieldsimilarity toquery_vectorclearsthreshold. The retained entries’ scores are the cosine values.- Subgraph
Index - Temporal
Pattern Match - Temporal-aware pattern matching (Section 10, Paper 2).
- Temporal
Traverse - BFS traversal that applies a
TemporalFilterto every candidate edge before it is followed. Mirrors the structure ofcrate::Traversebut with the filter step inlined. - Text
ToGraph - Build a token co-occurrence graph from a document corpus.
- ToGraph
- Convert a document corpus into a fresh
MemoryGraphStore. - Traverse
Traverse_{v,l,k}(Definition 2.2.1): BFS fromstart_vertexalong edges withlabel(any label whenNone) up tomax_hopshops. Each visited vertex becomes its own entry in the result.- Vector
Enhanced Match GMatchfollowed by a per-match cosine filter against the vertex bound toscore_variable. Matches with similarity belowthresholdare dropped; surviving entries take the cosine value as their score.- Versioned
Graph Store - Vertex
Aggregation - Aggregate a numeric property over the vertex set rolled up in a
source operator’s
GraphPayloads. Mirrors Definition 2.2.3. - Vertex
Embedding - Per-vertex cosine similarity to a query embedding. Reads the named
vector property and emits a standard
PostingListkeyed by vertex id, with the cosine score on the payload. - Vertex
Match - Single-vertex Match: every vertex in
graphwhose label matches and whose predicates all hold. Useful as a Cypher-style anchor. - Vertex
Pattern (V_P)— a vertex variable in a pattern, with optional constraints.- Vertex
Property Index - Immutable equality index over selected vertex properties in one named graph.
- Weighted
Path Query - A bounded regular-path walk whose accumulated numeric edge weight must satisfy a caller-provided predicate.
- Weighted
Path Query Operator WeightedPathQueryOperatorevaluates bounded DFA walks, sums a numeric edge property, and keeps endpoints for which the accumulated weight passespredicate. The selectivity value is retained solely for planning; it never substitutes for physical predicate evaluation.
Enums§
- AggFn
- Aggregation function over a numeric vertex property.
- Aggregation
Kind - Cross
Paradigm Error - DeltaOp
- A single mutation operation in a
GraphDelta. - Direction
- Edge traversal direction relative to a vertex.
- Edge
Predicate - Predicate over an edge.
- Graph
Posting List Error - Graph
Store Error - Label
Kind - AGE label kind: the
ag_label.kindcatalog value. - RPQBuild
Error - RPQParse
Error - Regular
Path Expr - Regular path expression.
- Subgraph
Merge Policy - How graph metadata is combined when two graph results contain the same
document. Ordinary posting payloads still follow
PostingList::merge_union/PostingList::merge_intersection; this policy applies only to the graph name and subgraph vertex/edge sets. - Temporal
Filter - Time-aware edge filter.
Timestamp(t)accepts an edge ifvalid_from <= t <= valid_to;Range(a, b)accepts an edge whose validity interval overlaps[a, b]. An edge with neithervalid_fromnorvalid_tois always accepted. - Vertex
Predicate - Predicate over a vertex.
Constants§
- DEFAULT_
GRAPH_ SCORE - Default score lifted into traversal and match payloads.
- EDGE_
DEFAULT_ LABEL_ ID - Reserved AGE label id for unlabeled edges (
_ag_label_edge). - FIRST_
USER_ LABEL_ ID - First label id available to user labels.
- GRAPHID_
LABEL_ SHIFT - Number of bits reserved for the per-label sequence inside an AGE
graphid. The label id occupies the remaining high 16 bits. - MAX_
DFA_ STATES - MAX_
GRAPH_ EMBEDDING_ DIMENSIONS - MAX_
GRAPH_ EMBEDDING_ LAYERS - MAX_
MESSAGE_ PASSING_ LAYERS - Protects the public graph API from accidentally scheduling billions of
full-graph propagation rounds from an unchecked
u32input. - MAX_
NFA_ STATES - MAX_
RPQ_ AST_ DEPTH - Hard limits keep user-provided path expressions from turning NFA or DFA compilation into an unbounded memory allocation. They are deliberately independent: a compact NFA can still have an exponential DFA.
- VERTEX_
DEFAULT_ LABEL_ ID - Reserved AGE label id for unlabeled vertices (
_ag_label_vertex).
Traits§
- Graph
Store - Storage interface for named property graphs.
Functions§
- build_
nfa - Build an NFA from a regular path expression via Thompson’s construction.
- epsilon_
closure - Epsilon closure of a state set: every state reachable by zero or
more epsilon (
label == None) transitions. - graphid_
label_ id - Label id component of an AGE
graphid. - graphid_
sequence - Sequence component of an AGE
graphid. - implicated_
vertices - Convenience helper: count vertices implicated by a delta, using the store to resolve removed edges back to their endpoints when those records are still around.
- make_
graphid - Compose an AGE
graphidfrom a label id and per-label sequence. - parse_
rpq - simplify
- Algebraic simplification (Section 8.2, Paper 2):
a|a -> a,(a*)* -> a*,a*|a -> a*,a*/a* -> a*, plus canonicalization of alternation operand order. - subset_
construction - Convert an NFA to a DFA via the standard subset construction.