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.

Relationship Tense

I'm new to graph databases, so please forgive me if the answer to this is obvious. In all the examples I've seen, relationships have a verb to describe them (such as employee WORKS_AT company). Is it common practice to use present tense and modify the relationship manually later on if the relationship changes? Or would it be better practice to create a second parallel relationship? Or would it be better still to use a property to describe the tense?

1 REPLY 1

ameyasoft
Graph Maven

Relationship types and node labels are case, tense independent and you are free to use anything. Also, one can change the relationship type using APOC library. Here is how:

CREATE (f:Foo)-[rel:WORKING]->(b:Bar)
We can change the relationship type from WORKING to WORKED

MATCH (f:Foo)-[rel:WORKING]->(b:Bar) with rel
CALL apoc.refactor.setType(rel, 'WORKED') YIELD input, output RETURN *

Result will be (f:Foo)-[rel:WORKED]->(b:Bar)