[tmql-wg] Result set requirements

Dmitry dmitryv@cogeco.ca
Wed, 25 Feb 2004 21:06:48 -0500


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