本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DFE 中的 Gremlin 步骤覆盖
Gremlin DFE 可以通过启用实例参数或使用 Neptune#useDFE 查询提示。有关更多信息,请参阅在 Neptune DFE 查询引擎中使用 Gremlin。
以下各节描述了海王星引擎版本 1.5.0.0 及更高版本以及 1.5.0.0 之前的海王星引擎版本的 DFE 步骤覆盖范围。
海王星引擎版本 1.5.0.0 及更高版本
从亚马逊海王星引擎版本 1.5.0.0 开始,DFE 原生支持大多数 Gremlin 步骤。DFE 本身不支持以下步骤:
-
突变 —
addV(),addE(),drop(),mergeV(),mergeE(),以及property()。 -
过滤器和谓词 —
all(),any(),none(),TextP.regex,以及TextP.notRegex。 -
Side-effects —
barrier(),subgraph(),timeLimit(),以及tree()。 -
地图 —
asBool(),asNumber(),element(),format(),math(),merge(),以及propertyMap()。
如果你使用其中一个步骤,海王星会回退到 TinkerPop 正在处理该部分的查询。
另请参阅 Gremlin 标准合规性 为了 Neptune-wide 与阿帕奇的区别 TinkerPop 这也适用于 DFE。
Gremlin 查询可以包含一组完全支持的步骤,但仍包含无法完全转换为 DFE 的步骤模式。如果您使用更复杂或不太常见的表单中的步骤,则查询的该部分会回退到 TinkerPop 用于处理。要检查特定查询是否在 DFE 中本地运行,请使用 说明 要么 轮廓 输出。
海王星引擎在 1.5.0.0 之前发布
以下步骤可在 Gremlin DFE 中使用。
路径和遍历步骤:
asDate ()
聚合和收集步骤:
聚合(全局)
数学步骤:
元素步骤:
otherV()
属性步骤:
properties()
筛选步骤:
和 ()
字符串操作步骤:
concat()
谓词:
限制
DFE 尚不支持在重复遍历内使用限制、标签和重复数据删除。
// With Limit inside the repeat traversal g.V().has('code','AGR').repeat(out().limit(5)).until(has('code','FRA')) // With Labels inside the repeat traversal g.V().has('code','AGR').repeat(out().as('a')).until(has('code','FRA')) // With Dedup inside the repeat traversal g.V().has('code','AGR').repeat(out().dedup()).until(has('code','FRA'))
尚不支持包含嵌套重复项的路径或使用分支步骤。
// Path with branching steps g.V().has('code','AGR').union(identity, outE().inV()).path().by('code') // With nested repeat g.V().has('code','AGR').repeat(out().union(identity(), out())).path().by('code')