Research has made big steps in the field of database theory, leading to large technological improvements of the existing systems. These systems ensure efficiency and suitable computational power to handle the so-called
“big data”. In particular, relational DBMSs provide high performance on read/write operations, and support a query language sufficiently expressive such as SQL. Furthermore, there exist logic-based systems - the so-called Deductive Database Systems (DDS) - that provide support to recursive queries, enabling complex reasoning capabilities and allowing querying of databases, using Datalog-like rules. Among the available DDS systems, one of the most known implementation is DLV. In particular, there is an extension of DLV - called DLVDB - that merges the potential of a DDS with the well-known optimization techniques implemented in the current DBMSs, improving rea-
soning efficiency on big data sets. DLVDB can evaluate a Datalog program having EDBs stored on a relational DBMS. Unfortunately, it can not handle database types in a satisfying way, and it does not support all DBMSs.
Moreover, it is difficult to integrate DLVDB into a real system, due to the lack of an API that simplifies the interoperability with third-party software.
In this thesis, we present two new software systems that address these problems. The first one is called RelGrounder, which is an evaluator of stratified Datalog programs with EDBs stored on relational databases. Unlike
DLVDB , it is database-independent, and can manage the data types. The second one is called RESTdlv, a RESTful web service for remote calls to RelGrounder, DLVDB and DLV.
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
A System for Stratified Datalog Programs - Master's thesis presentation
1. Dipartimento di Matematica e Informatica
A System for Stratified Datalog Programs
SUPERVISOR
Prof. Francesco Ricca
STUDENT
Simone Spaccarotella
138937
5.
RelGrounder
A new Evaluator of Stratified Datalog Programs
Developed in Java
DBMS-independent
Handles Data Types
RESTdlv
An umbrella project that cover RESTdlv WS and RESTdlv Client
… and SudokuLogic (a PoC for RESTdlv WS)
DLVWrapper uses RESTdlv Client
12. p(X,Y,Z) :- ....., ....., .....
INSERT INTO p(X,Y,Z) (
SELECT ....
FROM ....
[WHERE] ....
)
13. p(X,Y) :- t(X,Y), s(Y), Y >= 10, Y <= 50
SELECT t.X, t.Y
FROM t, s
WHERE t.Y = s.Y AND t.Y >= 10 AND t.Y <= 50
14. rich(X) :- worker(X,_), salary(X,Y), Y >= 2500.
subsidy(X,500) :- worker(X,_), not rich(X).
INSERT INTO subsidy(X) (
SELECT worker.X, 500
FROM worker
WHERE worker.X NOT IN (
SELECT rich.X
FROM rich
)
)
15. INSERT INTO q(X,Y) (
SELECT t.X, t.Y
FROM table as t
)
X
Y
7
2
13
9
2
0
9
11
5
10
11
3
2
0
11
3
16. INSERT INTO q(X,Y) (
SELECT t.X, t.Y
FROM table as t
EXCEPT ( SELECT * FROM q )
)
X
Y
7
2
13
9
0
9
11
5
10
3
2
0
11
3
17. INSERT INTO q(X,Y) (
SELECT t.X, t.Y
FROM table as t
WHERE NOT EXISTS (
SELECT X, Y FROM q
WHERE t.X = q.X AND t.Y = q.Y
)
)
18. INSERT INTO q(X,Y) (
SELECT t.X, t.Y
FROM table as t
WHERE NOT EXISTS (
SELECT X, Y FROM q
WHERE t.X = q.X AND t.Y = q.Y
)
)
table
X
Y
7
2
13
9
2
9
11
5
10
11
19. INSERT INTO q(X,Y) (
SELECT DISTINCT t.X, t.Y
FROM table as t
WHERE NOT EXISTS (
SELECT X, Y FROM q
WHERE t.X = q.X AND t.Y = q.Y
)
)
table
X
Y
7
2
13
9
2
9
11
5
10
11
20. INSERT INTO q(X,Y) (
SELECT DISTINCT ......
FROM ......
UNION
SELECT DISTINCT ......
FROM ......
)
Source 1
Source 2
X
Y
X
Y
7
2
13
9
9
11
5
10
10
2
4
7
14
11
3
9
35.
a RESTful web service for DLV (aka web API)
a remote workspace for Datalog Programs
a simple way to use DLV/DLVDB functionalities
developed in Java