Applied Systems · Practitioner Brief · 9 min read

Minimum Viable Semantics: When JSON Schema Suffices and When You Need an Ontology

A seven-level decision rule matching operational risk signals to JSON Schema, knowledge graphs, OWL 2 ontologies, and closed-world W3C SHACL action gates.

By AgenticHorizon AI Principal Architecture & Research Team · Published · 9 min read

Executive Summary & Key Architectural Takeaways

  • Use the lightest semantic formalism (L1–L7) that makes your highest-priority operational failure modes impossible, detectable, or recoverable.
  • JSON Schema (L3) validates local payload syntax at a single boundary but cannot resolve homonyms, traverse multi-hop lineage, or enforce bitemporal truth.
  • Open-world OWL 2 reasoners (L5) never flag missing mandatory fields as errors; pre-action validation requires closed-world W3C SHACL shapes (L6).
  • In production automotive retail, pairing 45 modular OWL/RDF files and 21 SPARQL resolvers with SHACL and fact-echo gates achieved 98.9% compliance across 2,571/2,600 checks.

1. Escaping the False Dichotomy Between Prompt-Only JSON and Monolithic Megagraphs

Enterprise architecture teams debating how to ground AI agents almost always polarize into two camp extremes. One camp insists that modern foundation models plus Pydantic or JSON Schema structured outputs can handle everything, dismissing ontologies as slow Semantic Web bureaucracy. The opposing camp proposes a multi-year, boil-the-ocean corporate ontology initiative to model every concept across the company before deploying a single agent. Both extremes fail in production.

Four Enterprise Meaning Deficits of Foundation Models

Pre-trained language models excel at public linguistic patterns but suffer from four structural deficits regarding private institutional meaning: (1) Boundary Deficit (they do not know your organization’s specific definition of an "Active Commercial Account" vs. a "Qualified Lead"), (2) Bitemporal Commitment Deficit (they cannot distinguish a Tuesday pricing bulletin that superseded Monday’s rate sheet from historical training text), (3) Closed-World Invariant Deficit (they round currency figures and interpolate plausible values when mandatory fields are missing), and (4) Kinetic Authority Deficit (they cannot verify whether a proposed state mutation violates cross-entity exposure limits).

The Minimum Semantic Machinery Decision Rule

Our Minimum Semantic Machinery Principle resolves this tension through risk-calibrated escalation: adopt the lightest semantic formalism across the seven-level spectrum (L1 through L7) that makes your highest-priority operational failure modes impossible, deterministically detectable, or safely recoverable.

2. The Seven-Level Spectrum (L1–L7): Where JSON Schema Succeeds and Where It Breaks

Understanding exactly when to stop at JSON Schema (`L3`) versus when to escalate to graph and ontological machinery (`L4–L7`) requires examining the structural guarantee each level provides:

Levels L1 to L3: Prompts, Controlled Vocabularies, and Typed Schemas

  • Level 1 · Prompt-Glossed Text & Raw Vectors: Sufficient only for low-stakes internal ideation or draft summarization where human authors review every output. Fails immediately on entity disambiguation and numeric precision.
  • Level 2 · Controlled Vocabularies & Canonical URIs (SKOS): Introduces a canonical URI registry and synonym rings so terms like "Customer", "Subscriber", and "Merchant" resolve to unambiguous identifiers across departments.
  • Level 3 · Strictly Typed Data Contracts (JSON Schema / Pydantic / OpenAPI): Enforces local syntactic structure, field data types, and enum bounds on single API payloads or tool calls. Where L3 breaks: JSON Schema validates a payload tree in isolation. It cannot verify whether the vin string inside a valid JSON object actually exists in today’s inventory ledger, whether the quoted apr_percent matches the current financing tier for that specific vehicle trim, or whether two different services use the same field name with conflicting semantics.

Levels L4 to L7: Knowledge Graphs, Ontologies, SHACL, and Kinetic Contracts

  • Level 4 · Bitemporal Enterprise Knowledge Graphs (RDF/SPARQL or Property Graphs): Connects entities across multi-hop relational joins and tracks both Valid-Time ($t_{\text{valid}}$) and Transaction-Time ($t_{\text{tx}}$) via W3C PROV-O so agents never act on superseded facts.
  • Level 5 · Bounded Domain Ontologies (OWL 2 RL/EL): Formalizes taxonomic class hierarchies, property domain/range axioms, and equivalence mappings aligned to industry standards (FIBO in finance, HL7 FHIR/SNOMED in healthcare, EDMC Automotive Ontology in mobility).
  • Level 6 · Closed-World Constraint & Policy Shapes (W3C SHACL + Datalog + OPA): Enforces mandatory field completeness, cross-property equality against canonical graph state, and statutory policy gates prior to action.
  • Level 7 · Kinetic Action Ontology & Proof-Carrying Envelopes: Binds pre/post-condition SPARQL checks, dry-run blast-radius simulation, semantic compensation handlers, and cryptographic execution receipts to every autonomous write.

3. The Open-World Trap: Why OWL 2 Cannot Replace Closed-World W3C SHACL Gates

Even teams that invest in semantic technologies frequently stumble into a classic formal logic trap: attempting to use an OWL 2 description-logic reasoner (`L5`) as a pre-execution payload validator (`L6`).

OWL 2 operates under the Open-World Assumption (OWA) and the Non-Unique Name Assumption. In open-world logic, if an ontology axiom states that every GovernedCommercialOffer must have at least one hasVerifiedVIN property, and an agent emits a proposal node lacking a VIN, an OWL reasoner does not raise a validation error—it simply infers that the offer possesses an unknown VIN that has not yet been stated in the graph! In an autonomous execution pipeline, silently passing an incomplete or ungrounded commercial offer is disastrous.

Pre-action agent gates require Closed-World Validation via W3C SHACL (Shapes Constraint Language). Under SHACL evaluation, whatever is not explicitly present in the target graph slice is treated as false or missing. A SHACL NodeShape deterministically verifies that sh:minCount 1 and sh:maxCount 1 hold on the 17-character VIN regex pattern and that ex:quotedPriceCents strictly sh:equals the canonical ledger price property before the proposal can advance.

4. The 3-Layer Ontology Extension Pattern and 90-Day Rollout

To avoid the "Boil-the-Ocean Enterprise Megagraph" anti-pattern, production ontologies are scoped to Domain-Driven Design (DDD) bounded contexts using our 3-Layer Ontology Extension Architecture:

  • Layer 1 · Upper Institutional Core (15–30 Classes): Defines organization-wide foundational commitments such as GovernedAsset, ActorIdentity, BitemporalFact, and CommercialOffer.
  • Layer 2 · Industry Standard Adapter: Aligns domain concepts to vetted external standards—such as FIBO for financial underwriting, HL7 FHIR for clinical workflows, or the EDMC Automotive Ontology for vehicle specifications—preventing teams from reinventing standard domain vocabularies.
  • Layer 3 · Local Operational & SHACL Action Shapes: Encodes the specific closed-world SHACL NodeShapes, SPARQL precondition queries, and OPA/Cedar policy bindings that gate concrete agent workflows.

This modular structure enables a disciplined 90-Day Semantic Control Plane Rollout: Days 1–30 deploy `L2–L3` canonical URI registries and JSON Schemas for the top 25 high-risk domain concepts; Days 31–60 stand up a bounded `L4–L6` Knowledge Graph slice and closed-world SHACL pre-action shapes; and Days 61–90 wire `L7` Proof-Carrying Action Envelopes and Semantic CI/CD regression suites into production.

5. Applied Production Evidence: Enterprise Knowledge & Decision Intelligence (98.9% Compliance)

The operational payoff of escalating from `L3` JSON Schema to `L4–L6` neuro-symbolic machinery is demonstrated in our deployed Enterprise Knowledge & Decision Intelligence architecture. In high-volatility commercial retail and enterprise decision operations—such as daily inventory, localized financing incentives, and strict statutory pricing disclosures—constraining foundation models only by JSON Schema (`L3`) routinely produced syntactically valid JSON objects while rounding currency figures ($28,500 → "$28.5K"), hallucinating finance rates, or leaking attributes across sibling entities.

By normalizing live enterprise feeds and merchandising telemetry into three Ontotext GraphDB repositories governed by 45 modular OWL/RDF files (>25,000 lines of ontology code aligned to upper enterprise and EDMC industry ontologies), the platform executes 21 parameterized SPARQL 1.1 resolvers to compile a deterministic 60/30/10 context window. Before and after the 8-agent Gemini 2.5 synthesis swarm emits its typed Abstract Syntax Tree, closed-world SHACL gates, a deterministic numeric Fact-Echo Verifier, and a 64-bit SimHash anti-cannibalization engine inspect every token—achieving a verified 98.9% ontology and policy compliance rate across 2,571 of 2,600 automated checks with zero ungrounded prices or rates reaching publication.

Join the Research Community · Applied Systems

Subscribe on Substack & Watch on YouTube

Follow ongoing architectural specifications, practitioner essays, and visual walkthroughs on Substack and YouTube.