3

I am attempting to model a network topology using Titan Graph DB.I want to specify the topology from a python application.

I have a java interface file that uses tinkertop frames annotation.An example structure is given below.

public interface IDeviceObject extends IBaseObject {

          @JsonProperty("mac")
          @Property("dl_addr")
          public String getMACAddress();
          @Property("dl_addr")
          public void setMACAddress(String macaddr);

          @JsonProperty("ipv4")
          @Property("nw_addr")
          public String getIPAddress();
          @Property("nw_addr")
          public void setIPAddress(String ipaddr);

          @JsonIgnore
          @Adjacency(label="host",direction = Direction.IN)
          public Iterable<IPortObject> getAttachedPorts();

          @JsonIgnore
          @Adjacency(label="host",direction=Direction.IN)
          public void setHostPort(final IPortObject port);

          @JsonIgnore
          @Adjacency(label="host",direction=Direction.IN)
          public void removeHostPort(final IPortObject port);

          @JsonIgnore
          @GremlinGroovy("it.in('host').in('on')")
          public Iterable<ISwitchObject> getSwitch();
    }


PYTHON OBJECTS  ----> BULBS ----> REXTER ---> Titan Graph DB ---> Cassandra DB

(1) BULBS converts python objects to Graphs (2) Rexter converts Graphs to JSON (3) Titan converts JSON back to Graphs?? (4) and also writes to cassandra store

It looks like I am doing things in a very round about manner,and I am missing something? It would be great if someone could point out waht is wrong with the above?

liv2hak
  • 14,472
  • 53
  • 157
  • 270

1 Answers1

4

Your diagram of:

PYTHON OBJECTS  ----> BULBS ----> Rexster ---> Titan Graph DB ---> Cassandra DB

Looks more or less correct depending on how you want to think of the abstractions involved. You might also define it as:

PYTHON OBJECTS  ----> BULBS ----> Rexster/Titan ---> Cassandra DB

As Rexster basically embeds a Titan instance that it exposes over REST for consumption by Bulbs. This part isn't quite right:

  1. BULBS converts python objects to Graphs
  2. Rexter converts Graphs to JSON
  3. Titan converts JSON back to Graphs??
  4. and also writes to cassandra store

I would say:

  1. Titan is a Blueprints implementation that writes to Cassandra
  2. Rexster hosts Blueprints implementations and exposes elements of that API (and Gremlin) over REST using JSON
  3. Bulbs is a Python object mapping layer over Rexster.

At the end of the day there is no direct connection from Python to Titan. Titan has the JVM based Blueprints interface and uses Rexster as a way for non-JVM languages to talk to it.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Now what is Gremlin? How does that fit into the above scheme? – liv2hak Apr 22 '14 at 20:59
  • 3
    Gremlin is the graph query language in the TinkerPop (http://tinkerpop.com) stack. Bulbs basically uses Gremlin under the hood as it communicates with Rexster. – stephen mallette Apr 22 '14 at 21:12
  • 3
    Bulbs objects are Python objects so it's simpler to think of it as: Bulbs/Python -> Rexster/Titan -> Cassandra. Gremlin is the graph query language (think of it like SQL for graphs), and you use Bulbs to execute Gremlin queries on Titan Server (Rexster), just like you would use SQL to execute queries on a RDBMS. – espeed Apr 23 '14 at 22:50