ram
ram

Reputation: 73

How to add a vertices to specified graph of rexsterserver (titan/cassandra)?

I am using rexster server with Titan cassandra. and all are installed in my local host. me configure my rexster.xml to create a specific graph.

<graph>
      <graph-name>empgraph</graph-name>
      <graph-type>tinkergraph</graph-type>`enter code here`
      <graph-mock-tx>true</graph-mock-tx>
      <extensions>
          <allows>
               <allow>tp:gremlin</allow>
          </allows>
      </extensions>
</graph>

And I want to add edges and vertices's to that my new graph with python bulbs. I wrote below code to add

from bulbs.rexster import Graph, Config
config = Config('http://localhost:8182/graphs/emptygraph';)
g = Graph(config)

but I am getting error ... if I add below data that will effect to default graph only ... that code not showing any effect on empgraph ... what i have to do to add a data to my newly created empgraph ?

from bulbs.config import Config, DEBUG
from bulbs.rexster import Graph
config = Config('http://localhost:8182/graphs/empgraph';)
g = Graph()
class inser_class():
        po = g.vertices.create(name="po")
        pr = g.vertices.create(name="pr")
        tanuja = g.vertices.create(name="tanuja")
        g.edges.create(pr, "knows", tanuja)

in above code i mention empgraph but that data added to the default(emptygraph).

Upvotes: 0

Views: 58

Answers (0)

Related Questions