cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Label or Node?

drew
Node Link

Hi,
I need to add the concept of tags in my data structure.
I have "Group" nodes and I want to classify them with tags.
Since in my case the tag would only have the "name" attribute, I thought there are two different ways to do this:

  1. create a new "Tag" node and create a relationship between Group and Tag
  2. Each new tag becomes a new label of node "Group"

Which approach is better? Are there any other better solutions?
Thank!

4 REPLIES 4

ameyasoft
Graph Maven

1 is the better approach

Thanks @ameyasoft ! Can you explain why?

Option 1 is non-invasive and all your Group nodes remain same, With option 2, you are changing the node label from 'Group' to 'Tag' and any query that was referencing this 'Group' node will fail and also in production environment this is a risky operation. My approach is prevention is better than cure!

@ameyasoft actually with the option 2, I didn't mean to change label from Group to Tag, but to add labels to Group.