SchemaValidator
org.llm4s.knowledgegraph.extraction.SchemaValidator
Validates an extracted graph against an ExtractionSchema.
Separates nodes and edges into conforming (valid) and non-conforming (out-of-schema) sets, and reports specific constraint violations such as relationship endpoint type mismatches.
Value parameters
- schema
-
The extraction schema to validate against
Attributes
- Example
-
val schema = ExtractionSchema.simple( entityTypes = Seq("Person", "Organization"), relationshipTypes = Seq("WORKS_FOR") ) val validator = new SchemaValidator(schema) val result = validator.validate(extractedGraph) if (result.isFullyValid) println("Graph conforms to schema") - Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article