def test_03_upsert_relations_and_get(neo4j_store):
    """
    Test creating relations between nodes, then retrieving them in multiple ways.
    """
    person = EntityNode(label="PERSON", name="Alice")
    city = EntityNode(label="CITY", name="Paris")
    neo4j_store.upsert_nodes([person, city])

    # Create a relation
    visited_relation = Relation(
        source_id=person.id,
        target_id=city.id,
        label="VISITED",
        properties={"year": 2023},
    )
    neo4j_store.upsert_relations([visited_relation])

    # Validate that the relation can be found in triplets
    triplets = neo4j_store.get_triplets(entity_names=["Alice"])
    assert len(triplets) == 1
    source, rel, target = triplets[0]
    assert source.name == "Alice"
    assert target.name == "Paris"
    assert rel.label == "VISITED"
    assert rel.properties["year"] == 2023

    Test creating relations between nodes, then retrieving them in multiple ways.
    
llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/tests/test_pg_stores_neo4j.py