logo       

Negation in the different TMQL candidates: msg#00069

Subject: Negation in the different TMQL candidates
Dear all,

I would like to ask how the different candidate TMQL languages deal
with negations similar to 5.2.2.04 in the use-cases.

Robert Barta wrote already about it:

>  If you have
>
>      in-location->container.id != 'case'
>
>   does this now mean that you select all assocs of type 'in-location'
>   which have a 'container' role and check whether all players of this
>   role are NOT 'case'? Is it a
>
>     "not some roles satisfy it"
>     "there is one which does not satisfy it"
>
>   How can I control the two cases? We have cases
>
>     "not one satisfies it"  (the same as "all do not satisfy it")
>     "at least one satisfies it"
>     "all satisfy it"

For explaining my question let's assume a very simple topic map
with two very simple associations:


      id:1 type:is-author              id:2 type:is-author
     ----------------------           ----------------------
       /                                /           
      /author                          /author      
     /                                /             
    /                                /              
steve-pepper                      holger-rath       

And another extra topic, bla, that doesn't play any role in any
association. 

Finally, in the selects I ignore the topics 'author' and 'is-author'. 

In toma, when we have the following select:

select $player where is-author->author = $player;

we get:

  $player
------------
steve-pepper
holger-rath

We can ask to see the association object ids:

select $player, %is-author where is-author->author = $player;

we get:

  $player   | %is-author
------------+------------
steve-pepper|     1
holger-rath |     2

Till here it is quite clear. The question is how the negation of the
above will work. In toma the following:

select $player, %is-author where is-author->author != $player;

Could give:

  $player   | %is-author
------------+------------
bla         |     1
bla         |     2

Because the topic 'bla' indeed doesn't play the author role in an
association of type is-author. But actually the more correct result
is: 


  $player   | %is-author
------------+------------
steve-pepper|     2
holger-rath |     1
bla         |     1
bla         |     2

Because the topic 'steve-pepper' doesn't play the role author in the
association object 2, and the topic 'holger-rath' doesn't play the
role author in the association object 1. And in toma the expression
is-author->author represents the topics that play the role author in
the associations of type is-author.

I have some vague ideas of how to solve this ambiguity in toma. One
way might be to write it as:

select $player, %is-author where $player not in is-author->author;

However, the first thing I did was to go and look at 5.2.2.04
solutions of the other candidate languages. But it is not totally
clear to me how the other languages avoid the problem from the
solutions to this use case. I know that in tolog for example, the
negation is like a filter - so it removes ALL the matches in the
association. But I wonder if/how it is possible to have the second
possibility in tolog.

I am not sure how TMPath and AsTMa? deal with this problem. 

So my question is if you can explain how the different languages deal
with the above two possibilities. 

Thanks,

Rani



-- 
Rani Pinchuk
Software Engineer
Space Applications Services
Leuvensesteenweg, 325
B-1932 Zaventem
Belgium

Tel.: + 32 2 721 54 84
Fax.: + 32 2 721 54 44

http://www.spaceapplications.com 


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
web.pylons.gene...    hurd.l4/2002-10...    kernel.commits....    user-groups.lin...    yellowdog.gener...    java.drools.use...    security.openva...    package-managem...    linux.debian.us...    qnx.openqnx.dev...    genealogy.gramp...    file-systems.if...    voip.wengophone...    tex.context/200...    ietf.smime/2003...    audio.csound.de...    culture.region....    xfree86.devel/2...    mobile.kannel.u...    distributed.con...    education.engli...    org.user-groups...    bug-tracking.gn...    recreation.bicy...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe