Interface HierarchySubset

All Superinterfaces:
CqnHierarchy, CqnHierarchySubset, CqnSource, CqnTableFunction, CqnToken, JSONizable, Source<StructuredType<?>>, TableFunction

@Beta public interface HierarchySubset extends CqnHierarchySubset, TableFunction
A function to compute the subset of a source hierarchy, which contains all nodes relative (ancestors or descendants) to a set of start nodes. The function adds the element hierarchy_distance : Int32 to the result, which indicates the distance of the retained node from the start node. Nodes can occur multiple times in the result if they are reachable from multiple start nodes.
  • Method Details

    • copy

      HierarchySubset copy(Source<?> source)
      Creates a copy of this hierarchy subset function with the given source.
      Specified by:
      copy in interface TableFunction
      Parameters:
      source - the hierarchy source
      Returns:
      new hierarchy subset function with given source
    • startWhere

      HierarchySubset startWhere(CqnPredicate startWhere)
      Specifies a filter condition that identifies the start nodes of this hierarchy subset function.
      Parameters:
      startWhere - the filter condition that specifies the start nodes
      Returns:
      this hierarchy subset function
    • distance

      HierarchySubset distance(int from, int to)
      Specifies a minimum and a maximum HIERARCHY_DISTANCE
      Parameters:
      from - the minimum distance
      to - the maximum distance
      Returns:
      this hierarchy subset function
    • from

      HierarchySubset from(int from)
      Specifies a minimum HIERARCHY_DISTANCE
      Parameters:
      from - the minimum distance
      Returns:
      this hierarchy subset function
    • to

      HierarchySubset to(int to)
      Specifies a maximum HIERARCHY_DISTANCE
      Parameters:
      to - the maximum distance
      Returns:
      this hierarchy subset function
    • distance

      HierarchySubset distance(int distanceFromStart, boolean keepStart)
      Specifies a maximum absolute HIERARCHY_DISTANCE
      Parameters:
      distanceFromStart - the maximum absolute HIERARCHY_DISTANCE
      keepStart - whether the start nodes should be included
      Returns:
      this hierarchy subset function