YADI /

Filename Size Date modified Message
bin
doc
src
test
114 B
778 B
1.7 KB
26.8 KB
490 B
2.0 KB
3.0 KB
YADI - Yet Another Datalog Interpreter
================================================
                                        
---------------------------------------------------------------------------

What is YADI?
-------------------------
Yet Another Datalog Interpreter (YADI) is a Datalog-to-SQL converter that transforms a Datalog query to an Abstract Syntax Tree to an SQL statement to an answer set of tuples.

A Datalog query against {R(A,B), S(B,C,D)} database looks like this:
    V(x,y) :- R(x,y) and S(y,_,_).
    Q(x,y) :- S(x,y,z) and V(z,t) and t>=3.
    ?- Q(x,y). 

where the two first lines define idb predicates and the third line provides the actual query, i.e. the idb in the result set.

Despite its multiple-rules form, the above Datalog query is a Conjunctive Query that can be translated into the following SQL statement:

    SELECT B, C
    FROM R INNER JOIN S S1 USING (B)
    INNER JOIN S S2 ON (R.A=S2.D)
    WHERE S1.B>=3; 

The purpose of the project is to develop a Command Line Interpreter for Datalog queries. It aims at converting Datalog queries into SQL statements. Then, a backend Relational Database is in charge of evaluating the query. 


Pre-requisites
-------------------------

It is madatory to connect a PostgreSQL server, with a role, a database and at least one populated table to formulate queries against that table.
	
We already have a database schema for testing purposes. You can execute the sql file below

	yadi/test/sql/employee.sql

with the following statement :
	psql -d test_db -a -f yadi/test/sql/employee.sql

be careful with the file owner permissions, you might need to give "postgres" user read/write permissions 
If your database schema is ready, now we can try to make YADI work.		



Usage
-------------------------

./yadi <connexion info>

Example:
./yadi "host=localhost port=5432 user=test password=test dbname=test_db"

You must see something like this :
dbname    = test_db
user      = postgres
password  = *password*
host      = localhost
port      = 5432
tty       = 
options   = 
pid       = 16007
--------------
DB Schema:
Departments(budget,name,code) :- .
Employees(department,lastname,name,empid) :- .
Phonenumber(employee,number) :- .


Sample Queries
-------------------------
Alldept(x,y,z) :- Departments(x,y,z).
?- Alldept(x,y,z).
/

Allemp(x,y,z,w) :- Employees(x,y,z,w).
?- Allemp(x,y,z,w).
/

All_pho(x,y) :- Phonenumber(x,y).
?- All_pho(x,y).
/



---------------------------------------------------------------------------

Contact Information and Contributing
------------------------------------

In the case of bugs, feature requests, contributions and similar, please

Carlos Colmenares   <carlos.a.colmenares.r@gmail.com>
Mark Abspoel        <mail@markabspoel.nl>
Jose Robles Noriega <atease@vista.aero>
Hasan Saygin Arkan  <sayginarkan@gmail.com>

based on the core code of maintainer :
  * Guillaume Raschia <guillaume.raschia@univ-nantes.fr>

Up-to-date information should be available at:
<https://bitbucket.org/cacol89/yadi/>

Enjoy!

Guillaume Raschia in Nantes, FR on Sept 28, 2012


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.