Ability to tag or otherwise classify links (in addition to notes)

What I’m trying to do

Obsidian newbie here… pardon me if this is something I should have been able to readily find on my own, but I am wondering if there is a way to classify or tag links - similarly to how one can classify or tag notes (using metadata or tags). The purpose would be to be able to specify characteristics of the destination note in relation to the current note in order to know in advance what type of material will be found at the far end of the link, (and potentially to take programmatic action based on these ‘linktags’).

For a simple example, let’s say I want to know in advance what language the destination note is written in. It would be convenient to tag a link as ‘es’, ‘fr’, ‘de’, etc, or perhaps as both ‘es’, and ‘de’ if, say, the destination topic was perhaps a Spanish/German dictionary. Such attributes could then be used to aggregate like materials together - imagine for example a dataview that selected notes on a topic, only if those notes also linked to French language resources.

For a more detailed example, let’s say I am building a noteset regarding contentious topics of argument… I may want to be able to tag links in a note on the topic with attributes such as:

linktag destination (the links goes to a topic which…)


definition (provides a definition of the topic of this note)
detail (provides additional detail on the topic of this note)
example (provides an example of the topic (an ‘is-a’ relationship)
related (is closely related to the current topic (an ‘is-like’ relationship)
evidence_pro (contains evidence supporting the veracity of the current note)
evidence_con (contains adversarial evidence undercutting the veracity of the current note)
argument_pro (contains a logical argument supporting the veracity of the current note)
argument_con (contains a logical argument undercutting the veracity of the current note)
opinion_pro (contains an opinion in favor of topic of the current note)
opinion_con (contains an opinion against the topic of the current note)
primary_src (contains first-hand evidence)
secondary_src (contains second-hand, hearsay, evidence)

then it would be possible, for example, to aggregate all links containing examples, or only those containing opinions from primary sources.

Things I have tried

It seems to me that there would be many, many uses for this ability, but I have not yet discovered how to accomplish this, short of only allowing a single outlink from a note and then specifiying the ‘linktag’ in the source note’s metadata - which is a quite wretched solution - I believe a layer of indirection is called for.

To be clear, a metadata element in the destination note, is useless for this purpose, as I am not primarily seeking to define an attribute of that target note, but rather an attribute about the nature of the relationship between the source note and it’s linked target.

Thoughts? Pointers?

Thank you.

You may want to investigate the Dataview plugin, and more specifically the Inline Metadata section.

You could have the keys be the languages, and the value the note

en:: [[path/to/english/note]]
fr:: [[path/to/french/note]]

You can find a lot more about Dataview here on the forums, good luck!

Some other examples how you could use Dataview and inline metadata:

[detail:: [[note link ]] ] (comment:: my comment)

That displays detail-key and unhides comment-key but shows my comment. You can use comment key to add any details and then query these details later. You can also name comment-key as detailComment etc if your note contains many inline-metadata.

To hide inline-metadata completely, you can use this syntax

My text begins %%[key :: my text ]%% my text continues

Thank you both for the suggestions. The dataview plug-in does seem like it would be very useful for many things; however, on initial review and a small amount of experimentation, I am not seeing that it directly meets my objective. However, based off your suggestions as a starting point, I have been able to use it to create a bit of a workaround.

The core problem is that metadata seems to basically decorate notes with attributes, primarily name/value pairs - in other words, they ultimately describe the note as an entity. I, conversely, am trying to describe the link as an entity, and I wish to be able to decorate it with attributes, query those attributes and return the matching links or query the set of links and return their attributes. I do not need anything complicated; such as for this to be semantically bi-directional, in the way that some might hope for in a graph context.

So, as far as I can tell, currently, whether we are using the dataview plug-in or not, when we create a metadata key, let’s say ‘English’, and then give it a value which represents ‘A Link to Some Document Written in English’, all we are really saying is this note has an attribute ‘English’ and that attribute has the value of ‘A Link to Some Document Written in English’. Which, unfortunately, doesn’t help a lick.

What I want is to be able to ask 'what links, in the current note, are classified in a particular way. For example, if my document contains, dispersed throughout its body…

Link A - an argument
Link B - an opinion
Link C - an argument
Link D - a first-hand statement
Link B - a second-hand statement

I basically want to say something on the order of:

give me a list of all the links from the current note where the link is an argument.

And get back:

Link A
Link C

or say something like:

give me a list of all links from the current note, ordered by classification and get back:

Link A - argument
Link C - argument
Link D - first-hand statement
Link B - opinion
Link B - second-hand statement

Desirable, but a good bit less generally useful would be to be able to ask such questions of a selectable set of notes.

In short, I am seeking to create links inline as I go, as one normally does, but also be able to drop a summary of the links, filtered or ordered by type, at another point in the note.

I see that dataview, can drop, into the current note, a summary table of links in the current note, but I don’t see an ability to select, filter, or order them. It can drop a list of links from a set of notes containing a given piece of metadata into a different note, but once again, that is not my objective.

As near as I can tell, whether one calls these linktags, link types, semantic links, directed links, attributed links, or something else, there is really no way to do this currently, and certainly no way to even approach it that does not appear to depend on external software, services, or APIs that would not meet my requirements for the simplicity and durability of my knowledgebase as a system. I have found a number of threads where people are discussing some of these ideas, often at significant length and cleverness, but I have yet to find a simple, workable example.

If I am wrong, I would dearly love to see such an example.

In the interim, I have devised a basic, if slightly inelegant, workaround which is not so onerous that I can’t imagine including it in my workflow. I will include it here in case it aids someone else. Specifically,

Step 1. I create inline metadata entries, as enabled by the dataview plugin, where the metadata key is a link type descriptor and the value is the outbound link. Since there are not many of these type descriptors that I wish to use, they can be quickly entered as snippets. The result is that there is little additional effort involved beyond creating an ordinary link, and the body text of the note looks normal.

Step 2. I create a companion or ‘sidecar’ note, which is done via template and thereby can come already populated with the dataview queries needed to pull back the desired metadata (set or subset of links) from the specific note (parent note) being worked on, so the work here is also very modest.

Step 3. The sidecar file is embedded at a desired location in the parent note.

The result is what I am after - in my current workflow, I can now have a note template of type ‘Proposition’ which creates a note that can be populated with outlinks characterized as pro_, contra_, example_. All Examples, Arguments For, and Arguments Against can be listed at the end of the note via the embedded sidecar file (as can a variety of other static or generated data for that matter).

It’s not perfectly lovely, but it works, and allows me to quickly make cunning insights such as that the proposition that the world is flat must be deemed false because the argument contra is compelling, namely that if it were, cats would have already batted everything over the edge. :slight_smile:

Thank you.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.