This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git
The following commit(s) were added to refs/heads/main by this push:
new 943e750 fix: null value detection on vid attributes (#115)
943e750 is described below
commit 943e75066aba3aa10f07c72453b1fb0679e65a44
Author: chenzihong <[email protected]>
AuthorDate: Mon Nov 18 18:17:07 2024 +0800
fix: null value detection on vid attributes (#115)
TODO:
1. add property limit for vertex & edge (could use 2 option to control it)
2. fix missing edge property
---------
Co-authored-by: imbajin <[email protected]>
---
.../src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py
b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py
index 8ac2c9a..3f11c91 100644
--- a/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py
+++ b/hugegraph-llm/src/hugegraph_llm/operators/hugegraph_op/graph_rag_query.py
@@ -236,7 +236,7 @@ class GraphRAGQuery:
return flat_rel, prior_edge_str_len, depth
node_cache.add(matched_str)
- props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items())
+ props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items() if
v)
# TODO: we may remove label id or replace with label name
if matched_str in v_cache:
node_str = matched_str
@@ -251,7 +251,7 @@ class GraphRAGQuery:
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())
+ props_str = ", ".join(f"{k}: {v}" for k, v in item["props"].items() if
v)
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]