Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我在设计基于 neo4j 的数据库时遇到问题。我希望能够在节点之间创建关系并让节点负责创建关系。我想出的一个例子是:
用户、标签、文章。用户可以标记文章...
[用户]
[标签] - [tags_article] -> [文章]
我希望能够获取文章的所有标签。使用关系 tags_article 很容易。但我想让用户在文章中添加标签。我不能这样做......任何想法,如何将关系与负责创建它的节点相关联?
Something like this?
(User)-[:ADDED]->(Tag), (Tag)-[:TAGS]->(Article)
And you could get what you're looking for with this:
MATCH (u)-[:ADDED]->(t)-[:TAGS]->(a) WHERE a.name='whatever' WITH t, u.name AS user RETURN user, t.name