MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / populate_graph

Method populate_graph

tests/flow/test_bound_variables.py:18–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 self.populate_graph()
17
18 def populate_graph(self):
19 global redis_graph
20
21 # Construct a graph with the form:
22 # (v1)-[:E]->(v2)-[:E]->(v3)
23 node_props = ['v1', 'v2', 'v3']
24
25 nodes = []
26 for idx, v in enumerate(node_props):
27 node = Node(label="L", properties={"val": v})
28 nodes.append(node)
29 redis_graph.add_node(node)
30
31 edge = Edge(nodes[0], "E", nodes[1])
32 redis_graph.add_edge(edge)
33
34 edge = Edge(nodes[1], "E", nodes[2])
35 redis_graph.add_edge(edge)
36
37 redis_graph.commit()
38
39 def test01_with_projected_entity(self):
40 query = """MATCH (a:L {val: 'v1'}) WITH a MATCH (a)-[e]->(b) RETURN b.val"""

Callers 1

__init__Method · 0.95

Calls 2

NodeClass · 0.50
EdgeClass · 0.50

Tested by

no test coverage detected