You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- transitive closure of the edges defined in `grano_relation`
WITH RECURSIVE search_graph(source_id, target_id, id, depth, path, cycle)
AS (
SELECTe.source_id, e.target_id, e.id, 1,
ARRAY[e.id],
false
FROM grano_relation e
UNION ALLSELECTe.source_id, e.target_id, e.id, sg.depth+1,
path||e.id,
e.id= ANY(path)
FROM grano_relation e, search_graph sg
WHEREe.source_id=sg.target_idAND NOT cycle
)
SELECT*FROM search_graph;
Gremlin looks like a great resource to draw inspiration from.
More relevant links:
Idea: implement a subset of Gremlin. Doesn't look that hard.
The text was updated successfully, but these errors were encountered: