This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> g.v(1).identity().choose({it.get().out().hasNext() ? 0 : 1}, g.of().out(), g.of().in()) | |
==>v[3] | |
==>v[2] | |
==>v[4] | |
gremlin> g.v(1).jump("x", {it.get().out().hasNext()}).in().jump("y").as("x").out().as("y") | |
==>v[3] | |
==>v[2] | |
==>v[4] | |
gremlin> g.V.jump("x", {it.get().out().hasNext()}).in().jump("y").as("x").out().as("y") | |
==>v[3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ gremlin | |
\,,,/ | |
(o o) | |
-----oOOo-(_)-oOOo----- | |
gremlin> g = new TinkerGraph() | |
==>tinkergraph[vertices:0 edges:0] | |
gremlin> (0..10).each{g.addVertex([name:it])} | |
==>0 | |
==>1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
plugin loaded: server | |
plugin loaded: gephi | |
plugin loaded: utilities | |
gremlin> g = TinkerFactory.createClassic() | |
==>tinkergraph[vertices:6 edges:6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> g = TinkerFactory.createClassic() | |
==>tinkergraph[vertices:6 edges:6] | |
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c')) | |
==>[a:v[1], b:v[4], c:v[5]] | |
==>[a:v[1], b:v[4], c:v[3]] | |
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c')).keep('a') | |
==>v[1] | |
==>v[1] | |
gremlin> g.V.as('x').match('a', g.of().as('a').out.as('b'), g.of().as('b').out.as('c')).keep('a','b') | |
==>[a:v[1], b:v[4]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public default <E2> GraphTraversal<S, E2> keep(final String... asLabels) { | |
return asLabels.length == 1 ? | |
(GraphTraversal) this.addStep(new KeepOneStep<E2>(this, asLabels[0])) : | |
(GraphTraversal) this.addStep(new KeepManyStep<Map<String, E2>>(this, asLabels)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> g.V.match('a', | |
gremlin> g.of().as('a').out('knows').as('b'), | |
gremlin> g.of().as('b').out('created').has('name','lop'), | |
gremlin> g.of().as('b').match('a1', g.of().as('a1').out('created').as('b1')).select('b1').as('c')).select{it.value('name')} | |
==>[a:marko, b:josh, c:ripple] | |
gremlin> g.V.match('a', | |
gremlin> g.of().as('a').out('knows').as('b'), | |
gremlin> g.of().as('b').out('created').has('name','lop'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/software/tinkerpop/tinkerpop3$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
plugin loaded: server | |
plugin loaded: gephi | |
plugin loaded: utilities | |
gremlin> g = TinkerFactory.createClassic() | |
==>tinkergraph[vertices:6 edges:6] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> g.V.match('a', | |
gremlin> g.of().as('a').out('created').fold().map{it.get().size()}.as('b')) | |
==>[a:v[1], b:1] | |
==>[a:v[4], b:2] | |
==>[a:v[6], b:1] | |
gremlin> | |
gremlin> | |
gremlin> g.V.match('a', | |
gremlin> g.of().as('a').out('created').fold().map{it.get().size()}.as('b'), | |
gremlin> g.of().as('b').map{(it.get() * 13.5) as Integer}.as('c')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/software/tinkerpop/tinkerpop3$ mvn clean install -Dmaven.test.skip=true | |
... | |
~/software/tinkerpop/tinkerpop3$ cd gremlin-console/target/gremlin-console-3.0.0-SNAPSHOT-standalone/ | |
~/software/tinkerpop/tinkerpop3/gremlin-console/target/gremlin-console-3.0.0-SNAPSHOT-standalone$ bin/gremlin.sh | |
\,,,/ | |
(o o) | |
-----oOOo-(3)-oOOo----- | |
plugin loaded: server | |
plugin loaded: gephi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BROKEN | |
gremlin> g = TinkerFactory.createClassic() | |
==>tinkergraph[vertices:6 edges:6] | |
gremlin> g.V.store("4") | |
The memory does not have a value for provided variable: %&%cap | |
Display stack trace? [yN] | |
// FIXED |