2016-01-19 21 views
0

节点已存在。 我试图通过放松添加边缘,但我的功能importBuyConnectionIntoNeo4j没有工作,如何通过使用neo4jclient展开来添加边?

有没有人可以帮助我?

的数据结构:

class Connection 
{ 
    private string type; 

    public string Type 
    { 
     get { return type; } 
     set { type = value; } 
    } 

    private string source; 

    public string Source 
    { 
     get { return source; } 
     set { source = value; } 
    } 

    private string target; 

    public string Target 
    { 
     get { return target; } 
     set { target = value; } 
    }  
} 

class BuyConnection:Connection 
{ 

} 

myFunction的:

public void importBuyConnectionIntoNeo4j(List<BuyConnection> connectionList) 
    { 
     GraphClient client = createConnectionToNeo4j(); 
     client.Cypher 
      .Unwind(connectionList, "connection") 
      .Match("(source:Person),(target:Vegetable)") 
      .Where("source.Name=connection.Source AND target.Type=connection.Target") 
      .Create("(source)-[:Buy]->(target)") 
      .ExecuteWithoutResults(); 
    } 
+0

你好,它怎么不起作用?只是不建立关系? –

+0

是的,没有创建任何关系。在此操作之前,我导入了一些节点。 –

回答

0

我认为这个问题是您.where文字:

.Where("source.Name=connection.Source AND target.Type=connection.Target")

SourceTarget钻机高高在上?

+0

是的,你是对的,所以我尝试了另一种方式来满足需求,Thx为你的关注。 –