I created an advanced query that shows all the scheduled and deadlined tasks relevant for today (much like the default “Scheduled and deadline”, but a bit custom). There I had an issue with a predicate clause with an “and”-clause, which I could solve by using two predicate clauses.
Can someone explain, why these two behave differently? The latter actually does what I expected from the former: it tests first on ?compareDate
not being false
and then on being less than or equal
?targetDate
. I do not understand how the former actually filters.
[(and (!= false ?compareDate) (<= ?compareDate ?targetDate))]
[(!= false ?compareDate)]
[(<= ?compareDate ?targetDate)]
EDIT:
Is it because of this? But this refers to “transformation function” and not “predicate clauses”. In the same source no such limitating was mentioned for predicate clauses.
One thing to be aware of is that transformation functions can’t be nested. You can’t write
[(f (g ?x)) ?a]
instead, you must bind intermediate results in temporary pattern variables
[(g ?x) ?t] [(f ?t) ?a]
[Source: Learn Datalog Today!]