New filter operator: kindred: Filter tiddlers by tags (or any fields) recursively

1,275 views
Skip to first unread message

bimlas

unread,
Oct 26, 2018, 8:59:08 AM10/26/18
to tiddl...@googlegroups.com
I just finished my filter operator plugin what I would like to be merged in to the next release of TiddlyWiki. Before I opening a Pull Request for it, I want to be sure that this is usefull enough and the behaviour is clean. Please try out the attached demo and tell me your opinions!

Usage examples:
  • Find tag intersections in any depth
  • Check similiarity between Tiddlers by any field
  • Generate Table of Contents dinamically (actually I don't know how to do, but I'm sure that this is possible)
  • Find orphaned tiddlers
  • Search in family trees, bus schedules, etc. for common elements
Example: Check similarity between two tiddlers (find common "family members")

[kindred[Variables]kindred[Filter Expression]]
  • Concepts 
  • Reference 
  • TableOfContents
TiddlyWiki-kindred-filter-operator-demo.html

TonyM

unread,
Oct 27, 2018, 12:06:08 AM10/27/18
to TiddlyWiki
Bimlas,

I was delayed in reviewing your demo, and the truth is despite our previous conversations, I at first felt lost. I think we can add to you documentation. 

I think in part the reason I was lost was because it is so elegant and powerful that in someways, it is hard to believe.

So let me voice its functionality and you can feel free to correct me.

Bimlas's Kindred operator allows you to filter based how tiddlers are related, This relationship can be determined using the default tags field, or any other field.

Lets consider the use of a table of contents macro. We choose a root tiddler, and and the toc macro looks for each tiddler tagged with the root tiddler, listing its child(ren), it then looks for all the tiddlers tagged with each child and further down until it can no longer find any more tags to follow. This produces a TOC for us. You could say that every tiddler in a TOC is related or a Kindred of the root tiddler. Ie this is a unique set of tiddlers defined by their membership of this Tree.

Using the filter "[kindred[TableOfContents]]" we will see every member of this tree, and "[kindred[TableOfContents]count[]]" will tell you how many items are in this set (tree).

If instead you target one of the children with the kindred operator you will have its children and its ancestors returned (not the whole tree)

You can also use kindredup to get the ancestors and this includes with more than one parent mentioned.
You can also use kindreddown to get the children and grand children etc.. without the parents.

In the case of tags it is possible to have multiple parents, but if you we using Marios New Here with Parent Button you could use the parent field (as yet untested by me) you could choose not to have multiple parents. Only single parents - good for many standard hierarchies. In these circumstances I believe you will be able to determine the "Path" to an individual tiddler from the root down. 

What is important to understand is you can now rapidly generate lists of such related tiddlers and use them with additional filters for some very sophisticated outcomes

For example you can find the siblings of Examples with the following filter;

[kindreddown[HelloThere]!kindreddown[Examples]]

In the above example "Examples" is a child of HelloThere.

I expect we can do some very sophisticated operations with Bimlas's very helpful Filter Operator. I believe their remains a lot to be explored when it is simple with filters to do various set manipulations like unions, removal of one set of items from a larger set of items, not in set etc...

Very good work Bimlas.

Regards
Tony

TonyM

unread,
Oct 27, 2018, 1:15:40 AM10/27/18
to TiddlyWiki
Bimlas,

A Little update. I tested this with "Marios new here with parent", because it assumes only one Parent, it will thus not delimit the tiddler name so parent: "parent 1" will be interpreted by kindred as "parent" and "1".

Thus since kindred is designed to work with tags, we could say it assumes other fields only contain tiddler titles appropriately delimited.

I think in this case you need to document this fact, but the solution is possibly to improve Marios tool than to change yours, unless you have a way to treat some fields as single title fields, and others as title lists.


Regards
Tony

On Friday, 26 October 2018 23:59:08 UTC+11, bimlas wrote:

bimlas

unread,
Oct 27, 2018, 5:14:43 PM10/27/18
to TiddlyWiki
I am grateful to you for being my "proper English voice". :) You clearly see the benefits of the filter and your description is correct.

As I re-read the code and the "documentation", I realized that "kindred" is a silly, unclear name for describing the purpose of the filter, thus I renamed it:

The new name of the filter is "connects" (instead of "kindred"): If you didn't understand the behaviour earlier, then please try it again, I rewrote the documentation and simplified the usage.

The HTML file is attached, but the most recent demo can be found at https://bimlas.gitlab.io/demo/tw5/connects-filter.html

I hope it's easier to understand and people will recognize the possibilities.
connects-filter.html

bimlas

unread,
Oct 27, 2018, 5:25:54 PM10/27/18
to TiddlyWiki
Thanks for your investigation!

I think that it would be wrong to hardcode some predefined fields ("parents") to take as a single-title field... Maybe extend the suffix to something like this?

[connects:parents:with:single[Some Tiddler]]

Here "single" signs that the field should be treated as a single title.

I don't like this idea, but it would be possible and easier than modifying an already used solution (PMario's plugin): the tiddlers are already exists and modifying the plugin will not update the tiddlers' field automatically to the new syntax.

(note for myself: I have to learn English, because I cannot express my thoughts as I want)

Lyn Headley

unread,
Oct 27, 2018, 7:16:23 PM10/27/18
to TiddlyWiki
Hello,

would it be possible to use this plugin to create a filter which would export all tiddlers tagged with a tag -- along with all of the tiddlers they link to, and they tiddlers THEY link to, recursively...?

This would help me with a workflow I want to use: To publish a portion of my  private wiki by exporting it and importing it into a public one.

-Lyn

TonyM

unread,
Oct 28, 2018, 12:33:04 AM10/28/18
to TiddlyWiki
Lyn,

Short answer is yes.kindred (now connect) is perfect for this, if by link you mean using the same conection method as the toc, ie children are tagged with their parent yes.

Because kindred/connect is a filter you can generate a list of everything in a toc heirachy, thus use this filter in advanced search and you can export the result from there. Even create a saved filter.

Regards
Tony

TonyM

unread,
Oct 28, 2018, 12:51:43 AM10/28/18
to TiddlyWiki
Bimlas,

Once I realised, I thought kindred was a great choice "connects" works as well, but it implies other connections as well.

I understand your suggestion, but it does not follow an established convention to my knowledge. Lets keep looking for a possibly better method. Is there a way to detect if a field other than tags is or is not handling multiple tiddlers? Could we set a value that told connects that the "parent" field is not a multi title field and treat it as one title?

Eg:
<$set name=connects-single-title-fields value="parent spouse">
<!-- tells connects filter to treat parent and spouse fields as containing a single title not a list, as in tag fields, this could be a global variable -->

<$list filter="[connects...

</$list>

</$set>

On learning english, dont be too hard on yourself, we can help each other, and what better way of learning with conversation?

Regards
Tony

bimlas

unread,
Oct 28, 2018, 6:03:18 AM10/28/18
to TiddlyWiki
Because I'm not sure about the name and the deployment of the plugin, please fill out the form at https://goo.gl/forms/bywjS7UiuaosfRlR2 to help me in decisions!

bimlas

unread,
Oct 28, 2018, 6:08:02 AM10/28/18
to TiddlyWiki
I see that my solution is not an established convention, but using "external" variables makes this option useless in Advanced Search, it would be available only in tiddlers as in your example.

bimlas

unread,
Oct 28, 2018, 6:32:51 AM10/28/18
to TiddlyWiki
Thanks for your question, Lyn! It's a great example usage of this filter!

Try out yourself: for example you want to extract Filters from the ToC of the demo (TableOfContents -> Reference -> Filters)
  • Open the demo at https://bimlas.gitlab.io/demo/tw5/connects-filter.html
  • Write "[connects:tags:to[Filters]] [[TableOfContents]]" into the Advanced Search: it will list everything "under" Filters, plus the TableOfContents tiddler (just to avoid the creating it manually in the new wiki)
  • Press the Export Tiddlers button in the Advanced Search and select JSON File: it will export the matching tiddlers in to a JSON file
  • Open an empty wiki at https://tiddlywiki.com/empty.html
  • Drag and drop the JSON file to it and press Import
  • Open the "Filters" tiddler and add the "TableOfContents" tag to it to be visible in the ToC sidebar
Note that this works, but it's just exporting the tiddler which are connected by tags - the links (and images, etc.) in the tiddler text will be broken if it point so a non-imported tiddler. For example see Filters -> Dominant Append: the link "Filters" in the text works, because that tiddler is imported, while "sets of titles" is missing, because it's not connects by tags to "Filters".

I attached the exported Filters tree.
filters-tree-exported.html

TonyM

unread,
Oct 28, 2018, 8:17:16 AM10/28/18
to TiddlyWiki
Bimlas,

I nominated kin perhaps even better than kindred due to its size. Kin is a short version which can be considered family in english, and I have heard people whos native tounge is not english use it, but I know the U.S. understand kin.

The value of your first choice is because kin includes both ansestors or anticedents and decendants (children grand children).

I look forward to others opinions of course, but of note to me is if anyone is using your filter operator then they need to already understand heirachical structures, and understand inheritance and other concepts.

I will be using this in things I hope others will use, even if they do not understand the role the filter plays in the result.

I would be happy to write supporting documentation and also hope to use it to also represent family trees that is with two parents such as mother and father. I expect this aspect to be very popular.

However, personally, I will use it most in constructing new and novel ways of organising information or knowledge, in hybrid network and heirachical database models. This is why if it does not have too much overhead I think it should be in the core, or at least in standard distributions

I have not yet worked out how far I can take this filter, combined with itself or other filters, but I expect it will go along way. Wow.

If I were currently earning more, I would make a donation to your effort, and when I do I will, just as I would to others.

If you dont get enough responces to your survey, let me know and I will help promote it.

I feel like we are collaborating on this, and thanks.

I hope this is not too hard to read :)

Regards
Tony

Thanks
Tony

bimlas

unread,
Oct 28, 2018, 4:38:20 PM10/28/18
to TiddlyWiki
Yeah, I feel the same. :D

I would be pleased if you could write the documentation - it seems that you are the best for this work, because you understand the filter clearly and speeking English well. :) But I don't know, where should the documentation be available? As I see, the reference contains only minimal description about the filters (https://tiddlywiki.com/static/Filter%2520Operators.html) and there is no other place to explain the behaviour.

Do you know Git? Can we collaborate on GitHub/GitLab or should we stay here?

bimlas

unread,
Oct 28, 2018, 4:48:35 PM10/28/18
to TiddlyWiki
About naming/promotion: "kin" is OK for me. I created the form to get some response about the users, "is it good for them?", but the final answer will come from Jeremy, thus I don't mind if there is not enough answers. It's just a way for users to explain their opinions, not a requirement. But thanks for contributing, if you would like, feel free to spread the world about the filter. .)

bimlas

unread,
Oct 28, 2018, 5:27:04 PM10/28/18
to TiddlyWiki
I just changed my mind and tweeted about the plugin: more users could give more ideas and use cases, so promotion is OK, but please direct them to here too.

bimlas

unread,
Oct 28, 2018, 5:51:26 PM10/28/18
to tiddl...@googlegroups.com
I thinking on adding another suffix for depth:

[connects:tags:to:2[Target]!tag[Target]]

It would list Target's grandchildren, but not the children. What do you think?

I'm not sure that using suffix in this way is conventional, but it's as flexible as parameters on command line (`ls --all`).

TonyM

unread,
Oct 28, 2018, 8:39:04 PM10/28/18
to TiddlyWiki
Bimlas,

Targeting depth is great, however I feel there is value exploring the currently available capabilities of "kin" before adding too much. For example I can count the number of generations (if no tiddler has more than one parent/tag), where using the new here with parent helps) with 

[kindredup:parent[target-tiddler]count[]]

eg;
<$list filter="[kindredup[Obadiah TOC]count[]]"> </$list>

I would like to use this feature as a representation of the "branch" an unbroken list of tiddlers from the root to the target-tiddler, however the order is not correct.
[kindredup[target-tiddler] for example is a branch.

Is their anyway of ensuring its correctly ordered?

I have a feeling there is a more elegant way of adding the level functionality but its not clear in my mind YET.

What if we could provide kindredup or down with "n" generations such that it only lists that many generations 
eg kindreddown:1[targent-tiddler] would only show target-tiddler's children, kindreddown:2[targent-tiddler] target-tiddler's children and grand children

then if you wanted only grand children you could use

"[kindreddown:tags:2[target-tiddler]!kindreddown:tags:1[target-tiddler]]"

Thus you are saying I want the the targets next 2 generations, and exclude the first generation resulting only in grandchildren.

Kindred could allow + and - such that "Kindred:-1[target-tiddler]" will list target-tiddler's parent(s) and all below (thus include siblings)

If you use the default of tags "kindreddown::2[target-tiddler] is two generations down

If your used this simple number method there would be no need to add "to:n" just "n"
[connects:tags:2[Target]!tag[Target]]

or
[connects::2[Target]!tag[Target]]

What do you think?

Regards
Tony

TonyM

unread,
Oct 28, 2018, 8:39:55 PM10/28/18
to TiddlyWiki
Bimlas,

I can use Git but only a newbie, Set it up and I will go there.

Regards
Tony

LorenzGL

unread,
Oct 29, 2018, 1:15:06 AM10/29/18
to TiddlyWiki
Hello bimlas,

Thanks for the filter. This looks awesome. I spent a lot of time solving this problem in a very pedestrian way... and I your filter will make my life much easier.

Thanks again,

Lorenz

bimlas

unread,
Oct 29, 2018, 3:01:17 AM10/29/18
to TiddlyWiki
You convinced me: I don't adding new functionalities, until we know what this beast can do.

I'm thinking on opening the Pull Request, so Jeremy can react to the features/documentation/naming. Can you please update the documentation to be correct English? Just modify on the demo, then export the tiddler as JSON and attach here (if you are new in Git, then I don't like to contribute in it, because we could lost in technical details, so let's share the files here).

I renamed the filter to "kin" because it has the most votes at https://goo.gl/forms/bywjS7UiuaosfRlR2 so the demo can be found at https://bimlas.gitlab.io/demo/tw5/kin-filter.html

About the voting:

Would you like to use this filter?
  • Yes: 5
Do you think it should be part of TiddlyWiki itself?
  • Yes: 5
Which name would be the best to describe the behaviour?
  • kin: 3
  • kindred: 1
  • related: 1

bimlas

unread,
Oct 29, 2018, 3:16:12 AM10/29/18
to TiddlyWiki
Please notice the users that the plugin works with 5.1.18 (prerelease)!

The descriptive documentation is not necessary for now, because I don't know where it should be (maybe in ToC ->Learning?), but if you can find a proper "place" for it, then it's OK to be in the Pull Request. As I see, this kind of information should not be in documentation, plus I'm sure that comments in the examples will be removed (becuse there is no comment in other examples), but without those the behaviour is unclear in my opinion.

@TiddlyTweeter

unread,
Oct 29, 2018, 4:42:22 AM10/29/18
to TiddlyWiki
Ciao bimlas

Its of interest to me because it may provide a way to navigate "kin" in TW. By which I mean "human kinship"--the kind of thing genealogists and anthropologists are interested in.

FWIW, I tried in TW several times to produce "kinship trees"--and failed. Others have too through diagramming, and that didn't work either. For instance even TiddlyMap can't do it.

The formal issue is that human kinship is a combination of "relationships" of Equality and Hierarchy
.

For instance: "John Bolt" is a blood descendant (hierarchy) of "Father Bolt" and "Mother Bolt (married name)" through their marriage (equality). The issue is that the descent is from both parents from their marriage, not from them individually.

In all the attempts I seen so far to tackle this problem in TW they end up with the descendent only having ONE parent, not two :-).

I'm still playing with your tool so I'm still not clear if it can help me with the issue of being able to navigate human "kinship trees". But I thought the example might be of interest.

Best wishes
Josiah

TonyM

unread,
Oct 29, 2018, 5:36:12 AM10/29/18
to TiddlyWiki
Bimlas,

I will do as best as I can. I have some importiant things to do this week, but will continue a bit each day.

Regards
Tony

@TiddlyTweeter

unread,
Oct 29, 2018, 6:23:19 AM10/29/18
to TiddlyWiki
Ciao Bimlas

I'm replying here on this as the google form lacks a way to answer in the way I wanted :-)


Would you like to use this filter?
  • It looks very interesting. But I don't fully understand it yet. I need time to play with it.
Do you think it should be part of TiddlyWiki itself?
  • I don't know. My initial reaction is 'probably not' because some of it seems to be doing a lot more than other filters and I'm not clear how it fits alongside them. But, TBH, I don't have the competence to make a judgement.
Which name would be the best to describe the behaviour?
  • "kin" looks good in the sense that its about "relationships". The word "kin" in English can be used very widely. Its not just for (human) kinship; its also for anything that shares some kind of relationship. 

Best wishes & good luck!

Josiah

TonyM

unread,
Oct 29, 2018, 7:29:13 AM10/29/18
to TiddlyWiki
Josiah,

I had not tried to build geneological trees yet to see the problem in tiddlywiki. I am confident I have a way and the kin opperator would help.

Basicaly you need a paternal and matralinial tree. However if you tag a child with a parent tiddler and that tiddler is female it is the childs mother. Step families etc can also make it more complex.

However the world can be more complex, especialy with modern reproductive technology.

Never the less if you have some pointers to how these are handled in geneology do share so we can find a way.

Regards
Tony

TonyM

unread,
Oct 29, 2018, 7:34:57 AM10/29/18
to TiddlyWiki
Josiah,

I beleave the kin operator fills the gaps in the toc macros, and expands set manipulation. It introduces new ways to take loosely coupled networks and heirachies to a new level, something that suits tiddlywikis non- linear nature.

It makes me wonder what other revolutionary constructs could be added.

Regards
Tony

bimlas

unread,
Oct 29, 2018, 7:44:30 AM10/29/18
to TiddlyWiki
Well... i tried to do it. :D

Filter by multiple tags: Use the checkboxes to filter the list of tags; clicking on the tag lists only those tiddlers that are assigned to each of the selected tags. The list can be filtered using the global search box.
https://bimlas.gitlab.io/#Filter%20by%20multiple%20tags%20easily%3A%20FilteredTag%20example

It's not introducing new stuff, but makes using of tags easier, more "dinamical". I'm feeling that Tags list in MoreSidebar is just a static list of tags which is useless, thus I tried to make it better: you can narrow the list of tags by search box plus combining tags to get the common tiddlers.

TonyM

unread,
Oct 29, 2018, 7:53:29 AM10/29/18
to TiddlyWiki
Bimlas,

I am not sure how this fits the current discussion, so need to work through it, can you explain a little more?

By the way I plan to test kin against marios alt tags which allows additional tag like fields.

Regards
Tony

@TiddlyTweeter

unread,
Oct 29, 2018, 7:55:47 AM10/29/18
to tiddl...@googlegroups.com
Thanks TonyM for bright thoughts ... but I think it would be a mistake to get too far into in the variants of human kinship too early :-) to avoid getting into knots. I was just interested if this can depict biological relatedness first :-).

---

FWIW, for your interest, TonyM, in anthropology we actually use "categorical kin terms" (i.e. usually the words people use daily to name their relatives) .. so, for instance, in some cultures a (blood) son of a father may have several people he equally calls "father" (usually the biological father's brothers or sometimes the brothers of the mother, depending on the culture). So you may have one biological genitor, but multiple "fathers".

However, the pragmatic assumption of "father" & "mother" with biological descendants remains a skeleton of kinship (there HAS to be some biological basis :-) even if, in reality, the same "chart" also can deal with adoption, non-marriage partnerships, fictive kin, second marriages, trans-gender individuals etc.

All that would be for later. Much later. :-)
Josiah

TonyM ...

bimlas

unread,
Oct 29, 2018, 8:21:48 AM10/29/18
to TiddlyWiki
Sorry, misunderstood English:

"It makes me wonder what other revolutionary constructs could be added." - I understood it as "It makes me wonder what other revolutionary plugins/filters/etc. could be added. (to TiddlyWiki)"

@TiddlyTweeter

unread,
Oct 29, 2018, 8:42:00 AM10/29/18
to TiddlyWiki
TonyM & bimlas

... if you have some pointers to how these are handled in geneology do share so we can find a way.

One point where I see a possible overlap with bimlas' filter is that usually (in anthropology) relationships are calculated relative to Ego. That is somewhat similar to having a filter running relative to a specific starting tiddler. Here is a simple kinship chart ... Notice that all the terms are determined relative to "Ego". If you move "Ego" to a different place in the chart the terms change.

Hope this is more helpful than confusing!

bimlas

unread,
Oct 29, 2018, 8:59:22 AM10/29/18
to TiddlyWiki
I can't really help, because it would be hard to explain my thoughts in English, but basically I like to explain that this is why `[kin::from/to[Member]` exists: for example if you want to know the ancestors of Mo, then `[kin::from[Mo]]` will list (hopefully) GrFr and GrMo, while `[kin::to[Mo]]` listing Ego and Z/Br. I see that these "things" are relative, but you can use the filter "relaitively" to the "base member". In the future I would like to add a "(max) depth" parameter/suffix/whatever, so `[kin::from:1[Ego]]` (or something similar) would list Fr and Mo (and Ego), because they are "above" Ego with 1 level (Ego is added because the "base" tiddler is allways included in to the results).

@TiddlyTweeter

unread,
Oct 29, 2018, 10:23:48 AM10/29/18
to TiddlyWiki
bimlas wrote:
... this is why `[kin::from/to[Member]` exists: for example if you want to know the ancestors of Mo, then `[kin::from[Mo]]` will list (hopefully) GrFr and GrMo, while `[kin::to[Mo]]` listing Ego and Z/Br. I see that these "things" are relative, but you can use the filter "relaitively" to the "base member".

bimlas, thanks. That is helpful.

Best, Josiah

Diego Mesa

unread,
Oct 29, 2018, 10:38:58 AM10/29/18
to TiddlyWiki
Hey all,

I am very excited about this new filter operator, but admittedly having a hard time understanding it. I think a great idea would be to take Josiah's diagram (or a simpler one?) and to highlight the returned nodes for each separate use of the filter. This could then be added to the documentation! 

Best,
Diego

bimlas

unread,
Oct 29, 2018, 7:10:18 PM10/29/18
to TiddlyWiki
Yeah, I agree with you: people could easily understand the behaviour and the purpose of the plugin.

I'm not sure how should it be visualised: I don't like to use static images, because if the examples are changing, the image should be updated too. I tried to extract a portion of the ToC to visually indicate what's happening, but I'm stuck at highlighting the items. I will work on it.

BTW I just found a new usage of the filter: create a Table of Contents about the family of a tiddler. For example the output of

<div class="tc-table-of-contents">
  <
<toc "TableOfContents" "kin[Filter Syntax]">>
</div>


TonyM

unread,
Oct 29, 2018, 8:24:05 PM10/29/18
to TiddlyWiki
Bimlas, (Just found this previously unsent post)

The Documentation macros make adding documentation to tiddlywiki.com quite exhausting especially for the operators, and I am not sure there is support for the two suffixes in the documentation.

It appears that use of a second suffix is not defined in https://tiddlywiki.com/#Filter%20Step so additional changes will be required. We need to seek support from the experienced developers on this.

This is however possible. I have attached an incomplete draft of such documentation.

Regards
Tony

On Monday, October 29, 2018 at 7:38:20 AM UTC+11, bimlas wrote:
kinOperator.jpg

TonyM

unread,
Oct 29, 2018, 9:57:34 PM10/29/18
to TiddlyWiki
Ahh Got you.

We started to stray off topic because of the Question I asked. Yes looking at Filter by multiple tags could be powerful, But personalty I do this more inside list filters so I am yet to fully grasp "Filter by multiple tags" full use.

Your kin filter operator is in my view very simple on the surface with massive potential. 

Am I correct in thinking you have replaced kindredup and kindereddown with :to and :from?
I prefer up and down, would it be hard to make an alias for to = up and From = down, if I understand this correctly?

On "It makes me wonder what other revolutionary plugins/filters/etc. could be added. (to TiddlyWiki)" I am thinking along the line of other filters which can provide quick access to a "set of tiddlers" themselves defined by sophisticated relationships as kin does. Off the top of my head, perhaps a "network" filter that generates a list of every tiddler "related" by one or more relationships eg; tags, field existence, field values etc... which can also extract a distance (steps) from the target tiddler, even build the branch of relationships between two tiddlers. Eg TiddlerA in Same "network" to tiddlerd"
 tiddlera tagging by tiddlerb that has a reference field naming tiddlerc which tags tiddlerd

The above is just dreaming to illustrate the point.

Regards
Tony

bimlas

unread,
Oct 30, 2018, 2:35:25 AM10/30/18
to TiddlyWiki
Am I correct in thinking you have replaced kindredup and kindereddown with :to and :from?
I prefer up and down, would it be hard to make an alias for to = up and From = down, if I understand this correctly?

Yes, I modified it, because up/down is not clear: if "up" means the ancestors, then in the case of "tags" this is where the tiddler points by its tags, while in the case of "list" the parents are which pointing to the children, so "up/down" is relative. I think "from/to" is more obvious. Please check the updated documentation at https://bimlas.gitlab.io/demo/tw5/kin-filter.html

bimlas

unread,
Oct 30, 2018, 2:38:53 AM10/30/18
to TiddlyWiki
The Documentation macros make adding documentation to tiddlywiki.com quite exhausting especially for the operators, and I am not sure there is support for the two suffixes in the documentation.

As I see you are modifying the very first version of the documentation, please check https://bimlas.gitlab.io/demo/tw5/kin-filter.html for an updated one - here I tried to document the format of the suffix.
 
It appears that use of a second suffix is not defined in https://tiddlywiki.com/#Filter%20Step so additional changes will be required. We need to seek support from the experienced developers on this.

For opening the Pull Request, I think that the reference page + examples are enough. If Jeremy doesn't likes something, then we can change that, thus I don't like to include too much documentation for first.

bimlas

unread,
Oct 30, 2018, 2:47:11 AM10/30/18
to TiddlyWiki
The notation that you use in the doc is just in plan, it's not exists yet and I'm not sure that this syntax will be the final! (kindredup::-1[target-tiddler]) Besides this, please use the current syntax (so the example would be "kin::from:-1[target-tiddler]", but as I said, -1 is just in plan!).

The note part is basically the Examples, those should be documeted separatelly (write them to "kin Operator Examples", which can be reached by clicking on Examples on the bottom of the tiddler).

BTW a big thanks for writing the documentation.

LorenzGL

unread,
Oct 31, 2018, 7:07:41 PM10/31/18
to TiddlyWiki
It would be great if kin could be used to create a generalization of the toc function; i.e. allowing to create ordered/nested lists of toddler relations defined by other fields than tags. Right now it is incredibly powerful as a filter but is there a way to get a tree view of the results?

bimlas

unread,
Oct 31, 2018, 7:19:02 PM10/31/18
to TiddlyWiki
I'm not sure I understand what you're asking for. In the above example, only the tiddlers of the TableOfContents family tree that are related to the "Filter Syntax" are displayed.

Please specify the question so that I can reply.

bimlas

unread,
Oct 31, 2018, 7:23:22 PM10/31/18
to TiddlyWiki
I've extended the examples: the filter output is visualized by a custom table of contents.

David Gifford

unread,
Oct 31, 2018, 8:33:46 PM10/31/18
to TiddlyWiki
I added this to the toolmap under two sections, Lists, and tables. Let moe know if it belongs also in some other category there. (https://dynalist.io/d/zUP-nIWu2FFoXH-oM7L7d9DM)

LorenzGL

unread,
Nov 2, 2018, 1:09:25 AM11/2/18
to TiddlyWiki
Sorry, shortly after writing this (and getting onto a plane) I realized that I could simply modify the TOC macro to use other fields than "tag" to create nested lists. I realize that generating formatted lists and getting tiddler lists through filters are two distinctly different use-cases and that they probably shouldn't be mixed. Hence, this isn't relevant to the "kin" macro.

However, on a side note, I discovered a weird behavior when I changed the "toc" macro to use a different field than tags: the macro doesn't work for tiddler names containing spaces that are encapsulated in double brackets. I'll see an incomplete lists missing the descendants of tiddlers that are listed in "[[...]]". The macro will work fine with the same tiddlers in the tags field but will not work when their names are used in a different field. I was wondering whether anyone else has seen/can reproduce this behavior.

bimlas

unread,
Nov 2, 2018, 1:07:59 PM11/2/18
to TiddlyWiki

TonyM: We can add the longer, tutorial-like documentation later, but I must first clarify the syntax with Jeremy.


TonyM

unread,
Nov 3, 2018, 12:23:29 AM11/3/18
to TiddlyWiki
Fantasitc,

Good work

Tony

TonyM

unread,
Dec 8, 2018, 5:42:06 PM12/8/18
to TiddlyWiki
Bimlas,

As the Kin Operator appears not to be included in the core yet, can you provide the location to find the latest plugin or bundle so I can install it into my 5.1.18 Wikis?

Thanks in advance
Tony

bimlas

unread,
Dec 9, 2018, 5:14:17 PM12/9/18
to tiddl...@googlegroups.com
I attach the filter, but be careful because it's overwriting some shadow tiddlers!

[[$:/core/modules/filters/kin.js]] [[$:/core/modules/wiki.js]] [[$:/core/modules/utils/utils.js]]

---

EDIT: I've removed the attachment, see the next (Jeremy's) post. If you've imported into your wiki, delete the above mentioned tiddlers.

Jeremy Ruston

unread,
Dec 9, 2018, 5:49:39 PM12/9/18
to tiddl...@googlegroups.com
Just to point out that I would strongly recommend in the strongest terms NOT to use any hack that requires overwriting a core module. It's hair-raisingly risky 99.9999% of the time, and I dread tracking down and resolving the sort of problems it is likely to cause. You can be absolutely certain that somebody will try to install this on a later version of TW than v5.1.18.

If you're a developer, please don't encourage end users to do this. It's impossible for them to make a sensible risk assessment, and will inevitably lead to people seeing TiddlyWiki itself as unreliable.

Best wishes


On 9 Dec 2018, at 22:14, bimlas <bimba....@gmail.com> wrote:

I attach the filter, but be careful because it's overwriting some shadow tiddlers!

[[$:/core/modules/filters/kin.js]] [[$:/core/modules/wiki.js]] [[$:/core/modules/utils/utils.js]]

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/1d3266c3-2fda-4dee-b3dd-ce52d140c176%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<kin-bundle.json>

TonyM

unread,
Dec 9, 2018, 8:14:22 PM12/9/18
to TiddlyWiki
Jeremy,

Can you suggest a way for bimlas to implement this without a system tiddler overwrite if possible?

I am very keen to have this kin operator in most of my wikis and see it as a powerful extension especialy alond with else filter and subfilter.

Regards
Tony

bimlas

unread,
Dec 10, 2018, 3:29:36 AM12/10/18
to TiddlyWiki
You're absolutely right, I'm sorry, removed the attachment. If I should describe myself as a role-playing character, my alignment would be "chaotic good": often I would like to help, but I do not choose the right path for this. :)
To make this information not just in this thread, I did a PR that warns if the user is trying to import a core tiddler.

https://github.com/Jermolene/TiddlyWiki5/pull/3634

Jeremy Ruston

unread,
Dec 10, 2018, 4:26:35 AM12/10/18
to tiddl...@googlegroups.com
Hi Bimlas

You're absolutely right, I'm sorry, removed the attachment. If I should describe myself as a role-playing character, my alignment would be "chaotic good": often I would like to help, but I do not choose the right path for this. :)

No worries. Paradoxically, for developers hacking TW5's internals overwriting core files is a critical way of learning more about the system, and is to be encouraged!

The ideal flow is that a developer prototypes a feature as a plugin, then realises that the core needs changes to support their functionality. To avoid waiting for that to happen, the developer should go ahead and overwrite the core tiddlers in their own fork. That let's them get the plugin up and running, and start experimenting with it. If things go well, the developer ideally then lobbies for the smallest core change that will permit their feature to be implemented cleanly. In many cases, the core change required is uncontroversial and of general benefit. In the "worst" cases we just add a hook that enables plugins to dynamically alter the affected behaviour.

The above process happens continually with TW5. The process itself is slow and cautious to complete, but it enables plugin development to proceed without ever being blocked by the need to change the core.


To make this information not just in this thread, I did a PR that warns if the user is trying to import a core tiddler.

Excellent, thank you, I've separately commented there.

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

bimlas

unread,
Dec 10, 2018, 8:46:51 AM12/10/18
to TiddlyWiki
If I understand that right, it's not bad to distribute modifications in the core as a plugin, because by deleting the plugin, changes in the core will also disappear? So passing kin as a plugin for TonyM is OK?

Jeremy Ruston

unread,
Dec 11, 2018, 4:45:46 PM12/11/18
to tiddl...@googlegroups.com
Hi Bimlas


On 10 Dec 2018, at 13:46, bimlas <bimba....@gmail.com> wrote:

If I understand that right, it's not bad to distribute modifications in the core as a plugin, because by deleting the plugin, changes in the core will also disappear? So passing kin as a plugin for TonyM is OK?

That’s exactly right.

Best wishes

Jeremy

bimlas

unread,
Dec 12, 2018, 3:32:33 AM12/12/18
to TiddlyWiki
Released the demo plugin: https://bimlas.gitlab.io/tw5-kin-demo/

Again: This is the demo version of the kin filter operator, use it only for testing purposes, do not install into an important wiki because it overwrites core modules.
Once this pull request is merged and the filter is available by default, delete this plugin and use the builtin version:

TonyM

unread,
Dec 12, 2018, 7:33:31 AM12/12/18
to TiddlyWiki
Bimlas

Once again this looks fantastic. It opens so many possibilities for heirachies and sets. It already stands on its own but are you open at this point to any of the following, or would you like to release and review later?

Some documentation rewording
Some questions that may suggest further improvements
Some questions about more advanced uses

Regards
Tony


bimlas

unread,
Dec 12, 2018, 8:08:46 AM12/12/18
to TiddlyWiki
I feel that the implementation of the filter will not change much, so if you still want to write a large description, I'd be happy to inculde it to the current one. I have only doubts about the location of the description: tiddlywiki.com may not be enough for the examples, but it would be necessary to introduce many tiddlers. Could it be a separate wiki for the description of the filter?

I'm not planning to write more documentation on my part because my English is still weak, but I'm already experimenting with how to use it. For example have a look at https://github.com/Jermolene/TiddlyWiki5/issues/3627#issuecomment-445487905

Diego Mesa

unread,
Dec 12, 2018, 9:49:33 PM12/12/18
to TiddlyWiki
bimlas,

Thank you so much for you work on this, and the excellent documentation complete with figures! A few seconds staring at the figure and I immediately got it! 

Thank you!
Diego

bimlas

unread,
Feb 12, 2019, 3:20:55 AM2/12/19
to tiddl...@googlegroups.com

Dave Gifford - http://www.giffmex.org/

unread,
Feb 12, 2019, 7:34:09 AM2/12/19
to TiddlyWiki
Updated the link in the toolmap

bimlas

unread,
Feb 12, 2019, 7:59:44 AM2/12/19
to TiddlyWiki
Thanks, Dave, but it seems broken:

vivaldi_2019-02-12_13-58-28.png

David Gifford

unread,
Feb 12, 2019, 9:26:04 AM2/12/19
to tiddl...@googlegroups.com
There you go. It's like it didn't save the change on the first one, and the second one I overlooked. But they should be good now.

David Gifford




--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/YZlPGP0qX1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages