imbajin commented on code in PR #117:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/117#discussion_r1850129132
##########
hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py:
##########
@@ -250,16 +259,18 @@ def _process_vertex(self, item: Any, flat_rel: str,
node_cache: Set[str],
return flat_rel, prior_edge_str_len, depth
def _process_edge(self, item: Any, flat_rel: str, prior_edge_str_len: int,
- raw_flat_rel: List[Any], i: int, use_id_to_match: bool,
e_cache: Set[str]) -> Tuple[str, int]:
- props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items() if
v)
+ raw_flat_rel: List[Any], i: int, use_id_to_match: bool,
+ e_cache: Set[Tuple[str, str, str]]) -> Tuple[str, int]:
+ props_str = ", ".join(f"{k}: {self._limit_property_query(v, 'edge')}"
+ for k, v in item["props"].items())
props_str = f"{{{props_str}}}" if len(props_str) > 0 else ""
prev_matched_str = raw_flat_rel[i - 1]["id"] if use_id_to_match else (
raw_flat_rel)[i - 1]["props"][self._prop_to_match]
- if item["label"] in e_cache:
+ if (item['inV'], item['label'], item['outV']) in e_cache:
Review Comment:
avoid visit params for multi times
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]