Search code examples
pythonbulbs

Bulb Flow: How to get a range of vertices?


I am trying to find out how is it possible to get a range of vertices from a graph, I am aware that this can be done in gremlin using

     gremlin> g.V.range(0,9)

But how can this be done using bulb flow model api ?


Solution

  • Here's how you can execute a one line Gremlin...

    >>> from bulbs.rexster import Graph
    >>> g = Graph()                                 # create the Graph object
    >>> script = "g.V.range(start,end)"             # set a one line script
    >>> params = dict(start=0, end=9)               # put function params in dict
    >>> vertices = g.gremlin.query(script, params)  # execute the script in DB
    

    See http://bulbflow.com/docs/api/bulbs/gremlin/