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

Allow hierarchy filter functions for ancestors and descendants to return true for starting node

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: V4.0_CSD03
    • Fix Version/s: V4.0_CSD04
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      To stay downward compatible with the current spec, the parameter default value must be false.

      Extend the current definitions (additions are enclosed in *):

      <Function Name="isdescendant" IsBound="true">
      <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/>
      <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
      <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
      <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
      <Parameter Name="MaxDistance" Type="Edm.Int16"/>
      *
      <Parameter Name="IncludeParent" Type="Edm.Boolean">
      <Annotation Term="Core.OptionalParameter">
      <PropertyValue Property="DefaultValue" String="false"/>
      </Annotation>
      </Parameter>
      *
      <ReturnType Type="Edm.Boolean"/>
      </Function>

      <Function Name="isancestor" IsBound="true">
      <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/>
      <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
      <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
      <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
      <Parameter Name="MaxDistance" Type="Edm.Int16"/>
      <ReturnType Type="Edm.Boolean"/>
      *
      <Parameter Name="IncludeChild" Type="Edm.Boolean">
      <Annotation Term="Core.OptionalParameter">
      <PropertyValue Property="DefaultValue" String="false"/>
      </Annotation>
      </Parameter>
      *
      </Function>

      Note that term OptionalParameter has become available in the Core vocabulary with the work on OData version 4.01.

      add to proposal:

      • extend description by explanation of newly added parameter.
      Show
      To stay downward compatible with the current spec, the parameter default value must be false. Extend the current definitions (additions are enclosed in *): <Function Name="isdescendant" IsBound="true"> <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/> <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/> <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/> <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/> <Parameter Name="MaxDistance" Type="Edm.Int16"/> * <Parameter Name="IncludeParent" Type="Edm.Boolean"> <Annotation Term="Core.OptionalParameter"> <PropertyValue Property="DefaultValue" String="false"/> </Annotation> </Parameter> * <ReturnType Type="Edm.Boolean"/> </Function> <Function Name="isancestor" IsBound="true"> <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/> <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/> <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/> <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/> <Parameter Name="MaxDistance" Type="Edm.Int16"/> <ReturnType Type="Edm.Boolean"/> * <Parameter Name="IncludeChild" Type="Edm.Boolean"> <Annotation Term="Core.OptionalParameter"> <PropertyValue Property="DefaultValue" String="false"/> </Annotation> </Parameter> * </Function> Note that term OptionalParameter has become available in the Core vocabulary with the work on OData version 4.01. add to proposal: extend description by explanation of newly added parameter.
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/77

      Description

      The current definitions of the two hierarchy filter functions isancestor and isdescendant specify that the functions return true only if the current entity is a strict ancestor/descendant of the given start node.

      Practical applications sometimes require the start node to be included in the result. For this purpose, both functions could be extended by an optional Boolean parameter that allows the OData client to specify, if the start node shall be included in the result. With this, the filter expression $it/Aggregation.isdescendant(Hierarchy='SalesOrgHierarchy',Node='EMEA',IncludeParent=”true”) could avoid the clumsier $it/Aggregation.isdescendant(Hierarchy='SalesOrgHierarchy',Node='EMEA') or ID eq 'EMEA'

        Attachments

          Activity

          gerald.krause1 Gerald Krause created issue -
          gerald.krause1 Gerald Krause made changes -
          Field Original Value New Value
          Proposal To stay downward compatible with the current spec, the parameter default value must be false.

          Extend the current definitions (additions are enclosed in *):

          <Function Name="isdescendant" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
          *
            <Parameter Name="IncludeParent" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
            <ReturnType Type="Edm.Boolean"/>
          </Function>

          <Function Name="isancestor" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
            <ReturnType Type="Edm.Boolean"/>
          *
            <Parameter Name="IncludeChild" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
          </Function>
          To stay downward compatible with the current spec, the parameter default value must be false.

          Extend the current definitions (additions are enclosed in *):

          <Function Name="isdescendant" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
          *
            <Parameter Name="IncludeParent" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
            <ReturnType Type="Edm.Boolean"/>
          </Function>

          <Function Name="isancestor" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
            <ReturnType Type="Edm.Boolean"/>
          *
            <Parameter Name="IncludeChild" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
          </Function>

          Note that term OptionalParameter has become available in the Core vocabulary with the work on OData version 4.01.
          gerald.krause1 Gerald Krause made changes -
          Component/s Vocabularies [ 10324 ]
          gerald.krause1 Gerald Krause made changes -
          Proposal To stay downward compatible with the current spec, the parameter default value must be false.

          Extend the current definitions (additions are enclosed in *):

          <Function Name="isdescendant" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
          *
            <Parameter Name="IncludeParent" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
            <ReturnType Type="Edm.Boolean"/>
          </Function>

          <Function Name="isancestor" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
            <ReturnType Type="Edm.Boolean"/>
          *
            <Parameter Name="IncludeChild" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
          </Function>

          Note that term OptionalParameter has become available in the Core vocabulary with the work on OData version 4.01.
          To stay downward compatible with the current spec, the parameter default value must be false.

          Extend the current definitions (additions are enclosed in *):

          <Function Name="isdescendant" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is a descendant of the given parent node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
          *
            <Parameter Name="IncludeParent" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
            <ReturnType Type="Edm.Boolean"/>
          </Function>

          <Function Name="isancestor" IsBound="true">
            <Annotation Term="Core.Description" String="Returns true, if and only if the value of the node property of the specified hierarchy is an ancestor of the given child node with a distance of less than or equal to the optionally specified maximum distance"/>
            <Parameter Name="Entity" Type="Edm.EntityType" Nullable="false"/>
            <Parameter Name="Hierarchy" Type="Edm.String" Nullable="false"/>
            <Parameter Name="Node" Type="Edm.PrimitiveType" Nullable="false"/>
            <Parameter Name="MaxDistance" Type="Edm.Int16"/>
            <ReturnType Type="Edm.Boolean"/>
          *
            <Parameter Name="IncludeChild" Type="Edm.Boolean">
              <Annotation Term="Core.OptionalParameter">
                <PropertyValue Property="DefaultValue" String="false"/>
              </Annotation>
            </Parameter>
          *
          </Function>

          Note that term OptionalParameter has become available in the Core vocabulary with the work on OData version 4.01.

          add to proposal:
          - extend description by explanation of newly added parameter.
          handl Ralf Handl made changes -
          Status New [ 10000 ] Open [ 1 ]
          Hide
          handl Ralf Handl added a comment -

          Resolved 2018-02-22

          Show
          handl Ralf Handl added a comment - Resolved 2018-02-22
          handl Ralf Handl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          gerald.krause1 Gerald Krause made changes -
          Resolution https://github.com/oasis-tcs/odata-vocabularies/pull/77
          Environment Proposed Applied
          handl Ralf Handl made changes -
          Status Resolved [ 5 ] Applied [ 10002 ]
          heiko.theissen Heiko Theissen made changes -
          Status Applied [ 10002 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              gerald.krause1 Gerald Krause
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: