def index_wn_rdf_triples(wn_rdf_triples, concept_ids, bidirectional=True):
    """
    Retrieve related WordNet RDF triples by synset entity id.

    Args:
        wn_rdf_triples: list, contains tuples of WordNet RDF triple.
        concept_ids: list, contains synset concept id.
        bidirectional: True if select RDF triples by 2 concept. Otherwise select RDF triples by the first concept.

    Return:
        list, contains index of WordNet RDF triples.
    """

    results = []
    for e_id in concept_ids:
        for t_index, t in enumerate(wn_rdf_triples):
            if (
                    (bidirectional and (t[0] == e_id or t[1] == e_id)) or (not bidirectional and t[0] == e_id)
            ) and t_index not in results:
                results.append(t_index)
    return results