【问题标题】:Gremlin/Neptune: sort edges by vertex propertyGremlin/Neptune:按顶点属性对边进行排序
【发布时间】:2019-11-05 22:34:53
【问题描述】:

使用远程连接到 Neptune 数据库实例的 gremlin 控制台,我正在抓取带有特定标签的所有边,并希望按输出顶点的 id 对它们进行排序。我收到此错误:"code":"UnsupportedOperationException","detailedMessage":"com.amazon.neptune.storage.volcano.ast.CutoffNode cannot be cast to com.amazon.neptune.storage.volcano.ast.AbstractGroupNode"

样本数据:

g.addV('user').property(id,'1').
  addV('content').property(id,'2').
  addE('history').property('val',9).from(g.V('1')).to(g.V('2'))

查询和输出:

g.E().hasLabel('history').order().by('val')
==>e[3][1-history>2]
g.E().hasLabel('history').outV().id()
==>1
g.E().hasLabel('history').order().by(outV().id())
{"requestId":<stuff>,"code":"UnsupportedOperationException","detailedMessage":
"com.amazon.neptune.storage.volcano.ast.CutoffNode cannot be cast to 
com.amazon.neptune.storage.volcano.ast.AbstractGroupNode"}

我希望最后一个的结果与第一个相同。我在 TinkerGraph 中尝试了相同的遍历,但没有收到错误,因此根据该消息和消息判断,它特别是海王星问题。谷歌搜索没有发现任何东西。

是否有一个遍历可以满足我的需求?我做错了什么?

【问题讨论】:

    标签: gremlin amazon-neptune


    【解决方案1】:

    我会调查为什么会抛出错误,但在短期内我认为这种解决方法应该会奏效。如果没有,请告诉我。

    g.E().order().by(identity().outV().id())

    干杯, 开尔文

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-14
      • 2020-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多