Leomrlin commented on code in PR #729:
URL: https://github.com/apache/geaflow/pull/729#discussion_r2716570425


##########
geaflow-ai/src/main/java/org/apache/geaflow/ai/consolidate/function/KeywordRelationFunction.java:
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geaflow.ai.consolidate.function;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.apache.geaflow.ai.GraphMemoryServer;
+import org.apache.geaflow.ai.common.ErrorCode;
+import org.apache.geaflow.ai.common.config.Constants;
+import org.apache.geaflow.ai.graph.*;
+import org.apache.geaflow.ai.graph.io.Edge;
+import org.apache.geaflow.ai.graph.io.EdgeSchema;
+import org.apache.geaflow.ai.index.EntityAttributeIndexStore;
+import org.apache.geaflow.ai.index.vector.KeywordVector;
+import org.apache.geaflow.ai.search.VectorSearch;
+import org.apache.geaflow.ai.verbalization.SubgraphSemanticPromptFunction;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class KeywordRelationFunction implements ConsolidateFunction {
+
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(KeywordRelationFunction.class);
+
+    @Override
+    public void eval(GraphAccessor graphAccessor, MutableGraph mutableGraph) {
+        EntityAttributeIndexStore indexStore = new EntityAttributeIndexStore();
+        indexStore.initStore(new 
SubgraphSemanticPromptFunction(graphAccessor));
+        LOGGER.info("Success to init EntityAttributeIndexStore.");
+        GraphMemoryServer server = new GraphMemoryServer();
+        server.addGraphAccessor(graphAccessor);
+        server.addIndexStore(indexStore);
+        LOGGER.info("Success to init GraphMemoryServer.");
+
+        if (null == mutableGraph.getSchema().getSchema(
+            Constants.CONSOLIDATE_KEYWORD_RELATION_LABEL)) {
+            int code = mutableGraph.addEdgeSchema(new EdgeSchema(

Review Comment:
   The modification and synchronization of the mutableGraph are entirely 
managed by the external HTAP graph engine. The Server side of the GraphMemory 
component is not responsible for this logic. Currently, there is only one 
instance of ConsolidateServer in the system, so there are no data 
synchronization or conflict issues between multiple instances.



-- 
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]

Reply via email to