First, we forget that filesystems are not hierarchies, they are graphs, whether DAG's or not. [1]
Second, and this follows from the first, both tags and hierarchy are possible with filesystems as they currently are.
Here's how you do it:
1. Organize your files in the hierarchy you want them in.
2. Create a directory in a well-known place called `tags/` or whatever you want.
3. For every tag `<name>`, create a directory `tags/<name>/`
4. Hard-link all files you want to tag under each tag directory that apply.
5. For extra credit, create a soft link pointing to the same file, but with a well-known name.
This allows you to use the standard filesystem tools to get all files under a specific tag. For example,
find tags/<name> -type f
(The find on my machine does not follow symbolic links and does not print them if you use the above command.)If you want to find where the file is actually under the hierarchy, use
find -L tags/ -xtype l
Having both hard and soft links means that 1) you cannot lose the actual file if it's moved in the hierarchy (the hard link will always refer to it), and 2) you can either find the file in the hierarchy from the tag or you know that the file has been moved in the hierarchy.Of course, I'm no filesystem expert, so I probably got a few things wrong. I welcome smarter people to tell me how I am wrong.
[1]: https://lobste.rs/s/ydno8w/tree_structure_file_systems#c_njg...