[joern-users] Some notes on gremlin v2/v3 differences

Tim Hemel joernusers at timit.nl
Mon Oct 31 17:51:27 CET 2016


On Mon, Oct 31, 2016 at 03:25:58PM +0000, Vlad Tsyrklevich via joern-users wrote:
>    I was playing with the octopus dev version a bit and it took me quite a
>    while to figure out how to perform some simple operations that I knew
>    how to do with gremlin v2. I wrote up some notes for my future self
>    that others might find useful if they want to play with
>    octopus: [1]https://tsyrklevich.net/2016/10/31/notes-on-octopus-gremlin
>    3/
> 
> References
> 
>    1. https://tsyrklevich.net/2016/10/31/notes-on-octopus-gremlin3/

Hi Vlad,

Getting from Gremlin2 to Gremlin3 is not an easy change. The syntax has changed,
but mostly for the better. The new steps allow more optimizations and rely less
on side-effect steps.
Specifically, the _match, flatMap and filter steps all take closures that are
difficult to optimize. Instead, you can use steps like
.has('type','MultiplicativeExpression').

I am working on a tutorial for learning Gremlin3 with Joern/Octopus:

https://github.com/timhemel/joern-pubs

You will need to build it with sphinx.

Hopefully this will give you some help when experimenting with Gremlin queries.
If you like unit tests, there is a simple unit test framework that I wrote for
testing Gremlin queries. It has helped me to discover some bugs in queries
already.

Comments and suggestions are welcome.



Tim




More information about the joern-users mailing list