groovycassandratitanbulbsrexster

Rexster query returns "No such property: v for class: com.thinkaurelius.titan.graphdb.database.StandardTitanGraph"


I'm using TitanGraphDB + Cassandra. I'm starting Titan as follows

cd titan-cassandra-0.3.1
bin/titan.sh config/titan-server-rexster.xml config/titan-server-cassandra.properties

I have a Rexster shell that I can use to communicate to Titan + Cassandra above.

cd rexster-console-2.3.0
bin/rexster-console.sh

I'm attempting to model a network topology using Titan Graph DB. I want to program the Titan Graph DB from my python program. I'm using bulbs package for that. I create five types of vertices

 - switch
 - port 
 - device
 - flow
 - flow_entry

I create edges between vertices that are connected logically. The edges are not labelled.

Let us say I want to test the connectivity between Vertex A and Vertex B

I have a groovy script is_connected.groovy

def isConnected (portA, portB) {
    return portA.both().retain([portB]).hasNext()
}

Now from my rexster console

g = rexster.getGraph("graph")
==>titangraph[embeddedcassandra:null]
rexster[groovy]> g.V('type', 'flow')    
==>v[116]
==>v[100]
rexster[groovy]> g.V('type', 'flow_entry')
==>v[120]
==>v[104]

As you can see above I have two vertices of type flow v[116] and v[100]

I have two vertices of type flow_entry v[120] and v[104]

I want to check for the connectivity between v[120] and v[116] for e.g

rexster[groovy]> ?e is_connected.groovy       
==>null
rexster[groovy]> is_connected(g.v[116],g.v[120])
==>An error occurred while processing the script for language [groovy]. All transactions across all graphs in the session have been concluded with failure: java.util.concurrent.ExecutionException: javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: v for class: com.thinkaurelius.titan.graphdb.database.StandardTitanGraph

Either I am doing something very wrong,or I am missing something obvious.It would be great if you could point me in the right direction.


Solution

  • This syntax is not valid groovy:

    is_connected(g.v[116],g.v[120])
    

    should be:

    is_connected(g.v(116),g.v(120))