Is there a way to do a transitive version of [tag[X]]?

Suppose I have a tiddler “Liquid” which is tagged with Ingredient. And I have a tiddler “Water” which is tagged Liquid.

Is there any way to do a transitive version of [tag[Ingredient]]? ie it would result in Liquid and Water being matched, not just Liquid.

To put it another way: can I do something similar to the “toc” macro, but just get the list of tiddlers that would be in the tree, as a filter?

It’s not too hard to write a recursive routine to do this. But, in the past, the go-to turnkey solution was the kin filter:

https://bimlas.gitlab.io/tw5-kin-filter/

Haven’t checked if it works with 5.3.0+

4 Likes

No need for recursion if its is a fixed number of tags deep.

Ingredients > liquid > water

In this case liquid is tagged ingredients, and water with liquid, but so would milk.

I would be tempted to use Ingredients > water and also tag water and milk with liquid.

The question is what questions or lists do you want answered? Your structure must allow these questions to be asked.

2 Likes

Good question.

My requirement: I want to be able to search for all Ingredients, without having to mark things as an ingredient at every level. Partly because I don’t want the <<toc>> macro to repeat nodes at different levels; I want water to appear just once in the toc, below liquid, and not also under ingredients. And partly because it would feel like I’m repeating myself and providing excess info that shouldn’t need to be stated explicitly.

Edited to wrap <<toc>> with backticks

Thanks, I didn’t know about Kin!

Also, take a look at
$:/plugins/yaisog/taggingtree-filter
It does a subset of kin – just the part that you need – and can be faster than kin in large wikis.

2 Likes

Thanks! I wish I could mark > 1 post as the solution!