簡體   English   中英

在添加或更新邊緣時出現錯誤“未匿名生成 - 使用 __ class 而不是 TraversalSource”(在 Neptune 中使用 gremlin)

[英]Getting Error "not spawned anonymously - use the __ class rather than a TraversalSource " while adding or updating the edge(in Neptune using gremlin)

我正在使用 Amazon Neptune 引擎版本 1.1.1.0,我正在嘗試執行以下查詢

gE().has(id, '6529056485837422516').fold().coalesce(unfold().property('id','6529056485837422516').property('createdat', 1553676114).property('status', 0).property('edgeproperty', 'connects').property('source', '63').property('destination', '54'),gV('54').addE('connects').to(__.V('63')).property(id,'6529056485837422516').property('id','6529056485837422516').property('createdat', 1553676114).property('status', 0).property('edgeproperty', 'connects').property('source', '63').property('destination', '54'))

我正在從我的 gremlin 控制台執行此查詢,執行此查詢后出現如下錯誤{"detailedMessage":"The child traversal of [GraphStep(vertex,[54]), AddEdgeStep({label=[connects], createdat= [1553676114], edgeproperty=[connects], ~to=[[GraphStep(vertex,[63])], destination=[54], id=[6529056485837422516], id=[6529056485837422516], 源=[63], status=[0]})] 不是匿名生成的 - 使用 __ class 而不是 TraversalSource 來構造子遍歷","code":"InternalFailureException","requestId":"ceee889e-c382-4bde-ad91-86ea1cb010c1 “}

但是,如果我使用以下查詢分別添加邊緣,那么我可以添加邊緣gV('54').addE('connects').to(__.V('63')).property(id,'6529056485837422516').property('id','6529056485837422516').property('createdat', 1553676114).property('status', 0).property('edgeproperty', 'connects').property('source', '63').property('destination', '54')

即使我能夠使用以下查詢更新邊緣,我也能夠更新gE().has(id, '6529056485837422516').fold().coalesce(unfold().property('id','6529056485837422516').property('createdat', 1553676114).property('status', 0).property('edgeproperty', 'connects').property('source', '63').property('destination', '54'))

但是如果我試圖通過使用 fold() 來同時更新或添加。 coalesce() 然后我收到錯誤,因為不是匿名生成的 - 使用 __ class 而不是 TraversalSource

請幫我解決這個錯誤

解決方案在錯誤消息本身中,並在此處進行了更詳細的描述,但基本上從 TinkerPop 3.5.0 開始,您不能再使用從g生成的子遍歷(即GraphTraversalSource )。 它必須從__ 匿名生成(即雙下划線類)。

簡而言之,您需要生成gV('54').addE(...遍歷__V('54').addE(...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM