2

I'd like to set a different style/color for relationships in my database that have the property "critical". I assume to do this, I need to update the relationships with a new label called "isCrit" and modify the grass file.

Can anyone help with selecting all relationships with a particular property and create the new label "isCrit"?

Fairly new to neo4j

tim
  • 33
  • 2
  • 7

1 Answers1

1

Can anyone help with selecting all relationships with a particular property and create the new label "isCrit"?

Neo4j relationships do not have labels. Labels are part of nodes. They can hold more than one label. Relationships have a relationship type. Take a look in the docs about relationships.

Also, relationships can have only one type. This way you cannot add another relationship type to a given relationship. Moreover, currently has no way to change the relationship type. In the cases that you want to change the relationship type you should delete the current relationship and create a new one with the desired type, as described in this answer:

MATCH (n:User {name:"foo"})-[r:REL]->(m:User {name:"bar"})
CREATE (n)-[r2:NEWREL]->(m)
// copy properties, if necessary
SET r2 = r
WITH r
DELETE r
Bruno Peres
  • 15,845
  • 5
  • 53
  • 89
  • thanks - I take it you can't color a relationship based on properties using grass like you can't with nodes? – tim Jan 23 '18 at 12:32
  • @tim I do not think so, but I'm not I'm not sure about this. Try opening an issue in the [Neo4j Browser Github Repo](https://github.com/neo4j/neo4j-browser). Or you can checkout the project and do your own customizations. Its open source. – Bruno Peres Jan 23 '18 at 12:39
  • I'm wondering whether I need to create a new subset of relationships because it can be driven, critical or have a type of relationship. Needs further thought. Thanks again. Very helpful. – tim Jan 23 '18 at 13:03