Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Using #linkedTo & #linkedFrom (Read 17203 times)
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Using #linkedTo & #linkedFrom
Sep 4th, 2008, 1:12pm
 
I'm interested in using an agent to collect, or filter out, notes that are linked to, or from, any other note.

Is this doable? What would the syntax be?

Thanks!
Back to top
 
« Last Edit: Sep 04th, 2008, 1:13pm by Rafter T. Sass »  
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #1 - Sep 4th, 2008, 1:28pm
 
You might also consider the links(). It works as an action to create a set of (attribute) values - default being $Name - of each matching note.

The #linkedTo/#linkedFrom special queries have an optional second parameter, 'Type', allowing you to tighten the match to a single link type.

When testing/researching links for the above don't forget that you can turn each link type off individually via the LinkTypes palette (Cmd+2). Also, the Path view (Cmd+Shift+P) allows you to see all notes linked by a given link type (albeit both source & sink without polarity). Raodmap (Cmd+Opt+R) allows links to be navigated and all inbound outbound links are shown (withuot link types). Browse links shows all outbound links. Lots of slightly overlapping tools.

Not time to build tests now but the above should help give some start points.
Back to top
 
« Last Edit: Sep 4th, 2008, 6:14pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #2 - Sep 4th, 2008, 1:48pm
 
Thanks! That's helpful.

If I want to exclude notes that are linked to, would the query be:
!#linkedTo(*)
or
#linkedTo(*) = ""

or something else?

I'm workin' on it.
Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #3 - Sep 4th, 2008, 1:55pm
 
Re-read the notes on #linkedTo/#linkedFrom and you'll see the target is a single note. I assume you're not trying to link to a note called "*"? Usage:

#linkedTo("some note",agree)
#linkedFrom("another note")

A note's name can be substituted for by any item object.

#linkedTo("some note","custom type")
Back to top
 
« Last Edit: Sep 4th, 2008, 6:13pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #4 - Sep 4th, 2008, 1:55pm
 
I'm getting sidetracked by very weird glitches.

Created a new TBX to test (before mucking with my GTD).

Created and linked some sample notes.

Created Agent#1: works great! Collects every note with a link running to it!

Subsequent Agents: do not work for anything - even if I cut-n-paste the exact query from Agent #1, they collect nothing

Duplicate Agent #1 - works great!

I'm stumped hard.


Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #5 - Sep 4th, 2008, 1:58pm
 
If you delete agent #1 do the others work? What is the query for agent #1?
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #6 - Sep 4th, 2008, 2:00pm
 
Maybe I should clarify my task.

I'm dealing with the hoary old problem of ordinality in GTD/TBX tasks.

It's of particular note when a project combines sequential and non-sequential tasks.

So, in order that my Context agents only pick up the relevant Next Action, I'm hoping that I can link sequential tasks, in order, and *add a filter layer* to the agent queries that ignores tasks that have uncompleted precedents.

Does that make sense?

So, unless I'm missing some important point here, I will want to use a wildcard in my #linked query...
Back to top
 
 
raughter   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #7 - Sep 4th, 2008, 2:57pm
 
Well, that weird agent behavior seems to have resolved itself.

Thanks much for your help, Mark!

I'm getting encouraging results from using the links() operator.

My little testing ground TBX has three User attributes:
Action (boolean)
OpenPrecedent(boolean)
MyPrecedent(set)

- the Rules for my Task prototype are looking like this:

OpenPrecedent=links.inbound.antecedent.Action;
if($OpenPrecedent) {Action=False};
MyPrecedent=links.inbound.antecedent.Name;

I'm still tinkering to figure out if I want to query from Action or OpenPrecedent, or both, or what, when I collect tasks.

Back to top
 
« Last Edit: Sep 4th, 2008, 2:59pm by Rafter T. Sass »  
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #8 - Sep 4th, 2008, 5:17pm
 
Re your previous, wildcard searches aren't possible in the way you used an asterisk search.  It's worth taking a read through the objects & concepts section of aTbRef so you understand what your options are when a query, code, etc., asks for a 'note' as an argument. It saves guessing, not least as due to under-the-hood coercion can produce false positives making you think your code works when it doesn't where Boolean tests are being made.

Most link type filters in codes/operators are a single link type. If necessary you may need to re-visit your link types & use  - perhaps consolidating - to allow you to locate sets links by a single link type.  I'm not saying that's ideal but rather it's an achievable solution for today.
Back to top
 
« Last Edit: Sep 4th, 2008, 6:15pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #9 - Sep 4th, 2008, 5:51pm
 
No doubt. Thanks for the pointer - I'll check out that section.

The way I'm working at it now, there are no attempted wildcard searches.

The Tbref that Mark A. referred me to on the #linkedTo syntax does seem to indicate that w*ldcards are ok in queries using #linkedTo and From.


Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #10 - Sep 4th, 2008, 6:24pm
 
I've corrected my earlier post as #linkedto/#linkedFrom are two exceptions to the general rule that TB does not use a '*' wildcard ( I should remember what I wrote!). Expressions & regexp allow the use of a wildcard via regexp syntax so with careful naming you might be able to use a regexp to match a sub-set of named link types.

IIRC Prototypes are found by these queries.  Not sure why your *-based scope of search wasn't working earlier.
Back to top
 
« Last Edit: Sep 5th, 2008, 2:51am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #11 - Sep 5th, 2008, 12:23am
 
What are IIRC prototpes? What's an 8-based scope of search?

Thanks!
Back to top
 
 
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #12 - Sep 5th, 2008, 3:09am
 
IIRC is an abbreviation for 'if I recall correctly'; sorry I was up late late and on a deadline so trying to be brief. '8' was a typo for '*' - I've corrected the original post.

I'm not 100% sure but certainly quick tests last night indicated 'Prototype'-labelled links are found when using #linkedTo/#linkedFrom. This may be an issue when querying link types as depending on what you're doing, queries including links from a prototype to notes using that prototype may not be appropriate.  If I recall not all functions treat prototype links the same but the fact isn't documented in any detail - this was the point I was making last night

Re asterisks, I was referring to the use of the asterisk (*) character as a placeholder for any character, i.e. as a wildcard. As already stated, the usage of an asterisk for any code's  required parameters is not generally expected so that is why their use in these particular queries is unusual. For more detail on that you'd need to ask Eastgate directly.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Rafter T. Sass
Full Member
*
Offline



Posts: 100
Burlington, VT
Re: Using #linkedTo & #linkedFrom
Reply #13 - Sep 6th, 2008, 12:36am
 
OK, I've continued tinkering for a while now. I'm learning a lot!

And making progress...

But right now I can't figure out from the available reference material if I'm using terms correctly or not, or if it's something else that's stopping me. So it seems like a good time to post.

Here's the idea:
(1) Sequential Tasks are connected, in their required order of doing, by links of a type called "antecedent".
(I.e. each task has a link that points to the task that comes after it, if there is one.)
(2) Through rules, task-notes will know if there is an undone task "upstream" from them. I'm calling an undone upstream task an "open precedent."
(3) Tasks-notes automatically set their Action attribute to false when they have an open precedent, so they won't get swept up by Context agents. Thus, the GTD maxim to focus only on the very next action is achieved. Or at least supported...

Here is the chunk of rules that I'm using, with **annotations**.
Code:
PrecedentValues= links.inbound.antecedent.Action;
**This populates a set attribute with the Action status of any preceding tasks**
if(PrecedentValues(true)){OpenPrecedent=true};
**This is meant to translate the set to a Boolean attribute - it doesn't seem to work.**
PrePrecedentValues=links.inbound.antecedent.OpenPrecedent;
If(PrePrecedentValues(true)){OpenPrecedent=true};
**These two lines are meant to ensure that the existence of an OpenPrecedent in the task sequence cascades downstream.**
if((PrePrecedentValues!(true)&PrecedentValues!(true))){OpenPrecedent=false};
**This last line is meant to reset OpenPrecedent to false when upstream tasks are completed.**
MyPrecedents= links.inbound.antecedent.Name;
**And this rule, which works great, fills a set attribute with the names of the immediate upstream tasks.** 



Here is a copy of the little tester TBX I've been tinkering on:
Sequence]Working.tbx (39.14 KB)

If anyone is able to help, I'll be eternally grateful.

I think this sequential task stuff is important for the TBX/GTD community, as well.

Thanks!


Back to top
 
« Last Edit: Sep 6th, 2008, 8:26am by Rafter T. Sass »  
raughter   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Using #linkedTo & #linkedFrom
Reply #14 - Sep 6th, 2008, 8:07am
 
Thanks for the TBX, that helps. I like your use of DisplayExpression. OK:

I think I found one code error and I needed to add one thing:

Code:
PrecedentValues= links.inbound.antecedent.Action;
if(PrecedentValues(true)){OpenPrecedent=true};
PrePrecedentValues=links.inbound.antecedent.OpenPrecedent;
if(PrePrecedentValues(true)){OpenPrecedent=true};
if((PrePrecedentValues(true))|(PrecedentValues(true))){OpenPrecedent=true}else{OpenPrecedent=false};
if(OpenPrecedent=true){Action=false};
MyPrecedents= links.inbound.antecedent.Name; 



The problem was the clause testing for 'true' precedents.  It had unequal balance of opening/closing () for the if part. Also the test was an and '&' when it should be an or '|' as a 'true' in either attribute should trigger and action here. To make thinks clearer I reversed the not (!) tests and explicitly set OpenPrecedent for both true/false branches. You could simply leave the true branch as empty {} if you want.

To try the fix, take your example TBX an in 'Task Prototype' and open the rename dialog. Replace the Rule code with the code above (removing the line breaks after each code line).

I've not attempted to change to improve the code or simplify it so as not to introduce ambiguity. I figured it better to get it working before trying improvements - if any (I've not looked at that aspect).

I'm not GTd-er but I think the now does what you want.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1 2 
Send Topic Print