Question-led guide · evaluation
How do I validate an ontology before an AI agent relies on it?
An ontology validation pack for competency questions, constraints, entailments, source mappings, temporal behavior, permissions, failures, and agent-use tests.
Direct answer
Validate an ontology against the decisions an agent will make. Start with competency questions and expected/forbidden answers; test vocabulary and axioms, SHACL or application constraints, entailments, source mappings, identity, temporal queries, permissions, coverage, conflicts, staleness, and performance. Then run agent tasks with missing, contradictory, and malicious data. Passing syntax or a reasoner consistency check is necessary in some stacks but never sufficient for operational reliance.
Scope
Use this pack before an agent retrieves, reasons over, or acts from an ontology-backed system. It applies to RDF/OWL/SHACL stacks and can be adapted to property-graph or relational semantic layers. The tests are driven by agent decisions, not by a requirement to use every semantic technology.
Why it happens
Ontology teams often validate serialization, parser success, and reasoner consistency. Agent teams then assume the graph is authoritative. The real failure may be elsewhere: source mappings merge entities, relationships are stale, open-world semantics are interpreted as missing-data failure, permissions are not carried into retrieval, or a generated query creates an expensive traversal.
An agent also changes the use case. A human analyst may notice that a dependency is uncertain; a generated answer may state it as fact. Validation must include the evidence envelope and failure behavior presented to the agent.
Diagnosis
Collect the actual questions and actions the agent must support. Rewrite each as a competency test with setup, query, expected answer characteristics, forbidden answer, evidence requirements, and maximum cost. Include historical as-of queries and cross-tenant denials.
Create adversarial fixtures:
- missing required source data;
- duplicate and conflicting identities;
- stale topology;
- invalid constraint values;
- logically inconsistent axioms where relevant;
- unauthorized but semantically related records;
- malicious labels or descriptions;
- large fan-out and cyclic graphs.
Observe whether the system fails visibly, safely, and diagnostically.
Solution
Build layered validation. Check syntax and vocabulary. Run reasoner/profile checks when OWL semantics are used. Validate explicit data constraints with SHACL or equivalent application rules. Test source mappings and identity resolution against reviewed fixtures. Measure coverage and freshness by source and decision, not only globally.
Run competency queries with expected evidence and negative cases. Test authorization before and after inference or traversal. Benchmark latency, result size, and budget enforcement. Finally, run the agent with the same cases and grade citation, uncertainty, abstention, and prohibited actions.
Make the pack part of CI for ontology and mapping changes, then add production drift and incident cases to a regression lane.
Artifact
The ontology-validation pack contains:
| Layer | Required tests |
|---|---|
| Scope/vocabulary | Purpose, competency questions, definitions, naming, ownership |
| Formal model | Parse, imports, profile, consistency, intended entailments/non-entailments |
| Constraints | Positive and negative SHACL/application fixtures and severity policy |
| Mapping/identity | Source versions, exact/candidate mappings, splits, merges, corrections |
| Time/provenance | As-of valid/record time, source lineage, hindsight prevention |
| Coverage/quality | Required sources, completeness by decision, staleness, conflicts |
| Security | Tenant/role filters, inference leakage, query limits, malicious text |
| Operations | Update, migration, rollback, backup/restore, latency, scale, failure mode |
| Agent use | Supported claims, citations, uncertainty, abstention, tools, and serious failures |
| Release | Versions, owners, thresholds, exceptions, canary, monitoring, review/expiry |
Common mistakes
- Treating parser or reasoner success as complete validation.
- Testing only valid examples and happy-path queries.
- Measuring global graph completeness instead of decision-specific coverage.
- Applying permissions after retrieval or inference.
- Updating the ontology without versioned mappings, migrations, rollback, and agent regression tests.
Evidence
SHACL defines validation of RDF data graphs against shapes and produces structured validation results.
The W3C Recommendation specifies shapes graphs, focus nodes, constraints, conformance, severity, and validation reports.
Primary source · standard · checked Aug 26, 2026
Limit: SHACL only checks declared shapes; a conforming graph can still be incomplete, stale, unauthorized, or semantically unhelpful.
Ontology development begins with purpose, scope, reuse, terms, classes, properties, and iterative evaluation rather than tool syntax alone.
Stanford's Ontology Development 101 provides an iterative practical method for defining scope and constructing an ontology.
Primary source · official-doc · checked Aug 26, 2026
Limit: It is an introductory methodology, not an agent-safety standard or production validation benchmark.
Shared ontology governance benefits from explicit principles for identifiers, definitions, reuse, versioning, maintenance, and responsiveness.
The OBO Foundry publishes principles for interoperable, maintained open ontologies in its domain community.
Primary source · official-doc · checked Aug 26, 2026
Limit: The principles arise from the OBO community and do not directly validate enterprise observability or AI-agent use.
Limitations
No finite validation proves all future data and agent behavior. Competency questions can omit real decisions, constraints can encode wrong assumptions, and source systems drift. Validation must continue after release with incident feedback and change governance.
FAQ
- Is a logically consistent ontology valid?
- It is consistent under the selected formal semantics, which is valuable, but it may still use the wrong concepts, omit required data, map sources incorrectly, expose forbidden facts, or fail operational queries.
- Should an AI agent query the graph directly?
- Only through a governed query surface with identity, scope, budgets, provenance, and result semantics. Generated queries need validation, and high-impact decisions require evidence and policy beyond graph access.
Related guides
Continue within Ontology and operational semantics, or use one of these adjacent diagnostics:
Editorial QA: automated native-English, structure, source-presence, and link checks completed . This record is not an independent expert endorsement. Review boundary.
