def lookup_relation(relation: str, triples: List[Triple]) -> Triple:
    """
    Look up a triple in a list of triples by the middle value.
    """
    for triple in triples:
        if triple[1] == relation:
            return triple
    return None

    Look up a triple in a list of triples by the middle value.
    
llama-index-integrations/graph_stores/llama-index-graph-stores-kuzu/llama_index/graph_stores/kuzu/utils.py