is there an "AND" version of tagging operator?

58 views
Skip to first unread message

Riz

unread,
May 3, 2020, 6:38:14 PM5/3/20
to TiddlyWiki
Say myfield contains a list of 5 titles - I want to find tiddlers tagged by all of them in combination

[enlist{!!list}tagging[]]

This code would list all tiddlers tagged by at least one of them - tag[title1] or tag[title2] and so on.
I want to find tag[title1] AND tag[title2] AND tag[title3] and so on

TonyM

unread,
May 3, 2020, 7:20:08 PM5/3/20
to TiddlyWiki
Riz
Perhaps also would be a better word than and if I understand you?

tony

Rizwan Ishak

unread,
May 3, 2020, 7:21:11 PM5/3/20
to TiddlyWiki
Yes

--
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/YFjCBU31PJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c96097df-c639-43fa-9209-a44bf07ee084%40googlegroups.com.

Rizwan Ishak

unread,
May 3, 2020, 7:27:09 PM5/3/20
to TiddlyWiki
The following PR had a matches operater doing what I am talking about. 


Has there been any developments regarding the same? I guess the current matches operater is not the same.

TonyM

unread,
May 3, 2020, 7:31:52 PM5/3/20
to TiddlyWiki
Riz

We can say [enlist{!!list}] generates the tiddlers you want to test if they have particular tags
This is a run, if you want to test each item in that run you either append more filters or use a +[[run]] to apply to each item
So the following should be what you are looking for

[enlist{!!list}tag[title1]tag[title3]tag[title3]]
or
[enlist{!!list}] +[tag[tag1]] +[tag[tag2]] +[tag[tag3]]

A
Common mistake is

[enlist{!!list}] [tag[tag1]] [tag[tag2]] [tag[tag3]]

This last one is 4 seperate runs that contribute to the output

Regards
Tony

TonyM

unread,
May 3, 2020, 7:35:42 PM5/3/20
to TiddlyWiki
Riz

I use the matches operator like this;

[{tiddlernam}match[yes]] 

[get[fieldname]match[no]]

Its a form of "string equals"

All these operators have being there in previous releases. https://tiddlywiki.com/#match%20Operator

Tony

On Monday, 4 May 2020 09:27:09 UTC+10, Riz wrote:
The following PR had a matches operater doing what I am talking about. 


Has there been any developments regarding the same? I guess the current matches operater is not the same.

On Mon, 4 May 2020, 04:50 Rizwan Ishak, <madapeed...@gmail.com> wrote:
Yes

On Mon, 4 May 2020, 04:50 TonyM, <anthon...@gmail.com> wrote:
Riz
Perhaps also would be a better word than and if I understand you?

tony

--
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/YFjCBU31PJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

TonyM

unread,
May 3, 2020, 7:38:46 PM5/3/20
to TiddlyWiki
I will just add for clarity

[[tiddler1]] [[tiddler2]] [[tiddler3]]
Is in effect three (3) Runs

To test these its easier to say 
[[tiddler1]] [[tiddler2]] [[tiddler3]] +[get[fieldname]match[yes]]

Regards
Tony

Rizwan Ishak

unread,
May 3, 2020, 7:42:02 PM5/3/20
to TiddlyWiki
We don't know beforehand what titles are there in the list field or how many.

So tag[title1]tag[title2]...won't work. 

--
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/YFjCBU31PJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/67e18a3b-c963-4b4a-aa59-ee79e771c9ee%40googlegroups.com.

Rizwan Ishak

unread,
May 3, 2020, 7:52:50 PM5/3/20
to TiddlyWiki
I thought

<$list filter="[get[tags]match{!!list}]"/>

would work. Unfortunately no.

Rizwan Ishak

unread,
May 3, 2020, 7:59:01 PM5/3/20
to TiddlyWiki
Another way to convey my problem is

How will you find all tiddlers which carry the same set of tags <<currentTiddler>> carries?

TonyM

unread,
May 3, 2020, 8:13:35 PM5/3/20
to TiddlyWiki
Riz,

That is more precise. Thanks

Unfortunatly I must work on something else, I will leave you with the following for now and return later

One would think you could compare tag fields, however the tags may be in a different order.

So you want to "iterate" the tags field and test each tag exists in the target tiddler, is it OK if an additional field is in the target?.

  • [enlist{!!tags}] will iterate all tags in the current tiddler
  • [enlist{!!list}] will iterate all titles in the list field in the current tiddler, ie items tagged by current Tiddler (if used and the order was altered)
  • I think you may need to nest filters or wistwidgets.
Regards
Tony



On Monday, 4 May 2020 09:59:01 UTC+10, Riz wrote:
Another way to convey my problem is

How will you find all tiddlers which carry the same set of tags <<currentTiddler>> carries?

On Mon, 4 May 2020, 05:22 Rizwan Ishak, <madapeed...@gmail.com> wrote:
I thought

<$list filter="[get[tags]match{!!list}]"/>

would work. Unfortunately no.

On Mon, 4 May 2020, 05:11 Rizwan Ishak, <madapeed...@gmail.com> wrote:
We don't know beforehand what titles are there in the list field or how many.

So tag[title1]tag[title2]...won't work. 

To unsubscribe from this group and all its topics, send an email to tiddl...@googlegroups.com.

TonyM

unread,
May 3, 2020, 8:15:17 PM5/3/20
to TiddlyWiki
Post script, Perhaps use https://tiddlywiki.com/#contains%20Operator to see if one tag field contains the tag in the other tag field.

Rizwan Ishak

unread,
May 3, 2020, 8:48:35 PM5/3/20
to TiddlyWiki
<$list filter="[contains:tags{!!tags}]"> tried this without success. Failed when there are more than one tag

To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dd1bceed-3262-413b-a1a3-bd40d428a29f%40googlegroups.com.

Mark S.

unread,
May 3, 2020, 8:58:09 PM5/3/20
to TiddlyWiki

\define filt-alltags()  
<$vars tag1="tag[" tag2="]" lb="[" rb="]">
<$set filter="[all[current]tags[]addprefix<tag1>addsuffix<tag2>]+[join[]addprefix<lb>addsuffix<rb>]" name="filt" select=0>
<$text text=<<filt>>/>
</
$set>
</$vars>
\end

<$wikify text=<<filt-alltags>> name="wiked">
<$list filter=<<wiked>>/
>
</$wikify>


Rizwan Ishak

unread,
May 3, 2020, 9:03:01 PM5/3/20
to TiddlyWiki
Works!!
Mind-effing-blown

Thanks Mark!!!!

Sincerely
Riz

--
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/YFjCBU31PJE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

TonyM

unread,
May 3, 2020, 9:30:19 PM5/3/20
to TiddlyWiki
Mark, Soo Cool!
Reply all
Reply to author
Forward
0 new messages