You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "aru-d-at (via GitHub)" <gi...@apache.org> on 2023/04/18 11:08:19 UTC

[GitHub] [age] aru-d-at commented on issue #820: Are multiple cypher calls possible within the same FROM clause?

aru-d-at commented on issue #820:
URL: https://github.com/apache/age/issues/820#issuecomment-1512888512

   Based on my trials, seems its only a combination of table, cypher() in whichever order you call them.
   
   But, I am quite curious to know what would be the intention behind wanting such functionality? Could perhaps elaborate some use cases to justify the need?
   
   At the moment, if your aim is to access more than one graph, you can just utilise the JOIN clause.
   
   Like so:
   
   
   ```opencypher
   SELECT * FROM cypher('graph1', $$
   CREATE (c: Customer { user: 'gomeZ', tags: 'dev' })
   $$) as (v agtype);
   
   SELECT * FROM cypher('graph2', $$
   CREATE (s: Queries { user: 'gomeZ', keywords: ['java', 'c', 'python'] })
   $$) as (v agtype);
   ```
   
   ```opencypher
   SELECT graph1.u, graph1.t, graph2.k         
   FROM cypher('graph1', $$
   MATCH (c:Customer)
   RETURN c.user, c.tags
   $$) as graph1(u agtype, t agtype)
   JOIN cypher('graph2', $$
   MATCH (s:Queries)
   RETURN s.user, s.keywords
   $$) as graph2(u agtype, k agtype)
   ON graph1.u = graph2.u;
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@age.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org