logo
Path Expressions < TMQL Introduction < < Home 

PrevUpNext

Path Expressions

The textual overhead of the SQLish style which we have used so far may not be convenient if queries are trivial. Especially for web applications where pages have to be filled with lots of content from a TM backend a much shorter notation is more adequate.

To return all albums from the map bound to %_ we can simply write

// album
If we need the english names only, then
// album / name [ @ en ]
will do just fine.

We can also, for instance, reformulate an earlier query which returned only the english names of Tom Waits albums:

// album [ . <- production [ * is-produced-by ] -> producer = tom-waits ] / name [ @ en ]
The processor will again start off with all albums and will subject each of them to a test provided by the filter condition in the first [] group. That will effectively test whether Tom Waits is one of the producers. This is accomplished by taking each album (the dot . symbolizes the current item), checking out all associations where this item is playing the role production, filtering these associations so that only those remain which are of type is-produced-by; when following the role producer from these associations we end up with a list of topics playing that role. This list will be compared with the list on the right side of the = symbol. While in our case there is only one, and it is a constant anyway, this comparison is trivial and returns true if one of the producers happens to be the same topic as that one with the identifier tom-waits.

Only these albums where the condition is satisfied will be postprocessed in that the english name is selected from them. Implicitly, the string values are taken.


PrevUpNext