private ServiceHierarchy filterConjecturableRelations(Map<HierarchyRelatedService, ServiceRelations> serviceRelationsMap,
                                                          ServiceHierarchy hierarchy,
                                                          int maxDepth) {
        Set<HierarchyServiceRelation> relations = hierarchy.getRelations();
        List<HierarchyServiceRelation> relationList = new ArrayList<>(relations);
        for (HierarchyServiceRelation relation : relationList) {
            HierarchyRelatedService upperService = relation.getUpperService();
            HierarchyRelatedService lowerService = relation.getLowerService();
            ServiceRelations serviceRelations = serviceRelationsMap.get(upperService);
            // if only one lower service, keep the relation
            if (serviceRelations.lowerServices.size() > 1) {
                if (checkIfConjecturable(serviceRelationsMap, serviceRelations.lowerServices, lowerService, maxDepth)) {
                    // if the lower service is conjecturable, remove the relation
                    relations.remove(relation);
                }
            }
        }
        return hierarchy;
    }
@return return the related service hierarchy recursively, e.g. A-B-C, query A will return A-B, B-C
If the relation could be conjectured will be removed, e.g. A-B-C-D and A-D, query A will return A-B, B-C, C-D because A-D could be conjectured.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/HierarchyQueryService.java