Except this isn’t Datalog. It’s just a poor quality implementation of relational algebra. This article did not actually teach you anything about Datalog, just continued to propagate misinformation.
I see what you mean, but I do see it as a little introduction to knowledge (and interest) you need to actual go for something more advanced. But I see what you mean. Here (0) is a quite straightforward implementation that would make you happier I guess. But yeah, shouldn't be called Datalog, I agree.
0 https://harvardpl.github.io/AbcDatalog/