A common abstraction for links, tags and frontmatter

Use case or problem

Right now we have 3 kinds of metadata associated to a note:

  1. the links to other notes
  2. the tags associated to the note (or to blocks inside the note)
  3. the yaml frontmatter

I believe all of this can be represented as key-value pairs, and with the right syntax it would open up new possibilities, such as inlining metadata in the document and qualifying links.

Proposed solution

To explain further, let’s map the various concepts to {key:value} pairs.

{todo:null} is a tag, there is no value associated to the key.

{link:name} is just a regular, boring link to the note “name”. with multiple links in a note it would turn into {link: [note1, note2, ...]}

{answer:42} is basically inlined metadata - it could be inlined YAML, something we find in many feature requests. That way you can associate arbitrary metadata to a block, and DataView shows how powerful this can be.

Now, {capital_of:Germany} is a qualified link to another note. This opens up new possibilities in term of queries. For example, this weekend I was tracking family relationships between 40 characters for a LARP. Being able to write something like [[children_of::John]] in a character and use the graph view to display only the links qualified with children_of would be just perfect.

Of course, there is a catch in the syntax: if I have a note called “42”, how do I know if {answer:42} is a qualified link to that note, or some metadata? I believe it would be necessary to introduce two syntax changes:

  1. a special syntax to add a qualifier in a link, such as [[qualifier::note's name]]
  2. a new syntax to insert inline YAML, such as <<key: value>>

And finally, an isolated inline YAML block would be treated as associated to the note instead of a block.

You mean, a bit like what the Dataview extension offers?

You may have missed it, but I’m citing Dataview in my post. I think (correct me if I’m wrong) that dataview covers a part of what I’ve described - specifically the part about inlining metadata inside the document. But it doesn’t cover the “qualified links” part.