def test_08_delete_relations(neo4j_store):
    """
    Test deleting relationships by relation names.
    """
    e1 = EntityNode(label="PERSON", name="Alice")
    e2 = EntityNode(label="CITY", name="Paris")
    neo4j_store.upsert_nodes([e1, e2])

    rel = Relation(source_id=e1.id, target_id=e2.id, label="VISITED")
    neo4j_store.upsert_relations([rel])

    # Ensure the relationship is there
    triplets_before = neo4j_store.get_triplets(entity_names=["Alice"])
    assert len(triplets_before) == 1

    # Delete the relation
    neo4j_store.delete(relation_names=["VISITED"])

    # No more triplets
    triplets_after = neo4j_store.get_triplets(entity_names=["Alice"])
    assert len(triplets_after) == 0

    Test deleting relationships by relation names.
    
llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/tests/test_pg_stores_neo4j.py