2
我正在嘗試使用Titan Graph DB來建模網絡拓撲。我想從python應用程序指定拓撲。使用Python中的Titan Graph數據庫
我有一個java接口文件,它使用了tinkertop frames annotation.An結構如下。
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)燈泡Python對象轉換爲圖形 (2)Rexter轉換圖來JSON (3)泰坦轉換JSON回圖形?? (4),並寫入卡桑德拉商店
它看起來像我在一個非常圓的方式做事情,我錯過了什麼?如果有人能指出上面的問題是錯誤的,那將會很棒。
什麼是Gremlin?這如何符合上述計劃? – liv2hak
Gremlin是TinkerPop(http://tinkerpop.com)堆棧中的圖形查詢語言。因爲它與Rexster通信,燈泡基本上使用Gremlin。 –
燈泡對象是Python對象,因此可以簡單地將它想象爲:燈泡/ Python - > Rexster/Titan - > Cassandra。 Gremlin是圖形查詢語言(想象它像圖形的SQL),並且使用燈泡在Titan服務器(Rexster)上執行Gremlin查詢,就像使用SQL在RDBMS上執行查詢一樣。 – espeed