When your maps get large, it can be helpful to filter those topics that you’re specifically interested in. For example, you might want to highlight those topics with a due date in the next few days or those topics that were modified yesterday.
iThoughts has a powerful ‘query language’ that enables you to describe those topics you’re most interested in. This is based on a database querying language called SQL (Google for ‘sqlite where clause’)
Some example queries might be:
shape like ‘Rectangle’
priority=1 and icon like ‘%smiley%’
…which I hope are reasonably self-explanatory?
Once you’ve described the topics you’re interested in, then you can either show or hide those topics (and/or the branches on which they live.) iThoughts will ‘dim out’ topics as appropriate.
When structuring your query, you need to know what values you can query for (and their type.) The following table gives you the field names/types.
|created||integer||The date/time (unix) when the topic was created|
|modified||integer||The date/time (unix) when the topic was last modified|
|text||text||The topic text as displayed (NOT the markdown)|
|note||text||The topic note as displayed (NOT the markdown)|
|link||text||The link attached to a topic|
|color||text||The RGB color of the topic (eg FF0000 for red)|
|icons||text||Comma delimited list of icon names|
|priority||integer||Number from 1-5 (or -1 if not set)|
|progress||integer||Progress from 0-100 (or -1 if not set)|
|start||integer||The START date/time (unix)|
|due||integer||The DUE date/time (unix)|
|effort||real||The effort (in hours)|
|resources||text||Comma delimited list of resource names|
Querying for Text (text, notes, links, shapes, colors etc.)
When querying for textual values you should use LIKE. Where you want a wildcard match you can use %.
For example if you want to match on all topics that have a smiley then you would use the following:
icons like ‘%smile%’
The % matches on any characters. So in the above, any icons with smile in their name will be matched.
Querying for dates
Querying for dates is a little more complex - but very powerful. The following example will pull out all topics modified yesterday:
DATE(modified,'unixepoch','localtime') = DATE('now','-1 day','localtime')
DATE(modified,'unixepoch','localtime') extracts the modified date and adjusts it for daylight saving time. The ‘unixepoch’ tells the system what format the modified date is stored in (i.e. the number of seconds since 1970.)
DATE('now','-1 day','localtime') calculates the date for yesterday (now - 1day)
The two dates are then compared for equality.
Individual queries can be strung together with AND or OR and NOT and nested with brackets. For example the following will pull out all topics DUE anytime before now+7days AND where their progress is not 100 (i.e. complete)
DATE(due,'unixepoch','localtime') <= DATE('now','+7 day','localtime') and progress != 100
Each icon has a fixed ‘name’ (in English.) To determine the name:
On Mac/Windows, hover your mouse over the icon in the icon picker (a tooltip will tell you the name)
On iOS - TODO
Colors are stored as RGB values.
On Mac/Windows, hover your mouse over the color in the color picker (a tooltip will tell you the value)
On iOS - TODO
Filtering is quite a complex beastie - but there is plenty on the internet regarding SQLite WHERE clauses - and you can alway email me…