Ontology-Based Natural Language Query Interfaces for Data Exploration

Chuan Lei, Fatma Özcan, Abdul Quamar, Ashish R. Mittal, Jaydeep Sen, Diptikalyan Saha, Karthik Sankaranarayanan

Introduction

Modern enterprises face a significant challenge in data exploration: information is often fragmented across diverse storage formats, including relational databases (SQL), document stores (JSON), and graph databases. This "poly-store" environment, while efficient for specialized storage needs, creates a barrier for business users who lack the technical expertise to navigate multiple complex query languages. This paper presents an end-to-end system designed to bridge this gap, allowing users to query multi-store data using natural language.

System Architecture and OQL

The core of the solution is a two-stage translation architecture that provides "physical independence." This means the natural language processing logic remains decoupled from the underlying data storage format.

The system architecture illustrating the flow from natural language interfaces to physical data stores via the Ontology Query Language (OQL).

As shown in the architecture, user queries from applications or chatbots are first translated into an intermediate Ontology Query Language (OQL). OQL is a high-level, object-oriented language that mirrors the structure of the domain ontology rather than the physical database schema. An OQL Query Compiler then translates these high-level queries into the specific languages required by the backend stores (SQL, Search, JSON, or Graph).

The Role of the Domain Ontology

The system relies on a domain-specific ontology (modeled in OWL) to define entities and their relationships. This layer acts as a semantic map that guides the translation process. For environments where an ontology is not pre-defined, the system includes mechanisms to automatically infer one from existing JSON schemas or relational database constraints.

Example of a finance domain ontology and the automated generation of an ontology from a document schema.

Natural Language Processing and Disambiguation

The Natural Language Query (NLQ) engine performs two primary tasks: evidence generation and interpretation.

  1. Evidence Generation: The engine identifies "tokens" in the user's query and maps them to ontology elements using a Translation Index (TI). This index is crucial for handling synonyms and semantic variations, such as mapping various corporate aliases to a single entity.
  2. Interpretation via Steiner Trees: To resolve ambiguity, the system treats the ontology as a graph. It employs a Steiner-tree algorithm to find the most compact subtree connecting all identified tokens. This approach is based on the heuristic that the most direct path in the ontology typically represents the user's true intent.

Furthermore, the system includes a conversational extension. A Context Manager tracks previous queries, allowing the ontology to serve as an anchor for resolving co-references (e.g., determining that "its" refers to a specific "Company" based on valid relationships defined in the ontology).

Evaluation and Results

The system was evaluated using several large-scale enterprise datasets:

  • Finance: Using 1.5 TB of SEC and FDIC filings, the engine demonstrated high precision and recall, successfully disambiguating terms like "IBM" which appeared in over 200 different roles across the dataset.
  • SAP-ERP: In a massive schema with 100,000 tables, the system proved scalable to environments that are typically too large for traditional keyword-to-SQL mapping techniques.
  • Healthcare and Weather: These datasets tested the system's ability to handle specialized terminology and time-related expressions (e.g., mapping "hot" to specific temperature thresholds).

Conclusion and Future Work

By using an ontology as a semantic bridge, this system enables intuitive data exploration across heterogeneous stores. While the current implementation effectively handles many enterprise scenarios, future work will focus on reducing "spurious mappings" and improving the detection of complex nested query intents in natural language.

Summary updated

BibTeX
@article{lei2018ontology,
  author = {Chuan Lei and Fatma Özcan and Abdul Quamar and Ashish R. Mittal and Jaydeep Sen and Diptikalyan Saha and Karthik Sankaranarayanan},
  title = {{Ontology-Based Natural Language Query Interfaces for Data Exploration}},
  journal = {IEEE Data Eng. Bull.},
  year = {2018},
}
Figure