This takes queries written in datalog (or Sparql) and compiles them to Bash (using sort, awk etc.) so you can run them on CSV files.
Wondering if I'm missing something but the example is
fact(X, R, Y) :∼ cat facts.tsv
locatedIn(X, Y) :- fact(X, "locatedIn", Y).
locatedIn(X, Y) :- locatedIn(X, Z), fact(Z, "locatedIn", Y).
main(X) :- locatedIn(X, "USA")
I think line 3 could just be locatedIn(X, Y) :- locatedIn(X, Z), locatedIn(Z,Y).
unless I'm missing something.
This creates potential infinite recursion, which is why the other form is used.