Tags

sitemap

1. all nodes

(->> [:select [nodes:id, nodes:title] :from nodes
              :where :not :exists [:select :null :from tags
                                           :where (and (= tags:node-id nodes:id)
                                                       (in tags:tag ["daily" "private"]))]
              :order-by nodes:title]
     (org-roam-db-query)
     (-map (cl-function (lambda ((id title))
                          (org-link-make-string (concat "id:" id) title)))))

2. by tag

(->> [:select [tags:tag, nodes:id, nodes:title] :from tags
              :join nodes :on (= tags:node-id nodes:id)
              :where :not :exists [:select :null :from tags
                                           :where (and (= tags:node-id nodes:id)
                                                       (in tags:tag ["daily" "private"]))]
              :order-by [tags:tag nodes:title]]
     (org-roam-db-query)
     (-group-by #'car)
     (-map (cl-function (lambda ((tag . nodes))
                          (->> nodes
                               (-map (cl-function (lambda ((tag id title))
                                                    (concat "- " (org-link-make-string (concat "id:" id) title) "\n"))))
                               (cons tag))))))

Author: Nicholas Coltharp (mail@heraplem.xyz)

Last modified: 2026-06-17 Wed 00:01

Emacs 30.2 (Org mode 9.7.11)

Validate