The Logica System: Elevating SQL Databases to Declarative Data Science Engines

Evgeny Skvortsov, Yilin Xia, Shawn Bowers, Bertram Ludäscher

Research output: Contribution to journalConference articlepeer-review

Abstract

Logica (= Logic + aggregation) is a freely available, open-source, feature-enhanced version of Datalog that automatically compiles logic rules to a number of popular SQL platforms (DuckDB, SQLite, PostgreSQL, and BigQuery). Logica combines beginner-friendly declarative features of Datalog with advanced analytical features needed by data science and ML practitioners when processing real-world data. Since Logica is built on top of mature SQL implementations, these features can be executed robustly and scalably. Logica allows beginners to seamlessly progress from simple textbook examples to intermediate and advanced use cases. We introduce Logica with examples that combine aggregation, recursion, and negation in interesting and powerful ways. Additional advanced examples (maximum flow, matrix inversion, etc.) are demonstrated in an online notebook. Logica source programs are compiled into (a) self-contained SQL scripts (for non-recursive and shallow-recursive problems) or (b) Python-driven iterations of SQL queries (when deep recursion is needed). Logica’s practical and theoretical expressive power thus extends both SQL and (pure) Datalog. The Logica system has been used for data science applications and training in industry, and in graduate-level courses in academia.

Original languageEnglish (US)
Pages (from-to)69-73
Number of pages5
JournalCEUR Workshop Proceedings
Volume3801
StatePublished - 2024
Event5th International Workshop on the Resurgence of Datalog in Academia and Industry, Datalog-2.0 2024 - Dallas, United States
Duration: Oct 11 2024 → …

Keywords

  • aggregation
  • Datalog-to-SQL compilation
  • declarative data science applications
  • non-stratified negation

ASJC Scopus subject areas

  • General Computer Science

Fingerprint

Dive into the research topics of 'The Logica System: Elevating SQL Databases to Declarative Data Science Engines'. Together they form a unique fingerprint.

Cite this