Skip to main content

Quality Rules & Validation

Graphora’s quality validation system provides comprehensive data quality enforcement through format rules, business rules, and automated scoring. This ensures that extracted data meets your standards before being merged into your knowledge graph.

Quality System Overview

The quality validation system operates on multiple levels:

Format Rules

Pattern matching, length constraints, and case formatting validation

Business Rules

Domain-specific validation including allowed/forbidden values and ranges

Automated Scoring

0-100 scale scoring with letter grades (A-F) and auto-approval logic

Violation Reporting

Detailed reports with context, suggestions, and confidence scores

Adding Quality Rules to Properties

Quality rules are defined within property definitions using the quality section:

Format Rules

Format rules validate the structure and formatting of text data.

Pattern Validation

Use regular expressions to enforce specific formats:
Use double backslashes (\\) to escape special regex characters in YAML strings.

Length Constraints

Enforce minimum and maximum character limits:

Case Format Validation

Enforce consistent text casing:
First Letter Of Each Word Capitalized
ALL LETTERS UPPERCASE
all letters lowercase
First letter capitalized, rest lowercase

Business Rules

Business rules enforce domain-specific constraints and data validity.

Forbidden Values

Prevent specific values that indicate poor data quality:

Allowed Values (Whitelist)

Restrict values to a predefined set:

Numeric Range Validation

For integer and float properties, enforce value ranges:

Range Inclusivity

Control whether boundary values are included:

Global Quality Configuration

Define global quality settings that apply to the entire ontology:

Quality Thresholds

Configure when data requires manual review:

Complete Quality-Aware Example

Here’s a comprehensive example showing all quality rule types:

Quality Scoring System

The quality system automatically scores extracted data:

Scoring Algorithm

  • Base Score: Starts at 100 points
  • Format Violations: -5 to -15 points each (based on severity)
  • Business Rule Violations: -10 to -25 points each
  • Missing Required Properties: -20 points each
  • Low Confidence Extractions: -5 to -10 points each

Letter Grades

Excellent Quality
  • Minimal or no violations
  • High extraction confidence
  • Auto-approval eligible
Good Quality
  • Minor violations only
  • Generally acceptable for production
  • May require brief review
Acceptable Quality
  • Some quality issues present
  • Manual review recommended
  • Fixable violations
Poor Quality
  • Significant quality issues
  • Manual review required
  • Consider re-extraction
Failed Quality
  • Critical quality failures
  • Not suitable for production
  • Re-extraction strongly recommended

Violation Reporting

Quality violations include detailed context and suggestions:

Best Practices

Start with Essential Rules: Begin with basic format and business rules, then add more sophisticated validation as needed.
Test with Real Data: Validate your quality rules against sample extractions to ensure they’re not too restrictive.
Avoid Over-Constraining: Too many strict rules can result in excessive false positives and manual review overhead.
Use Meaningful Thresholds: Set quality thresholds based on your specific use case and tolerance for data imperfection.

API Integration

Quality-validated ontologies work seamlessly with the extraction pipeline:

Next Steps

See Examples

Browse complete quality-aware ontology examples

Validation Testing

Learn how to test and validate your quality rules