Query all tasks without template property

Hello there!

I’m trying to create a query to get all on-going tasks that are not templates. I tried this, but the issue is that I don’t get anything back as my other tasks don’t have “block/properties” as they have no properties set. How can I say that I want all tasks BUT the ones that have a property “template” ? Side question, I tried to read through datalog documentation, why is it (not [(get ...)]) and not [(not (get ?props :template))] not sure to understand the difference between [] and () .

    :query [:find (pull ?h [*])
            [?h :block/marker ?marker]
            [?h :block/properties ?props]
            [(contains? #{"NOW" "LATER" "TODO" "WAITING"} ?marker)]
            (not [(get ?props :template)])]

Thanks in advance !


Need to move [?h :block/properties ?props] inside the not-clause, like this:

  [?h :block/properties ?props]
  [(get ?props :template)]

Check this thread. Not a full explanation, but should give the idea.

Thank you very much for the pointer and help !