HN user

muydeemer

33 karma
Posts6
Comments11
View on HN

You might find https://github.com/graknlabs/grakn of interest. Datalog was one of our main sources of inspiration. The query mentioned in this thread (the person named Bob who lives in Texas) would be something like:

$x has name 'Bob'; ($x, $y) isa lives; $y has name 'tx';

Backward chaining is goal-driven, it's aimed at answering specific questions where you can prune your search space effectively. This is opposed to data-driven forward chaining where you basically keep looking at what things can be derived without having specific queries in mind. I wouldn't say one is better than the other, it depends on circumstances and use cases. In dynamic systems where there is a lot of data changes/data is fed in dynamically, backward chaining gives you a completeness guarantee whereas FC is eventually consistent (specific answer you are looking for might be not triggered yet). On the other hand, FC is useful when we want to use triggering behaviours - once a specific information is added to the system, a trigger can be executed/specific action can be taken.

Just to add and clarify: it supports recursion (since a couple releases back) and pattern negation based on set difference (on current master branch, soon to be released).

As I see people mentioning Datalog-related software, I'm gonna throw a pebble into the yard as well - Graql (https://github.com/graknlabs/grakn) is a declarative graph-based query language with rule-based reasoning heavily inspired by Datalog and Logic Programming.

Disclaimer: I am one of the maintainers.