Kungsgeten / org-brain

Org-mode wiki + concept-mapping
MIT License
1.72k stars 102 forks source link

Org-brain relationship adding messes up org-roam indexing #395

Open nameiwillforget opened 6 months ago

nameiwillforget commented 6 months ago

I hope this is the best place to put this (the alternative being the org-roam issues page). I'm a user of org-roam and ekg, and I enjoy both of them: org-roam is good for quickly capturing notes and linking between them, ekg is great for sorting by tags and I can synchronize from org-roam to ekg. But neither captures hierarchical relationships as well as org-brain, so to add it into the mix I just made my org-roam directory my org-brain directory, and org-brain quickly found all notes generated by org-roam. But it seems the relationship-adding functions of org-brain throw the org-roam indexing out of concept. The issue seems fairly simple, from what I can see: when I add, say, a parent relation to a an org-roam/brain node like this:

:PROPERTIES:
:ID:       f854d54f-4cd2-4845-b71e-8744077961bd
:END:
#+title: Mackey functor

it is added at the top:

#+BRAIN_PARENTS: Math/20240127140305-functor

:PROPERTIES:
:ID:       f854d54f-4cd2-4845-b71e-8744077961bd
:END:
#+title: Mackey functor

but it seems that org-roam can't accept anything above :PROPERTIES:, not even an empty line. If I place it below :END: though, everything seems to work fine. Isn't it possible to modify the relationship functions to auto-detect such a situation and add the relationship information below the properties?

Kungsgeten commented 6 months ago

Hi! Unfortunately I haven't done any major work on org-brain in quite a while, and meanwhile there has been some changes to org-mode which org-brain really could make use of. One of these changes is the org-mode support for top-level property drawers ("level 0" headlines, almost) which didn't exist when org-brain was written.

The best solution would be for org-brain to put BRAIN_PARENTS etc inside of the PROPERTIES drawer, but until that becomes the case I guess it is a good idea to add the file properties below the drawer, as you suggest.