Ontology-Based Data Access (OBDA) separates the conceptual domain model from physical storage. A user poses a query using familiar domain vocabulary defined in an OWL ontology, unaware of the underlying data organization. A reasoning-enabled mediator automatically rewrites this high-level SPARQL query into the specific SQL dialect required by the relational database, using declarative R2RML mappings to bridge the semantic gap.
Glossary
Ontology-Based Data Access

What is Ontology-Based Data Access?
Ontology-Based Data Access (OBDA) is a virtual data integration paradigm that uses a high-level conceptual ontology as a unified semantic schema to mediate and transparently reformulate user queries into native data-source queries, eliminating the need for physical data centralization.
This virtual approach ensures semantic consistency without costly Extract-Transform-Load processes. The ontology serves as a stable, shared conceptualization, insulating user queries from schema evolution. By leveraging description logic reasoning, the system can infer implicit relationships and enrich queries, delivering integrated answers from disparate, autonomous sources in real-time.
Key Characteristics of OBDA
Ontology-Based Data Access (OBDA) is a paradigm that uses a high-level conceptual ontology to mediate and reformulate SPARQL queries into native SQL for underlying relational databases, enabling semantic access without physical data migration.
Three-Layer Architecture
OBDA separates concerns into three distinct layers:
- Ontology Layer: A high-level conceptual schema defining business entities and relationships using OWL 2 QL
- Mapping Layer: Declarative R2RML or custom mappings that connect ontological terms to relational schemas
- Data Layer: Existing relational databases that remain untouched and in-place
This separation allows domain experts to query using familiar business concepts while databases remain optimized for operational performance.
SPARQL-to-SQL Query Reformulation
The core mechanism of OBDA is query rewriting. When a user submits a SPARQL query against the ontology, the OBDA engine:
- Parses the SPARQL graph patterns
- Consults the mapping assertions to identify relevant database tables and columns
- Reformulates the query into one or more native SQL queries
- Executes against the actual relational database
- Transforms SQL result sets back into RDF triples
This process is transparent to the end user, who never sees the underlying SQL.
OWL 2 QL Profile
OBDA systems typically use the OWL 2 QL profile, a fragment of the Web Ontology Language specifically designed for efficient query answering over large datasets. Key properties:
- Enables query rewriting to first-order SQL without requiring a separate reasoner at query time
- Captures common modeling constructs: class hierarchies, disjointness, domain/range constraints
- Sacrifices some expressivity (no existential quantification on right-hand side of subsumptions) for polynomial-time query answering
- Implemented by engines like Ontop and Stardog
Virtual RDF Graph
OBDA creates a virtual knowledge graph—an RDF representation that appears to exist but is never physically materialized. Benefits include:
- Zero ETL: No batch extraction, transformation, or loading processes required
- Real-time access: Queries always reflect the current state of the source database
- Reduced storage costs: No duplicate data infrastructure
- Simplified governance: Source systems remain the single source of truth
The virtual graph is defined entirely through declarative mappings, not data copying.
Mapping Assertions
Mappings are the critical bridge between ontology and data. Each mapping assertion defines:
- A source: SQL query over one or more relational tables
- A target: RDF triple pattern using ontology terms
Example mapping logic:
- Map
SELECT id, name FROM employeestoex:Employeeinstances withfoaf:nameproperties - Join
employees.department_idtodepartments.idto generateex:worksForrelationships
These mappings are typically authored using R2RML or vendor-specific DSLs with graphical editors.
OBDA vs. Traditional Data Integration
A feature-level comparison of Ontology-Based Data Access against classic ETL and data virtualization approaches for enterprise data integration.
| Feature | OBDA | Traditional ETL | Data Virtualization |
|---|---|---|---|
Integration Paradigm | Virtual, query-time reformulation | Physical, batch materialization | Virtual, query-time federation |
Conceptual Schema | OWL ontology with reasoning | Target warehouse schema | Canonical data model |
Data Freshness | Real-time, source-of-truth | Stale, snapshot-dependent | Real-time, source-of-truth |
Semantic Reasoning | |||
SPARQL Query Support | |||
Schema Evolution Agility | High, ontology absorbs change | Low, ETL pipeline refactoring required | Moderate, view redefinition needed |
Query Performance | Moderate, dependent on SQL rewriting | High, optimized for analytics | High, push-down optimization |
Storage Overhead | None, data remains in situ | High, full data duplication | None, data remains in situ |
Real-World Applications of OBDA
Ontology-Based Data Access (OBDA) moves from theory to practice in environments where data must remain in situ. These applications demonstrate how a conceptual ontology mediates access to legacy relational systems, providing a semantic query layer without physical ETL.
Biomedical Data Federation
OBDA is the foundational paradigm for integrating heterogeneous clinical and genomic data. Institutions use the Observational Medical Outcomes Partnership (OMOP) Common Data Model as an ontology to virtualize patient records, drug exposures, and lab results stored across disparate hospital systems.
- Query Translation: SPARQL queries over the OMOP vocabulary are reformulated via R2RML mappings into SQL for each source database.
- Use Case: Enables cross-institutional cohort identification for rare disease research without moving protected health information.
- Reasoning: OWL 2 QL ontologies allow for class subsumption reasoning at query time, expanding a search for 'Cardiovascular Agent' to automatically include all mapped subclasses like beta-blockers and ACE inhibitors.
Oil & Gas Subsurface Integration
Energy companies deploy OBDA to unify petrotechnical data locked in legacy PPDM (Professional Petroleum Data Management) relational databases and real-time drilling sensors. An upper-level ontology defines concepts like 'Wellbore', 'Formation', and 'Seismic Survey'.
- Semantic Mediation: A geologist queries for 'all wells penetrating the Brent Group formation' using a conceptual vocabulary, while the OBDA engine rewrites this into complex SQL joins across well headers, directional surveys, and stratigraphic tables.
- Temporal Reasoning: The ontology captures the 4D nature of reservoirs, allowing queries about the state of a well at a specific geological time or operational phase.
Cultural Heritage & Digital Libraries
Museums and archives use OBDA to expose heterogeneous cataloging systems as a unified Linked Data endpoint. The CIDOC Conceptual Reference Model (CRM) ontology serves as the global schema, mediating between native MARC, Dublin Core, or relational collection management systems.
- Event-Centric Modeling: CIDOC-CRM models historical events (e.g., the 'Production of a Sculpture') as central entities linking actors, places, dates, and objects. OBDA mappings transform flat relational records into this rich event graph.
- Query Example: A researcher can query for 'all objects created in Florence during the Medici era' across multiple institutions' databases via a single SPARQL endpoint, with the OBDA system handling the syntactic and semantic translation to each source.
Smart Manufacturing & Industry 4.0
Factories implement OBDA to create a virtual knowledge graph over operational technology (OT) data silos. An ontology based on ISA-95 standards defines the hierarchy of equipment, materials, and processes.
- Real-Time Access: OBDA mappings connect the ontology directly to time-series databases and MES (Manufacturing Execution System) tables. A query for 'all sensors on Line 7 reporting temperature > 80°C in the last hour' is rewritten into a SQL window function query against the historian.
- Predictive Maintenance: Maintenance ontologies define failure modes and their observable symptoms. OBDA allows a diagnostic query to traverse from a 'Pump Cavitation' event class to the specific vibration sensor readings and material batch IDs stored in separate SCADA and ERP systems.
Geospatial Intelligence & Defense
Intelligence agencies use OBDA to fuse geospatial intelligence (GEOINT) from imagery databases, signals intelligence (SIGINT) logs, and human intelligence (HUMINT) reports without centralizing classified data. A spatio-temporal ontology defines entities like 'Facility', 'Event', and 'Person'.
- Geospatial Query Rewriting: The ontology includes OGC GeoSPARQL topological relations (e.g.,
sf:within,sf:intersects). An OBDA engine translates a SPARQL query for 'all observation posts within 5km of a known border crossing' into SQL with PostGIS spatial functions on the underlying relational tables. - Provenance Tracking: The ontology captures the source and confidence of each assertion. OBDA mappings ensure that query results include the lineage of the data, allowing analysts to trace a geospatial relationship back to the original SIGINT intercept.
Enterprise Data Governance & Compliance
Financial institutions deploy OBDA to enforce a business glossary over their data landscape. An ontology defines authoritative terms like 'Customer', 'Trade', and 'Risk Exposure', mapped via OBDA to their physical representations in hundreds of source systems.
- Data Lineage at Query Time: When a compliance officer queries for 'all trades by a politically exposed person (PEP)', the OBDA system uses the ontology's definitions and mappings to identify the relevant tables and columns across trading, KYC, and watchlist databases.
- Policy Enforcement: The ontology can encode regulatory rules (e.g., GDPR residency restrictions). The OBDA query rewriting process can inject additional SQL filters based on these rules, ensuring that a query automatically excludes data from customers in restricted jurisdictions without the analyst needing to know the physical data location.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technical answers to the most common questions about using ontologies as a virtual mediation layer over relational databases.
Ontology-Based Data Access (OBDA) is a virtual data integration paradigm that uses a high-level conceptual ontology as a unified semantic schema to query heterogeneous, often relational, data sources. It works through a three-layer architecture: the data layer (the underlying SQL databases), the ontology layer (a formal OWL 2 QL model defining business concepts and relationships), and the mapping layer (declarative R2RML or Direct Mapping rules linking database tables to ontology classes). When a user poses a SPARQL query against the ontology, an OBDA engine performs query rewriting: it uses the ontology's TBox axioms and the mappings to reformulate the SPARQL into a native SQL query that is pushed down to the source databases. The results returned by the database are then transformed back into RDF answers. This eliminates the need for costly ETL processes and provides a real-time, semantically rich view of legacy data without physical relocation.
Related Terms
Explore the core components and adjacent technologies that enable virtual data integration through semantic query mediation.
Virtual Knowledge Graph
An alternative term for OBDA, emphasizing the creation of a virtual RDF graph over relational sources. Unlike materialized graphs, data remains in its original tables and is translated to triples at query time via R2RML mappings. This ensures real-time access to the most current operational data without costly ETL duplication.
SPARQL-to-SQL Rewriting
The computational heart of OBDA. A query rewriter parses a SPARQL query against the ontology and transforms it into an equivalent SQL query over the underlying schema. This involves:
- Unfolding: Replacing ontology terms with their mapped SQL views
- Optimization: Eliminating redundant joins and pushing filters down
- Native Execution: The generated SQL runs directly on the RDBMS, leveraging existing indexes
Ontology-Mediated Query Answering
The theoretical framework underpinning OBDA. It studies how a TBox (ontology axioms) combined with an ABox (data assertions) yields answers beyond simple SQL translation. The ontology adds deductive capabilities, allowing the system to return answers inferred via class subsumption and property hierarchies even when no explicit data match exists.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us