grano
grano copied to clipboard
Query language
Gremlin looks like a great resource to draw inspiration from.
More relevant links:
- Bulbs — A Python framework for graph databases (big overlap with grano)
- sql2gremlin — Gremlin tutorial
- SQL adapter for Blueprints
Idea: implement a subset of Gremlin. Doesn't look that hard.
Just for the record:
-- transitive closure of the edges defined in `grano_relation`
WITH RECURSIVE search_graph(source_id, target_id, id, depth, path, cycle)
AS (
SELECT e.source_id, e.target_id, e.id, 1,
ARRAY[e.id],
false
FROM grano_relation e
UNION ALL
SELECT e.source_id, e.target_id, e.id, sg.depth + 1,
path || e.id,
e.id = ANY(path)
FROM grano_relation e, search_graph sg
WHERE e.source_id = sg.target_id AND NOT cycle
)
SELECT * FROM search_graph;
I'm really interested in exploring the MQL approach and have started an extension to that end here:
https://github.com/granoproject/grano-ql