User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:03_query:04_context

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
01_user_documentation:07_rgg_xl:02_xl:03_query:04_context [2025/09/04 10:17] gaetan01_user_documentation:07_rgg_xl:02_xl:03_query:04_context [2025/09/04 10:26] (current) gaetan
Line 7: Line 7:
 ===== Example ===== ===== Example =====
  
-For the following graph: +<code java> 
 +module A; 
 +module B; 
 +module C; 
 +module D; 
 +protected void init () 
 +
 + Axiom ==> A [>D] B C; 
 +
 +public void ruleWithContext () 
 +
 +   (*A [> D]*) B ==> C; 
 +
 + 
 +public void ruleNoContext () 
 +
 +   A [> D] B ==> C; 
 +
 +</code> 
 + 
 +produce the following graph: 
  
 {{:01_user_documentation:07_rgg_xl:02_xl:03_query:context_g1.png?200|}} {{:01_user_documentation:07_rgg_xl:02_xl:03_query:context_g1.png?200|}}
 +
 +
 +The two rules declared above use the same query. Thus will match the same nodes. The first one (with context) will not replace the bounded ''A > D'', while the second rule will.
 +
 +The first rule (''ruleWithContext'') produce the following graph (notice that only the ''B'' node has been replaced by a ''C''):
 +
 +{{:01_user_documentation:07_rgg_xl:02_xl:03_query:context_g2.png?200|}}
 +
 +The ''ruleNoContext'' rule produce the following graph (the whole matched sub-graph is replaced):
 +
 +{{:01_user_documentation:07_rgg_xl:02_xl:03_query:context_g3.png?100|}}
01_user_documentation/07_rgg_xl/02_xl/03_query/04_context.1756973879.txt.gz · Last modified: 2025/09/04 10:17 by gaetan