You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "ChenZiHong-Gavin (via GitHub)" <gi...@apache.org> on 2024/11/19 09:20:00 UTC

[PR] fix: correct e_cache type [incubator-hugegraph-ai]

ChenZiHong-Gavin opened a new pull request, #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117

   - [X] fix edge cache using (inV, label, outV) as key
   - [X] limit node and edge property length
   - [ ] handle isolate node problem


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117#discussion_r1850119590


##########
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 ""

Review Comment:
   no need now?



-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "ChenZiHong-Gavin (via GitHub)" <gi...@apache.org>.
ChenZiHong-Gavin commented on code in PR #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117#discussion_r1848476027


##########
hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py:
##########
@@ -117,18 +117,23 @@ def query_graphdb(
         self,
         max_deep: int = 2,
         max_items: int = 30,
+        max_v_prop_length: int = 4096,

Review Comment:
   changed to `max_v_prop_len` and `max_e_prop_len`



-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix(llm): correct e_cache type [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin merged PR #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117#discussion_r1848052361


##########
hugegraph-llm/src/hugegraph_llm/config/config_data.py:
##########
@@ -70,6 +70,7 @@ class ConfigData:
     graph_user: Optional[str] = "admin"
     graph_pwd: Optional[str] = "xxx"
     graph_space: Optional[str] = None
+    enable_prop_limit: Optional[str] = "False"

Review Comment:
   prefer short param  name like `limit_property`



##########
hugegraph-llm/src/hugegraph_llm/operators/graph_rag_task.py:
##########
@@ -117,18 +117,23 @@ def query_graphdb(
         self,
         max_deep: int = 2,
         max_items: int = 30,
+        max_v_prop_length: int = 4096,

Review Comment:
   `max_v_prop_len` or `v_prop_len_max`
   
   same as edge



-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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 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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] fix: correct e_cache type [incubator-hugegraph-ai]

Posted by "ChenZiHong-Gavin (via GitHub)" <gi...@apache.org>.
ChenZiHong-Gavin commented on code in PR #117:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/117#discussion_r1848475234


##########
hugegraph-llm/src/hugegraph_llm/config/config_data.py:
##########
@@ -70,6 +70,7 @@ class ConfigData:
     graph_user: Optional[str] = "admin"
     graph_pwd: Optional[str] = "xxx"
     graph_space: Optional[str] = None
+    enable_prop_limit: Optional[str] = "False"

Review Comment:
   changed to `limit_property`



-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org