Remove deprecated code from Postgres_impl.py
- Stop filtering out 'base' node labels - Match any edge type in query to improve performance
This commit is contained in:
parent
492269ac44
commit
72384f87c4
1 changed files with 7 additions and 6 deletions
|
|
@ -1701,10 +1701,11 @@ class PGGraphStorage(BaseGraphStorage):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Remove the 'base' label if present in a 'labels' property
|
# Remove the 'base' label if present in a 'labels' property
|
||||||
if "labels" in node_dict:
|
# if "labels" in node_dict:
|
||||||
node_dict["labels"] = [
|
# node_dict["labels"] = [
|
||||||
label for label in node_dict["labels"] if label != "base"
|
# label for label in node_dict["labels"] if label != "base"
|
||||||
]
|
# ]
|
||||||
|
|
||||||
nodes_dict[result["node_id"]] = node_dict
|
nodes_dict[result["node_id"]] = node_dict
|
||||||
|
|
||||||
return nodes_dict
|
return nodes_dict
|
||||||
|
|
@ -1833,14 +1834,14 @@ class PGGraphStorage(BaseGraphStorage):
|
||||||
forward_query = f"""SELECT * FROM cypher('{self.graph_name}', $$
|
forward_query = f"""SELECT * FROM cypher('{self.graph_name}', $$
|
||||||
WITH [{src_array}] AS sources, [{tgt_array}] AS targets
|
WITH [{src_array}] AS sources, [{tgt_array}] AS targets
|
||||||
UNWIND range(0, size(sources)-1) AS i
|
UNWIND range(0, size(sources)-1) AS i
|
||||||
MATCH (a:base {{entity_id: sources[i]}})-[r:DIRECTED]->(b:base {{entity_id: targets[i]}})
|
MATCH (a:base {{entity_id: sources[i]}})-[r]->(b:base {{entity_id: targets[i]}})
|
||||||
RETURN sources[i] AS source, targets[i] AS target, properties(r) AS edge_properties
|
RETURN sources[i] AS source, targets[i] AS target, properties(r) AS edge_properties
|
||||||
$$) AS (source text, target text, edge_properties agtype)"""
|
$$) AS (source text, target text, edge_properties agtype)"""
|
||||||
|
|
||||||
backward_query = f"""SELECT * FROM cypher('{self.graph_name}', $$
|
backward_query = f"""SELECT * FROM cypher('{self.graph_name}', $$
|
||||||
WITH [{src_array}] AS sources, [{tgt_array}] AS targets
|
WITH [{src_array}] AS sources, [{tgt_array}] AS targets
|
||||||
UNWIND range(0, size(sources)-1) AS i
|
UNWIND range(0, size(sources)-1) AS i
|
||||||
MATCH (a:base {{entity_id: sources[i]}})<-[r:DIRECTED]-(b:base {{entity_id: targets[i]}})
|
MATCH (a:base {{entity_id: sources[i]}})<-[r]-(b:base {{entity_id: targets[i]}})
|
||||||
RETURN sources[i] AS source, targets[i] AS target, properties(r) AS edge_properties
|
RETURN sources[i] AS source, targets[i] AS target, properties(r) AS edge_properties
|
||||||
$$) AS (source text, target text, edge_properties agtype)"""
|
$$) AS (source text, target text, edge_properties agtype)"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue