Add support for link types

@ringelblum @soma Now I’ve gotten myself confused. I had to remind myself that this topic is about what we want link types to look like as a supported feature in Obsidian, not how to do it in Obsidian as-is. For now I’m thinking of using the [[TargetNote|:linktype]] notation. The colon distinguishes it as a link type to differentiate it from a regular link rename.

What’s interesting about @soma’s suggestion is that he’s defining a triple, and therefore the full relationship, in a “3rd-party” note. This is distinctive from a notation to simply link the current note to a target with a link type. These are two very different things. Currently Obsidian graphs reflect relationships between notes implied by reference. Whereas this notation expects Obsidian graphs to reflect relationships explicitly defined by notes. And the grammar could be tricky:

NamedEdge → Link Words – Predicate → Link
Link → [[ Words ]]
Words → Word Words
Words → Word
Words → Lambda?
Predicate → Words

(This grammar isn’t completely correct because it allows for blank note names and blank predicates, but was shortened for clarity, if you can overlook that.) This will parse, but there’s a lot of room for error. for example:

[[Berlin] is the – capital of → [[Germany]]

If “[[Berlin]” is not seen as a link, then the “capital of” link will never be defined. Obsidian isn’t trying to be a compiler; if it doesn’t see the first link then the rest is just free-form text, and there is no error, and you may never know the link wasn’t defined. Worse, it means seeing [[this notation]] in two contexts. So if a syntactical error leaves the named-edge undefined, it also means that a link from this defining note to [[Germany]] is created, which wasn’t wanted. I’m not suggesting that other methods cannot similarly fall victim to such a mistake, but it speaks to the need to keep the notation as concise as possible. And also there would have to be a decision regarding Obsidian continuing to only recognize relationships between notes, or include relationships between notes defined by other notes. Personally I don’t see this happening due to the ambiguity created.

1 Like