,
Yilin Xia
,
Bertram Ludäscher
,
Shawn Bowers
Creative Commons Attribution 4.0 International license
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.
@Article{skvortsov_et_al:TGDK.4.2.7,
author = {Skvortsov, Evgeny and Xia, Yilin and Lud\"{a}scher, Bertram and Bowers, Shawn},
title = {{Logica-TGD: Transforming Graph Databases Logically}},
journal = {Transactions on Graph Data and Knowledge},
pages = {7:1--7:27},
ISSN = {2942-7517},
year = {2026},
volume = {4},
number = {2},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/TGDK.4.2.7},
URN = {urn:nbn:de:0030-drops-275889},
doi = {10.4230/TGDK.4.2.7},
annote = {Keywords: Logic rules, Graph queries, Graph transformations}
}