Hi all,
I am trying to build a query that will show a list with all pages (from a specific namespace) that have no task block or - more advanced - do not have exactly one task block with a specific state (“TODO”)
Background: For my project management I want to ensure that all of my projects (pages in the project namespace) have a TODO. And I want to build a query that will show me all pages that do NOT have this requirement, so I want to find the “uncompliant” pages.
My current approach will only show pages, which have a least one block without a task which is not what I want:
#+BEGIN_QUERY
{:title [:h3 "Project pages without a task"]
:query [:find (pull ?p [*])
:where
[?p :page/name ?name]
[?b :block/page ?p]
[(clojure.string/starts-with? ?name "project/")]
[(missing? $ ?b :block/marker)]
]
}
#+END_QUERY
Does anybody have an idea what I need to improve/change so I can get the result I want?