A possible way of better supporting hierarchical/parent-child related pages

It seems like there’s a lot of interest in greater hierarchical organisation capabilities judging by the existence and popularity of a hierarchy tag in the forums. I know I find myself sometimes trying to organise pages that make the most sense to be organised hierarchically. This topic is my attempt and advocating why I think it would be valuable to have greater support for organising a subset of pages this way, and my suggestion for a possible implantation. I haven’t seen a topic that captures quite how I’m imagining this being potentially implemented but since this is a somewhat abstract topic and a lot has been written about it in the forums I could have easily missed something that essentially suggests the same thing. Sorry if that’s the case!

Why I think hierarchical organisation of objects is sometimes useful

In my experience a lot of relationships between pages provide additional information but aren’t fundamental to the identity of a page. For example if I have a page called “History of design” and that includes a link to a page called “Skeuomorphism” then likely both of those pages can be meaningful understood even if you take that link away.

But in my experience I find that some pages in my anytype space part of the meaning of that page comes from it’s relationship to another page. Let me give a concrete example. One pattern I have is that I’ll have a number of people objects representing various friends and family and then I’ll have some pages related to that person like so:

“Favourite foods” is a page of Felix’s favourite foods with recipes I’ve collected. That page only makes sense in the context of Felix. So if I want that page title to be meaningful I need to title it something like “Felix Smith / Favourite foods”. This is especially important for search and even more so if I have multiple “Favourite foods” pages each connected to separate people. If the pages are just titled “Favourite foods” and I search “favourite food” I’m gonna see multiple results and have no idea what person they’re connected to:

You might think “Just title it Felix's favourite foods or something and be done with it”. And sure that mostly works but I don’t think it’s ideal since that relationship is now capture in two places, in a true anytype page relationship and conceptually in the title. That has a number of downsides including:

  • Introducing multiple sources of truth. This means that adding/editing a relationship requires changing multiple places which is both a bit annoying to maintain, especially if you have many pages like this, and also introduces the possibility of them becoming out of sync. In this case Felix is probably not likely to change their name terribly often so it’s not a huge deal or anything. But this is a pattern I find myself using in quite a few different places. For example when I start a new project with a working title, build a number of pages off that project and then as the project starts to take shape, start experimenting with finding an “official” title, if I change the project title I’ll need to go update the titles of all the pages I’ve included the project title in.

  • The relationship reference in the title doesn’t offer the affordances of a true relationship. If I have a page called “Felix Smith / Favourite foods” (again just an example of this pattern) it would be nice to be able to click on “Felix Smith” and be taken to that object and see all the other objects connected to it.

How I’m imaging this use case could be better supported

I’m thinking it would be nice if there was a way that certain page relationships could be setup that such that are marked as important to the meaning of a page. Perhaps this would be implemented as a “Parent objects” relationship. Then on any object this could be added to the in the same way that any other relation is added. And this relation would allow you to selection other objects to be “parents”. Then the page view of any objects that are parents of other objects would have a way of displaying any child relationships (and possibly adding/removing them). This is tricky because ideally you’d want to allow the user to customise that children list to there liking (change how predominately they’re displayed, grouped by different headings, etc) but you’d also want anytype to keep that list up to date automatically so that it can’t become out of sync with children that have set it as their parent. Not sure how this could best be done!

Once there’s a system in place for capturing these relationship it would be great to have Anytype can do things like include that relationship context when searching for a page. Eg:

I could see this integrating nicely with the idea of blocks being treated as objects. Instead of “Favourite foods” being just it’s own page maybe it’s page + a block on the “Felix Smith” page with it’s contents being nested under it. Then when searching I’d see it listed in the same way as before (“Felix Smith / :pizza: Favourite recipes”) and selecting it would take me to that section of the “Felix Smith” page (or to a page view of just the “Favourite recipes” since in this scenario if blocks were treated more like objects I’m imagining they’d have their own page view).

Now you might notice that all of this introduces a new kind of ambiguity. If I have a single “Favourite foods” page related to multiple people (or if this was implemented using the “everything is a block” approach, then having that same “Favourite foods” block included in the page contents of multiple people) that raises the question what would the search results show? My suggestion is that it would show up as multiple results, one for each relationship. So “Felix Smith / :pizza: Favourite recipes” and “Other Person / :pizza: Favourite recipes” would both show up in the search results even though they’d link to the same object. My thinking is that if I’ve decided to relate that page to multiple different people then it has multiple different contexts in which it’s relevant. If I were to search “felix food” I’d expect it to show up under that but I’d also expect it to show up if I searched “other person food”.

I know this is all pretty rambly and abstract so thanks for taking the time to read and consider!

在原子化的笔记体系中,加入页面的父子关系(允许一个页面多个父页面或者多个子页面),这很不错,让我联想到notion的“同步块”功能。如果这样的功能能够实现,anytype的使用将变得更加灵活,因此我表示支持。

Oh interesting. I hadn’t herd on the atomic note system before. Thanks for introducing me to it :blush:

voted for you :+1:

SOURCE OF TRUTH

What do you mean by truth here?

It looks to me you want something like single source of truth - only one source for one thing - multiple things will update as you change one, where the multiple occurrences are actually one thing that you can link/relate it else where and reuse them. There are no two objects of the same thing, e.g. no two Felix Smith object , no two recipe objects of the same combination ← the concept of Transclusion and linking.

PAGE TITLE

This looks like a current feature request build title with relation where you can put Felix onto the recipe.

QUERY

Are these what you are trying to query?

  • Felix AND Recipe
  • Recipe → All objects that contain relation/link to recipe

Both Felix and recipe should be treated equally in terms of notes? ← if not equally, then it is an indication of hierarchy.

If you have both relations added to an object, I believe you can query both above situation - using filters in sets? What is hierarchy or can single layer connection deliver what you need?

Did I misunderstand what you want?

P.S. I am also asking myself if I really need a function for hierarchical relation in software. I currently use a relation name “Core” to label parent hierarchy and a “Related” relation for sibling.

I really like the idea.
But i think this can be solved without introducing another relation, but rather have the search function also include linked objects.
This would mean for your example i could simply type in “Favorite foods Felix” or “food felix” and it would rank the search results according to the best match.
Ideally this would be a full fuzzy search.