Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store link not inserting existing files into roam graph #66

Closed
bchr0n opened this issue Oct 13, 2024 · 8 comments
Closed

Store link not inserting existing files into roam graph #66

bchr0n opened this issue Oct 13, 2024 · 8 comments

Comments

@bchr0n
Copy link

bchr0n commented Oct 13, 2024

Been getting used to org-mode over the past few months and wanted to start dipping my toes into moving over my obsidian notes into org-roam. But I have run into an issue where I can't insert my existing org files into the graph. I tried the store link tip in the Docs but I was never able to get an ID and I assume that a node was never created. I tried both with a precreated properties and title like the docs show and then without but I still never received an ID for the headline. Creating nodes through the insert means still works perfectly fine, just the inserting existing files functionality hasn't been working. Below is screenshots of my config for org-mode and org-roam.

image

@chipsenkbeil
Copy link
Owner

@bchr0n hey there 😄 To make sure I understand, what you're trying to do is take existing org files that you've already written and are in the codex directory and convert them into nodes?

I'm not sure which document you're referring to about using the store link feature of the orgmode plugin, but at the moment the only way to get existing org files to be counted as nodes (for use in inserting, finding, etc) is to add a unique id following the properties format that roam uses and reload the database.

Since I don't use the store link feature, I read through it a little bit and it looks similar to trying to use org-get-or-create from Emacs, but at the moment that functionality of adding an ID does not parse the document as a roam node or load it into the roam database. But it seems like the store link isn't working like you'd expect by inserting an id, so I'd recommend filing the issue with the nvim-orgmode plugin first to figure out why it isn't adding the ID property. Once that is resolved, you'd want some way to cause that to reload the roam database to parse the file as a node.

@bchr0n
Copy link
Author

bchr0n commented Oct 14, 2024

Hello again, I take that emoji to mean you remember me. Yeah that is correct. For reference I was using this part of the org-roam docs
image

How would you recommend adding that ID property then? Is that something I can create and reference myself or do I need the roam database to generate it for me and if so how do I do that? Is store link the only way nvim-orgmode or org-roam can achieve that?

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented Oct 15, 2024

Oh, @seflue wrote that as part of #55. I've never done that myself. Once the properties with an id is in place, the plugin should ideally detect the file and load it into the database. You can try :RoamUpdate! or :RoamReset once you've written the file with the properties id and it should pick it up.

The tip in the docs mentions that you need to have a headline for the id to show up. Were you trying this with a headline? It's using nvim-orgmode's functionality to generate with that approach.

Sounds like a potential enhancement would be to support a method directly from this plugin that will insert an id into an existing file/headline and update the roam database all in one go.


Is that something I can create and reference myself

You can technically make up any id you want and reference it yourself. As soon as there is an id property, the next time you load neovim it should be parsed as a roam node. You can use the above commands to try to load it with neovim already running.

@seflue
Copy link
Collaborator

seflue commented Oct 15, 2024

Exactly, @chipsenkbeil. The improvement is something, which primarily needs to be done in the store-link feature in orgmode, to support plain files. A wrapper in org-roam could update the node database, that would be convenient for headlines too.
It's somewhere down my to-do list but I not with priority, because I don't need it often and the workaround mentioned in the docs works for me most of the time.

@bchr0n
Copy link
Author

bchr0n commented Oct 15, 2024

I did do it with a top level (*) headline and no ID was generated. I can provide a video when I get off work but @seflue just out of curiosity are you using any additional orgmode plugins? I am running basic lazyvim with just orgroam and org mode and haven't been able to get it to work.

And @chipsenkbeil so I could create a note with ID:1 and the database would recognize it? And then if I wanted to branch off of it the Roam-Origin would be 1? And once I run :RoamUpdate! I would be able to go back and forth between those two connected nodes?

@chipsenkbeil
Copy link
Owner

And @chipsenkbeil so I could create a note with ID:1 and the database would recognize it? And then if I wanted to branch off of it the Roam-Origin would be 1? And once I run :RoamUpdate! I would be able to go back and forth between those two connected nodes?

Yes, you can manually create a node with id 1 and use :RoamUpdate! (maybe just :RoamUpdate would work) and it will now exist within the database. Here's a video demonstrating the full flow:

example-of-adding-roam-node-manually.mp4

@seflue
Copy link
Collaborator

seflue commented Oct 16, 2024

I did do it with a top level (*) headline and no ID was generated.

Did you activate the necessary option in or more config? org_id_link_to_org_use_id must be set to true.

I can provide a video when I get off work but @seflue just out of curiosity are you using any additional orgmode plugins? I am running basic lazyvim with just orgroam and org mode and haven't been able to get it to work.

I'm using telescope-orgmode.nvim in addition, but this is not necessary for the workaround. But I recommend it anyway. 👍

@bchr0n
Copy link
Author

bchr0n commented Oct 24, 2024

I did not activate that setting, so i'll check out that and that plugin. I've been just manually setting IDs for the past week as I start to transfer over and while a lil tedious its pretty nice to set an ID based on my own system. So I think I'm in a spot where I can close this. Thanks again for your help

@bchr0n bchr0n closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants