Syntax flavour | constants | variables | rule | support |
---|---|---|---|---|
‘Standard’ datalog (like Prolog) | lowercase | uppercase | :- | getting there |
Prolog | lowercase | uppercase | :- | |
Datalog with ? variables | start with ? | :- | ||
Datomic | start with ? | |||
LogiQL | <- |
Syntax example adapted from MITRE datalog:
% facts
parent(john, douglas).
parent(bob, john).
parent(ebbon, bob).
% rules
ancestor(A, B) :-
parent(A, B).
ancestor(A, B) :-
parent(A, C),
D = C,
ancestor(D, B).
% query
ancestor(A, B)?