如何使用neo4jclient通过展开来添加边缘?

时间:2016-01-19 02:50:10

标签: c# neo4j neo4jclient

节点已经存在。 我尝试通过展开来添加边缘,但我的函数importBuyConnectionIntoNeo4j不起作用,

有人可以帮助我吗?

数据结构:

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();
    }

1 个答案:

答案 0 :(得分:0)

我认为问题在于您的.where文字:

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

是正确的SourceTarget吗?