code: protected void addLeftOrRightDominance(List<String> conditions, QueryNode node,
      QueryNode target, QueryData queryData, RankTableJoin join,
      String aggregationFunction, String tokenBoarder)
    {
      RankTableJoin rankTableJoin = (RankTableJoin) join;
      String componentName = rankTableJoin.getName();
      
      // the parent and rank_id are already unique, so don't add extra join on component_id
      addComponentPredicates(conditions, node, target, componentName, "d", false);
  
      conditions.add(join("=", tables(node).aliasedColumn(RANK_TABLE, "id"),
        tables(target).aliasedColumn(RANK_TABLE, "parent")));
  
      List<Long> corpusList = queryData.getCorpusList();
      
      
      String innerSelect = 
         "SELECT "
        + aggregationFunction
        + "(lrsub."
        + tokenBoarder
        + ") FROM ";
      
      innerSelect += SelectedFactsFromClauseGenerator.inheritedFactTables(corpusList, "")
        + " AS lrsub ";
  
      
      innerSelect +=
          "WHERE parent="
        + tables(node).aliasedColumn(RANK_TABLE, "id")
        + " AND component_id = " + tables(node).aliasedColumn(RANK_TABLE,
          "component_id")
        + " AND corpus_ref="
        + tables(target).aliasedColumn(NODE_TABLE, "corpus_ref")
        + " AND lrsub.toplevel_corpus IN("
        + (corpusList == null || corpusList.isEmpty() ? "NULL"
        : StringUtils.join(corpusList, ",")) + ")";
      
      conditions.add(in(
        tables(target).aliasedColumn(NODE_TABLE, tokenBoarder), innerSelect));
    }
docs: FIXME: why not in addSingleRelationConditions() ?