Neo4J外键

发布于 2025-01-25 14:35:40 字数 131 浏览 2 评论 0原文

我需要您的学校作业帮助。我们需要将Neo4J用作数据库。我们有3个桌子,研究人员,善良和出版表。 每个出版物都必须有一种,它将来自该表。如果每个研究人员都有出版物,则将来自出版表。我们需要添加一个外键。我找不到这个来源。如何在Neo4J中添加外键?

I need your help with my school homework. We need to use neo4j as a database. We have 3 tables, researcher, kind, and publication tables.
Each publication has to have a kind and it will come from the kind table. If every researcher has a publication, it will come from the publication table. We need to add a foreign key. I couldn't find a source for this. How to add a foreign key in Neo4j?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

真心难拥有 2025-02-01 14:35:40

外键不适用于NEO4J

Foreign keys do not apply to a Graph Database like neo4j ????.

Instead, create one Node for each publication, create a Node for each kind, and create a Relationship between the respective Nodes. I.e.:

MERGE (pub1:Publication {name: "Neo4j Databases"})
MERGE (technical:Kind {name: "Technical"})
MERGE (pub1)-[:IS]->(technical)

MERGE (pub2:Publication {name: "Fried Chicken"})
MERGE (recipe:Kind {name: "Recipe"})
MERGE (pub2)-[:IS]->(recipe)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文