-
Type:
New Feature
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_WD01
-
Fix Version/s: V4.0_WD01
-
Component/s: ABNF, URL Conventions
-
Labels:None
-
Environment:
[Applied]
-
Proposal:
-
Resolution:
To be able to use/extend the set of functions that can be used in a $apply query option functions need parameters of type expression, which expression can then be applied to each and every instance in the set they are processing.
An very simple example of such a function would:
$apply=GroupBy()/TopN(N=5, Value=Revenue)
Where 5 is just a number indicating the top N we are interested in but were 'Revenue' is actually an expression referring to the Revenue property of the entity in the set the function is acting upon. A better example in which this becomes more apparent would be:
$apply=GroupBy()/TopN(N=5, Value=Revenue sub Cost)
For build in functions we can obviously simply define this but currently there is no way of defining a 'custom' function that could implement the same behavior because we can't pass in expressions.
We then could annotate these functions to signal to tools that they can be used in $apply.
Field | Original Value | New Value |
---|---|---|
Proposal |
Relax ABNF from functionExprParameter = functionParameterName EQ ( parameterValue / firstMemberExpr ) to functionExprParameter = functionParameterName EQ ( parameterValue / commonExpr ) |
|
Description |
To be able to use/extend the set of functions that can be used in a $apply query option functions need parameters of type (lambda) expression, which expression can then be applied to each and every instance in the set they are processing. An very simple example of such a function would: $apply=GroupBy()/TopN( 5, Revenue ) Where 5 is just a number indicating the top N we are interested in but were 'Revenue' is actually an expression refering to the Revenue property of the entity in the set the function is acting upon. A better example in which this becomes more apparent would be: $apply=GroupBy()/TopN( 5, Revenue - Cost ) For build in functions we can obviously simply define this but currently there is no way of defining a 'custom' function that could implement the same behavior because we can't pass in expressions. |
To be able to use/extend the set of functions that can be used in a $apply query option functions need parameters of type expression, which expression can then be applied to each and every instance in the set they are processing. An very simple example of such a function would: $apply=GroupBy()/TopN(N=5, Value=Revenue) Where 5 is just a number indicating the top N we are interested in but were 'Revenue' is actually an expression referring to the Revenue property of the entity in the set the function is acting upon. A better example in which this becomes more apparent would be: $apply=GroupBy()/TopN(N=5, Value=Revenue sub Cost) For build in functions we can obviously simply define this but currently there is no way of defining a 'custom' function that could implement the same behavior because we can't pass in expressions. We then could annotate these functions to signal to tools that they can be used in $apply. |
Environment | [Proposed] |
Fix Version/s | V4.0_WD01 [ 10247 ] |
Status | New [ 10000 ] | Open [ 1 ] |
Proposal |
Relax ABNF from functionExprParameter = functionParameterName EQ ( parameterValue / firstMemberExpr ) to functionExprParameter = functionParameterName EQ ( parameterValue / commonExpr ) |
Relax ABNF from functionExprParameter = functionParameterName EQ ( parameterValue / firstMemberExpr ) to functionExprParameter = functionParameterName EQ ( parameterValue / commonExpr Note: this passes in the result of the expression to the function (not the expression) |
Proposal |
Relax ABNF from functionExprParameter = functionParameterName EQ ( parameterValue / firstMemberExpr ) to functionExprParameter = functionParameterName EQ ( parameterValue / commonExpr Note: this passes in the result of the expression to the function (not the expression) |
Relax ABNF from functionExprParameter = functionParameterName EQ ( parameterValue / firstMemberExpr ) to functionExprParameter = functionParameterName EQ ( parameterValue / commonExpr ) Note: this passes in the result of the expression to the function (not the expression) |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Assignee | Ralf Handl [ ralfhandl ] |
Component/s | OData ABNF Construction Rules [ 10269 ] | |
Component/s | OData URL Conventions [ 10270 ] | |
Component/s | OData CSDL [ 10268 ] | |
Environment | [Proposed] | [Applied] |
Status | Resolved [ 5 ] | Applied [ 10002 ] |
Resolution |
Accepted: https://www.oasis-open.org/committees/download.php/49055/odata-meeting-35_on-20130502-minutes.html#odata-239 |
|
Status | Applied [ 10002 ] | Closed [ 6 ] |
Assignee | Ralf Handl [ ralfhandl ] | Ralf Handl [ handl ] |
I don't think this works; this says that I can pass any arbitrary expression, but doesn't say how that expression is interpreted. Does this mean I can pass any expression to any function, or do we need to have a way to define that a function takes an expression?
How would we differentiate between passing the value of the expression (as we do with firstMemberExpression today) and passing the expression itself? For example, how do I differentiate between passing the value for revenue versus the expression revenue?