I am using TitanGraphDB + Cassandra.I am 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 want to program the Titan Graph DB from my python program.I am using bulbs package for that.
from bulbs.titan import Graph
g = Graph()
vertex1 = g.vertices.get_or_create('dpid',dpid_str,{'state':'active','dpid':dpid_str,'type':'switch'}))
vertex2 = g.vertices.get_or_create('desc',desc,{'desc':desc,'port_id':port_id,'state':state,'port_state':port_state,'number':number,'type':'port'}))
From the examples I understand how to create edges between the vertices as below
g.edges.create(vertex1,"out",vertex2)
But assume that I don't have the reference to the vertices in my program.
I want to RETRIEVE vertex1 using its key "dpid" AND I want to RETRIEVE vertex2 using its key "desc"
AND then using the retrieved values I want to create the edge.How do I do this?