Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag zettels #379

Closed
srid opened this issue Sep 8, 2020 · 11 comments
Closed

Tag zettels #379

srid opened this issue Sep 8, 2020 · 11 comments
Labels
Graph Zettel Graph related proposal Proposal with exact spec yet to be fleshed out unification Reduce complexity of neuron, and unify otherwise disparate concepts, removing features if necessary v2 Next generation neuron -- simple core, with plugins

Comments

@srid
Copy link
Owner

srid commented Sep 8, 2020

Proposal

Treat tags as zettels.

Every tag #foo (see inline tags in #189) is, conceptually speaking, also a zettel, with ID foo, and as such gets the associated foo.html generated page (with an implicit [[z:zettels?tag=foo]] query in it, for listing tagged zettels).

Now here comes the interesting part: if the user already has a zettel file foo.md, then that zettel is used as the "tag zettel" - and all instances of inline tags will link to it. This is useful if you want to take custom notes on the tag itself.

Brainstorming / open questions

  • At this point, one might ask - why not unify the tagging and linking syntax? For example, why not link to some zettel "ef324s3" as #ef324s3 (i.e. no different to "tagging")? Because, now, both tagging and linking creates an edge in the zettel graph. Consequently, the tag query z:zettels?tag=foo becomes equivalent to the (yet to implement) backlinks query z:zettels?to=foo.

  • How do we deal with hierarchical tags? What does foo/bar/baz map to? What about its intermediaries (eg: foo/bar)?

@srid srid added Graph Zettel Graph related proposal Proposal with exact spec yet to be fleshed out labels Sep 8, 2020
@srid
Copy link
Owner Author

srid commented Sep 8, 2020

This might also take some inspiration from the hierarchical index of @b0o's https://github.com/b0o/neuron-extras

@srid
Copy link
Owner Author

srid commented Sep 8, 2020

How do we deal with hierarchical tags? What does foo/bar/baz map to? What about its intermediaries (eg: foo/bar)?

Switch to foo.bar.baz format, and create 3 associated zettels with IDs: foo, foo.bar and foo.bar.baz. So when using hierarchical tags you get "free" index zettels for each level of the tag, which index zettels can latter be converted if desired to a regular zettel note whilst still being treated as tag(node) zettels.

@srid
Copy link
Owner Author

srid commented Sep 9, 2020

vscode-memo's author operates on a similar idea: svsool/memo#60 (comment)

@srid
Copy link
Owner Author

srid commented Sep 9, 2020

If tags are treated as just another link, we can still identify which links are tags by using an edge label on the graph. Currently we have two edge labels -- cf & folgezettel -- now, we simply add a third label to denote tags.

#foo 
is equivalent to,
<z:link/foo?label=tag>

just as:

[[foo]]
is equivalent to
<z:link/foo?label=cf>

or:

[[[foo]]]
to:
<z:link/foo?label=branch>

And hierarchical tags can delineate into multiple links, one for each level of hierarchy:

#foo.bar.baz 
is equivalent to having 3 links:
<z:link/foo?label=tag>
<z:link/foo.bar?label=tag>
<z:link/foo.bar.baz?label=tag>

@srid srid added unification Reduce complexity of neuron, and unify otherwise disparate concepts, removing features if necessary v2 Next generation neuron -- simple core, with plugins labels Sep 9, 2020
@srid srid added this to the 1.0 milestone Sep 12, 2020
@srid srid removed this from the 1.0 milestone Sep 15, 2020
@ericapisani
Copy link

I really like the ideas that you've outlined so far! I have a question regarding your comment on dealing with hierarchical tags:

How do we deal with hierarchical tags? What does foo/bar/baz map to? What about its intermediaries (eg: foo/bar)?

This could be due to me being newer to the whole concept of zettelkasten, but could we not view tags (and their zettels) as having a folgezettel relationship with the zettels that use those tags?

It seems like you're kind of suggesting that in this comment around free index zettels for each level of tag in a hierarchy, but I guess I'm slightly confused around what makes a tagging relationship distinct from that of a folgezettel relationship.

@srid
Copy link
Owner Author

srid commented Sep 22, 2020

@ericapisani

could we not view tags (and their zettels) as having a folgezettel relationship with the zettels that use those tags?

Right, that was my thinking - for the default generated tag zettels.

I suppose the following folgezettel relationships can be implicitly created, in the generated zettels:

  • foo.md contains [[[foo.bar]]] & [[[z:zettels?tag=foo]]]
  • foo.bar.md contains [[[foo.bar.baz]]] & [[[z:zettels?tag=foo.bar]]]
  • foo.bar.baz.md contains [[[z:zettels?tag=foo.bar.baz]]]

Basically a tag(node) zettel "branches off" to both child-tag(node) zettels and zettels that are tagged with it. I think this is exactly what https://github.com/b0o/neuron-extras does.


However, if the user creates foo.bar.md (for example) themselves, then neuron won't autogenerate it, and any folgezettel relationships from it is up to the user. That said, any zettels tagged #foo.bar will appear in the Backlinks of the foo.bar.md zettel.

This is why (that backlinks are still valid when user creates the tag zettel, unlike folgezettel "foward" links which vanish) I'm increasingly moving towards relegating folgezettel relationships as cherry-on-top, and focus more on non-folgezettel (i.e, normal) relationships. In that sense, tagging == linking. And "zettels tagged foo" == "backlinks of foo". So, in theory, tagging can be eliminated entirely, and re-added simply as a syntatic alias to the existing zettel/linking functionality. In my personal zettelkasten, I'm increasingly moving towards simple linking (i.e., [[foo]]) rather explicit tagging (#foo), and based on that I try to come up with ideas for improving backlinks support in neuron.

Not sure if that answers your question. In any case, I have not made any 100% concrete proposal here; just throwing some general ideas. This issue is still open for alternative suggestions, or new ideas. One thing is sure: tags should be unified with linking, as that is what they are in essence. How we implement that is what needs to be speced out.

@ericapisani
Copy link

What you've written makes a lot of sense, thanks for the explanation and the additional context!

@srid
Copy link
Owner Author

srid commented Dec 27, 2020

While making progress on #497, I realized that this tag zettels proposal can be vastly simplified to mean just one thing: tagging, (#foo), is the same as linking ([[[foo]]]), except the folgezettel relationship is reversed. Plus, it will obviate having to write the query [[[z:zettels?tag=foo]]] (thanks to the upcoming plugin mechanism).

(We ignore hierarchical tags with a slash, as those are not relevant - based on the design decisions made on #497, which the tag zettel plugin would likely be based on)

@srid srid pinned this issue Dec 28, 2020
@srid
Copy link
Owner Author

srid commented Dec 28, 2020

We ignore hierarchical tags with a slash, as those are not relevant

Actually, we may be able to use them. By having the dirtree plugin automatically tag child zettels with their parent folder; then, the the tag-zettel plugin can do the rest of the job, of forming links and rendering them.

For example, the dirtree plugin can automatically tag Tech/Software/Browsers/Vivaldi.md with #Tech/Software/Browsers, and finish its job. Then, the tag-zettel plugin can automatically link to, and render, the contents of the Browsers foler (along with other folgezettel connections made with [[[ or an explicit #Browsers) in the Browsers zettel.

@RoyiAvital
Copy link

In my University time I used to have the following files tree:

- Courses
  - <CourseName1>
    - Notes/
    - Exercises/
    - Exams/
    - Books/
  - <CourseName2>
     - Notes/
    - Exercises/
    - Exams/
    - Books/
  - <CourseName3>
    - Notes/
    - Exercises/
    - Exams/
    - Books/

What I'd expect tagging system which takes into account the folder tree hierarchy is to tag each file by each folder name in its tree.

So if I search for Books / click on the Books tag I will see all files inside all Books folders.
Even if I didn't explicitly added the tag Books to each (As I want the folder tree hierarchy to serve me, not me serving it).

I'd be happy if you give it a thought.

Thank You.

@srid
Copy link
Owner Author

srid commented Jan 10, 2021

Splitting this "mega" proposal into individual units:

Closing this one, in favour of the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph Zettel Graph related proposal Proposal with exact spec yet to be fleshed out unification Reduce complexity of neuron, and unify otherwise disparate concepts, removing features if necessary v2 Next generation neuron -- simple core, with plugins
Projects
None yet
Development

No branches or pull requests

3 participants