![](/img/trans.png)
[英]How to start a new connection with CosmoDB graph database using gremlin on version ^3
[英]Cayley: How do insert vertices and edges into graph using Cayley-Gremlin code?
因此,對於Go和Cayley來說,我是新手,我正努力將數據插入到圖形中。 我正在使用以下命令在命令行上運行gremlin控制台:
cayley repl --db="bolt" --dbpath=../../database/database1 --query_lang="gremlin"
我知道Cayley使用Gremlin的其他變體。 此頁面( https://github.com/google/cayley/wiki )指出它使用的是“ Cayley-Gremlin”而不是“ Tinkerpop-Gremlin”。 我認為在大多數情況下,API都將保持不變,但事實並非如此。 該文檔指出該圖形對象具有可用的addVertex
方法。 但是,當我嘗試在Cayley repl中使用該方法時,出現錯誤:
cayley> g.addVertex("test")
Error: TypeError: 'addVertex' is not a function
-----------
1 Results
Elapsed time: 0.102239 ms
為什么該方法在圖形上不可用? API是否不同? 還有另一種使用“ Cayley-Gremlin”將節點/邊插入圖形的方法嗎?
提前致謝!
Cayley中的gremlin僅用於遍歷。 https://github.com/google/cayley/blob/master/docs/GremlinAPI.md是用於cayley的完整gremlin API。
使用http添加數據: https : //github.com/google/cayley/blob/master/docs/HTTP.md#apiv1write
我是Cayley的新手,但我認為
cayley> :a subject predicate object label .
是gremlin的命令,用於添加從repl執行的新頂點(對我來說,這是添加和刪除( :d
)的更方便的方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.