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

A recursive hierarchy annotation may also contain a navigation property to the children nodes

    XMLWordPrintable

    Details

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

      Applied

    • Proposal:
      Hide

      Extend the RecursiveHierarchy term by a property ChildrenNavigationProperty }}of type {{Edm.NavigationPropertyPath. Added element with yellow background:

      <ComplexType Name="RecursiveHierarchyType">
        <Property Type="Edm.PropertyPath" Name="NodeProperty" Nullable="false">
          <Annotation Term="Core.Description" String="Property holding the hierarchy node value"/>
        </Property>
        <Property Type="Edm.NavigationPropertyPath" Name="ParentNavigationProperty" Nullable="false">
          <Annotation Term="Core.Description" String="Property for navigating to the parent node"/>
        </Property>
      
        <Property Type="Edm.NavigationPropertyPath" Name="ChildrenNavigationProperty" Nullable="true">
          <Annotation Term="Core.Description" String="Property for navigating to the children nodes"/>
        </Property>
      
        <Property Type="Edm.PropertyPath" Name="DistanceFromRootProperty" Nullable="true">
          <Annotation Term="Core.Description" String="Property holding the number of edges between the node and the root node"/>
        </Property>
        <Property Type="Edm.PropertyPath" Name="IsLeafProperty" 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>
      
      Show
      Extend the RecursiveHierarchy term by a property ChildrenNavigationProperty }}of type {{Edm.NavigationPropertyPath . Added element with yellow background: <ComplexType Name= "RecursiveHierarchyType" > <Property Type= "Edm.PropertyPath" Name= "NodeProperty" Nullable= "false" > <Annotation Term= "Core.Description" String= "Property holding the hierarchy node value" /> </Property> <Property Type= "Edm.NavigationPropertyPath" Name= "ParentNavigationProperty" Nullable= "false" > <Annotation Term= "Core.Description" String= "Property for navigating to the parent node" /> </Property> <Property Type= "Edm.NavigationPropertyPath" Name= "ChildrenNavigationProperty" Nullable= "true" > <Annotation Term= "Core.Description" String= "Property for navigating to the children nodes" /> </Property> <Property Type= "Edm.PropertyPath" Name= "DistanceFromRootProperty" Nullable= "true" > <Annotation Term= "Core.Description" String= "Property holding the number of edges between the node and the root node" /> </Property> <Property Type= "Edm.PropertyPath" Name= "IsLeafProperty" 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>
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/74

      Description

      Consider a client processing entities according to their hierarchical structure imposed by the given hierarchy annotation.

      If the client wants to retrieve the descendants for the next three levels, this could be accomplished with a single request that makes use of a (cyclic) navigation property pointing to the children of a node. Assuming this navigation property has name childrenNodes, and the corresponding navigation property annotated as ParentNavigationProperty has name parentNode, the request would be:

      GET set(nodeId)?$expand=childrenNodes($levels=3;$select=parentNode/nodeId,nodeId)

      In order to let clients detect the availability of such navigations, the existing RecursiveHierarchy term needs to be Extended as proposed.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: