def skos_hierarchical(rdf, narrower=True):
    """Infer skos:broader/skos:narrower (S25) but only keep skos:narrower on request.

    :param bool narrower: If set to False, skos:narrower will not be added,
        but rather removed.
    """
    if narrower:
        for s, o in rdf.subject_objects(SKOS.broader):
            rdf.add((o, SKOS.narrower, s))
    for s, o in rdf.subject_objects(SKOS.narrower):
        rdf.add((o, SKOS.broader, s))
        if not narrower:
            rdf.remove((s, SKOS.narrower, o))