List of projects with no next action? Odd to fomulate

Hi all. I’m trying to identify what projects have no tasks tagged as “next”. Escapes my rudimentary understanding of queries:

List of all pages that do NOT appear on a block that has the following 3 characteristics (third one is an OR):
1-task with status other than CANCELED, DONE
2-contains page reference [[next]] on the very block, NOT inherited from a parent.
3- has the page reference [[project/…]] (any within the namespace) (inherited or not)
OR
has a page ref (inherited or not) which has a property “area” = [[family]] or [[health]]

Thanks for your help!

  • For the first two characteristics, try something like this:
    #+BEGIN_QUERY
    {
     :query [:find (pull ?b [*])
       :where
         [?b :block/marker ?marker]
         (not [(contains? #{"CANCELED" "DONE"} ?marker)])
         [?next :block/name "next"]
         [?b :block/refs ?next]
     ]
    }
    #+END_QUERY
    
  • The third characteristic is not clear to me.
    • Will need an example for each one of the multiple combinations.