This python project is a converter from Non-Recursive Datalog to SQL Query, which can be executed directly on PostgreSQL/OWLGres.
- PLY (Python Lex-Yacc) Datalog Parser
- NetworkX Dependency Analysis
These dependencies can be installed by PIP from PyPI
We assume that the OWL 2 QL ontology is loaded into PostgreSQL by OWLGres.
$ ./src/datalog/datalog2sql.py datalog.dl tbox_name.txt > query.sql
- datalog.dl is a non-recursive Datalog program with DL predicates from the OWL 2 QL ontology
- tbox_name.txt is the output of query
SELECT * FROM tbox_name
FROM PostgreSQL/OWLGres.