linmengmeng-1314 opened a new pull request, #331:
URL: https://github.com/apache/hugegraph-ai/pull/331

   ## Summary
   
   - Fix edge creation failure when loading extracted graph data into HugeGraph
   - The HugeGraph server assigns vertex IDs (e.g., `1:Sarah`) using numeric 
label IDs, which differ from LLM-predicted IDs (e.g., `person:Sarah`) that 
edges reference
   - Add `vid_mapping` to track the ID mapping and update edge `outV`/`inV` 
after vertex creation
   
   ## Problem
   
   When using "Load into GraphDB" to import extracted graph data, edges fail to 
be created with `java.lang.IllegalArgumentException`. The root cause is that 
the LLM generates vertex IDs using label names (e.g., `person:Sarah`), but the 
HugeGraph server uses numeric label IDs (e.g., `1:Sarah`). Edge references 
still point to the LLM-predicted IDs, causing vertex lookup failures.
   
   ## Solution
   
   - Save original vertex ID before server creation
   - Build a mapping from original ID to actual server-assigned ID
   - Apply the mapping when creating edges (with fallback to original ID for 
backward compatibility)
   
   ## Test plan
   
   - [ ] Extract graph data with an LLM
   - [ ] Load into GraphDB and verify both vertices and edges are created 
successfully
   - [ ] Verify existing functionality is not broken (when LLM predicts correct 
IDs)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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