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

    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

          hubert.heijkers Hubert Heijkers (Inactive) created issue -
          ralfhandl Ralf Handl made changes -
          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]
          ralfhandl Ralf Handl made changes -
          Fix Version/s V4.0_WD01 [ 10247 ]
          ralfhandl Ralf Handl made changes -
          Status New [ 10000 ] Open [ 1 ]
          mikep Michael Pizzo (Inactive) made changes -
          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)
          sdrees Stefan Drees (Inactive) made changes -
          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)
          ralfhandl Ralf Handl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          ralfhandl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ]
          ralfhandl Ralf Handl made changes -
          Component/s OData ABNF Construction Rules [ 10269 ]
          Component/s OData URL Conventions [ 10270 ]
          Component/s OData CSDL [ 10268 ]
          Environment [Proposed] [Applied]
          sdrees Stefan Drees (Inactive) made changes -
          Status Resolved [ 5 ] Applied [ 10002 ]
          sdrees Stefan Drees (Inactive) made changes -
          handl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: