How to list linked references in hierarchical order?

I am writing a book using logseq. I have placed my sections and chapters within a hierarchy.

To help me to eliminate any duplicated content, as an alternative to the linked references at the bottom of a page, I would like to run a query to list linked references in the order in which they appear within the book/hierarchy. How might I achieve this efficiently? (i.e. without specifically tailoring the query to my particular hierarchy structure, which is highly likely to change)

What do you mean by this:

Could you provide some example?

My book is organised hierarchically in sections, subsections and chapters, using a hierarchy of namespaces.

Let’s say I introduce a [[concept A]] in chapter 1, expand on it in chapter 2, go deeper in chapter 3, etc. I want to check that my content in chapter 3 does not unnecessarily repeat info from chapter 1 or 2. Therefore, I would like search results for [[Concept A]] to be listed in the order in which they appear in the book, so I can easily see the progression (or unwanted repetition) of content relating to [[Concept A]].

I realise now that a hierarchy of namespaces does not actually reflect the linear order of chapters (only their grouping into subsections and sections), so I think that properties for section-, subsection- and chapter-numbers might work better than namespaces as a basis for ordering query results?

Continuing to think aloud here…

The simplest option might just be to incorporate numbers into the page names of my chapters. I could then look at the linked references for any given concept page and load them, in sequential order, into the right sidebar.

    • This makes all these approaches impractical, as they will require you to change the numbering etc. every time you move something to a different position.
  • I think that what you want to do is theoretically possible, but you need to provide an example of a very small book similar to yours.
    • Then I can prepare a query that fits its structure.
    • Then you will run the query in your real (big) book and it should work.
      • There is a chance that it will be slow, but we’ll have to find out it practice.