标签: gremlin

图灵完备图查询语言

是否准确地说,在现有的图查询语言(Cypher、Datalog、Sparql 等)中,Gremlin 是唯一一种图灵完备的语言?

如果重要的话,我并不是在寻找像《万智牌》的图灵完备性证明这样的边缘情况;我的问题的目的是 Gremlin 是否是唯一适合在实践中对图执行任意计算的图查询语言。

sql turing-complete graph-traversal datalog gremlin

5
推荐指数
1
解决办法
1293
查看次数

Gremlin 远程命令失败并出现超时错误:主机未及时响应

我通过 gremlin groovy shell 连接到远程 gremlin 服务器。连接成功。但对于我尝试执行的任何远程命令,它都会出现超时错误。即使是为了指挥:> 1+1

gremlin> :remote connect tinkerpop.server conf/senthil.yaml
==>Connected - 10.40.40.65/10.40.40.65:50080

gremlin> :> 1+1
Host did not respond in a timely fashion - check the server status and submit again.
Display stack trace? [yN]
org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: Host did not respond in a timely fashion - check the server status and submit again.
at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:120)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.apache.tinkerpop.gremlin.console.commands.SubmitCommand.execute(SubmitCommand.groovy:41)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:215)
at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:101)
at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
Run Code Online (Sandbox Code Playgroud)

这是我的conf文件:remote.yaml

hosts: [10.40.40.65]
port: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-dynamodb gremlin titan

5
推荐指数
1
解决办法
3053
查看次数

Cosmos DB Graph-API 中的查询参数

新的 Cosmos DB 图形 API 是否支持查询参数?例如在查询中:

IDocumentQuery<dynamic> query = client.CreateGremlinQuery<dynamic>(graph, "g.V().has('name', 'john')");
Run Code Online (Sandbox Code Playgroud)

我可以像在 DocumentDB 中那样用查询参数替换硬编码值“john”吗:

IQueryable<Book> queryable = client.CreateDocumentQuery<Book>(
                collectionSelfLink,
                new SqlQuerySpec
        {
                    QueryText = "SELECT * FROM books b WHERE (b.Author.Name = @name)", 
                    Parameters = new SqlParameterCollection() 
            { 
                          new SqlParameter("@name", "Herman Melville")
                    }
        });
Run Code Online (Sandbox Code Playgroud)

我是出于安全考虑才问的。或者是否有其他方法可以防御 Gremlin 中的注射?

gremlin azure-cosmosdb

5
推荐指数
1
解决办法
1238
查看次数

Gremlin:服务器上未配置别名 [g] 的遍历源 [g]

我正在为我的 janusGraph 数据库使用 Docker 实例,并且非常具体;我使用以下 Docker 映像: https://github.com/sunside/janusgraph-docker

图像工作正常,除非我删除此 groovy 文件中的第 12 行:https://github.com/sunside/janusgraph-docker/blob/master/janusgraph/empty-sample.groovy其中包含以下内容:

graph.io(graphml()).readGraph('data/air-routes-small.graphml')
Run Code Online (Sandbox Code Playgroud)

如果我尝试使用 gremlin python 从数据库中选择任何顶点,在删除前面提到的行后,我会收到以下错误:

gremlin_python.driver.protocol.GremlinServerError: 499: The traversal source [g] for alias [g] is not configured on the server.
Run Code Online (Sandbox Code Playgroud)

因此,如果不导入任何现有数据,它就不起作用。但我想从一个空数据库开始,而不是现有数据库,这就是我不想导入 .graphml 文件的原因。但我想我仍然需要以某种方式初始化一个空数据库,有什么想法吗?

graph gremlin docker gremlin-server janusgraph

5
推荐指数
1
解决办法
2759
查看次数

将 Gremlin 的字符串命令转换为可执行文件

我创建了一个长 Gremlin 链接命令作为字符串。在 NodeJS 或 Python 中执行它的最佳方法是什么?

g.addV("person").
  property(id, 1).
  property("name", "marko").
  property("age", 29).as("1").
  addV("person").
  property(id, 2).
  property("name", "vadas").
  property("age", 27).as("2").
  addV("software").
  property(id, 3).
  property("name", "lop").
  property("lang", "java").as("3").
  addV("person").
  property(id, 4).
  property("name", "josh").
  property("age", 32).as("4").
  addV("software").
  property(id, 5).
  property("name", "ripple").
  property("lang", "java").as("5").
  addV("person").
  property(id, 6).
  property("name", "peter").
  property("age", 35).as("6").
  addE("created").from("1").to("3").
  property(id, 9).
  property("weight", 0.4).
  addE("knows").from("1").to("2").
  property(id, 7).
  property("weight", 0.5).
  addE("knows").from("1").to("4").
  property(id, 8).
  property("weight", 1.0).
  addE("created").from("3").to("4").
  property(id, 11).
  property("weight", 0.4).
  addE("created").from("3").to("6").
  property(id, 12).
  property("weight", 0.2).
  addE("created").from("4").to("5").
  property(id, 10).
  property("weight", 1.0)
Run Code Online (Sandbox Code Playgroud)

上面给出的命令在 …

node.js python-3.x gremlin tinkerpop3 gremlinpython

5
推荐指数
1
解决办法
548
查看次数

在 Gremlin 中,如何查询一个属性值大于另一属性值的顶点?

我确信这很简单,但我不知道该怎么做。我有带有特定标签的顶点,它们有两个整数属性。我们将它们称为整数 1 和整数 2。我只想查询整数2大于整数1的所有顶点。

我已经尝试过以下方法:

g.V().hasLabel("myLabel").has("integer2", P.gt(values("integer1"))).toList(); 
Run Code Online (Sandbox Code Playgroud)

但这会导致异常 - 可以理解,因为“值”方法调用会导致遍历步骤,而谓词需要一个数字。

Exception in thread "main" java.lang.ClassCastException: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal cannot be cast to java.lang.Integer
    at java.lang.Integer.compareTo(Integer.java:52)
    at org.apache.tinkerpop.gremlin.process.traversal.Compare$3.test(Compare.java:92)
    at org.apache.tinkerpop.gremlin.process.traversal.P.test(P.java:72)
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer.testValue(HasContainer.java:118)
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer.test(HasContainer.java:94)
    at org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer.testAll(HasContainer.java:180)
    at org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.step.sideEffect.TinkerGraphStep.iteratorList(TinkerGraphStep.java:116)
    at org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.step.sideEffect.TinkerGraphStep.vertices(TinkerGraphStep.java:88)
    at org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.step.sideEffect.TinkerGraphStep.lambda$new$0(TinkerGraphStep.java:59)
    at org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.step.sideEffect.TinkerGraphStep$$Lambda$23/1123629720.get(Unknown Source)
...
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。谢谢。

gremlin tinkerpop3

5
推荐指数
1
解决办法
4494
查看次数

Gremlin:投影所有标签和每个标签的数量

我目前有一个查询,可以提供每个标签的计数: g.V().group().by(label).by(count())

然而,这会导致每个标签都有一列。我想投影两列“实体类型”和“计数”并计算每个标签的数量。到目前为止,这就是我所拥有的一切,但它是不正确的:

g.V().project('Entity Type','Count')
.by(label)
.by(groupCount())
Run Code Online (Sandbox Code Playgroud)

orientdb gremlin

5
推荐指数
1
解决办法
2356
查看次数

我在哪里可以找到 AWS Neptune 使用的 Tinkerpop Gremlin 的哪个版本

我正在尝试.valueMap().with(WithOptions.tokens)在针对 AWS Neptune 的查询中使用。我明白了MalformedQueryException。我怀疑这是 Gremlin 3.4 中的一个新功能。*

我找不到概述 Neptune 支持的语法版本的页面。

这些信息在哪里存在?

gremlin tinkerpop amazon-neptune

5
推荐指数
1
解决办法
338
查看次数

aws neptune 因大图下降而超时 ()

已经有一些关于这个主题的话题了..特别是这个

但是除了批处理之外,还有什么推荐的解决方案可以删除大图吗?我尝试增加超时时间但不起作用

下面是例子..


gremlin> gV().count()

==>5230885

gremlin> gV().drop().iterate()

{“requestId”:“77c64369-45fa-462f-91d7-5712e3308497”,“detailedMessage”:“评估[RequestMessage{期间脚本内发生超时,requestId = 77c64369-45fa-462f-91d7-5712e3308497,op =' eval',processor='',args={gremlin=gV().drop().iterate(),bindings={},batchSize=64}}] - 考虑增加超时","code":"TimeLimitExceededException"输入 ':help' 或 ':h' 获取帮助。显示堆栈跟踪?[yN]N

gremlin> gE().count()

==>83330550

gremlin> :远程配置超时无

==>远程超时已禁用

gremlin> gE().drop().iterate()

{“requestId”:“d418fa03-72ce-4154-86d8-42225e4b9eca”,“detailedMessage”:“评估[RequestMessage{期间脚本内发生超时,requestId = d418fa03-72ce-4154-86d8-42225e4b9eca,op =' eval',processor='',args={gremlin=gE().drop().iterate(),bindings={},batchSize=64}}] - 考虑增加超时","code":"TimeLimitExceededException"输入 ':help' 或 ':h' 获取帮助。显示堆栈跟踪?[yN]N

gremlin amazon-neptune

5
推荐指数
1
解决办法
2687
查看次数

AWS Neptune 数据库中的多租户

我是海王星的新手。在 Neptune 数据库中支持多租户的最佳方式是什么?
要求:
1. 支持数据库中的数千个租户(一个集群)
2. 通过租户过滤避免查询变得过于复杂
3. 良好的性能(如果有一种方法可以使用数据分区来加快查询时间)
4. 安全 -很难犯错误,从而导致跨租户访问。

gremlin amazon-neptune

5
推荐指数
1
解决办法
2692
查看次数