Schema Validation
Schema validation ensures that ontology definitions are consistent, complete, and aligned with physical data sources. The validation engine checks object type integrity, relationship consistency, mapping correctness, and governance compliance.
Validation Rules
Object Type Validation
| Rule | Description | Severity |
|---|---|---|
| Unique names | No duplicate object type names within a tenant | Error |
| Required properties | At least one property must be defined | Error |
| Valid data types | All property data types must be recognized | Error |
| Description required | Description must be non-empty | Warning |
| Governance required | Owner and classification must be set | Warning |
Relationship Validation
| Rule | Description | Severity |
|---|---|---|
| Target exists | Target object type must exist | Error |
| No circular references | Detect circular relationship chains | Error |
| Inverse consistency | Inverse relationship must reference back correctly | Warning |
| Cardinality match | Both sides of the relationship agree on cardinality | Error |
Mapping Validation
| Rule | Description | Severity |
|---|---|---|
| Source exists | Physical table or endpoint must be accessible | Error |
| Column exists | All mapped source columns must exist | Error |
| Type compatibility | Source column types must be compatible with property types | Warning |
| Coverage | All required properties must have mappings | Warning |
Validation API
POST /v1/ontology/validate
Request:
{
"objectTypeId": "ot-abc-123",
"checks": ["object_type", "relationships", "mappings", "governance"]
}
Response:
{
"valid": false,
"errors": [
{
"check": "relationships",
"rule": "target_exists",
"message": "Target object type 'OrderItem' not found",
"path": "relationships[0].target_type"
}
],
"warnings": [
{
"check": "mappings",
"rule": "coverage",
"message": "Property 'phone_number' has no datasource mapping",
"path": "properties[3]"
}
]
}Bulk Validation
Validate all object types in a tenant ontology:
POST /v1/ontology/validate/all
Response:
{
"totalObjectTypes": 25,
"valid": 22,
"invalid": 3,
"results": [...]
}Pre-Deployment Validation
Before deploying ontology changes to production, the validation engine runs a comprehensive check:
| Phase | Checks |
|---|---|
| Syntax | Valid JSON/YAML, required fields present |
| Semantic | Relationship consistency, type compatibility |
| Physical | Datasource accessibility, column existence |
| Governance | Owner set, PII fields classified, retention configured |
Migration Validation
When updating an existing ontology, the validator checks for breaking changes:
| Change Type | Validation |
|---|---|
| Property removed | Check if any downstream consumers reference it |
| Type changed | Check backward compatibility |
| Relationship removed | Check if any queries depend on it |
| Property renamed | Check all datasource mappings |
Related Pages
- Object Types -- Object type definitions
- Datasource Mapping -- Physical mappings
- API Reference -- Full API documentation