User Tools

Site Tools


01_user_documentation:groimp-platform:xl-builtin-methods

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
01_user_documentation:groimp-platform:xl-builtin-methods [2025/01/24 11:58] – ↷ Page moved from groimp-platform:xl-builtin-methods to 01_user_documentation:groimp-platform:xl-builtin-methods gaetan01_user_documentation:groimp-platform:xl-builtin-methods [2025/01/24 17:06] (current) – removed gaetan
Line 1: Line 1:
-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. 
-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. 
  
-====== Analytical Operators ====== 
- 
-| Command | description | example | 
-| min((*//query//*)[//value//]) | returns the smallest value | min((*F*)[length]) | 
-| max((*//query//*)[//value//]) | returns the largest value | max((*F*)[length]) | 
-| sum((*//query//*)[//value//]) | calculate the sum of the values | sum((*F*)[length]) | 
-| mean((*//query//*)[//value//]) | calculate the mean of the values | mean((*F*)[length]) | 
-| prod((*//query//*)[//value//]) | calculates the product of the values | prod((*F*)[length]) | 
-| count((*//query//*) )| returns the number of pattern matching the query | count((*F*) ) | 
-| empty((*//query//*) ) | returns true if no pattern matches the query | empty((*F*) ) | 
-| 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) | 
- 
- 
-For the operators min,max,sum,mean,prod it is possible to give "omitnan" as a second parameter to ignore NAN values. eg. ''sum((*F*)[length],"omitnan")''  
-====== Selection Operators ====== 
- 
-| command | description| example| 
-| first((*//query//*) ) | get the first element found with the query | first((*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)  | 
-|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])  | 
-|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//*),prob)| ??? | ???  | 
- 
- 
-====== Other ====== 
- 
-|command | description|example| 
-| array((*//query//*) ) | creates an java array of the items or values  | array((*F*) ), array((*F*)[length]) |  
-| string((*//query//*) ) | creates an comma separated string of the items or values  | string((*F*) ), string((*F*)[length]) |  
- 
- 
- 
-additional information can be found in the [[https://grogra.gitlab.io/groimp-javadoc/xl.core/de/grogra/xl/util/Operators.html|javadoc]] 
01_user_documentation/groimp-platform/xl-builtin-methods.1737716338.txt.gz · Last modified: 2025/01/24 11:58 by gaetan