Answers are grounded in this paper and cite their sources.
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.
No takes yet. Share an insight, caveat, or question.
Juanola et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: