NLQ-to-SQL Conversion via Ontological Codes and Placeholders
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Converting natural language queries (NLQs) to structured query language queries (SQLQs) is challenging in domains like healthcare and life sciences due to complexities such as different medical ontologies and codes, making it difficult for users with limited technical knowledge to retrieve data from databases.
Innovation Solution
A system that uses machine learning-based models and ontological codes with placeholders to convert NLQs into SQLQs, leveraging predefined SQL subquery templates and custom entity recognition rules to disambiguate medical codes and generate executable SQL queries, allowing users to query databases using natural language.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If traditional NLQ-to-SQL conversion approaches are used, then users with limited technical knowledge can retrieve data, but conversion fails in domains with complex ontologies like healthcare and life sciences
Solution Approach 1:
The patent introduces an intermediary layer consisting of ontology codes and placeholders that mediates between natural language queries and SQL queries. The system maps NLQ terms to ontology codes (e.g., medical concepts to SNOMED CT codes), which then map to database tables and columns. This intermediary translation layer enables accurate data retrieval in complex domains like healthcare by resolving ontology-specific terminology without requiring users to understand the underlying complexity.
2Ease of operation
If users with limited technical knowledge query databases directly, then data retrieval is simple, but technical barriers prevent access in complex domains
Solution Approach 1:
The system performs self-service by automatically handling the complex translation and mapping processes without requiring user intervention. The NLQ-to-SQL conversion system autonomously maps natural language terms to ontology codes, resolves ambiguities, generates appropriate SQL queries, and executes them against the database. This eliminates the need for users to manually navigate complex ontology structures or write SQL queries, while the system manages all technical complexity behind the scenes.
3Ease of manufacture
If static ontology mappings are used, then conversion is straightforward, but the system cannot adapt to dynamically changing ontologies
Solution Approach 1:
The patent implements dynamics by enabling the ontology code to code mappings to be updated and evolved over time. The system maintains dynamic mappings between natural language terms, ontology codes, and database schemas, allowing these relationships to be modified when ontologies change. This dynamic adaptation capability ensures the system continues to accurately convert NLQs to SQLQs even as medical or domain-specific ontologies evolve, without requiring complete reconfiguration of the conversion system.
Data Source
AI summary
An NLQ-SQLQ tool or service of a provider network may receive a natural language query (NLQ) from a client and convert the NLQ to an SQL query using ontological codes and placeholders. For one or more portions of the NLQ, the tool/service determines that the portion is associated with one or more codes of an ontology. The tool/service then assigns, based on criteria, a particular code to the portion. The tool/service replaces portions of the NLQ with different argument placeholders to generate a modified NLQ. A trained model converts the modified NLQ into an initial SQL query that has argument placeholders and subquery placeholders. The tool/service generates a final SQL query based on the initial SQL query, predefined SQL subquery templates associated with the subquery placeholders, and codes associated with the argument placeholders. The tool/service executes the final SQL query and sends results to the client.


