def disjoint_relations(rdf, fix=False):
for conc1, conc2 in sorted(rdf.subject_objects(SKOS.related)):<EOL><INDENT>if conc2 in sorted(rdf.transitive_objects(conc1, SKOS.broader)):<EOL><INDENT>if fix:<EOL><INDENT>logging.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>conc1, conc2)<EOL>rdf.remove((conc1, SKOS.related, conc2))<EOL>rdf.remove((conc2, SKOS.related, conc1))<EOL><DEDENT>else:<EOL><INDENT>logging.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>conc1, conc2)<EOL><DEDENT><DEDENT><DEDENT>
Check if the graph contains concepts connected by both of the semantically
    disjoint semantic skos:related and skos:broaderTransitive (S27),
    and optionally remove the involved skos:related relations.

    :param Graph rdf: An rdflib.graph.Graph object.
    :param bool fix: Fix the problem by removing skos:related relations that
        overlap with skos:broaderTransitive.