def check_hierarchy(rdf, break_cycles, keep_related, mark_top_concepts,
                    eliminate_redundancy):
    """Check for, and optionally fix, problems in the skos:broader hierarchy
    using a recursive depth first search algorithm.

    :param Graph rdf: An rdflib.graph.Graph object.
    :param bool fix_cycles: Break cycles.
    :param bool fix_disjoint_relations: Remoe skos:related overlapping with
        skos:broaderTransitive.
    :param bool fix_redundancy: Remove skos:broader between two concepts otherwise
        connected by skos:broaderTransitive.
    """
    starttime = time.time()

    if check.hierarchy_cycles(rdf, break_cycles):
        logging.info(
            "Some concepts not reached in initial cycle detection. "
            "Re-checking for loose concepts.")
        setup_top_concepts(rdf, mark_top_concepts)

    check.disjoint_relations(rdf, not keep_related)
    check.hierarchical_redundancy(rdf, eliminate_redundancy)

    endtime = time.time()
    logging.debug("check_hierarchy took %f seconds", (endtime - starttime))
Check for, and optionally fix, problems in the skos:broader hierarchy
    using a recursive depth first search algorithm.

    :param Graph rdf: An rdflib.graph.Graph object.
    :param bool fix_cycles: Break cycles.
    :param bool fix_disjoint_relations: Remoe skos:related overlapping with
        skos:broaderTransitive.
    :param bool fix_redundancy: Remove skos:broader between two concepts otherwise
        connected by skos:broaderTransitive.