Release of the kin filter plugin: Recursively looking for kinship between tiddler titles; finds related tags

397 views
Skip to first unread message

bimlas

unread,
Feb 12, 2019, 2:54:38 AM2/12/19
to tiddl...@googlegroups.com
The purpose of the kin operator with examples:
  • Finds related tags, related tiddlers in any depth
  • Finds out where base tiddler originates and what other elements originate from it
  • Finds the ancestors and successors of a family member
  • Finds the "leaves" of the branch of the base tiddler in a tree-like structure (where the base tiddler is a leaf)
  • Finds the super- and subsets / groups of a mathematical set (where the base tiddler is a set)
Demo: https://bimlas.gitlab.io/tw5-kin-filter/
Official repository: https://gitlab.com/bimlas/tw5-kin-filter/
Mirror, please give a star if you like it: https://github.com/bimlas/tw5-kin-filter/

TonyM

unread,
Feb 12, 2019, 10:55:57 PM2/12/19
to TiddlyWiki
Thanks Bimlas,

For others, I am very excited about Bimlas's kin operator. In someways it is like a TOC in an operator, you can get all the tiddlers in a TOC structure as easy as if they all had the same tag. 

Why Kin? Its short for Kindred, like relatives, it helps you find your tiddlers kin, be it ancestors or descendants.
  • This means you can treat a large set of tiddlers related not by tag or field value etc.. but as a member of a more complex hierarchical structure.
  • Given the field option you can interrogate not only lists and tags, but any field used to establish a relationship.
  • However you can also use the kin operator to find tiddlers higher or lower in a given hierarchy from the current tiddler. You can even use it to find the root tiddler of a hierarchy.
  • One trick is to use kin to generate one set of "relatives/kin" in a filter and use a second kin filter to add or remove from the first set. Thus you can get a union, intersection, difference or join between two or more sets. For example you could list all descendants of your grand-parents to a dept of two, but exclude your parents and their descendants (You and your siblings) to get a list of your aunts and uncles and cousins
  • Remember the easiest way to create a set is with a shared tag, you can use the kin filter thus to manipulate sets that can reduce or grow over time, and add grand children
  • Similarly you could build your own TOC macro then use kin to determine the relationships between members of the TOC eg is this tiddler my sibling, cousin, uncle etc...
  • Kin does not nativelly differentiate between parents but it provides the underlying tools to build both patralinial and matralinial hierarchies if you want to build a genealogical tree of infinite complexity.

Top work Bimlas.

Bimlas Only the Demo link works with my test just now


Regards
Tony


On Tuesday, 12 February 2019 18:54:38 UTC+11, bimlas wrote:
The purpose of the kin operator with examples:
  • Finds related tags, related tiddlers in any depth
  • Finds out where base tiddler originates and what other elements originate from it
  • Finds the ancestors and successors of a family member
  • Finds the "leaves" of the branch of the base tiddler in a tree-like structure (where the base tiddler is a leaf)
  • Finds the super- and subsets / groups of a mathematical set (where the base tiddler is a set)
Demo: https://bimlas.gitlab.io/tw5-kin-filter/
Official repository: https://gitlab.com/bimlas/kin-filter
Mirror, please give a star if you like it: https://github.com/bimlas/kin-filter

bimlas

unread,
Feb 13, 2019, 1:29:27 AM2/13/19
to TiddlyWiki
TonyM,

Thank you very much for the introduction, I think many people don't understand what the plugin is, despite the documentation. I think I will have to add example family trees to explain how the plugin works.

I fixed the URLs, thanks for pointing on them:

Official repository: https://gitlab.com/bimlas/tw5-kin-filter/
Mirror, please give a star if you like it: https://github.com/bimlas/tw5-kin-filter/

TonyM

unread,
Feb 13, 2019, 2:01:03 AM2/13/19
to TiddlyWiki
Bimlas,

You have done a great job with the description and examples. The main reason I posted was so those who's imagination does not realise what kin means or so those who search in future would find the thread.

Exploring family trees with two parents will be interesting to genealogical uses of TiddlyWiki, I am sure its possible I have just not done the work yet.

But the solution is basically complete for most hierarchy models.

Once again, great Work,

Regards
Tony

mervin mecklenburg

unread,
Feb 14, 2019, 10:04:08 AM2/14/19
to TiddlyWiki
Can you use the operator to find toddlers carrying tags related to each other because they share similar portions -- for example, tags having the same prefix or suffix, or tags that share some expression somewhere in their center?

Merv

bimlas

unread,
Feb 14, 2019, 11:20:25 AM2/14/19
to TiddlyWiki
Mervin,

The filter is unable to do this because it only finds the connection between tiddlers, which are defined by fields.

To achieve what you want, here's a solution:

<$list filter="[all[shadows]]">
  <$list filter="[all[current]tags[]suffix[SideBar]]" variable="doNotOverrideCurrent">
  <
<list-links filter:"[all[current]]">>
  </$list>
</$list>

On the first line `[all[shadows]]` defining the input tiddlers, on the second line `tags[]suffix[SideBar]]` allowing only those of the input tiddlers that have a tag ending with `SideBar`.

Same logic, but now search for `$:/tags/Edit` prefix in tiddler's tags by `prefix[]`:

<$list filter="[all[shadows]]">
  <$list filter="[all[current]tags[]prefix[$:/tags/Edit]]" variable="doNotOverrideCurrent">
  <
<list-links filter:"[all[current]]">>
  </$list>
</$list>

Search for portion of tag names by `search:title[]`:

<$list filter="[all[shadows]]">
  <$list filter="[all[current]tags[]search:title[Library]]" variable="doNotOverrideCurrent">
  <
<list-links filter:"[all[current]]">>
  </$list>
</$list>

Mohammad

unread,
Feb 14, 2019, 11:23:32 AM2/14/19
to TiddlyWiki
Hi Bimlas,

Great tool and unique in the field.
I would appreciate if you add some examples to the demo page.

Mohammad

bimlas

unread,
Feb 14, 2019, 11:25:47 AM2/14/19
to TiddlyWiki
Mohammad,

Thanks!

See the README/examples tab or open this link directly to the tiddler: https://bimlas.gitlab.io/tw5-kin-filter/#%24%3A%2Fplugins%2Fbimlas%2Fkin-filter%2FREADME%2Fexamples

It seems that the documentation is not clear enough, I still need to refine it.

Mohammad

unread,
Feb 14, 2019, 12:37:12 PM2/14/19
to TiddlyWiki
Thanks Bimlas.

Cheers
Mohammad

mervin mecklenburg

unread,
Feb 15, 2019, 4:11:12 AM2/15/19
to TiddlyWiki
Bimlas;

Thanks for the great examples. I'll give them some study.

Mervin

bimlas

unread,
Mar 27, 2019, 3:40:59 AM3/27/19
to TiddlyWiki
I have given example tiddlers to the demo to make it easier to understand and try.

@TiddlyTweeter

unread,
Mar 27, 2019, 5:47:51 AM3/27/19
to TiddlyWiki
Ciao bimlas,

Great example! Shows how you can drill down the levels to get all parts of a nested hierarchy. 

I'm still trying to figure out if I can use it to generate "kinship charts" of the type anthropologists need. The issue is "marriage", i.e. each child has two parents. So "parents" are pairs at the same level of hierarchy and "children" are descendants from the "parents" union. Part of the issue is presentation as HTML lists are "unilinear"--i.e. they can't cope with the intersection of two equal level hierarchies. But it looks like kin-filter might be able to get the structure even if I need to present the data using something other than HTML lists? Just wondering. Hope this is clear!

Best wishes
Josiah

TonyM

unread,
Mar 27, 2019, 5:54:46 PM3/27/19
to TiddlyWiki
Josiah,

Have you considered using the kin operators ability to use a field. Then create matralinial and patralinial trees?

I have given some thought to gynecologic trees in tw though have not built one yet.

Regards
Tony

Mohammad

unread,
Mar 28, 2019, 1:03:43 AM3/28/19
to TiddlyWiki
Thnaks bimlas!

great efforts! I think kin filter when have a use case can be understood much better! This is true for every new learner!
So, examples here are crucial for understanding kin!

--Mohammad

Mark S.

unread,
Nov 10, 2020, 2:53:45 PM11/10/20
to TiddlyWiki
Is there a way that the kin operator could return a non-alphabetized list? If the list was un-sorted, it could be used to navigate the entire structure of a tag tree using the before/after operators.

Thanks!


bimlas

unread,
Nov 10, 2020, 4:20:59 PM11/10/20
to TiddlyWiki
Mark S,

If the list was un-sorted, it could be used to navigate the entire structure of a tag tree using the before/after operators.

On the https://bimlas.gitlab.io/tw5-kin-filter/#Family%20tree%20of%20Ford page, use the Filter below the image to try it: [kin::to[Henry Ford]] gives alphabetical output, [[Henry Ford]kin::to[]] returns the tiddlers in the order of crawl, which happens in the vertical direction. I don’t know if it serves the purpose, but these options are available.

History Buff

unread,
Mar 13, 2021, 2:51:23 PM3/13/21
to TiddlyWiki
Bimlas,

I love the kin filter plugin and use it in all of my TWs. I do have a question though. I seem to not be able to get it to work with dictionary tiddlers. Is there something in the plugin that prevents dictionary tiddlers from being recognized? If not, then is there some secret sauce to get it to work?

Thanks,

Damon

bimlas

unread,
Mar 17, 2021, 5:22:34 PM3/17/21
to TiddlyWiki
Thank you for using the plugin!

Do you want to search for links between titles in dictionaries? So, for example, the Y title in the X dictionary is the title of another dictionary and the Y dictionary also contains additional dictionary titles (X dict -> Y dict -> ...)? In this case, the Kin filter will not work because it can only search in fields, not dictionaries.

History Buff

unread,
Mar 17, 2021, 7:21:59 PM3/17/21
to TiddlyWiki
What I'm trying to do is to follow the tags trail (kin:tags:to[]). The tiddlers are a mix of regular tiddlers and dictionary tiddlers. The filter finds all of the regular tiddlers, but not the dictionary tiddlers. The dictionary tiddlers are tagged with regular tiddlers.

bimlas

unread,
Mar 18, 2021, 2:46:04 AM3/18/21
to TiddlyWiki
It works properly for me.

Create the https://bimlas.gitlab.io/tw5-kin-filter/#%24%3A%2Ftags%2FPalette tiddler and add the TopTag tag so you can test the tag trail. In Advanced Search -> Filter, enter the following expression:

[all[shadows]type[application/x-tiddler-dictionary]kin:tags:to[TopTag]]

This lists all palettes because the tag trail looks like this: TopTag -> $:/tags/Palette -> palette tiddlers.

Maybe it’s not the data tiddlers that are actually left out of the list, but the shadow tiddlers? Exactly which tiddlers do you want to see in the list? Tiddlers you've created, or ones that belong to the TiddlyWiki itself (shadow tiddlers)?

History Buff

unread,
Mar 18, 2021, 11:56:26 AM3/18/21
to TiddlyWiki
You're absolutely right. I misspoke in my last message using tags with dictionary tiddlers works just fine. I'm not 100% sure why it was working before, but I'm thinking that I must have not had all of my tags set correctly in the dictionary tiddlers. 

Separate question: I've noticed that the kin filter outputs a flat list. Is there any way for it to output a hierarchical list? I think this question has been asked before so I apologize if it has.

Damon

bimlas

unread,
Mar 18, 2021, 3:40:06 PM3/18/21
to TiddlyWiki
If your goal is not to filter but to display, then I think one of the TableOfContents macros may be more effective.

History Buff

unread,
Mar 18, 2021, 6:26:36 PM3/18/21
to TiddlyWiki
Interesting point. I hadn't quite thought of it that way. Thanks.
Reply all
Reply to author
Forward
0 new messages