Hi, there are some use cases / patterns that are needed by many users and I think it is a good idea to support them directly in TinkerPop with such higher-order patterns. For me personally, I would really appreciate getOrCreate steps for vertices and edges and also some upsert step. Both are already described in an old ticket <https://issues.apache.org/jira/browse/TINKERPOP-479> and they are also frequently requested on this mailing list and on StackOverflow.
Another pattern that could be interesting for Gremlin is a getSimilar step. Elasticsearch has for example a More Like This Query <https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-mlt-query.html>. For a graph, this could be solved by traversing the neighborhood of the start vertex and trying to find vertices with the same label that have short paths to the start vertex and ideally those paths have only few branches (e.g., a path including a supernode doesn't mean that those vertices are similar). But this use case might already be too special / complicated. So I would start with easier patterns like the bidirectional search. Regards, Florian Am Mittwoch, 23. November 2016 13:46:51 UTC+1 schrieb Marko A. Rodriguez: > > Hi, > > g.V(1).as(‘a’). > V(2).as(‘b’). > shortestPath().from(‘a’).to(‘b’). > by(outE(‘knows’).has(’since’,lt(2010)).inV()). > path() > > > Is equivalent to: > > g.V(1).as(‘a’). > V(2).as(‘b’). > repeat(outE(‘knows’).has(’since’,lt(2010)) > .inV()).until(where(‘a’)).limit(1). > path() > > > However, for the Gremlin-Java VM a BiDirectionalSearchStep could then be > added in the compilation as a more optimal way of doing this. > > Basically, should we be adding more high-order constructs for common > patterns….? If so, what other common patterns do you know of that we should > make steps? > > Marko. > > http://markorodriguez.com > > > >