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") - Source
- SchemaValidator.scala
- Graph
-
- Supertypes
Members list
In this article
