-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I would like to create a simple query to the graph with hierarchy. Starting from a child I would like to find a parent and all children of this parent including starting node. Here the example of the code,
from grandcypher import GrandCypher
import networkx as nx
host = nx.DiGraph()
host.add_node("p", foo="Parent")
host.add_node("c1", foo="Child01")
host.add_node("c2", foo="Child02")
host.add_node("c3", foo="Child03")
host.add_node("c4", foo="Child04")
host.add_node("c5", foo="Child05")
host.add_edge("c1", "p")
host.add_edge("c2", "p")
host.add_edge("c3", "p")
host.add_edge("c4", "p")
host.add_edge("c5", "p")
qry = """
MATCH (n {foo: "Child01"})-->()<--(s)
RETURN s.foo
"""
print(GrandCypher(host).run(qry))In current implementation the code output exclude initial node Child01
{'s.foo': ['Child02', 'Child03', 'Child04', 'Child05']}
Is it implemented on purpose?
How I can alter this behavior in single query?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels