Logica-TGD: Transforming Graph Databases Logically
Evgeny Skvortsov, Xia, Yilin, Bertram Ludäscher, Shawn Bowers · arXiv (Cornell University) · 2025
Graph transformations are a powerful computational model for manipulating complex networks, but handling temporal aspects and scalability remain significant challenges. We present a novel approach to implementing graph transformations using Logica, an open-source logic programming language and system that operates over standard database systems including PostgreSQL, DuckDB, and BigQuery. Logica leverages the inherent parallelism of these engines and offers a practical and scalable way to carry out a variety of graph transformations, including complex scenarios such as time-varying graphs. We illustrate Logica’s graph querying and transformation capabilities with several examples, including a declarative program for pathfinding in a dynamic graph and a taxonomic analysis over a full current Wikidata dump. Experimental results compare Logica running on DuckDB engine to the Datalog engines Soufflé and Nemo, and to DuckPGQ, an implementation of SQL/PGQ. We argue that a logic-based declarative syntax, a built-in visualization library, and (plug-and-play) support for large-scale database engines make Logica a convenient and practical tool for a wide range of graph transformation tasks.