Work

BLAST: a tool for bidirectional logics to SQL translation

Year: 2026
Type: article
Abstract: SQL is the main language used to query data in relational databases and interact with them. However, for accomplishing certain reasoning tasks (such as semantic query optimization, reasoning, query containment, etc), it is desirable to translate SQL into first-order languages (e.g., relational calculus, or Datalog). Indeed, a first-order logic formalism facilitates the analysis of SQL queries without having to depend on the nuances of their implementations. The possibility of this translation is already known due to the equivalence in expression power between relational algebra and relational calculus. Unfortunately, although this equivalence was discovered more than 40 years ago, to date there is no public, open-source, and validated tool to obtain these translations. This paper presents BLAST, an automatic and bidirectional translator between SQL expressions and first-order logic, focused on mapping SQL queries, views or assertions into logic queries, derivation rules, or logic constraints, and vice versa. The translator comes with two interfaces, a GUI one (for end users), and a Java API (for integrating the translator into other tools); and provides two different translation strategies depending on the user needs. To ensure that the code is easy to adopt, maintain, and contribute to, the whole project is based on metamodels.
Language: English
Open Access status: hybrid
Estimated APC paid: $3,090
OpenAlex ID: W7225453229
FWCI:
Cites: 22
Cited by:
Related to: 10