[sc34wg3] TMQL: Predicate invocation and scope

Robert Barta rho at devc.at
Wed Jul 9 05:31:34 EDT 2008


On Tue, Jul 08, 2008 at 12:34:40PM +0200, Lars Marius Garshol wrote:
> What we have seen with tolog is that it would be great if the  
> association predicates could put the matching association into a  
> variable. With something like, say,
> 
>    $a = member-of(member: $p, group: $g)

With the current TMQL you can do

  select $a
  where
      $a == member-of(member: $p, group: $g)

> it would be easy to use the path language for working with
> reification and scope on the association. It would also be easy to
> get hold of the association for editing/deletion etc.

or also

   for $a in member-of(member: $p, group: $g)
   return
       $a

The 'member-of(member: $p, group: $g)' is just a special form of path
expression. Given that, you can also postfix it:

   ( member-of(member: $p, group: $g) ) <~~    # follow reification backwards

   ( member-of(member: $p, group: $g) ) [ @ scope ] # filter all of them by scope

\rho


More information about the sc34wg3 mailing list