2

I'am using graph database (Neo4j) , and I need to make relations between relations , for example :

(user1)-[:FOLLOWED]->(user2)

I want to allow other users to like this activity (that user1 followed user2) , what's the best implementation for this ?

Supamiu
  • 8,501
  • 7
  • 42
  • 76
user3703910
  • 624
  • 1
  • 5
  • 25
  • Essentially a duplicate of: http://stackoverflow.com/questions/30520893/neo4j-db-design-edges-with-relationship-filtered-shortest-path/30534449#30534449 – cybersam Feb 29 '16 at 20:11

1 Answers1

3

Short answer:

You can't create a relation to a relation.

How to do?

You have to create an activity node in the middle of your relation:

(user1)-[:FOLLOWED]->(activity{date:..., blabla:...})-[:ACTIVITY_FOR]->(user2)

Then you'll be able to make another user LIKE this activity by creating a relation from user to activity node.

Relation names are subjectives, of course you can set your own relation names.

Community
  • 1
  • 1
Supamiu
  • 8,501
  • 7
  • 42
  • 76