[geaflow/ai-memory] Implement `SchemaValidator` for extracted graph facts
- Dominant language
- Java
- Stars
- 808
- Forks
- 188
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 2
Description
Priority: P0
Difficulty: Intermediate
Context: `GraphEntity` can be written today, but extracted facts need schema validation before entering graph storage or indexes.
Scope:
- Validate vertex labels, edge labels, required properties, property types, and relation endpoints.
- Return structured validation errors with fact ID and source span.
- Add tests for invalid label, missing property, wrong type, dangling edge, and unsupported predicate.
Constraints:
- Do not mutate the graph.
- Do not silently drop invalid facts.
Acceptance Criteria:
- Valid facts pass unchanged.
- Invalid facts are returned with stable error codes.
- Error messages do not include full raw document text.
Suggested paths:
- `geaflow-ai/src/main/java/org/apache/geaflow/ai/validate`
Contributor guide
Research direction
Start by tracing how GraphEntity enters graph storage or indexes, then inspect the suggested geaflow-ai/src/main/java/org/apache/geaflow/ai/validate package. Add focused tests for invalid labels, missing properties, wrong types, dangling edges, and unsupported predicates; done means valid facts pass unchanged and invalid facts return stable error codes without mutating the graph or exposing raw documents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 56/100