Skip to content

Commit d8d8bec

Browse files
committed
zero
1 parent 1dbc591 commit d8d8bec

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

reasoner_transpiler/cypher.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def transform_result(cypher_record,
168168
# Each path is an array of nodes and edges like [n1, n2, n3, e1, e2, e3],
169169
# where nodes are node_ids from the graph and edges are element_ids of relationships from the graph.
170170
for path in paths:
171-
print(path)
172171
# Map results/paths to their corresponding qnodes and qedges
173172
qnode_id_to_results = {qnode_id: (qnode, result_node_id) for (qnode_id, qnode), result_node_id in
174173
zip(qgraph_nodes.items(), path[:len(qgraph_nodes)])}
@@ -217,35 +216,25 @@ def transform_result(cypher_record,
217216
# Create TRAPI edge bindings
218217
for qedge_id, (qedge, path_edge) in qedge_id_to_results.items():
219218

220-
print(" ",qedge_id, qedge, path_edge)
221-
222219
# skip empty results
223-
if not path_edge:
224-
print('bb1')
220+
if ((not path_edge) and (not path_edge == 0)):
225221
continue
226222
# don't return subclass qedges in the edge bindings
227223
if qedge.get("_subclass", False):
228-
print('bb2')
229224
continue
230225

231226
# find the knowledge graph edge id for the element id from the path edge
232227
edge_element_id = path_edge
233228
graph_edge_id = element_id_to_edge_id[edge_element_id]
234229

235-
print(" edge_element_id:", edge_element_id, " graph_edge_id:", graph_edge_id)
236-
print(" qewatt:",qedges_with_attached_subclass_edges.get(qedge_id, []))
237-
238230
# Check to see if the edge has subclass edges that are connected to it
239231
subclass_edge_ids = []
240232
superclass_node_ids = {}
241233
for (subclass_subject_or_object, subclass_qedge_id, superclass_qnode_id) in \
242234
qedges_with_attached_subclass_edges.get(qedge_id, []):
243235
# If so, check to see if there are results for it
244-
print("-",subclass_qedge_id)
245236
qedge, subclass_edge_element_ids = qedge_id_to_results[subclass_qedge_id]
246-
print("--",qedge,subclass_edge_element_ids)
247237
qedge, subclass_edge_element_ids = qedge_id_to_results[subclass_qedge_id]
248-
print("-?-",qedge,subclass_edge_element_ids)
249238
if subclass_edge_element_ids:
250239
# If path_edge is Truthy, it means the subclass was used in the result.
251240
# For subclass edges, path result is a list of element ids, due to being a variable length edge.
@@ -254,14 +243,12 @@ def transform_result(cypher_record,
254243

255244
qnode, superclass_result_node_id = qnode_id_to_results[superclass_qnode_id]
256245
superclass_node_ids[subclass_subject_or_object] = superclass_result_node_id
257-
print("-=-",subclass_edge_ids)
258246

259247
if subclass_edge_ids:
260248
# make a composite id with all of their kg edge ids
261249
composite_edge_ids = [graph_edge_id] + subclass_edge_ids
262250
composite_edge_id = "_".join(composite_edge_ids)
263251
aux_graph_id = f"aux_{composite_edge_id}"
264-
print(" ",aux_graph_id)
265252
if aux_graph_id not in aux_graphs:
266253
aux_graphs[aux_graph_id] = {
267254
"edges": composite_edge_ids,

tests/fixtures.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77

88

99
@pytest.fixture(name="db_driver", params=["neo4j", "memgraph"], scope="module")
10-
#@pytest.fixture(name="db_driver", params=["memgraph"], scope="module")
1110
def fixture_db_driver(request):
1211
database = request.param
1312
driver = TranspilerNeo4jBoltDriver(database)
1413
yield database, driver
1514
driver.close()
1615

1716

18-
#@pytest.fixture(name="async_db_driver", params=["neo4j","memgraph"], scope="module")
19-
@pytest.fixture(name="async_db_driver", params=["memgraph"], scope="module")
17+
@pytest.fixture(name="async_db_driver", params=["neo4j","memgraph"], scope="module")
2018
def fixture_async_db_driver(request):
2119
database = request.param
2220
driver = TranspilerAsyncNeo4jBoltDriver(database)

tests/test_transform_results.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def test_bolt_driver_transform_results(db_driver):
2121
dialect, driver = db_driver
2222
query = get_query(qgraph, dialect=dialect)
2323
output = driver.run(query, convert_to_trapi=True, qgraph=qgraph)
24-
assert False
2524
assert len(output['results']) == 15
2625
for result in output["results"]:
2726
assert len(result["node_bindings"]) == 2

0 commit comments

Comments
 (0)