OK, clear. What there is, is already interesting. I love the fact that I can stay away from Namespaces — perhaps that is being narrow-minded, whatever — because I feel that if they are not used properly, they will sooner or later cause hassles/problems.
I’ll await the next stage, patiently
BTW, I don’t know if you saw, but I advertised your system here.
The algorithm can support endless combinations, but its input is currently limited by the syntax of macros. I don’t want to support a few scenarios and leave others out. If you have any idea for a generic-enough syntax, please share it. Meanwhile, you can get some results by editing the queries directly.
@alex Actually, could you provide something more specific as an example? I have come with some design and would like to ensure that it covers your case before implementing it.
There you propose a single filter-sort-group query, which:
is a bottom-up approach (hierarchy-wise)
has no surprises (thus no discoveries either)
operates like this:
extracts some items (there books)
imposes some structure on them, which is:
regular
in position: properties have fixed layers
top nationality, bottom authorship, birthday on authors only
in participation: e.g. a nation without books doesn’t appear
limited
in size: the exact number of layers is predefined
in info: the reader should already know what each layer represents
This is not a genuine tree.
unless if we abstract nationality and authorship to e.g. origin
but then more results may appear and of less rigid structure
In contrast, a genuine tree:
is a top-down approach (hierarchy-wise)
operates like this:
begins from some root
spreads out in irregular forms
In my approach I implement a generalized graph traversal (like you said on this occasion), fed on every step by multiple predefined parameterized queries, operating on a level above them, to provide an unlimited partial structure of the graph itself, potentially discovering emerged relationships (e.g. “items authored after the birth of nationalities”, which may be books, but not strictly). Therefore, this is more than a tree, it is a cascade. It should still be possible to cover your scenario, but should:
define some queries that are more targeted, in order to avoid unwanted results
implement some syntax that needs parsing, e.g.: {{pagecascade top strict-from nationality ; flat strict-from nationality ; flat strict-from author }}
I don’t have particular topic in mind but I struggle to create some hierarchy of information, todos, ideas. Todo’s are connected to many ideas, ideas are connected to many todo’s.
For me complex hierarchy issue is when I try to manage my todo’s. I have different areas of interest like cooking, home, work, productivity, learning English, reading books, etc. I noticed that traditional tree of documents is not enough to create hierarchy, but tags are also not enough. I created #todo and as a subpage #todo/now #todo/next. But I also want to have #work/todo #productivity/todo pages. So, #todo/next page and #work/todo are different and separate pages. And another layer of information is differentiation between ideas and physical things. Increasing productivity is an idea, connected to self-improvement. Should I have another page: self-improvement? While learn how to use Logseq is connected to idea: productivity, and todo. It is and activity.
Good solution for me would be to have ability to see different trees based on properties, so that the same page could have different places in different trees: ideas tree, activities tree, physical objects tree (book about productivity is a physical object to buy), etc. the same page: “now” could appear as todo/now and productivity/now depending on what tree I display. And productivity page could be at different levels of hierarchy depending on tree displayed:
/ideas/self-improvement/productivity/software/logseq
todo/now/productivity
productivity/now
physical_objects/books/room2/cupboard3/productivity/author/title
physical_objects/room2/books/cupboard3/productivity/author/title
This way naming pages like this: productivity/now would be not necessary because properties would manage hierarchy.
I’d like to be able to switch easily between different tree views to have easy access to them, for example from panel icon.
It would be like virtual trees not physical pages trees.
No. Queries results can’t be sorted manually. I want to have todo pages because I don’t use to do option. I know that something is todo when I have it on todo page and I use references from text to todo page. When there is a reference on todo page it means I must do something about it.
I added direct link to jpg.
Use one macro for each tree, built around its defining property.
I am new to Logseq and I wish there was a video about it, about creating macros. I will customize it.
If possible, please use your own properties and show how to write and run macros to display trees. And how to create an easy access to them. I don’t have so many data in Logseq yet. It will be easier for me to use properties in a meaningful way if I know what can be utilized for.
I found only one video about properties
How to use properties and templates in Logseq by OneStutteringMind, but it doesn’t cover the topic in depth.
Currently, I can only clear up how to use the single macro for this thread:
A macro is defined only once, by providing its name and output. For the trees, you only need to copy the following line and paste it inside the configuration file config.edn (found in the first page of Logseq’s Settings), inside section macros{}.
A defined macro is called as many times as you need, by opening double curly braces in a note, and writing inside the name of the macro (here pagetree) followed by the desired parameters (called arguments), like this:
{{pagetree arg1, arg2, ... }}
Make sure each time to replace the part arg1, arg2, ... with a comma-separated series of the actual arguments (i.e. the desired tree’s characteristic property, preceded by its type), like in the examples provided in the OP:
{{pagetree to, children}}
{{pagetree from, broader, is, refs}}
From the example below (taken from one of the examples), I would sometimes only want to show the pagetree where parent:: [[man1]], so that the tree would look like the following:
Welcome. Currently the code is limited by the syntax of macros, so there is no placeholder for defining a page as the single root. But if you can write some code, you can define in PageTree.roots.queries a query that returns a specific page as a starting point (in your example man1). Using this query, the tree would look like the following:
bro do you know any tutorial for this? looks like is what i was seeking in a note app, but im not tech savy
Is there a page/github that we can track that code ?