Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用gremlin创建名称为的空图形_Python_Graph Databases_Gremlin_Gremlin Server - Fatal编程技术网

Python 使用gremlin创建名称为的空图形

Python 使用gremlin创建名称为的空图形,python,graph-databases,gremlin,gremlin-server,Python,Graph Databases,Gremlin,Gremlin Server,我试过了 但我不知道什么是‘g’。如果我尝试不同的字符串,请说“你好” 它无法连接 名为“my_database”的createDatabase的等价物是什么 创建一个新的图形 如何连接到名为“my_database”的现有数据库 在您连接到的服务器上,g必须是可用的GraphTraversalSource,地址为'ws://localhost:8182/gremlin。创建“g”的方式取决于所使用的图形数据库。如果您使用的是开源的Gremlin服务器,则可以通过文档“”部分中所述的服务器初始

我试过了

  • 但我不知道什么是‘g’。如果我尝试不同的字符串,请说“你好” 它无法连接
  • 名为“my_database”的createDatabase的等价物是什么 创建一个新的图形
  • 如何连接到名为“my_database”的现有数据库

在您连接到的服务器上,g必须是可用的
GraphTraversalSource
,地址为
'ws://localhost:8182/gremlin
。创建“g”的方式取决于所使用的图形数据库。如果您使用的是开源的Gremlin服务器,则可以通过文档“”部分中所述的服务器初始化脚本来配置
GraphTraversalSource
。您可以在Gremlin Server附带的示例脚本中看到创建“g”的示例。Neptune、CosmosDB、DSE Graph以及Compose上的JanusGraph都有自己的“g”的具体方法,您可以查阅他们的文档以了解更多细节。

我使用JanusGraph。我应该如何创建名为“my_graph”的图形我以后应该怎么做才能连接到图形?JanusGraph包了Gremlin服务器,这样您就可以在init脚本或其ConfiguredGraphFactory中使用该方法-ConfiguredGraphFactory.createConfiguration有一个python等价物?对于JanusGraph,大多数图形都需要使用其本机语言/API进行配置,这意味着Java/Groovy/JVM。JanusGraph没有“Python配置API”。太混乱了:(我什么都不懂。甚至无法创建名为“my_graph”的图形):(
graph = Graph()
g = graph.traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))