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').has('name','lop').as('b'), | |
gremlin> g.of().as('b').in('created').has('age', 29).as('c'), | |
gremlin> g.of().as('c').out().jump('c',2)). | |
gremlin> select('c').out('knows').name | |
==>vadas | |
==>josh | |
==>vadas | |
==>josh | |
==>vadas |
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
@Test | |
public void shouldSerializeObject2() throws Exception { | |
TraversalCounterMessage traverser = new TraversalCounterMessage(); | |
traverser.setCounter(10l); | |
KryoWritable writable = new KryoWritable<>(traverser); | |
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); | |
final DataOutput out = new DataOutputStream(outputStream); | |
writable.write(out); |
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
/usr/local/hadoop-1.2.1/lib$ ls | |
asm-3.2.jar jackson-core-asl-1.8.8.jar | |
aspectjrt-1.6.11.jar jackson-mapper-asl-1.8.8.jar | |
aspectjtools-1.6.11.jar jasper-compiler-5.5.12.jar | |
commons-beanutils-1.7.0.jar jasper-runtime-5.5.12.jar | |
commons-beanutils-core-1.8.0.jar jdeb-0.8.jar | |
commons-cli-1.2.jar jdiff | |
commons-codec-1.4.jar jersey-core-1.8.jar | |
commons-collections-3.2.1.jar jersey-json-1.8.jar | |
commons-configuration-1.6.jar jersey-server-1.8.jar |
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 = TinkerGraph.open() | |
==>tinkergraph[vertices:0 edges:0] | |
gremlin> g.loadGraphML('data/grateful-dead.xml') | |
==>null | |
gremlin> clock(1000){g.V.has('name','Garcia').next()} | |
==>0.11787599999999974 | |
gremlin> g = TinkerGraph.open() | |
==>tinkergraph[vertices:0 edges:0] | |
gremlin> g.createIndex('name',Vertex.class) | |
==>null |
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().has("name","marko").store("x") | |
No signature of method: com.tinkerpop.gremlin.tinkergraph.process.graph.TinkerGraphTraversal.store() is applicable for argument types: (java.lang.String) values: [x] | |
Possible solutions: sort(), sort(java.util.Comparator), sort(groovy.lang.Closure), size(), toSet(), join(java.lang.String) | |
Display stack trace? [yN] |
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 Traversal<Vertex, Collection> get_g_v1_storeXa_nameX_out_storeXa_nameX_name_capXaX(final Object v1Id) { | |
g.v(v1Id).store('a'){it.get().value('name')}.out().store('a'){it.get().value('name')}.name.cap('a'); | |
} |
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 class InjectStep<S> extends FilterStep<S> implements TraverserSource { | |
private final List<S> injections; | |
public InjectStep(final Traversal traversal, final S... injections) { | |
super(traversal); | |
this.setPredicate(t -> true); | |
this.injections = Arrays.asList(injections); | |
} |
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.of().inject(g.v(1),g.v(2)) | |
==>v[1] | |
==>v[2] | |
gremlin> g.of().inject(g.v(1),g.v(2)).out | |
==>v[3] | |
==>v[2] | |
==>v[4] | |
gremlin> g.of().inject(g.v(1),g.v(2)).out.name |
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.of().inject(user.store("x").as("a").out("in").store("x").jump("a").cap("x").next()).unfold().outE("AXO").has("read", true).inV().choose({ it.get() == r3 }, | |
gremlin> g.of(), | |
gremlin> g.of().as("x").out("has").jump("x", { it.get() != r3 })).hasNext() | |
==>true |
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> Neo4jTraversal<S, E2> map(final SFunction<Traverser<E>, E2> function) { | |
return (Neo4jTraversal) GraphTraversal.super.map(function); | |
} | |
public default <E2> Neo4jTraversal<S, E2> flatMap(final SFunction<Traverser<E>, Iterator<E2>> function) { | |
return (Neo4jTraversal) GraphTraversal.super.flatMap(function); | |
} | |
public default Neo4jTraversal<S, Object> id() { | |
return (Neo4jTraversal) GraphTraversal.super.id(); |