# [tmql-wg] Comments against TMQL draft 2006-02-22

Robert Barta rho at bigpond.net.au
Fri Mar 9 03:25:06 EST 2007

On Fri, Mar 09, 2007 at 01:21:01AM +0100, Lars Marius Garshol wrote:
> >TMQL does not use a 'default namespace', otherwise it would have said
> >so, but it does not. The reason why
> >
> >   jack / name
> >
> >should work is that 'name' is a _valid_ item reference of a topic in
> >every map(!) for the TMDM concept
> >
> >   http://psi.topicmaps.org/iso13250/glossary/topic-name
>
> We haven't spelled that out anywhere, have we?

No, we discussed it in Leipzig that it should, though.

> >I think you are right, but I cannot find a place where
> >
> >   http://psi.topicmaps.org/iso13250/model/
> >
> >is defined as namespace. Could be just me being tired.
>
> This is for the TMDM -> TMRM mapping to do. But I had to put off
> writing that until after the Oslo meeting. :-(

Having it in the mapping is certainly good enough for the short
term. Maybe in TMDM 2.0 (when we all are much wiser) we can it put in
directly.

> >Definitely. In fact, I would love to see this whole axes business move
> >into TMDM at some point. It has nothing to do with TMQL, not?
>
> I'm surprised by this. Why isn't navigation along axes a QL thing?

Because it is a model thing? The navigation section is the _only_
thing in TMQL which touches TMDM. The rest is vanilla query
mechanics. This is an indicator for me, that that part might go
elsewhere later.

The only thing which would have to remain in TMQL is the syntax. But
as people use to say "it's just fu**ing syntax" :-)

> >In almost all languages there is a huge difference between & and &&
> >and | and ||. So also in TMQL:
> >
> >  & symmetric, non-short circuit AND
> >  && does not exist in TMQL
> >  | symmetric, non-short circuit OR
> >  || asymetric, short-circuit OR (can be defined via if-then-else)
> >
> >This is the same in Java, which got it from C++ which got it from
> >C.....
> >
> >I would not advise to switch & to short-circuit because this can
> >dramatically undermine automatic optimization.
>
> I really don't know what "short-circuit" means in a query language.
> It would be helpful if you explained how you interpret this.

"Short-circuit" && in C, for example, means that if the first operand
evaluates to false, the other is not evaluated at all. In C (a state
oriented language) this makes a difference, in functional language
which do not have any side-effects, there is no difference between &
and &&.

In TMQL, the operator || is *sort-of* 'short-circuit' in the sense
that only if the first operand is not empty, then the second operand
will be taken. This is only sensible because || is not over booleans
but _any_ value. Still, TMQL is functional.

\rho