Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query language #38

Open
jazzido opened this issue Mar 15, 2014 · 4 comments
Open

Query language #38

jazzido opened this issue Mar 15, 2014 · 4 comments

Comments

@jazzido
Copy link
Contributor

jazzido commented Mar 15, 2014

Gremlin looks like a great resource to draw inspiration from.

More relevant links:

Idea: implement a subset of Gremlin. Doesn't look that hard.

@jazzido
Copy link
Contributor Author

jazzido commented Mar 16, 2014

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;

@jazzido
Copy link
Contributor Author

jazzido commented Mar 16, 2014

Also, RDBMS in the social networks age

@pudo
Copy link

pudo commented Apr 5, 2014

Collecting stuff:

@pudo
Copy link

pudo commented Jun 22, 2014

I'm really interested in exploring the MQL approach and have started an extension to that end here:

https://github.com/granoproject/grano-ql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants