2016-09-30 73 views
0

我能夠在IBM Graph中成功構建頂點,但是當我執行查詢時,輸出不顯示頂點之間的邊。我運行下面的代碼:如何顯示IBM Graph中頂點之間的邊界?

def v1 = graph.addVertex("name", "Darshit", label, "Inventorymanager","zip","95112"); 
def v2 = graph.addVertex("name", "Vikas", label, "Vendor","zip","95112"); 
def v3 = graph.addVertex("name", "Sidharth", label, "Vendor","zip","95112"); 
def v4 = graph.addVertex("name", "iPhone7", label, "Item","price",750,"quantity",10); 
def v5 = graph.addVertex("name", "chair", label, "Item","price",20,"quantity",15); 
def v6 = graph.addVertex("name", "laptop", label, "Item","price",800,"quantity",3); 
v1.addEdge("ordered_to", v2); 
v1.addEdge("ordered_to", v3); 
v2.addEdge("has", v4); 
v3.addEdge("has", v5); 
v2.addEdge("has", v6); 
v3.addEdge("has", v6);  
def g = graph.traversal(); 
g.V().has("name", "Darshit").out("ordered_to").has("name", "Vikas").path(); 
+1

可以粘貼您從查詢得到的輸出? –

回答

0

更改您的查詢

g.V().has("name", "Darshit").outE("ordered_to").inV().has("name", "Vikas").path(); 

這會讓你的邊緣以及

相關問題