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

A recursive hierarchy annotation may also contain a navigation property to the parent node

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS01
    • Fix Version/s: V4.0_CSD03
    • Component/s: Data Aggregation
    • Labels:
      None
    • Environment:

      [Applied]

    • Proposal:
      Hide

      Extend the RecursiveHierarchy term by a property ParentNavigationProperty of type Edm.NavigationPropertyPath. Added element surrounded by *:
      <Term Name="RecursiveHierarchy" Type="Aggregation.RecursiveHierarchyType" AppliesTo="EntityType ComplexType">
      <Annotation Term="Core.Description" String="Defines a recursive hierarchy." />
      </Term>

      <ComplexType Name="RecursiveHierarchyType">
      <Property Name="NodeProperty" Type="Edm.PropertyPath" Nullable="false">
      <Annotation Term="Core.Description" String="Property holding the hierarchy node value" />
      </Property>
      <Property Name="ParentNodeProperty" Type="Edm.PropertyPath" Nullable="false">
      <Annotation Term="Core.Description" String="Property holding the value of the parent node" />
      </Property>
      <Property Name="HierarchyLevelProperty" Type="Edm.PropertyPath" Nullable="true">
      <Annotation Term="Core.Description" String="Property holding the hierarchy level of the node" />
      </Property>
      *<Property Name="ParentNavigationProperty" Type="Edm.NavigationPropertyPath" Nullable="true">
      <Annotation Term="Core.Description" String="Property for navigating to the parent node" />
      </Property>*
      <Property Name="IsLeafProperty" Type="Edm.PropertyPath" Nullable="true">
      <Annotation Term="Core.RequiresType" String="Edm.Boolean" />
      <Annotation Term="Core.Description" String="Property indicating whether the node is a leaf of the hierarchy" />
      </Property>
      </ComplexType>

      Ammendments:
      -Remove the term property "ParentNodeProperty"
      -Make the ParentNavigationProperty required by changing the Nullable property to false.

      Applied: https://www.oasis-open.org/committees/document.php?document_id=56041&wg_abbrev=odata

      Show
      Extend the RecursiveHierarchy term by a property ParentNavigationProperty of type Edm.NavigationPropertyPath. Added element surrounded by *: <Term Name="RecursiveHierarchy" Type="Aggregation.RecursiveHierarchyType" AppliesTo="EntityType ComplexType"> <Annotation Term="Core.Description" String="Defines a recursive hierarchy." /> </Term> <ComplexType Name="RecursiveHierarchyType"> <Property Name="NodeProperty" Type="Edm.PropertyPath" Nullable="false"> <Annotation Term="Core.Description" String="Property holding the hierarchy node value" /> </Property> <Property Name="ParentNodeProperty" Type="Edm.PropertyPath" Nullable="false"> <Annotation Term="Core.Description" String="Property holding the value of the parent node" /> </Property> <Property Name="HierarchyLevelProperty" Type="Edm.PropertyPath" Nullable="true"> <Annotation Term="Core.Description" String="Property holding the hierarchy level of the node" /> </Property> *<Property Name="ParentNavigationProperty" Type="Edm.NavigationPropertyPath" Nullable="true"> <Annotation Term="Core.Description" String="Property for navigating to the parent node" /> </Property>* <Property Name="IsLeafProperty" Type="Edm.PropertyPath" Nullable="true"> <Annotation Term="Core.RequiresType" String="Edm.Boolean" /> <Annotation Term="Core.Description" String="Property indicating whether the node is a leaf of the hierarchy" /> </Property> </ComplexType> Ammendments: -Remove the term property "ParentNodeProperty" -Make the ParentNavigationProperty required by changing the Nullable property to false. Applied: https://www.oasis-open.org/committees/document.php?document_id=56041&wg_abbrev=odata

      Description

      Consider a client processing entities according to their hierarchical structure imposed by the given hierarchy annotation. If the client wants to filter this entity set on some other property not related to the hierarchy, s/he wants to get all tree segments from the matching entities upwards to the root node. If the recursive hierarchy would also include a "parent" navigation property, this could be accomplished with a single request:
      GET Set?$filter=dataProp eq someValue&$select=nodeId,parentNodeId&$expand=parent($levels='max')
      In order to let clients detect the availability of such navigations, the existing RecursiveHierarchy term needs to be extended.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: