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
Send Topic Print
Agents to gather all words in a given attributes (Read 9593 times)
Amafortas
Full Member
*
Offline



Posts: 90

Agents to gather all words in a given attributes
Mar 27th, 2009, 4:24pm
 
Hello all,

I have a question about how to accomplish the following:

I've started to develop a Tinderbox to gather an organize my notes on various readings for a class in which I work as a teaching assistant. I've defined an attribute named "TextAuthor" and applied it to each reading.

Is it possible to create an agent that will cull through the notes and create a list of authors and to have the elements of that list include links back to the notes I've created?

I think it might help if I offer a more concrete explanation.

At the moment, I have three notes:

O'Neil _The Hairy Ape_
O'Neil _A Long Day's Journey into Night_
Mowatt _Fashion_

I'd like to see the following in the agent:
O'Neil
Mowatt.

And I'd like to be able to click on O'Neil and have the choice of following a link to either _The Hairy Ape_ or _A Long Day's Journey into Night_.

Thanks for all your help,

~A

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents to gather all words in a given attributes
Reply #1 - Mar 27th, 2009, 4:56pm
 
I think what you want is possible but you describe a UI metaphor that doesn't sound like TB, so I guess you're thinking in terms of some other app you looked at.

You describe a note title like "O'Neil _The Hairy Ape_" where I assume you're trying to combine 2 different pieces of information, like:



I've hardly scratched the surface of TB's features but we're already pulling out features.  This isn't Word! Rather than try to describe things within the constraints of past tools, put data in and then look for ways to link it, for instance by adding attribute. 'Books' don't have to be placed in a note whose title is their author.  They could be in a container called "Books" with an 'author' attribute. You could then, for instance sort by Author, DatePublished whatever.

Bottom line, stop worrying about what your last tool didn't let you do.
Back to top
 
« Last Edit: Jun 25th, 2009, 4:16am by Mark Anderson »  

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



Posts: 90

Re: Agents to gather all words in a given attributes
Reply #2 - Mar 27th, 2009, 5:52pm
 
Mark A,

I'm sorry if my question frustrated you. However, I need some additional guideance but before I get to my question, let me clarify a few things.

First, you are correct that the note titles include two pieces of information: the last name of the author and the title of the piece. I've done this not because I expect Tinderbox to be able to sort on the title but rather because I prefer to work in map view and need to jog my memory about who wrote what.

Because of how the class is structured, I'd prefer not to list works in a hierarchy under their authors but instead to be able to have an agent pull data from the TextAuthor attribute I've created. Instead, I'd like to have an agent sort through the notes, find the attribute titled TextAuthor and then create a list of all the unique entreis it finds there.

I've created a mock up of what I'm trying to describe and have a screen capture ready to go, but can't figure out how to include it in this post. If you'd please woalk me through the process, I think it might help to clarify what I'm trying to explain.

Thanks,

~A


Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents to gather all words in a given attributes
Reply #3 - Mar 27th, 2009, 7:06pm
 


OK, (quick sketch later) go flat in Map view. Use links and the many affordances of Maps. Previously, I assumed you'd be using Outline view as your descriptions thus far implied a hierarchical point of view. albeit only a few notes, but it tok seconds to turn my earlier sketch around. Either way these were made from the same TBX - though I did promote the books out of the authors to make the Map.

I think - and I don't mean this combatively - you're encountering a common problem most of us share of feeling we have to see (an approximation of) the final structure before we feel confident to more ahead. My early TB use certainly suffered from this. Now I both start piling in information and structuring as I go. Sure, some TB experience teaches you more things you might do at outset but it doesn't stop one 'just' getting started. IOW, eventually one runs out of excuses for not starting or getting stuck in analysis-paralysis.

In parallel with the above in my day job I'm constanly being asked to "just build an example so I can tell you if it's what I had in mind". Problem is, building that is most of the task's work and invariably the answer is "no - do it differently", so pretty much everything is thrown away; wasteful in time if not money. I can't say it often enough, TB's flexibility allows you to side-step that trap and structure as you go avoiding either plan-everything-before-starting-paralysis or only-know-it-works-when-finished-and-then-do-over syndromes.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agents to gather all words in a given attributes
Reply #4 - Mar 27th, 2009, 7:06pm
 
Consider using $DisplayExpression to control what you see in map view. For example, a DisplayExpresion of

    $Author+" : "+$BookTitle

would display "Brecht : Mother Courage".  But you'd also have separate author and title attributes, making things simpler elsewhere.  And you have some flexibility for modifying the displayed name if your needs change.

I don't see an easy way to do precisely what you suggested in the first post -- at least not without creating an agent for each author.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents to gather all words in a given attributes
Reply #5 - Mar 28th, 2009, 4:37am
 
If an aliases Display expression was intrinsic to the alias and not the original, the 'list' - i.e. note titles - shown in an agent could show different information. Thus if the agent found all books but the $DisplayExpression for the aliases generated was $AuthorName you'd get a list of authors; OK, not a list of unique values but a lit nonetheless. To my mind this also touches on the fact we've now operators to make sets but sets aren't easily visualised in primary views as the information is an attribute - actually I'm wrong, the new v4.5 Maps tools offer a way around this. So, you make a set for $AuthorName of every Book-type note, then use the new map visualisation tools to display that set's data in Map view. By making a set we avoid the duplicates we'd see if using an agent.
Back to top
 
 

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



Posts: 90

Re: Agents to gather all words in a given attributes
Reply #6 - Mar 28th, 2009, 10:45am
 
Mark A,

I understand the theory behind what you are suggesting about assembling a list, but I'm still having trouble understanding how to write the code. The Tinderbox cookbook looks like a valuable document but with my limited understanding of how the syntax for the commands works and not being to clear on where I should put the code I've written, I'm afraid it is currently a bit beyond me.

Here is what I'm trying to do: I'd like to create a set of all the author names. These names are included in some notes as the value for the attribute Author. I would like the search to run against all the notes in the Tinderbox. I would like the results to display on the top level of my map.

If it is not too much trouble, could you show me the code for accomplishing this and then parse each element of the code so I can understand how it works and the syntax it must observe?

Thanks,

~A
Back to top
 
 
  IP Logged
Johnnie Wilcox - mistersquid
Full Member
*
Offline



Posts: 84
San Francisco, CA
Re: Agents to gather all words in a given attributes
Reply #7 - Mar 28th, 2009, 11:37am
 
In your agent make this the query

($Author!="")

which tells an agent to find notes where: $Author is not (!=) empty ("")

If you have multiple items with the same value for $Author, they will all show up in this agent. There is no simple way for an agent to include one note as a representative for all notes that have the same attribute.

There has been an advanced discussion whose principles might be applied to your problem.

But I don't think you need to go that way. It would be easier as in Mark A's example, to create an author prototype and create author notes from that prototype. Then link each author note to a particular book. Your agent could then simply search for any note whose

($Prototype="Author")
Back to top
 
« Last Edit: Mar 28th, 2009, 11:38am by Johnnie Wilcox - mistersquid »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents to gather all words in a given attributes
Reply #8 - Mar 28th, 2009, 12:57pm
 
Another idea for layout visualisation, to help those trying to get started. I'm sticking with the author/book analogy though the principle is general.

OK, so authors write books and we might, in good old-fashioned hierarchical thinking make author containers and place each of their books within. Fine, but not so helpful in Map view as we can't see the books (except in the author container's viewport). We could make aliases of the books and put them on the map but aliases use an italicised typeface (so we know their aliases) which might look odd. We could swap around and put the books on the map alongside the authors and place book aliases in each author - we could even make the author an agent saving us the bother of finding the books.

As containers now all sorts of display options we can do neat things. For instance, the author container can list the names of it's children (i.e. the authors books). By sorting the container, e.g. $PublishedDate, the books would be listed in chronological order. Using $TableDisplay we can show more data about each item, perhaps $Name and $PublishedDate.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Paul Walters
Ex Member




Re: Agents to gather all words in a given attributes
Reply #9 - Mar 29th, 2009, 6:25am
 
To offer a thought in a related direction: for a similar problem (portraying the structure of fictional works) I've used links and sets and had Tinderbox create Text based on the relationships defined by links.  In other words, to put characters into scenes (this could be books and authors), I created a link named AppearsIn.  I had a map with adornment actions that made AppearsIn links between the character notes and the scene notes.  I defined a custom attribute named SceneSet, which was of type "set".  Finally, Characters had a prototype whose rule was:

$SceneSet = links(this).outbound.AppearsIn.Name; $Text=$Name+" appears in " +format($SceneSet," "," ",", ","");

The rule creates Text, such as this example:

Martin appears in Day Three, After Dawn, Red Horizon


When the container for this note is of sufficient size on the map, the above appears.  With a series of agents, I was able to see on the map the entire Book - Chapter - Scene - Character structure.    The code example is old and doesn't take advantage of new Tinderbox features e.g., the link-making agents.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Aside: Making sets with collect
Reply #10 - Mar 29th, 2009, 9:54am
 
I think this is now almost off-topic -- that the discussion of WHAT we want to collect, WHAT we build into the structure, and HOW it all should look is actually much deeper than the original query.

But, to answer the original query, there is a quick and easy way to collect all the authors as a set:

     Rule: $MySet=collect(all,$AuthorName)
Back to top
 
 
WWW   IP Logged
Amafortas
Full Member
*
Offline



Posts: 90

Re: Agents to gather all words in a given attributes
Reply #11 - Mar 29th, 2009, 2:38pm
 
Mark B.,

I've created an agent with the code you've given me in the rule field. However, no links or files are showing. Do I need a separate command to display the results of the rule?

If so, could you please point me to the correct page of the manual?

Thanks,

~A
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Agents to gather all words in a given attributes
Reply #12 - Mar 29th, 2009, 2:47pm
 
The code populates a set. You need to display the set in order to see that data.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Agents to gather all words in a given attributes
Reply #13 - Mar 29th, 2009, 2:53pm
 
For example, the agent's $DisplayExpression might display the set of author names:

    DisplayExpression: $Name+": "+format($MySet,", ")
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print