Query excluding id a child has specific tag

I am marking some blocks with #q in my graph, how do I query for all blocks marked with #q that do not contain #a in one of their children?
This one

{{query (and [[q]] (not [[a]]))}}

returns all blocks with #q and excludes blocks only if they are marked #a on the same level. How do I filter out those if a child is marked #a as well?