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
Multi step query (Read 1478 times)
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Multi step query
Jan 15th, 2016, 11:46am
 
Back again with a query I can imagine, but not code properly.

I have a file with the following data structure:

/Citations/ : This container holds notes with the following relevant attributes: $CiteKey(string) and $Research_Article(boolean). It contains only one note per $CiteKey. E.g., 1 note for Smith 1985, 1 note for Jones 2005, 1 note for Frank 2001

/Coding/ : This container holds notes with the following relevant attributes: $CiteKey(string) and $Text. It contains many notes per $CiteKey (which are the same cite keys as above). E.g. 5 notes for Smith 1985, 20 notes for Jones 2005, 15 for Frank 2001.

I want to find all notes for a given citation for which $Research_Article is true.

$CiteKey=="Smith1985" & $Research_Article==true  however, only returns the single note from the "Citations" container, not the notes from the "Coding" container. I want all those as well. Is it possible to construct a query to get this? Even better, could I do it in the Attribute Browser?
Back to top
 
« Last Edit: Jan 15th, 2016, 11:46am by Derek Van Ittersum »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Multi step query
Reply #1 - Jan 15th, 2016, 11:59am
 
It sounds like the notes in /Citations/ have $Reasearch_Article set to true and those in the other container set to false. that would give the results you describe. If you flip the last term, i.e.

$CiteKey=="Smith1985" & $Research_Article==false

What do you get?

~~~~~~~~~
Likely you can use attribute browser, thuogh the setting are mott until we figure your attribute values correctly.
Back to top
 
« Last Edit: Jan 15th, 2016, 12:00pm by Mark Anderson »  

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



Posts: 168

Re: Multi step query
Reply #2 - Jan 15th, 2016, 12:15pm
 
Mark, you're right. Since I didn't have $Research_Article set as a KeyAttribute, I hadn't really considered the notes in /Coding/ as having that attribute at all, but you're right, they have it set to false.

The reason for this is that the different containers were created via different spreadsheets with different columns of data (except for $CiteKey, which was the connecting point between them).

Is there some way to efficiently flip the $Research_Article to "true" for all notes that have at least one note for which it is true? I wouldn't want to create an agent for each $CiteKey to do this ...
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Multi step query
Reply #3 - Jan 15th, 2016, 1:32pm
 
Surely you want to set $Research_Article to true for every note in the /Coding/ container (or at least those that have a value for $CiteKey).

Solution #1.  Use a stamp. Good if experimentation along the want mean setting/inheritance can't be relied on. Make a stamp of $Research_Article=true and apply as equired.

Solution #2. Make a query for inside("Coding")& $CiteKey with an action of $Research_Article=true.
Back to top
 
 

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



Posts: 168

Re: Multi step query
Reply #4 - Jan 15th, 2016, 1:51pm
 
Unfortunately, it's more complicated than that Sad

I have many types of data in the /Citation/ container: research articles, book reviews, editor introductions, announcements, etc. Each of these has a CiteKey, but only one kind is a "research article." (I'm doing an analysis of 20 years of a journal, coding all of its contents.)

I am coding each kind of data in the /Coding/ container. So, there may be many notes here with CiteKeys that are *not* research articles.

I also have a similar dilemma with another attribute: "Word_Processor". This is a boolean that is "true" if the text uses that term and false if not. I will also be wanting to sort these by "research articles" as well using the same method.

If manual is the only way to go, it will be painful but possible.  I wonder if there's some way to generate a list the relevant CiteKeys via this:

inside("Citations") & $Research_Article==true

Then use that to maybe create a set that then could be used to flip all the relevant notes from /Coding/ to $Research_Article=true?
Back to top
 
« Last Edit: Jan 15th, 2016, 1:51pm by Derek Van Ittersum »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Multi step query
Reply #5 - Jan 15th, 2016, 3:04pm
 
It's not but it has to be manual, but 'full disclosure'  Wink of the data layout helps.

I'm not 100% sure just flipping the default for $Research_Article isn't just punting a problem down the road. Some errors are best accepted and fixed manually (speaking from humiliating experience); next time, thuogh... .

However, I'm still not 100% clear. You've a container "Coding" where some items are citations-related and there are *no* featires apart from the human eye to tell them apart. It may be so, but clearly the lesson here is that if something has a special staus, it's worth marking - be it a boolean, a tag (list) value or whaever.

My hunch is there will be some query that even if it does find only the research cites at least weeds out lots of notes you won't have to manually review. Without seeing the data, it's hard to say  - my all means drop me a copy at mwra at mac dot com which I'll treat in confidence.
Back to top
 
 

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