TOC-like sub indexes?

I’m coming from Obsidian where it’s relatively simple to query things and list them.

What I’d like to do in Roam as well but couldn’t figure out:

  • have a topic note explaining the topic
  • notes link to that topic note
  • the topic note lists all notes that link to it and sorts them by a header property value

Maybe someone here has an idea how to do that. Thanks.

Just as a suggestion, I have been representing “topic notes” as follows.

  1. Have a file-node explaining the topic. I tag it as “Index”
  2. In each of file-nodes related to the topic, I create link to the Index node for the topic.
    Note that you can have multiple topics in each node
  3. The topic note (= the file-node tagged “Index”) can then show the related notes in its backlinks buffer (org-roam-buffer-toggle)

What this does not do from your list is to sort the notes by a “header property value” – by default, backlinks are sorted by the title in alphabetical order (source).

If you wish to achieve sorting backlinks by a property value, a simple way is to override function org-roam-backlinks-sort in the way you would like – that is, to write your own function in your configuration with the same function name and evaluate the new function definition after loading the original.

I would lean toward keeping the original sorting logic as it is; I don’t see the value in investing my energy sorting in a custom way, but of course that’s just me.

1 Like

Books in a sequence tend to not start with numbers.
To keep it simple for an example:

Lord of the Rings

  • Fellowship of the Ring
  • The Two Towers
  • The Return of the King

Sorting them alphabetically would mess up the order of the last two. For longer sequences it would mean proper chaos.

ChatGPT suggested to hit the database directly. But documentation there is sparse at best.

You could potentially combine org-roam-db-query with dynamic blocks.

For this, I’d probably simply have the title to something like this:

1. Fellowship of the Ring
2. The Two Towers
3. The Return of the King

If there are more than 9 volumes in the series, I could have 01, 02, 03 … as a prefix.

Holy :poop: that’s like Dataview for Roam! I’ll definitely check that out. Thank you.

For known volumes, it’ll be either that or what @nickanderson suggested.

For my own in-development sequences I’m “embracing the graph” now. Adding a previous / next links to node. That way I only have to change 2 files when I add something in between. Better than changing ALL files after it. And it’s kinda like a digital choose your own adventure book which really helps figuring out structure.