[tmql-wg] Result set requirements

Rani Pinchuk Rani.Pinchuk@spaceapplications.com
Thu, 26 Feb 2004 10:10:24 +0100


Hi Dmitry,

I am not sure about this attitude: in my opinion it is not that good to
mix two languages in such a way. It brings into a very un-readable
result. The almost "prove" to that is that you had to indent your
example very carefully so it will be readable. 
Other problem with mixing two languages is that you have to know the two
in order to use them. 

As I see it, the constructors controls the way the data is presented,
while the data itself is controlled by the query language. I would try
to separate those two (so separating the logic from the presentation). 
Arguments for such separation can be found in the Skin and the
Phrasebook design patterns
(http://jerry.cs.uiuc.edu/~plop/plop2k/proceedings/proceedings.html)

Rani


On Thu, 2004-02-26 at 03:06, Dmitry wrote:
> From: "Lars Marius Garshol"
> > |
> > | I personally prefer explicit XQuery-like constructors.
> > |
> > | We can have constructors for XML, lists and Topic Maps as default set.
> > |
> > | And we can allow to provide additional set of constructors (wiki
> > | pages, for example)
> > |
> > | Constructors, I think, can be mixed with any "select" query language.
> >
> > That's an interesting idea, I think. Personally, I'm not clear on what
> > I prefer, but it would be interesting to see the constructor approach
> > and compare it with what AsTMa? does.
> >
> > I have to admit I hadn't thought of this myself, but it does seem that
> > you can do TM -> TM transformations even with something as un-tm-ish
> > (to use Robert's terminology :) as tolog. I already had an idea for TM
> > constructors for tolog, but didn't think of them being used in this
> > way.
> 
> I am thinking about something like this (I just rewrote my TMPath
> implementation using Tolog for "select" queries):
> 
> 54.1
> 
> Select only journal papers and deliver them together with the relevant
> author associations as
> topic map (fragments [xtmfragments]). There is no need to include the author
> topics as well.
> Replace all occurrences of type publication-date with associations of type
> was-published-in.
> For the date-role the topic players should use ids of the form x-dates-yyyy.
> 
> 
> declare default subjectIndicator
> namespace="http://psi........com/defaultpsi/#"
> 
> topicMap{
>         for $JournalPaper in instanceOf($JournalPaper,journal-paper)
>         for $IsAuthor in
> association($IsAuthor,is-author_of),role($IsAuthor,opus,$journalPaper)
>         return(
> 
> topic($JournalPaper,$NewTopic){                              ## we construct
> new topic based on existing one and $newTopic binds to it
>                             retract publication-date($Self,_)
> ## delete some assertions from $newTopic
>                   }
> 
> 
> association($IsAuthor,_){                                           ##copy
> and modify association, association constructor takes care of referencing
> "hidden" topics
>                          replace role opus{$NewTopic}
>                   }
>                   association
> was-published-in{                                    ## create new
> association
>                          role opus {$NewTopic}
>                          role date-role {
>                                    topic{
>                                          id{
>                                                  select $PubDate from
> publication-date($JournalPaper,$PubDate)
>                                                  select $NewValue from
> concat("x-dates-",$PubDate,$NewValue)
>                                                  return $NewValue
>                                          }
>                                     }
>                           }
>                   }
>         )
> }
> 
> 
> Dmitry
> 
> 
> 
> _______________________________________________
> tmql-wg mailing list
> tmql-wg@isotopicmaps.org
> http://www.isotopicmaps.org/mailman/listinfo/tmql-wg
-- 
Rani Pinchuk                                      tel: +32 3 326 79 97
                                                  fax: +32 2 612 43 08
                                                         rani@cpan.org
                                             http://pinchuk.homeip.net