User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:03_query:05_query_expression

This is an old revision of the document!


Query expression

A query can be used as an expression if it is enclosed in asterisked parentheses (* and *). Theses symbols are also used to declare context in a query but the concept is different. A query expression enables to execute the query in an imperative context (e.g. in a java block). Thus, the query can be used combined with other imperative statements (e.g. methods, aggregators, …). The query expression is a Node generator and can be used as such.

Query expressions finds all matches of the pattern and yields the currently bound value of the right-most non-bracketed node pattern.

The model graph of such expression is defined implicitly based on the first enclosing declaration which has an annotation of the type @UseModel. The annotation takes an argument to specify a concrete class to use as compile time model.

If we want to specify the current graph explicitly, it has to be prepended in front of the query as in

graph.(* ^ (>)* Node *)
01_user_documentation/07_rgg_xl/02_xl/03_query/05_query_expression.1756980088.txt.gz · Last modified: 2025/09/04 12:01 by gaetan