[sc34wg3] TMQL: Navigation step and the optional anchor

Lars Heuer heuer at semagia.com
Thu Dec 4 08:20:45 EST 2008


Hi all,

I think I've brought this already up but I cannot find the reference
yet: All navigation steps accept an optional anchor, but the optional
anchor isn't considered for all navigation steps.

Example:
The following expression returns all types of a duck:

    //duck >> types

According to the grammar and the text it is also possible and valid to
use this expression

    //duck >> types hello-world
        
since "hello-world" is ignored. Strangely enough a TMQL parser must
accept that expression.

Here a table that shows if the optional anchor is actually considered
in an expression or not:

===============     ===============================================
Name                Anchor considered
===============     ===============================================
types               No
instances           No
supertypes          No
subtypes            No
players             Yes, anchor used as filter for role types
                    assoc >> players anchor
                    topic << players anchor
roles               No
traverse            Yes, anchor used as filter for assoc types
                    topic >> traverse anchor
                    Result is always empty for backward direction!
characteristics     Yes, anchor used as type filter
                    topic >> characteristics anchor
                    name/occ << characteristics anchor
scope               No
locators            No
indicators          No
items               No
reifier             No
atomify             No


Only three axes from 14 use the optional anchor at all! I find it
strange that all axes must accept an optional anchor even if the
common case is that the anchor is not evaluated. From my point of view
it would be much better if the few (3) axes accept the anchor and the
other (11) axes do not accept an anchor at all.

Best regards,
Lars
-- 
Semagia 
<http://www.semagia.com>



More information about the sc34wg3 mailing list