Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-239

Allowing expressions to be passed as parameters to (super) functions

    XMLWordPrintable

    Details

    • 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:
      Hide

      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)

      Show
      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:
      Show
      Accepted: https://www.oasis-open.org/committees/download.php/49055/odata-meeting-35_on-20130502-minutes.html#odata-239

      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 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.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              hubert.heijkers Hubert Heijkers (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: