是否可以通过Web库将节点/边添加到graphDB?

时间:2022-04-25 15:43:50

I'm trying to make a tool that will have a graph component. I wanted users to be able to build/model their own relationships. I was thinking of something similar to how mind map software works(users create nodes and edges,etc..).

我正在尝试制作一个具有图形组件的工具。我希望用户能够建立/建立他们自己的关系。我在考虑类似于思维导图软件的工作原理(用户创建节点和边缘等等)。

I was hoping to use Neo4J(they have a library but I don't think you can add nodes/edges to it) but honestly any web library would work because I can transfer the data to their format, let users modify it then push the changes back to my backend DB.

我希望使用Neo4J(他们有一个库,但我不认为你可以添加节点/边缘)但老实说任何网络库都可以工作,因为我可以将数据传输到他们的格式,让用户修改它然后推送更改回我的后端数据库。

Any suggestions?

1 个解决方案

#1


2  

Most graphDBs offer a REST endpoint for CRUD operations: Neo4J offers also a specific transactional one for ACID operations.

大多数graphDB为CRUD操作提供REST端点:Neo4J还为ACID操作提供特定的事务端点。

Basically you can use CREATE and MATCH queries to create or update/delete your data in the database, and send them by an AJAX call to the Neo4J server.

基本上,您可以使用CREATE和MATCH查询在数据库中创建或更新/删除数据,并通过AJAX调用将它们发送到Neo4J服务器。

Using a graph drawing library you can trigger, based on the user activity, the ajax requests and create the elements in the database.

使用图形绘制库,您可以根据用户活动触发ajax请求并在数据库中创建元素。

Have a look at the Cypher Cheatsheet for an overview of the possible operations.

请查看Cypher Cheatsheet,了解可能的操作概述。

Note: probably you don't want to expose your database to the user completely, so I'd say maybe to wrap the REST interface with a Business Software layer of yours so that you can control all the process (and not distribuite the Authentication credentials to the user as well).

注意:可能您不希望将数据库完全暴露给用户,因此我想说可能将REST接口与您的业务软件层包装在一起,以便您可以控制所有进程(而不是分发身份验证凭据)对用户而言)。

#1


2  

Most graphDBs offer a REST endpoint for CRUD operations: Neo4J offers also a specific transactional one for ACID operations.

大多数graphDB为CRUD操作提供REST端点:Neo4J还为ACID操作提供特定的事务端点。

Basically you can use CREATE and MATCH queries to create or update/delete your data in the database, and send them by an AJAX call to the Neo4J server.

基本上,您可以使用CREATE和MATCH查询在数据库中创建或更新/删除数据,并通过AJAX调用将它们发送到Neo4J服务器。

Using a graph drawing library you can trigger, based on the user activity, the ajax requests and create the elements in the database.

使用图形绘制库,您可以根据用户活动触发ajax请求并在数据库中创建元素。

Have a look at the Cypher Cheatsheet for an overview of the possible operations.

请查看Cypher Cheatsheet,了解可能的操作概述。

Note: probably you don't want to expose your database to the user completely, so I'd say maybe to wrap the REST interface with a Business Software layer of yours so that you can control all the process (and not distribuite the Authentication credentials to the user as well).

注意:可能您不希望将数据库完全暴露给用户,因此我想说可能将REST接口与您的业务软件层包装在一起,以便您可以控制所有进程(而不是分发身份验证凭据)对用户而言)。