在本地dynamodb的gremlin图中创建多个顶点 [英] create multiple vertices in gremlin graph in local dynamodb

查看:121
本文介绍了在本地dynamodb的gremlin图中创建多个顶点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用其本地DynamoDB几个命令在其控制台的gremlin图中创建多个顶点。

I have to create multiple vertices in gremlin graph in its console using local DynamoDB few commands.

使用:= TitanDB

Uses := TitanDB

存储后端:= DynamoDB

Storage Backend := DynamoDB

服务器:= Gremlin服务器

Server := Gremlin server

推荐答案

以下是我提供的相同示例以前

Here's the same example I provided previously

gremlin> graph = TitanFactory.open('conf/gremlin-server/dynamodb-local.properties')
==>standardtitangraph[com.amazon.titan.diskstorage.dynamodb.DynamoDBStoreManager:[127.0.0.1]]
gremlin> v0 = graph.addVertex('name', 'jason'); v1 = graph.addVertex('name', 'mustaffa'); v0.addEdge('helps', v1)
==>e[175-39k-1lh-374][4232-helps->4144]
gremlin> graph.tx().commit()
==>null

它创建2顶点和1条边。此示例显示不使用Gremlin Server即可直接连接至Titan图。

It creates 2 vertices and 1 edge. This example shows a direct connection to the Titan graph without using a Gremlin Server.

如果要连接到Gremlin Server,语法基本相同。首先创建与Gremlin服务器的远程连接,然后必须使用:> :submit 发送请求到服务器。还要注意,您不需要显式调用 graph.tx()。commit(),因为事务是在每个远程请求上自动提交的。

If you want to connect to a Gremlin Server, the syntax is largely the same. First create a remote connection to the Gremlin Server, then you have to use :> or :submit to send the request to the server. Also note that you don't need to explicitly call graph.tx().commit() because the transaction is automatically committed on each remote request.

gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Connected - localhost/127.0.0.1:8182
gremlin> :> v0 = graph.addVertex('name', 'jason'); v1 = graph.addVertex('name', 'mustaffa'); v0.addEdge('helps', v1)
==>e[17c-3b4-1lh-3a8][4288-helps->4256]

这篇关于在本地dynamodb的gremlin图中创建多个顶点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆