def test_02_upsert_nodes_and_get_multiple(neo4j_store):
    """
    Test inserting multiple nodes at once and retrieving them by IDs.
    """
    entity1 = EntityNode(label="PERSON", name="Bob")
    entity2 = EntityNode(label="PERSON", name="Charlie")
    chunk1 = ChunkNode(text="This is sample text.")
    chunk2 = ChunkNode(text="Another sample text.")

    # Upsert multiple
    neo4j_store.upsert_nodes([entity1, entity2, chunk1, chunk2])

    # Retrieve by IDs
    ids_to_get = [entity1.id, entity2.id, chunk1.id, chunk2.id]
    results = neo4j_store.get(ids=ids_to_get)
    assert len(results) == 4

    # Check some known values
    person_bob = [r for r in results if isinstance(r, EntityNode) and r.name == "Bob"]
    assert len(person_bob) == 1

    chunk_texts = [r for r in results if isinstance(r, ChunkNode)]
    assert len(chunk_texts) == 2

    Test inserting multiple nodes at once and retrieving them by IDs.
    
llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/tests/test_pg_stores_neo4j.py