Nodes not displaying ID when creating graph DB with py2neo

Hi everyone,

I'm working with a recommender system that connects players and games (games as in matches). I started to play with py2neo trying to import a dummy DB from a csv with the following info:


This is what I do to create the graph (constraints are already in place)

csv_players_df= pd.read_csv(path+'games-users1.csv')
tx = g.begin()
for index, row in csv_players_df.iterrows():
    WITH split($userId,",") as users
    UNWIND users as user
    MERGE (p:Player {userId:user})
    MERGE (g:Game {gameId:$gameId})
    MERGE (p)-[:played_in]->(g);
    ''', parameters = {'userId': row['userId'],'gameId': row['gameId']})

The code executes without any issues. However, when displaying the graph in neo4j, user ids are not displayed for the nodes. There must be something wrong with my UNWIND but I cannot figure it out.

I know userIds are correctly inserted though:
When testing the same code directly in neo4j I see the IDs are displayed correctly:
This is the code for neo4j:

'file:///games-users1.csv' AS row
  WITH row, split(row.userId, ",") AS users
  UNWIND users AS user
  MERGE (p:Player {userId: user}) 
  MERGE (g:Game {gameId: row.gameId}) 
  MERGE (p)-[:played_in]->(g);

What am I missing here?
Thanks! Raul.

This just looks like a question of what to display, doesn't look like there's anything wrong with your load.

In the graph display pane, click on the label associated with the orange nodes (where it has the label name and the count of those nodes). At the bottom of the pane it should show some options of what properties to use for display. Click he userId property and the display should update accordingly.

1 Like

Thanks Andrew.
feeling stupid know :slight_smile:
I thought there was something wrong as it wasn't showing it by default