Hi everyone,
For those on the Gremlin-users mailing list, this is not new. However, for
others, I thought you would like to see some work over at TinkerPop that I'm
really diggin'.
In Pipes 0.8-SNAPSHOT, we have made it so that its much easier to construct
"Gremlin-esque" traversals in native Java. The new killer pipe is called
FluentPipeline.
It works as such:
Graph g = new Neo4jGraph('/tmp/mygraph');
List<String> friendsProjectNames = new
FluentPipeline(g.getVertex(1)).out("knows").out("created").property("name").toList()
In short, every Pipe in Pipes has an associated (in many cases, many
associated) methods in FluentPipeline that to allow for this style of traversal
construction. As you may realize, the only reason Gremlin still exists is
because of the ease by which closures (~anonymous functions) can be defined in
Groovy (as well as some other random meta-programming stuff). With
FluentPipeline, inner-classes are required which are very verbose.
See the last two code blobs of
https://github.com/tinkerpop/pipes/wiki/FluentPipeline that compare pure Java
and Groovy.
This work along with some vast speed improvements to Gremlin will be seen in
Gremlin 1.3 which will probably trickle up to Neo4j at version 1.4.3.
Enjoy,
Marko.
http://markorodriguez.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user