Support subdirs for namespace hierarchy

You’re right, maybe someone could think my posts and possibly some related ones are cluttering your FR somehow. The topic may be considered expanded as being talked about hierarchies.

We could at least agree that a form of hierarchy is of help for users. The actual implementation is being discussed then.

Thing to notice is that it seems no team member has given their thoughts in here.

Current hierarchy implementation (Namespaces) may be cool, but they also have their knowns limitations.

Great summary of the points made in the posts by the way.

(My very personal feeling, and I want to stress it’s just a feeling, that I’m sharing here, don’t want to make a point or anything, is that:
the team has made their decision about hierarchies; they believe Namespaces are sufficient, and they see the need of meticulously adding tags/metadata to your new info and creating simple/complex queries to retrieve them is the way to go.)

As I said I’m not against it and I don’t think it’s set on stone for Logseq devs neither. I think it just happened that Logseq focuses on the Efficiency mindset and the UI for a more RDB experience is just lacking at the moment. If one contributes to Logseq in that direction with a good implementation I don’t think the devs will refuse it. Indeed properties are a step in that direction.


I mean one should use the best approach according to the problem, not the situation. For example if I want to track books and their authors the RDB model is better for me.

Again it depends on the problem: sometimes OOP is very naturally the best paradigm and sometimes it makes sense to use FP instead. It’s not like a developer will always use one or the other, of course.

In my opinion, compared to other applications, Logseq gives very abstract, general and powerful tools and the user is free to build a custom workflow :slight_smile: . Indeed my “indexes” are a workaround that is possible thanks to the generic Logseq tools.


I don’t remember if I already mentioned it, but for example here there is my proposal to make it easier to add properties while keeping the efficiency approach:

2 Likes

They are very different: namespaces are for disambiguation. They are named so because they work like the namespaces we use in programming languages.

I think the confusion comes from Logseq labeling the breadcrumb to browse namespace “hierachy”.

When you mention [[Parent/Child]] somewhere you are referring to a “Child” that is specifically a child of the [[Parent]] page and it is different from [[Child]].

Namespaces makes sense for chapters of a book for example, [[Title/Chapter 1]], not to dinamically organize pages.

Namespaces are not folders or notebooks, they are not collections of pages, they carry a specific meaning… I don’t know how to better phrase it, sorry.

But when you want to move a page from one folder to another one… do you really want to say: “this page referred to one folder and now refers to another one”, like namespaces do?

For example, where namespaces make sense:

- [[Event A/Photos]]
- [[Place B/Photos]]

Namespaces here are saying “Photos of Event A/Place B”.

Instead a folder/notebook structure like this one:

Images
  Photos
  Artworks
  ...

is just how you choose to (temporarily) organize things, it’s not like “Photos” indicates “the photos of the images”.

I hope it makes sense to you.

1 Like

Hmm, you say:

Namespaces are not folders or notebooks, they are not collections of pages […]
Namespaces makes sense for chapters of a book for example, […]

which maybe is how you use them, but I use them exactly as collections of related pages. Perhaps the term “namespace” is confusing? As implemented in logseq, it’s just a simple parent/child hierarchy. I think it’s really useful that when I create projects/ProjectA/schedule I can then go to projects/projectA and see all the pages related to that project (schedule, people, resources, etc. etc.) in the hierarchy list at the bottom, as well as all the blocks tagged with that project.

But that’s just one way to use it, of course. As you say, books/Title/Chapter would be useful too.

As for moving a single page, that’s easy in logseq today – you just rename it (change the parent).

Sorry, as I said it is not: “namespaces” mean a specific thing and indeed Logseq’s namespaces work exactly as elsewhere. If not, why would they use a niche term like namespaces instead of well known folders/notebooks?

When it comes to UI, i.e. what Logseq uses to present them, it is indeed useful for browsing purposes but just because Logseq lacks notebooks/folders or other hierachical browsing, so you “hacked” your way through the UI.

ProjectA/schedule is indeed how namespaces are supposed to work, but projects/ProjectA does not.

So I hope it is clear now why Logseq devs are not going to mix namespaces with other hierarchies nor the hard drive folder structure.

@Gary_O

Did you see this reply by one of the Logseq devs?

“Namespaces are for content disambiguation”.

3 Likes

My assumption has been that they didn’t want to use a term like “folder” because logseq presents the folders as pages themselves (with default queries, but also optional content). So the name “folder” would be confusing. But as to why they chose “namespace”? ¯_(ツ)_/¯

Makes sense…

By the way, would you be happy with the Notebooks feature described above plus a button to set a certain Notebook as the folder structure on the hard drive that Logseq would automatically respect?

Most probably because of the following:

  • They clearly stated, in another post, that namespaces are for Disambiguation
  • In most programming languages disambiguation is solved with Namespaces

Having Namespaces allows a software project, a code base (which is just a big giant set of coding files) to have several classes (think of them as pages in Logseq) with the same name, but in different namespaces. It is useful in many cases, you can have a Utility class inside UI Namespace, and Utility class inside Network Management namespace.
If you didn’t have namespaces, you wouldn’t be allowed to have classes with the same name. Same thing I believe in Logseq, in which I think you probably can’t have pages with the same name (Logseq will ask you to merge them, but I don’t remember if you can say no to that)

Namespaces are a very technical solution to a very technical problem within the software development domain.

They just took that idea and implemented it in Logseq.

They are conceptually similar to file system folder, as there can’t be 2 folders with the same name at the same level in the hierarchy, same goes with the files (pages in Logseq).

The similarities lay only in the text form: NamespaceA/SubNamespace/PageX.md
(In some programming languages they are written with a separating dot: NamespaceA.SubNamespace.PageX.md)

Folders in the file system are a superset of Namespaces. Folders have the same capabilities of Namespace but then some more. You can drag-n-drop easily, have column view, icon view, whatever of a more visual aspect you can think of with respect of just having different names inside other different names, separated by a specific symbol.

Yes, probably… Basically I just want what namespace gives me now. For instance, I would want to see my Notebooks path (one of them? Which one?) as the primary path in the heading, rather than the current namespace path. I assume any page could have Notebook parents, even Notebook pages (pages which are some other page’s Notebook). Also I assume Notebook pages would have the same default queries at the bottom, so you can see all the child pages and parent(s) – that’s important.

Just to be clear, your proposal is for a page property notebooks like this:
notebooks:: #parent1, #parent2
and page parent1 could have:
notebooks:: #parent2, #parent3
It seems like since notebooks can now be at any level (they can have notebook-parents themselves), only “top-level” notebooks (those with no notebooks property) could be selected as “primary” to commit to the FS, or use as a path in the header.
There’s also the question of circularity of course, since it’s now a graph rather than a tree, but that’s solvable.

Then you should try Trilium Notes … Does exactly that.

Hey, thanks for the suggestion. I actually found my peace with Remnote now. It has everything Logseq has, plus a bit more features, (IMO) a nicer UI/UX, and of course Folders.

For visual Whiteboards, I’m using Heptabase for now, really intuitive. Will check out WBs in Logseq when they will be released. Remnote also plans to add them in the future; they are now focused on tables.

Logseq is great, don’t get me wrong, but after using it for some weeks, I felt it’s still a bit rough and perhaps it leans on satisfying a workflow and mindset of structuring the whole experience for more developer-like users, not sure how to express it better (just my impress though).

2 Likes

Has anyone imagined the idea that a virtual directory, notebook or collection of pages, as a one more block in the graph, but actually being a link to a new graph? (that could receive certain parameters and inherit certain properties, for example, that we could call context).

Perhaps it is something drastic, but it illustrates the concept of namespace as a synonym of another (sub?) graph space, and the layout of it as an output of some kind of function or query. Doesn’t it?

Related thread about namespaces. It’s a use case of using diferents graphs as namespaces:

So the idea I described in my previous message it’s that but visualizing them as a branch of a root graph (and with the optional feature to visualize that “sub” graph according a filter, etc), in a kind of a browseable graph.

Did you already see this proposal? Specify and display relations between pages/tags

The idea is that a multi-level folder structure is a tree extracted from a graph; instead of having a predefined folder structure, the user could use any property:: as an indication on how traversing the graph and so be able to browse that tree.

We could even concatenate more properties:: as indications, for example genre::, year:: and artist:: to browse music albums starting from genre folders, then years and then by artist.

1 Like

I’m glad this discussion is ongoing. Thank you all, especially @Gary_O whose summary taught me a few things I had not considered.

TL;DR (i have some detailed writing about this but I’m sparing you) I usually don’t propose solutions because if the problem is well-defined enough, there are smarter people in this room who can come up with the best solutions. So I apologise in advance.

So, what about the ~, ~/., ~/ws/git, ~ali/ws/sandbox/model/MasterData, notation? We can map tilt, ~ to base directory in Logseq and the command line context starts from there. But if I decide to create a file in Logseq (logseq’s strength) and whatever I type in that file in Logseq is created or updated exactly in the right place/path on the filesystem. Effectively, Logseq becomes the context layer of, my workspace where my filesystem manipulations are relevant to Logseq as opposed to the entire thing.

In fact, already now, I wonder why this doesn’t work:
Cmd + K, then I type ~/ws/scripts/replace-all

If this file actually opened the actual file sitting on the file system, I would be golden. Because in my case, it’s the file itself that I look to document so I don’t see why I have to maintain a separate entity if the page is directly mapped to the file on the file system. And the trick is the follow the directories, which is not happening now.

Another Example is how I produce master and reference data for my app.

Also, please also consider the mapping to URLs, as well, which I have posted about but closed in favour of this thread for simplicity, but let’s please also discuss how we map to URLs.

Also, @Didac started another thread along the same lines: https://discuss.logseq.com/t/integrate-logseq-with-the-command-line/12018/2

Checkout this workflow:

Over email, I had to exchange a number of important financial documents regarding a real-world topic, which has aspects that go beyond digital life, but also I tend to excerpt an unreasonable amount of control over these types of document exchange. For instance, one of the imperatives for me is that files must be grouped in one place. Cause at the end of the day, you know that tools come and go. Although I think Logseq and I are married for life, but still it’s that conservative way of thinking in specific situations that ask you to not overthink it. Make a folder, put them there.

And this is the twist of this workflow. HEY.com people have understood this nuance very well. As an email client, IMHO they represent the state of the art in their category.

  1. Now, imagine I already have a folder in Dropbox or a backed up file system node [^1].
  • The name of this folder usually corresponds to a well-known topic that is well-documented.
  • The odds are good that the topic in Logseq was even created before the file exchange.
  • Or not. Either way,
  1. Cmd+K and BAM, I’m on the topic. I just drop the files and start typing.
  • I as the artist of my knowledge graph will make sure that when I find my topic, that I land under:
    ~ws/2022/Budget Forecast 2023
    and this is mapped to
    /Users/skh/ws/2022/Budget Forecast 2023 on the filesystem

Here’s the twist, this can only happen if Logseq follows subdirs. Because I need to be connected to the filesystem context so the files land, exactly where I want them to, rather than all in assets.

And in fact, it’s the disconnect between the filesystem context of the assets and that of the topic page, that is the key to understanding my argument here. For real world topics, some want control, some want files grouped in classical directories. In fact, Logseq does present filesystem parity as one of its main features and rightly so. You guys are gods in what you do. But this breaks that imperative.

[^1]: Backed up of course because these are things I intend to keep for 7 years (at least) (required by Belgian law)

cc @Didac

@sindoc The dev’s already said they will not map namespaces to folders, and they have good reasons for this decision.

On the other hand, arbitrary relations between pages can also be specified as attributes.
This technique can easily reproduce the folder structure that you desire. Currently there is no way to display the results, but it seems to be on the queue.

Independently of this, I would love to see the ability to have local Logseq graphs spread over multiple folders. It is a bad design decision IMO to force all Logseq files into one folder and force the user to copy all files into assets (relative links out of assets don’t work). You do not want to re-built your entire filesystem hierarchy in the Logseq folder.

A more natural solution is to go to your budget folder, put all the relevant Logseq files into that folder, and link to them as needed from the outside.

An additional advantage is that you keep all your financial files in one spot, so you can backup and don’t intermix them with your main graph.
It also reduces the risk of accidentally leaking finance info sitting in the same folder with cooking recipes.

Could you please point me to the reasons why it would be an issue to map to FS directories? And have you given thought to the tilt notation? It’s a Unix-compatible notation that also provides focus and natural filtering so the whole file system is NOT in logseq. That’s indeed not what anyone wants. But if I know that ~/ or ~ws/ is bound to a Logseq context, then I can use symbolic links to make sure everything is in the right place.

Indeed and I agree, we don’t want to re-build our entire filesystem in Logseq. But under a base, why not? In order to support the use cases I have defined.

Oh, and Logseq doesn’t scan. It acknowledges the existence of a file only when the file is created through it. So if I do mkdir -p foo/bar and then touch hello then hello is not supposed to show up in Logseq

But if I Cmd+K in Logseq, and say ~ws/foo/bar/hello, then Logseq places the file under the /Users/skh/ws/foo/bar directory, if it finds it, otherwise Logseq does create it.