Handling Changing Relationships Between Tiddlers

328 views
Skip to first unread message

Diego Mesa

unread,
Jun 7, 2018, 10:34:01 AM6/7/18
to TiddlyWiki
Hello all,

I've been thinking a lot recently about how to handle tiddler "relations". That is, I have some tiddlers that are related to others, but not necessarily through (my version) of a tag relationship. I first just started typing out a related section in each tiddler like this: 

Tiddler 1
-------------
...
my content
...

!! Related

* [[Tiddler 2]]
* [[Tiddler 3]]


I quickly got tired of copy/pasting this into tiddler 2 and 3, so I turned into a field, where each tiddler has a "related" field with the names of tiddlers its related to. If this field is present, its automatically displayed at the end as a list. 

I am still building and learning and so these relationships change. Say I want to say that they are all now related to a Tiddler 4. I have to now go back and make changes to 3 tiddlers. As the process continues this gets cumbersome. 

So I thought, well I could just have some kind of tiddler like this:

A Relation
-----------
* [[Tiddler 1]] 
* [[Tiddler 2]]
* [[Tiddler 3]]

And then just go back and change that tiddler as the relationships of that group change. This system is nonoptimal though, as:
  • What does its title mean?
  • With this setup, every single time a tiddler is opened it has to search ALL RELATION TIDDLERS and see if it's listed in any of them. This doesnt make sense! 
Im envisioning some way to enter a new relation, and upon saving in this one tiddler, it handles populating the related field somehow. 

Anyway, this is all just some random thoughts on this. 

Does anyone have any better ideas/systems for managing this?

Thanks!

PMario

unread,
Jun 7, 2018, 11:46:57 AM6/7/18
to tiddl...@googlegroups.com
Hi Diego,

I'm not sure if this is what you are talking about, but I was thinking about different losely coupled "grouping" systems, for some time already.

1) The first one is built on attracton / repulsion, that is built up over time.

But it would need a graphical component, that would let us graphically adjust the position of different tiddlers, which also effect "related" tiddlers. So a "TiddlyMap" type of interface, which is way too much overhead.


2) A second system I was thinking of, is based on weight.

Where tags get a "fixed" weight and related tiddlers get a modifier. ...

But all those systems are kind of complicated to define, or need graphical tools, for setup. And the query language to request qrouping is complicated. :(


While I was typing the reply, I had a new idea. ... I'll need to think about it :)

have fun!
mario


David Gifford

unread,
Jun 7, 2018, 12:01:59 PM6/7/18
to TiddlyWiki
Why not use a tiddler tagged $:/tags/ViewTemplate, with this:

<$list filter="[all[current]backlinks[]sort[title]]"><$link><$view field="title"/></$link> </$list>

Then anything that links or tags to the present tiddler will show up in the tiddler as a related tiddler. There wouldn't be a separate tiddler 'A relation', but between tagging and backlinking you would be able to see all related tiddlers. And it would change as you change the links.

Diego Mesa

unread,
Jun 7, 2018, 2:10:24 PM6/7/18
to TiddlyWiki
Hey David,

I do use something like that, but I seperate links, tags, and what is "related". I currently used a related to field to handle this, but that has the problem that if I want to add another tiddler to that relatedness, I have to edit ALL of the tiddlers it is now related to.

Diego Mesa

unread,
Jun 7, 2018, 2:11:03 PM6/7/18
to TiddlyWiki
Wow mario those sound like really interesting ideas. For both I suspect you could using something like d3 force action graph

Thomas Elmiger

unread,
Jun 7, 2018, 2:11:56 PM6/7/18
to TiddlyWiki
Hi Diego,

For me it sounds like you want tags without using tags. Maybe I weren’t able to grasp your concept or it IS very similar to tags. So for me it would help if you could explain why you don’t want to use tags.

I think there have been attempts to build tag-like relations based on other fields before, maybe you (or someone else) will be able to find a link.

All the best,
Thomas

Diego Mesa

unread,
Jun 7, 2018, 2:26:03 PM6/7/18
to TiddlyWiki
Hey Thomas,

I think I know what you mean, but if topic 1, 2, and 3 are "related" by the particular way they prove something (or in anyway that is not easy to capture by a few words), what would I tag them with to capture that relation? 

I think of a "relation" as an UNNAMED edge between tiddlers, point SIDEWAYS. A tag is a NAMED edge between tiddlers (sometimes point UP to parents and DOWN to children, but could also be SIDEWAYS - depends on you)

PMario

unread,
Jun 7, 2018, 3:18:01 PM6/7/18
to TiddlyWiki
On Thursday, June 7, 2018 at 8:26:03 PM UTC+2, Diego Mesa wrote:
...
I think of a "relation" as an UNNAMED edge between tiddlers, point SIDEWAYS. A tag is a NAMED edge between tiddlers (sometimes point UP to parents and DOWN to children, but could also be SIDEWAYS - depends on you)

Yea, that's similar to what I was thinking about. ... My concepts should create a structure, that "grows over time". Once it is "mature" enough, you can ask some questions.

Using the "weight" metapher - eg: Show me all tiddlers with a similar weight as "this tiddler" +-100 ...

If a TW contains enough tiddlers .. and .. tiddler weights are (somehow) permutated over time ... The resulting lists may be interesting, and may reveal "hidden patterns" ... but it won't be predictable.

-m

PMario

unread,
Jun 7, 2018, 3:22:54 PM6/7/18
to TiddlyWiki

My new idea should be much more predictable (at the beginning) and easier to use for humans. So it should be possible to create a predictable structure, as described in the OP.

In the end, it still should have the potential to create and show "hidden patterns".

-m

PMario

unread,
Jun 7, 2018, 3:25:48 PM6/7/18
to TiddlyWiki
On Thursday, June 7, 2018 at 8:11:03 PM UTC+2, Diego Mesa wrote:
Wow mario those sound like really interesting ideas. For both I suspect you could using something like d3 force action graph

d3 has way to much overhead. There are more light wight frameworks available.

I like TiddlyMap quite a bit. ... But I personally use a very different workflow and it is "too heavy" for me.

-m

Thomas Elmiger

unread,
Jun 7, 2018, 4:34:08 PM6/7/18
to TiddlyWiki
Would this concept of sideways linking be "to the right" and "to the left" like a chain or would this be multi directional? In other words: Would the goal be to link from one tiddler to the "next" and the "previous" or would it rather be to locate them visually on a map to see their proximity to edges? (From the discussion with Mario I get the impression that it is rather the latter, while I myself have some thougts about the former.)

-te

Diego Mesa

unread,
Jun 7, 2018, 4:51:49 PM6/7/18
to TiddlyWiki
For me, its the latter - multidirectional. 

FYI - In working with ankwiki, I made a simple macro I posted here a while ago to create a "linkd list" of tiddlers from a filter, where each one can point to the next one.

Mark S.

unread,
Jun 7, 2018, 5:36:49 PM6/7/18
to TiddlyWiki
It reminds me of user groups in linux. So, in terms of structure.

You have a "related" field. It is a list field and lists tiddlers that represents groups the the tiddler might belong to.

For instance tiddler "Jaguar" might list as its groups:

Cats, Cars

The list field of "Cats" would, for instance, contain Jaguar, Tiger, Tabby
The list field of "Cars" would, for instance, contain Jaguar, Volvo, Jetta

If you have a new car, say Tesla, you could just add it to the list field of Cars. Then all the tiddlers that are part of Cars would know about new member "Tesla" without having to update every member.

-- Mark

Ste Wilson

unread,
Jun 7, 2018, 6:00:15 PM6/7/18
to TiddlyWiki
I think I have something along those lines if I'm understanding correctly... Previously contributed to me by you good people here...
So stephenteacher.tiddlyspot.com/#Force generates the table and links to the entries in vars field. Other equations which use force automatically appear beneath.


It was inspired by http://foxridgegarden.tiddlyspot.com

Bits of code are


<br>

<center>
{{!!equation}}
</center>

<table>
<tr><th>Variable</th><th>Description</th><th>Unit</th></tr>
<$list filter="[list[!!vars]sort[title]]" >
<tr><th>
<$transclude field="variablelatex"/>
</th><th><$link><$transclude field="title"/></$link></th><th><$transclude field="unitlatex"/></th></tr>
</$list>
</table>

And

{{!!description}}

Symbol: {{!!variablelatex}}
<br><br>
Unit: {{!!unitlatex}} {{!!unitname}}

<$list filter="[title<currentTiddler>listed[vars]tag[Equation]] -[title<currentTiddler>] +[limit[1]]"><br><br>
<h2>Used in Equations</h2><br>
</$list>

<$list filter="[title<currentTiddler>listed[vars]tag[Equation]] -[title<currentTiddler>]">
<$link><$transclude field="title"/></$link>
<$transclude field="equation"/><br><br>
</$list>

TonyM

unread,
Jun 7, 2018, 9:47:56 PM6/7/18
to TiddlyWiki
Diego,,

I love this kind of problem, and are yet to fully understand each contributors view of this. It is however my Gut instinct to suggest you can achieve what you are asking for using Jeds GenTags plugin to create generic tags fields. Basically you can create a separate tags field called relations and populate this as much as you wish knowing it is independent from your tags. When you want to place [[Tiddler 2]]
 [[Tiddler 3]] instead place the additional tag groupname for which [[Tiddler 2]] [[Tiddler 3]] (alternatively)tagged with groupname.

I suppose what I am saying is there is a relationship at any point in time you need a way to name the relationship, such that you can later alter the members in that relationship. In your example you are failing to encode this relationship as can be seen by you needing to visit multiple tiddlers to adjust it.

One trick is to ensure you have a named relationship where ever possible 

eg;  Call this the "somerel" with the members;
 * [[Tiddler 1]] 
* [[Tiddler 2]]
* [[Tiddler 3]]

All tiddlers that have this are tagged/Alt Tagged somerel

So now you can change the members in one place in somerel

Now you can clone this and create a new relationship called otherrel with different members
 * [[Tiddler 1]] 
* [[Tiddler 3]]

But you can use the somrel relationship to find all tiddlers that are candidates to change from somerel to otherrel.

For someone familiar with Databases and using a third table to index relationships between table1 and table2 the index table becomes two tables one for "table1 to table2" relationships, one for "table2 to table1" relationships, there are effectively two relationship tags. It depends if this is one-to-one (named tiddler) one-to-many (Relationship tag) or many-to-many (2 Relationship tags) 

Further with normal tags an alternative tags system in place you can clone or even have a custom Clone here button for new tiddlers and they can contain the original tiddlers tags and/or relationships fields and/or values. Thus as you build your tiddlers, you build the relationships.

Also I love placing tiddlers that display their content based on conditions in the view template and where necessary have a tag or alternative tag that can also toggle the display on and off.

For example if the Alternate tag field exists display the toggle, if toggled display all alternative tags, or provide a select alternative tag option and list all tiddlers tagged with that alternative tag. Jeds GenTags provides some of this out of the box.

I do not yet have a way to prove it but I believe TiddlyWiki allows you to encode simple through complex relationships such that you need no other tool to represent any complex relationship (in the universe) . Now that is a Subject for a data science or mathematics PHD.

Regards
Tony

S. S.

unread,
Jun 18, 2018, 4:27:11 AM6/18/18
to TiddlyWiki


On Thursday, June 7, 2018 at 9:34:01 PM UTC+7, Diego Mesa wrote:
Hello all,


Does anyone have any better ideas/systems for managing this?



After lurking for over a year, this is my first time posting here.

This was the exact issue I had as well.
A few hundred cases of tiddlers related to each other.
Often starting with just 2 related tiddlers, but then adding in 2 or 3 more related tiddlers.
I decided to write a macro, to save time, but as importantly, to avoid mistakes when editing 4 or 5 tiddlers to put in the right related lists.
On laying out the logic I thought it would be quite simple.
It should have been, but my lack of skill coupled with TW's delightfully fickle handling of variables made it much more difficult for me that I first imagined.

THE LOGIC I USED

for macro - <<related>>
creates a button which updates related tiddlers' field: related

List of related tiddlers W X Y
Add a new related tiddler: Z

Editing NEW Tiddler Z - give field: related - value:  [[W]] [[X]] [[Y]]

Set Variables: TT , RL
Derived Variables: FL , WT , PL

TT = This Tiddler - Z = {{!!draft.title}}
RL = Related Tiddlers = {{!!related}}
FL = Full List - [[W]] [[X]] [[Y]] [[Z]] // made from RL + TT
WT = Working Tiddler ( $list RL )
PL = Partial List ( FL minus WT {to put in related field of WT} )

$List RL - output = ?  ( W , X , Y ) into variable WT
   1st item ? is W
            $action-setfield $tid=W field:related= X Y Z
   2nd item ? is X
           $action-setfield $tid=X field:related= W Y Z
   3rd item ? is Y
           $action-setfield $tid=X field:related= X W Z
List End RL


The macro I use is named: <<related>>
This is in a tiddler with a tag: $:/tags/Macro

A New tiddler that is being created should have a field: related
The related field should have one or more tiddlers in a list - ex. : [[tid 1]] [[tid2]] [etc.]]
The macro <<related>> is put at the bottom of the New tiddler being created, and a button is visible only when that tiddler is in Draft mode.
The new name of this tiddler should be entered (title) before using the button.


\define set-field(PL)  <$action-setfield $tiddler="$(WT)$" $field ="related" $value="$(PL)$">

\define related()

<$list filter="[has[draft.of]]">

<$set name =TT value={{!!draft.title}}>
<$set name =RL value={{!!related}}>
<$set name=FL filter="[enlist<RL>][<TT>]">

<$button>
<$list filter="[enlist<RL>]" variable="WT">
<$set name=PL filter="[enlist<FL>]-[<WT>]">

<$macrocall $name="set-field"/>

</$set>
</
$list>

Set Related Tiddlers<br>
as shown below:<br>
</$button>

<$list filter="[enlist<RL>]" variable="WT">
<$set name=PL filter="[enlist<FL>]-[<WT>]">

Tid: <<WT>> - Set Related: <<PL>>
</
$set></$list></$set></$set></$set></$list>
\end

Hope it helps.

The accompanying <<related-footer>> macro is comparatively trivial - but I will include it for other beginners like myself.
When used in a tiddler, it displays a (one line) list of the tiddlers in that tiddler's related field.

\define related-footer()

<h5><$list filter=[all[current]has[related]]>
 
//Related// |
<$list filter=[all[current]list[!!related]] variable="name">
<$set name="tv-wikilink-tooltip" value="{{!!title}} - {{!!description}}">
<$link to=<<name>> > <<name>>
</$link> |
</
$set>
</$list></$list></h5>
\end


As I mentioned at the beginning of this post, this is my first time on the list (in fact, first time posting on Google Groups) - so if there are any mistakes in my posting - please bear with me.

Cheers.

 
Reply all
Reply to author
Forward
0 new messages