# Datalog
What is Datalog?
> [!ai]+ AI
>
> Datalog is a declarative programming language that is primarily used as a query language for deductive databases. It was developed in the 1970s and 1980s as a logical query language for relational databases. Datalog uses a subset of first-order logic for its syntax and can be used to express queries in an intuitive and readable manner. The name "Datalog" is derived from "data" and "logic", reflecting its basis in formal logic.
Who invented Datalog?
> [!ai]+ AI
>
> Datalog was invented by a team of researchers at the University of California, San Diego in the 1970s. The key contributors were David Maier, Jeffrey Ullman, and Moshe Y. Vardi.
## References
Mentioned in Chapter 5 of [[BOOK - Computational Logic and Human Thinking - Robert Kowalski]], where the representation the world as a series of positive observations can be made more compact by introducing conditionals.
## PyDatalog
[[PyDatalog]] is based on work by [[John Ramsdell]]:
- [GitHub - ramsdell/ocaml-datalog: This package contains a lightweight deductive database system in OCaml](https://github.com/ramsdell/ocaml-datalog)
- [GitHub - ramsdell/datalog: Datalog interpreter in Lua](https://github.com/ramsdell/datalog)