lplalbert opened a new pull request, #423:
URL: https://github.com/apache/hugegraph-ai/pull/423

   Clears the `# TODO: use a more efficient way to compare the extract & input 
property` in `extract_triples_by_regex_with_schema`.
   
   Every extracted triple used to scan all schema vertices and edges to find 
its label/property match. The schema is now indexed once per call - a 
`(vertex_label, lowercased property)` set and a first-definition `edge_label -> 
edge` map - so each triple matches in constant time.
   
   Semantics preserved exactly: property matching stays case-insensitive (the 
extracted property keeps its original casing as the stored key), edge labels 
stay exact-match and first-definition-wins, and a triple whose label matches 
both a vertex property and an edge label still runs both paths independently 
(the prompt contract: LABEL is the subject's vertex_label or the predicate's 
edge_label).
   
   ## Validation
   
   - `SKIP_EXTERNAL_SERVICES=true uv run pytest 
hugegraph-llm/src/tests/operators/llm_op/` -> 75 passed, 3 subtests passed (the 
existing extraction test pins the multi-triple/edge path).
   - New `test_extract_by_regex_with_schema_lookup_semantics` pins the lookup 
contracts the refactor relies on (case-insensitive properties, exact edge 
labels).
   - `ruff format --check` / `ruff check` / `ty check` clean on touched files.
   - No wall-clock benchmark: no representative workload at hand, so only the 
complexity change is claimed (per-triple O(schema) scans -> one O(schema) index 
build per call). Not measured.
   
   🤖 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