User Tools

Site Tools


15_cheatsheet:operators

Differences

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

Link to this comparison view

Next revision
Previous revision
15_cheatsheet:operators [2025/11/03 04:24] – created gaetan15_cheatsheet:operators [2026/04/21 14:28] (current) – [Selection Operators] Tim
Line 1: Line 1:
 ====== XL operators ====== ====== XL operators ======
  
-XL-Operators are designed to simplify the usage of XL queries and rewriting rules. Moreover these operators can improve the performance of a query due to there deep integration into the model. +XL-Operators are designed to simplify the usage of XL queries and rewriting rules. Moreover these operators can improve the performance of a query due to their deep integration into the model. 
-In the following the operators a separated into Analytical and selection operators to either get a value for analysis or a node/ a collection of nodes for rewriting.+In the followingthe operators a separated into analytical and selection operators to either get a value for analysis or a node/ a collection of nodes for rewriting.
  
 ====== Analytical Operators ====== ====== Analytical Operators ======
Line 16: Line 16:
 | forall((*//query//*)[//value//]//condition//) | checks if a condition is true for the all results of the query |forall((*f:F*)[length]==1) |   | forall((*//query//*)[//value//]//condition//) | checks if a condition is true for the all results of the query |forall((*f:F*)[length]==1) |  
 | exist((*//query//*)[//value//]//condition//) | checks if a condition is true for at least one result of the query |exist((*f:F*)[length]==1) | | exist((*//query//*)[//value//]//condition//) | checks if a condition is true for at least one result of the query |exist((*f:F*)[length]==1) |
 +|statistics((*//query//*)[//value//] |return an instance of the class [[https://javadoc.grogra.de/rgg/de/grogra/rgg/Statistics.html| Statistics]] |statistics((*F*)[length]) |
  
  
Line 24: Line 25:
 | first((*//query//*) ) | get the first element found with the query | first((*F*) ) | | first((*//query//*) ) | get the first element found with the query | first((*F*) ) |
 | last((*//query//*) ) | get the last element found with the query | last((*F*) ) | | last((*//query//*) ) | get the last element found with the query | last((*F*) ) |
-| slice((*//query//*),//s//,//e//) | return the subset(form s to e) of the result | slice((*F*),2,4), slice((*F*)[length],2,4)  |+| slice((*//query//*),//s//,//e//) | return the subset(from s to e) of the result | slice((*F*),2,4), slice((*F*)[length],2,4)  |
 |selectWhere((*//query//*),//condition//)| Select a node of the query that fits the condition | selectWhere((*f:F*),f[length]==1) | |selectWhere((*//query//*),//condition//)| Select a node of the query that fits the condition | selectWhere((*f:F*),f[length]==1) |
 |selectWhereMin((*//query//*),//parameter//)| Select a node of the query where the parameter is the smallest | selectWhereMin((*f:F*),f[length])  | |selectWhereMin((*//query//*),//parameter//)| Select a node of the query where the parameter is the smallest | selectWhereMin((*f:F*),f[length])  |
 |selectWhereMax((*//query//*),//parameter//)| Select a node of the query where the parameter is the largest | selectWhereMax((*f:F*),f[length]) | |selectWhereMax((*//query//*),//parameter//)| Select a node of the query where the parameter is the largest | selectWhereMax((*f:F*),f[length]) |
 |selectRandomly((*//query//*) )| select a Random node from the query | selectRandomly((*F*) ) | |selectRandomly((*//query//*) )| select a Random node from the query | selectRandomly((*F*) ) |
-|selectRandomly((*//query//*),prob)| ??? ???  |+|selectRandomly((*//query//*),prob)| select a Random node from the query using a given numeric value as weight selectRandomly((*f:F*),f[length])  more likely to pick longer Fs |
  
  
15_cheatsheet/operators.1762140275.txt.gz · Last modified: 2025/11/03 04:24 by gaetan