User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:03_query:02_query_variable

Variables

Query variables are variables declared in a query. They are either explicitly (in a declaration) or implicitly declared. To be used manually, the variable need to be given an identifier. Indeed, all node pattern declare a query variable, used in the pattern matching, but only the one with an identifier are accessible manually.

The query variables are available in both the scope of the query where they are declared, and in the the scope of the statement this query belongs. In the case of rule statement, the variables are available in the production. In the case of an query expression, the variables are available in the rest of the statement.

Declaration

A query may start with the declaration of query variables in the usual syntax of the Java programming language. The sole purpose of this is to shorten the specification of a query with several variables of the same type.

→ Read more...

Identifier on implicit QV

It is possible to associate a query variable declared implicitly with an identifier. This, enables the manual usage of that query variable, like any other final variable in the scope. The most common approach is: n:Node, where n is the query variable.

→ Read more...

Folding

The pattern matching algorithm obeys several constraints. One constraint is the injectivity of matches with respect to nodes, i. e., no two query variables containing nodes may be bound to the same node of the graph. However, there are situations where this constraint it too restrictive. One solution is then to completely disable the requirement of injectivity, but a more fine-grained mechanism is given by folding clauses,

→ Read more...

01_user_documentation/07_rgg_xl/02_xl/03_query/02_query_variable.txt · Last modified: 2025/08/21 12:44 by gaetan