Then a filter that finds A is "[tag[A]]"B OR C is "[tag[B]] [tag[C]]"A AND B is "[tag[A]tag[B]]"A and (B or C) has to be rewritten as(A and B) or (A and C) and is
"[tag[A]tag[B]] [tag[A]tag[C]]”
Which in a strange way reminds me of horn clauses in Prolog where I'd write:```filter(a, b) :- ...filter(a, c) :- ..```So really these filter expressions are equivalent to queries in predicate logic.(which is why they are so powerful :-)
Cheers/Joe--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/9b8edbb1-8657-4502-ba5e-c867651203a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi JoeThen a filter that finds A is "[tag[A]]"B OR C is "[tag[B]] [tag[C]]"A AND B is "[tag[A]tag[B]]"A and (B or C) has to be rewritten as(A and B) or (A and C) and is"[tag[A]tag[B]] [tag[A]tag[C]]”You can directly do A and (B or C) as:[tag[B]] [tab[C]] +[tag[A]]There are three runs here:* The first two are processed in the same way: they start with an implicit [all[tiddlers]] to select all “real” tiddlers (ie, non-shadow tiddlers), whether or not they are system tiddelrs. The [tag[x]] filter operator selects those tiddlers that carry the indicated tag. At the end of processing each run, the results of the run are merged into the accumulator, the temporary holding storage for intermediate results.* The third run starts with a “+” which means that instead of kicking off with all the real tiddlers, it instead uses the accumulator as the input to the run. The [tag[A]] then selects those tiddlers from the accumulator that carry the tag “A”.The results of the third run replace the accumulator, and become the results of the entire filter.
The other filter prefixes that are available are “-“ and “~”. The action of minus is that the results of the run are removed from the accumulator (the input to the run is still the list of all “real” tiddlers). The action of tilde is to only evaluate the run if the accumulator is empty; the results of the run then become the accumulator.Which in a strange way reminds me of horn clauses in Prolog where I'd write:```filter(a, b) :- ...filter(a, c) :- ..```So really these filter expressions are equivalent to queries in predicate logic.(which is why they are so powerful :-)Thank you! It’s slightly embarrassing to have to invent something rather than being able to adopt something tried and trusted, so it’s good to hear that it’s not too terrible.
Joe
FYI I'm not a programmer and don't want to be one :-).
But I found your probing is very illuminating.
Given you are a highly achieved programmer I find it interesting even you need to grapple the TW.
I think there is a kind of "implicit" TW zeitgeist or weltanschauung in TW that is both very happily bracing and quite askance (oblique) to other stuff. Once we get into it I think we tend forget its divergences.
THB I think Jeremy does not fully know himself quite how far he has got and how good it is.
One thing I'm kinda interested in is "comparing Wiki". IMO we are underselling TW. Its a different world.
-- Mohammad
Joe,I empathise with you learning journey, having come to tiddlywiki in a similar way, as an IT Professional with coding in my past. Perhaps this perspective can help with the conceptualisation.In case it helps, filters and the filter runs are somewhat like command line filters piping selecting etc... but in Tiddlywiki the primary purpose (but not the only one) is the manipulation of tiddlers, and lists of tiddlers so they lean towards handing tiddler titles, of course you can list fields in the current tiddler, or throughout the whole wiki, or generate virtual titles (EG Range operator)Tiddler titles are in effect the key to a tiddler, and tiddlers are the standard unit of data, "the records in the database". But of course these records also provide the user interface and bootstrap the whole wiki in a file model.You said "equivalent to queries in predicate logic", I tend to think of it as the previously defined but forgotten 4th Generation programming languagesIn effect we are normally processing sets at a time, even if that set has zero 1, or many members, tags on a tiddler are just a subset as are fields.the special design in tiddlywiki is, changes in these lists are automatically reflected in what you see and it does this economically by using trees to identify the effected tiddlers.TiddlyWikis tag line is "a non-linear personal web notebook", and this explains somewhat its structure and concept, but I now consider "tiddlywiki a platform" on which to build almost any algorithm, and deploy it almost anywhere.For 3Generation language coders there is a need to in someways forget a little of how we conceptualise programming, because tiddlywiki is handling the relationship and changes in tiddlers across the whole wiki, provides the tools for list / set management and more. Of course if you want to be a developer, rather than a TiddlyWiki Super User, you may need to revert to the regular programming language models, but then you need to learn about the way in which tiddlywiki achieves its magic. See https://tiddlywiki.com/dev/ especialy https://tiddlywiki.com/dev/#TiddlyWiki%20ArchitectureOf course if you are across object oriented coding you can in some ways treat tiddlers as objects, or a html developer think of it as website design (A lot of html and css works out of the box in TiddlyWiki, unless it needs javascript), if you have database skills you can build databases using tiddlers or datatiddlers, if you are a user interface designer you can use tiddlywikis logic, tiddlers, html and css. If you are a javascript designer, you could build widgets and filter operators and create plugins that bring in open source javascript solutions to tiddlywiki - one of the best already is codemirror but there are many more in math and visualisation as examples.If you want to be involved in core development perhaps building a widget and a filter operator would be a good start, I would be happy to provide some ideas if you want a project.
However there is so much more than can be done without going into core development, because this is a platform of almost infinite possibilities.
Welcome to the community, I see by your questions, you are likely to be a productive member.