How Can I Add Metadata to Metadata :)

So, in an effort to force myself to think about how a new note links up to the existing network, I have template that inserts something like this into every new note:

> [!metadata]- Relations
> [adjacent::   ] /
> [parent::      ] /
> [sibling::     ] /
> [previous::    ] /
> [next::        ] /
> [child::       ] /

I populate as many fields as I go along. Sometimes I add relations, other times I might even remove them. It allows me to capture strong relations that may not be in the text, and plays very well with, e.g. the breadcrumbs plugin.

> [!metadata]- Relations
> [adjacent::   [[notes/foo|Title of Foo]] ]  /
> [adjacent::   [[notes/bar|Title of Bar]] ]  /
> [parent::   [[notes/baz|Title of Baz]] ]  /

I thought by keeping to a small set of consistent terms for some core relation types, it would work across all sorts of knowledge domains and make surfacing and discovery easier.

But at the same time, I want to communicate more semantics than just “parent” etc…
I would like to be able to express things like:

  • “‘parent’ in the sense of background theory/framework”
  • “parent in the sense that you have the understand this other note as a pre-requisite”
  • “parent in the sense that it is a project that required me to understand this concept” etc.

Is there a way I can do this without an explosion of metadata fields?

One way that occurred to was to use the alias field, e.g.

[adjacent:: [[notes/foo|Relevant literature]] ]

Do folks have other systems or maybe just an overall better approach?

1 Like

Hey, did you ever figure this out? For something like that, I personally would use nested properties/attributes. Unfortunately, Obsidian’s new Properties function is yet to support nested YAML, but it seems to be popular enough among users that I think it’s just a matter of time before they do implement it. It might look something like this:

---
relations:
  adjacent: 
    - file: "[[Some Adjacent Note]]"
      relation-context: "adjacent because of the way that it is."
    - file: "[[A Different Adjacent Note]]"
      relation-context: "adjacent because of the way that it is."
  parent: 
  - file: "[[The Parent Folder's MOC/Index]]"
    - file: "[[Note About Some Framework]]"
      relation-context: "parent in the sense of background theory/framework."
    - file: "[[Note About Some Other Concept]]"
      relation-context: "parent in the sense that you have to understand this note as a prequisite."
    - file: "[[Note About Some Other, Other Concept]]"
      relation-context: "parent in the sense that it is a project that required me to understand this concept."
  sibling: 
    - file: "[[Some Sibling Note]]"
      relation-context: "This note is a sibling to this one because of the way that it is."
    - file: "[[A Different Adjacent Note]]"
      relation-context: "This note is also adjacent because of the way that it is."
---

The cool thing about this is that if you use Dataview, nested YAML is compatible with DQL, so you can still query the individual values easily with some alterations to your queries while maintaining the entirety of the data available (if that makes sense).

The other issue is that I don’t believe you can do nested attributes with inline metadata, so you’d have to add it to the frontmatter instead. If you really want it in the note, you could just put in Dataview query that would list them somewhere in the note. For the example I gave, this should work:

LIST WITHOUT ID joinedRelations
WHERE file.name = this.file.name
FLATTEN relations AS relation
FLATTEN join(nonnull(relation.adjacent, relation.relation-context), " - ") AS joinedRelations

Again, it’s not perfect, but it’s an option to consider that I personally love for use with Dataview. I think the alias idea ain’t bad either, especially if it’s only for referencing while you’re in the note itself. I hope you or anyone else who stumbles on this thread with a similar use case finds it helpful!