I really wanted to start a conversation on how people are using the force query expressions in Gaudi view. I realize a lot depends on what you want to do. The point is to hear how others are starting to use this view.
My possible use case might be a collection of random notes from Drafts I have collected in a new tinderbox document? Clean. No tags or colors.
Just for full disclosure… my sticking point with customizing Gaudi is formulating the query. Yes, i know the query syntax but I am a little uncertain in terms of the boolean logic needed such as this example from MarkB using color
$Color(that) & $Color!=[default color]
My thought is it would be interesting to use on the front end using $Tags, $Color, NLTags and possibly the #number of links (outbound, inbound ,Text Links?? (important notes) I would want clustered together to find random connections.
Anyway, I wanted to share some thoughts as I board a plane.
Tom
Trying to figure out the right query expressions for each of these…
I’m not sure, but I think the query you quote is asking “do I have a $Color value and is my colour that of the querying note?”. Sorry, MB’s on a long overdue travelling vocation and I’m buried in Conference Proceedings organisation so a deeper answer might need to wait a few days.
Suppose the default color for this document is “black”. Most notes are black, but some are red and others are green.
The force expression
$Color==$Color(that)
makes notes of the same color clump together. But I find this works poorly because ALL the notes want to clump to other notes. So let’s exempt that black notes:
$Color==$Color(that) & $Color!="black"
Now, green notes attract green notes, and red notes attract red notes. If you had an orange note, it won’t attract any other notes, but if you add TWO orange notes, they’ll attract each other.
Side note, one tip - I almost forgot - combine View / Use Filter with Gaudi view to assist with visibility to selectively filter out notes to optimize the view.
Yes… it works beautifully in Gaudi view. Try it… its a nice touch before you use the Force Query.
One thing I learned yesterday is that the filter variable must be different than your boolean variables otherwise the force expression will not work. Which is obvious after the fact.
Works
Filter: $Color!=7 //my default color is 7 for my notes. I want to just filter for colored notes
Force: $Tags.intersect($Tags(that)) // finds the notes that have tags that intersect with this note.
Your first example fails because you ask for only notes with no $Tags and then check for … $Tags values!
The second example works by chance. A note having a $Color value of 7 doesn’t say anything about whether a notehas a value in $Tags. But if you want to filter out all notes that have no $Tags value at all, then your filter should be:
$Tags!=""
The != operator is functionally the reverse of ==.