Documentation

Graph Engine

Native property graph capabilities built into Absolute DB. Create relationships, traverse graphs, run analytics, and combine graph with vector search — all in SQL, all transactional.

Overview & Performance

Absolute DB embeds a full property graph engine inside the same process as the SQL and vector engines. Graph relationships share the same MVCC transaction layer as relational tables — a single transaction can create a relationship, insert a row, and update a vector simultaneously.

MetricCurrent
Edge creates/sec1.25 million
Graph traversals/sec1.3 billion
Max edges per node16,384
Shortest path algorithmDijkstra + A*
BFS/DFSConfigurable max depth

RELATE Syntax

Use RELATE to create a directed relationship (edge) between two nodes. Edge types label the kind of relationship, and optional properties carry arbitrary key-value metadata.

sql — creating relationships
-- Basic relationship between two nodes
RELATE 101 → 202 AS follows;

-- Relationship with properties
RELATE 101 → 202 AS follows
    PROPERTIES { since: '2026-01-15', strength: 0.9 };

-- Relationship between named nodes
RELATE user:alice → user:bob AS knows
    PROPERTIES { since: '2024-06-01', weight: 1.0 };

-- Undirected relationship (creates edges in both directions)
RELATE product:1001 ↔ product:1002 AS similar
    PROPERTIES { score: 0.87 };

-- Bulk edge creation from a subquery
RELATE (SELECT id FROM users WHERE active = true) → 9999 AS member_of;
sql — querying relationships
-- Who does user 101 follow?
SELECT target_id, properties->>'since' AS since
FROM graph_edges
WHERE source_id = 101 AND edge_type = 'follows';

-- Delete a relationship
UNRELATE 101 → 202 AS follows;

-- Count outgoing edges
SELECT count(*) FROM graph_edges WHERE source_id = 101;

Graph Traversal (BFS / DFS)

Breadth-first search (BFS) and depth-first search (DFS) traversals are available as SQL functions. Both accept a starting node, edge type filter, and maximum depth limit.

sql — BFS and DFS traversal
-- BFS: find all nodes reachable from node 101 within 3 hops
SELECT node_id, depth, path
FROM graph_bfs(
    start     => 101,
    edge_type => 'follows',
    max_depth => 3
);

-- DFS: depth-first traversal for hierarchical data
SELECT node_id, depth, path
FROM graph_dfs(
    start     => 1,
    edge_type => 'parent_of',
    max_depth => 10
);

-- Find all paths between two nodes
SELECT path, path_length
FROM graph_all_paths(
    from_id   => 101,
    to_id     => 999,
    edge_type => 'follows',
    max_depth => 5
)
ORDER BY path_length
LIMIT 20;

-- Count hops (degree of separation)
SELECT graph_distance(101, 999, edge_type => 'follows') AS hops;

Shortest Path (Dijkstra + A*)

The GRAPH SHORTEST_PATH statement uses Dijkstra's algorithm for unweighted graphs and A* with a supplied heuristic for weighted graphs. Edge weights can be any numeric property.

sql — shortest path
-- Unweighted shortest path (Dijkstra)
GRAPH SHORTEST_PATH FROM 101 TO 999 EDGE follows;

-- Returns: path (array of node IDs), total_hops, edges_traversed

-- Weighted shortest path (Dijkstra with weight property)
GRAPH SHORTEST_PATH FROM 'city:sydney' TO 'city:perth'
    EDGE route
    WEIGHT distance_km;

-- A* with heuristic for geographic graphs
GRAPH SHORTEST_PATH FROM 'node:A' TO 'node:Z'
    EDGE road
    WEIGHT travel_time
    HEURISTIC haversine;

-- Bidirectional shortest path (faster for long paths)
SELECT * FROM graph_bidirectional_shortest_path(
    from_id   => 101,
    to_id     => 99999,
    edge_type => 'transaction',
    weight    => 'amount'
);

Graph Analytics

Absolute DB includes built-in implementations of the most widely used graph analytics algorithms. All run in-database without exporting data to an external graph processing system.

PageRank

PageRank assigns an importance score to each node based on the number and quality of incoming edges. Widely used for ranking web pages, identifying influential users in social networks, and scoring entities in knowledge graphs.

sql — PageRank
-- Compute PageRank for all nodes in a graph
SELECT node_id, pagerank_score
FROM absdb_graph_pagerank(
    edge_type    => 'follows',
    damping      => 0.85,
    iterations   => 20,
    tolerance    => 1e-6
)
ORDER BY pagerank_score DESC
LIMIT 100;

Louvain Community Detection

The Louvain algorithm detects communities (clusters) in a graph by maximising modularity. Useful for segmenting users in a social graph, identifying fraud rings, and grouping related entities in a knowledge graph.

sql — community detection
-- Detect communities using Louvain algorithm
SELECT node_id, community_id, modularity_contribution
FROM absdb_graph_louvain(
    edge_type  => 'interacts_with',
    resolution => 1.0
)
ORDER BY community_id, node_id;

Betweenness Centrality

Betweenness centrality measures how often a node appears on the shortest path between two other nodes. High-centrality nodes are critical chokepoints — removing them has the most impact on graph connectivity.

sql — betweenness centrality
-- Compute betweenness centrality (top 50 most central nodes)
SELECT node_id, betweenness_score
FROM absdb_graph_betweenness(
    edge_type    => 'transaction',
    normalised   => true
)
ORDER BY betweenness_score DESC
LIMIT 50;

Property Graph Model

Both nodes and edges can carry arbitrary key-value properties stored as JSONB. Properties are fully queryable with standard SQL JSON operators and can be indexed with GIN for fast access.

sql — property graph queries
-- Filter edges by property value
SELECT source_id, target_id, properties
FROM graph_edges
WHERE edge_type = 'transaction'
  AND (properties->>'amount')::numeric > 10000
  AND (properties->>'currency') = 'AUD';

-- Index edge properties for fast filtering
CREATE INDEX idx_edges_amount
    ON graph_edges USING GIN (properties)
    WHERE edge_type = 'transaction';

-- Update edge properties
UPDATE graph_edges
SET properties = properties || '{"flagged": true}'::jsonb
WHERE source_id = 101 AND target_id = 202
  AND edge_type = 'transaction';

VecGraph — Vector Similarity + Graph Traversal

VecGraph enables combined queries that traverse the graph structure and filter by vector similarity simultaneously. This is the foundation for knowledge graph retrieval, semantic recommendation, and contextual AI memory — finding nodes that are both close in the graph and similar in semantic meaning.

sql — VecGraph combined query
-- Find graph neighbours of node 101 that are semantically similar to a query
SELECT n.id, n.name, n.embedding <=> $1 AS semantic_distance
FROM graph_neighbours(101, edge_type => 'related_to', max_depth => 2) AS g
JOIN entities n ON n.id = g.node_id
WHERE n.embedding <=> $1 < 0.3   -- semantic similarity threshold
ORDER BY semantic_distance
LIMIT 10;

-- Knowledge graph + vector: find concepts related to a query AND semantically close
SELECT * FROM absdb_vecgraph_search(
    start_node  => 'concept:machine_learning',
    query_vec   => EMBED('minilm', 'neural network training'),
    edge_type   => 'related_to',
    max_hops    => 3,
    vec_cutoff  => 0.25,
    top_k       => 20
);

openCypher Graph Queries

Absolute DB includes a native openCypher parser that compiles Cypher queries directly to calls on the underlying graph engine — no separate graph database, no bridge, no translator. This covers approximately 90% of real-world Cypher queries seen in Neo4j migrations.

Cypher featureSupported
MATCH (n:Label {prop:val})-[:REL]->(m:Label) pattern match
CREATE (n:Label {props}) / CREATE (a)-[:REL]->(b)
MERGE (n:Label {id:val}) SET n.name = val
DELETE n / DETACH DELETE n
WHERE cond RETURN ... with predicates and aggregates
WITH n, count(*) AS cnt WHERE cnt > 5 (pipelining)
OPTIONAL MATCH
UNWIND list AS x
Variable-length paths (a)-[*1..5]->(b)
Gremlin / GQL dialect parsersRoadmap v8.3
cypher — fraud-ring detection
-- Find accounts that transferred money through a 2-hop path back to themselves
MATCH (a:Account)-[:TRANSFER]->(b:Account)-[:TRANSFER]->(c:Account)
WHERE a.id = c.id AND a.id <> b.id
RETURN a.id AS account, b.id AS middleman, count(*) AS cycle_count
ORDER BY cycle_count DESC
LIMIT 20;

openCypher queries execute against the same storage, same transactions, and same RBAC as SQL queries — no separate configuration. Neo4j clients that speak the Cypher query language (not the Bolt wire protocol) can be migrated by replaying their queries through Absolute DB's Cypher endpoint.

Limits & Roadmap

PropertyCurrent
Max edges per node16,384
Max edge typesUnlimited
Max property key length256 bytes
Max property value size16 MB (JSONB)
Nodes per graphLimited only by storage
The 16,384 edges-per-node limit is a current-release constraint. A CSR (Compressed Sparse Row) adjacency redesign targeting unlimited edges per node is planned for v9.0.

Use Cases

Use CaseGraph Pattern
Fraud detectionBetweenness centrality + BFS ring detection; suspicious transaction rings
Recommendation enginesBFS from user → item graph; collaborative filtering via graph traversal
Social graphsDegree of separation (hops); community detection; influence scoring (PageRank)
Knowledge graphs / AI memoryVecGraph: semantic similarity + relationship traversal
Supply chain / logisticsShortest path with weighted edges (cost, distance, time)
Identity resolutionBFS cluster expansion from known entity; property matching
Network topology analysisCritical path identification; node criticality via betweenness

Ready to run Absolute DB?

~154 KB binary  ·  zero external dependencies  ·  2,737 tests passing  ·  SQL:2023 100%

Download Free → View Pricing All Docs