[geaflow/ai-memory] Define `ExtractionSchema` for property graph and KBQA triples
- Dominant language
- Java
- Stars
- 808
- Forks
- 188
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 2
Description
Priority: P0
Difficulty: Intermediate
Context: HugeGraph-AI-style import uses schema/prompt-driven extraction. geaflow-ai currently supports pre-structured graph import, but lacks a workflow that converts text paragraphs into typed graph facts or traditional KBQA triples.
Scope:
- Add `ExtractionSchema` contract for vertex types, edge types, properties, aliases, required fields, and allowed relation predicates.
- Include a KBQA triple projection: `subject`, `predicate`, `object`, `source_span`, `confidence`.
- Add JSON examples and parser tests.
Constraints:
- Do not implement LLM extraction in this issue.
- Do not hard-code a single business ontology.
- Schema parsing must fail closed for unknown required fields.
Acceptance Criteria:
- Valid schema examples round-trip through JSON.
- Invalid relation predicate, missing required property, and duplicate type definitions fail with typed errors.
- Schema examples include both property graph and triple-style facts.
Suggested paths:
- `geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/schema`
- `geaflow-ai/src/test/resources/extraction/schema`
Contributor guide
Research direction
Start in geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/schema and review the schema contract requirements, then inspect geaflow-ai/src/test/resources/extraction/schema for the expected JSON examples. Add parser tests covering round trips and typed failures for invalid predicates, missing required properties, duplicate definitions, and unknown required fields; done means both property-graph and triple-style examples validate correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, json
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100