グレムリンの言語(Groovyの子)の中では、私は動作と使用方法が少し混乱しています。;
、&&
です。例えばGremlinのシーケンス文の構文は何ですか?
は、GremlinClient REPL(ここではタイタン1.0を実行している)で、私は一度にいくつかのノードを追加することを望むかもしれません:
gremlin> graph = TitanFactory.open("../conf/gremlin-server/titan-cassandra-server.properties")
==>standardtitangraph[cassandra:[localhost]]
gremlin> g = graph.traversal(standard())
==>graphtraversalsource[standardtitangraph[cassandra:[localhost]], standard]
gremlin> g.V().count()
==>0
gremlin> g.addV(label, 'Subject', 'ident', '1') ; g.addV(label, 'Subject', 'ident', '2')
==>v[4304]
gremlin> g.V().count()
==>1
OK、そう;
は動作しませんでした。 &&
はどうですか?これはかなり私が欲しいの意味を持っていないが、私はそれを介して仕事ができる:
gremlin> g.V().count()
==>0
gremlin> g.addV(label, 'Subject', 'ident', '1') && g.addV(label, 'Subject', 'ident', '2')
==>true
gremlin> g.V().count()
==>2
うーん...それは一種のOKです。また、一連のコマンドの一部として変数をバインドできるようにする必要もあります。奇妙なことに、セミコロンはここで動作します:
gremlin> g.V().count()
==>0
gremlin> g.E().count()
==>0
gremlin> g.addV(label, 'Subject', 'ident', '1') && g.addV(label, 'Subject', 'ident', '2')
==>true
gremlin> node3 = graph.addVertex(label, 'Subject', 'ident', '3') ; g.V().has('ident', '1').next().addEdge('dc:isPartOf', node3) ; node3.addEdge('dc:isPartOf', g.V().has('ident','2').next())
==>e[35z-6d4-2l91-9n4][8248-dc:isPartOf->12496]
gremlin> g.V().count()
==>3
gremlin> g.E().count()
==>2
ここではトリックです。どのようにしてこれらの操作を1行で実行できますか(実際には1つのWebsocket要求)。私は上記のnode3 = ...
行を;
経由で複製し、適切な機能を得ることさえできないようです。
「あなたの横断を繰り返す」は毎回人々を捉えます。 http://tinkerpop.apache.org/docs/current/tutorials/the-gremlin-console/#result-iteration - GremlinはTinkerPop 2.xの "グルーヴィー"でした。私はTinkerPop 3.xのためにそれ以上の制限を置いていません。 –
ありがとう! –