[英]How to add user defined constraints on a node/relationship in Neo4j using Java API
Consider I have a node having Label L1
in Neo4j database.考虑我在Neo4j数据库中有一个带有标签
L1
的节点。 I need to put a constraint on all nodes having label L1
such that there shall be no outgoing edge from these nodes.我需要对所有具有标签
L1
节点施加约束,以便这些节点没有传出边缘。 So whenever user tries to add an outgoing edge from these nodes, a constraint violation occurs.因此,每当用户尝试从这些节点添加出边时,就会发生约束违规。 Is it possible to add user defined constraints on nodes and relationships?
是否可以在节点和关系上添加用户定义的约束?
If yes, how can I put such constraint(s) on nodes/relationships using Neo4j Java API's?如果是,我如何使用Neo4j Java API 对节点/关系施加此类约束?
According to the Neo4j constraints documentation there is no way to do this.根据Neo4j 约束文档,没有办法做到这一点。
I think you should delegate this type of responsibility to the application layer.我认为您应该将这种责任委托给应用程序层。 Alternatively, you can try achieve your goal writing your own user defined procedure .
或者,您可以尝试编写自己的用户定义过程来实现您的目标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.