Zahid07 commented on PR #787:
URL: https://github.com/apache/age/pull/787#issuecomment-1494018403

   Changed the getChildren to cater the following situation.
   
   A inherits B
   B inherits C.
   
   When we do the query to get all labels connected to A, we were getting only 
A and B
   But now we are getting A, B and C.
   
   //Creating a graph
   SELECT create_graph('Testing1');
   
   //Creating Edge Labels with inheritance
   SELECT create_elabel('Testing1', 'A');
   SELECT create_elabel('Testing1', 'B', ARRAY['A']);
   SELECT create_elabel('Testing1', 'C', ARRAY['B']);
   
   //Creating Vertex Labels
   SELECT create_vlabel('Testing1', 'Head');
   SELECT create_vlabel('Testing1', 'Node');
   SELECT create_vlabel('Testing1', 'Tail');
   
   //Adding data
   SELECT * FROM cypher('Testing1', $$
       CREATE (:Head {id: 1})-[:A]->(:Node {id: 2})-[:B]->(:Node {id: 
3})-[:C]->(:Tail {id: 4})
    $$) AS (a agtype);
   
   //Query
   SELECT * FROM cypher('Testing1', $$
       MATCH (a)-[:A*1]->(b)
       RETURN a.id, b.id
   $$) AS (a_id agtype, b_id agtype);
   
   Result:
    a_id | b_id
   ------+------
    1    | 2
    2    | 3
   
   Intended Result:
    a_id | b_id
   ------+------
    1    | 2
    2    | 3
    3    | 4
   
   After changing the getChildren function, we get our intended result which is:
    a_id | b_id
   ------+------
    1    | 2
    2    | 3
    3    | 4
   
   
    
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to