[tw5] Re: Using kin filter with multiple tags

2020-05-11 Thread Damon Pritchett
Alrighty then. After a bit of trial and error and realizing that there were 
other considerations when a tiddler has a succession of two tags, but then 
those two tags have a common single tag and also having to make sure that I 
didn't break the normal case where only one tag was involved (whew!), I 
came up with the code below. It does work for all cases that I've come 
across so far in my TW. I know that it only handles the case when there is 
a single tag or two tags, but not more than two. It was definitely a 
learning experience. Now the trick will be to remember those lessons 
learned.

I would appreciate any feedback if anyone sees a simpler or more generic 
way of doing it or there is something fundamentally wrong with the way I 
did it.




<$list filter="[title
tags[]tag[Railroads]count[]compare:number:eq[1]then]">
  Successors to ''<>'':
  
<$list filter="[title
kin:tags:from[]!is[system]!title[Railroads]!title]"> ->
  <$link><$view field="title"/>
  

  



<$list filter="[title
tags[]tag[Railroads]count[]compare:number:gt[1]then]">
  Successors to ''<>'':
  <$list filter="[titletags[]tag[Railroads]first[]]" 
variable=firsttag>
  <$list filter="[titletags[]tag[Railroads]last[]]" 
variable=secondtag>

  <$list filter="[title
kin:tags:from[]!is[system]!title[Railroads]!title]"> ->
<$link><$view field="title"/>

  


  <$list filter="[title
kin:tags:from[]!is[system]!title[Railroads]!title]"> ->
<$link><$view field="title"/>

  

  
  



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/be2b8fe7-ad8f-4ff1-88e5-3739faf825af%40googlegroups.com.


[tw5] Re: Using kin filter with multiple tags

2020-05-11 Thread Damon Pritchett
After a bit of trial and error, I was able to modify the code as follows;




Successors to ''<>'':


<$list filter="[titletags[]tag[Railroads]first[]]" 
variable=firsttag>
  
<$list filter="[titlekin:tags:from[]!kin!title
]"> ->
  <$link><$view field="title"/>
  

  



<$list filter="[titletags[]tag[Railroads]last[]]" 
variable=secondtag>
  
<$list filter="[titlekin:tags:from[]!kin
!title]"> ->
  <$link><$view field="title"/>
  

  


The above works just how I wanted. Since my current case never has more 
than two tags, first and last will suffice. If there's ever a case where 
there will be more than two, then I'll have to readdress that.

If anyone sees a simpler way of doing it, I would be more than happy to 
hear what that would be. I'm sure that there is a better way to do it given 
that I'm pretty much a noob at this.

Thanks,

Damon





On Saturday, May 9, 2020 at 11:09:13 AM UTC-7, Damon Pritchett wrote:
>
> Here's an example I created to illustrate.
>
> I have a series of tiddlers named RR#1 through RR#7.  RR#1 will be the 
> base and all others are successive tags from there. I've included some 
> screenshots of the filter at work. If RR#1 is only tagged with RR#2, then I 
> get  what is illustrated in picture1.png. If RR#1 is only tagged with RR#5, 
> then I get what is pictured in picture2.png. If RR#1 is tagged with both 
> RR#2 and RR#5, which is the case I'm trying to fix, I get what's in 
> picture3.png.
>
> I've thought about different ways of breaking the tiddlers up, but I can't 
> get away from one tiddler being tagged with two.
>
> Tony - I'm not sure I followed the hint you were trying to give. Maybe 
> it's because I haven't had enough caffeine this morning.
>
> Thanks,
>
> Damon
>
>
>
>
>
> On Saturday, May 9, 2020 at 1:42:37 AM UTC-7, TonyM wrote:
>>
>> Damon,
>>
>> It is the standard TOC that tends to work the other way, dividing into 
>> branches, leaves etc... Can you ask the Question the other way around?
>>
>> If you can write an independant filter you can actually subtract one from 
>> the other such as a filter than runs out all branches, then remove the 
>> tiddler in the main line (not railways) the original kin filter exposed, 
>> what will be left is the line of tiddlers that were not in the first 
>> filter, or you can add them together.
>>
>> I know this is but a hint, not a solution but the test data is not 
>> available. If you could demonstrate it on say a copy of tiddlywiki.com?
>>
>> Regards
>> Tony
>>
>> On Saturday, May 9, 2020 at 2:27:42 PM UTC+10, Damon Pritchett wrote:
>>>
>>> All,
>>>
>>> I've been using the following code which encompasses the kin filter to 
>>> trace tiddler tags. More specifically, I'm using it trace the line of 
>>> mergers for certain railroads (each railroad is a separate tiddler) such 
>>> that for any given company I can see the line of successive 
>>> railroads traced all the way up to the present.
>>>
>>> 
>>> <$list filter='[all[current]title
>>> kin:tags:from[]!is[system]!title[Railroads]!titlelimit[1]]' 
>>> variable=null>
>>> Successors to ''<>'':
>>> 
>>> 
>>> 
>>>   <$list filter="[title
>>> kin:tags:from[]!is[system]!title[Railroads]!title]"> ->
>>> <$link><$view field="title"/>
>>> 
>>>   
>>> 
>>>
>>>
>>> It generally works quite beautifully, but I have a very small  number of 
>>> cases where I have where the railroad was split and merged into two 
>>> different companies. The above code includes everything, but shows all as a 
>>> single line of succession. I'm pretty sure that the kin filter was only 
>>> meant to trace a succession of single tags so I'm wondering if there is 
>>> something I can do to the code above or I'll have to figure out a way to 
>>> split tiddlers. Any suggestions will be welcomed.
>>>
>>> Thanks,
>>>
>>> Damon
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d028a335-067c-4123-b163-c9bbb9c83240%40googlegroups.com.


[tw5] Re: Using kin filter with multiple tags

2020-05-09 Thread TonyM
Damon,

It is the standard TOC that tends to work the other way, dividing into 
branches, leaves etc... Can you ask the Question the other way around?

If you can write an independant filter you can actually subtract one from 
the other such as a filter than runs out all branches, then remove the 
tiddler in the main line (not railways) the original kin filter exposed, 
what will be left is the line of tiddlers that were not in the first 
filter, or you can add them together.

I know this is but a hint, not a solution but the test data is not 
available. If you could demonstrate it on say a copy of tiddlywiki.com?

Regards
Tony

On Saturday, May 9, 2020 at 2:27:42 PM UTC+10, Damon Pritchett wrote:
>
> All,
>
> I've been using the following code which encompasses the kin filter to 
> trace tiddler tags. More specifically, I'm using it trace the line of 
> mergers for certain railroads (each railroad is a separate tiddler) such 
> that for any given company I can see the line of successive 
> railroads traced all the way up to the present.
>
> 
> <$list filter='[all[current]title
> kin:tags:from[]!is[system]!title[Railroads]!titlelimit[1]]' 
> variable=null>
> Successors to ''<>'':
> 
> 
> 
>   <$list filter="[title
> kin:tags:from[]!is[system]!title[Railroads]!title]"> ->
> <$link><$view field="title"/>
> 
>   
> 
>
>
> It generally works quite beautifully, but I have a very small  number of 
> cases where I have where the railroad was split and merged into two 
> different companies. The above code includes everything, but shows all as a 
> single line of succession. I'm pretty sure that the kin filter was only 
> meant to trace a succession of single tags so I'm wondering if there is 
> something I can do to the code above or I'll have to figure out a way to 
> split tiddlers. Any suggestions will be welcomed.
>
> Thanks,
>
> Damon
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/55d27d40-b7ab-45ac-8215-1ec8dfa104b1%40googlegroups.com.