问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/35700653/neo4j-can-i-make-relations-between-relations