Search code examples
olaptinkerpopjanusgraphtinkerpop3graph-traversal

Gremlin OLAP traversal query error regarding local star-graph


I'm trying to execute an OLAP traversal on a query that needs to check if a vertex has a neighbour of certain type. i keep getting

Local traversals may not traverse past the local star-graph on GraphComputer

my query looks something like:

g.V().hasLabel('label1').
where(_.out().hasLable('label2'))

I'm using the TraversalVertexProgram. needless to say, when running the same query in oltp mode there is no problem is there a way to execute such logic?


Solution

  • That is limitation of TinkerPop OLAP GraphComputer. It operate on 'star-graph' objects. The vertex and connected edges only. It uses message passing engine inside. So you have to rewrite you query.

    Option 1: start from label2 and go t label1. This should return the same result

    g.V().hasLabel('label2').in().hasLabel('label1')
    

    Option2: try to use unique edge labels and check edge label instead

    g.V().hasLabel('label1').where(_.outE('label1_label2'))