List all namespaces

I am using hierarchical namespaces very heavily. The regular namespace query

{{namespace [[parent_namespace]] }}

lists all namespaces under parent_namespace. But I could not find a way to list “all” namespaces with all parent namespaces in a hierarchical manner. I would appreciate if anyone can have a query for this.

Thanks.

Welcome. Let’s begin with this:

#+BEGIN_QUERY
{
 :query [:find (pull ?p [*])
   :where
     (or
       [?p :block/namespace]
       [_ :block/namespace ?p]
     )
 ]
 :result-transform (fn [result] 
  (sort-by :block/name result))
}
#+END_QUERY

[quote=“mentaloid, post:2, topic:31090”]
DO NOT try this at home :wink: – without an edit
1620 Results in an unreadable table for my big graph, and a an almost stalled Logseq.