View a markdown version of this page

DFE 中的 Gremlin 步骤覆盖 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

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 (), 屏障 (), call (), cap (), 日期添加 (), dateDiff (), 分离 (), 掉落 (), 失败 (), 过滤器 (), flatMap (), id (), 身份 (), 索引 (), 相交 (), 注入 (), 标签 (), 长度 (), 循环 (), 地图 (), 订购 (), 订购(本地), 路径 (), 项目 (), 范围 (), 重复 (), 反向 (), 麻袋 (), 样本 (), 选择 (), 副作用 (), 分裂 (), 展开 (), 联盟 ()

聚合和收集步骤:

聚合(全局), 结合 (), 计数 (), dedup (), 重复数据删除(本地), 折叠 (), 组 (), 群组数量 (),

数学步骤:

max()、mean()、min()、sum()

元素步骤:

otherV()、elementMap()、element()、v()、out()、in()、both()、outE()、inE()、bothE()、outV()、inV()、bothV()、otherV()

属性步骤:

properties()、key()、valueMap()、value()

筛选步骤:

和 (), 合并 (), 硬币 (), 丢弃 (), 有 (), 是 (), 本地 (), 无 (P), 不是 (), 或 (), 哪里 ()

字符串操作步骤:

concat()、lTrim()、rTrim()、substring()、toLower()、toUpper()、trim()

谓词:

限制

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')