无法在此处创建具有属性的节点。它已经存在于这种背景下

时间:2013-07-07 20:17:46

标签: php neo4j cypher neo4jphp

我收到以下错误:

Can't create `referee` with properties here. It already exists in this context

执行以下操作时:

foreach($feedarray as $feed)
            {

            $game= $client->makeNode();
            $game->setProperty('label', "Game: ".$feed['game_number'])
                    ->setProperty('type', "game")
                    ->setProperty('referee_name',$disposition['referee_name'])     
             ->save();

$queryString = "START referee=node:node_auto_index(name={name}), game=node({nodeId}) ".
                           "CREATE UNIQUE (referee{label:{name}, type:'referee'})-[:REFEREED{ label:'REFEREED' }]->(game)".
                           "RETURN referee";
            $query = new Neo4j\Cypher\Query($client, $queryString, array('nodeId' => $game->getId(),'name' => $feed['referee_name']));
            $result = $query->getResultSet();
                }

}//for loop

1 个答案:

答案 0 :(得分:0)

这看起来是因为您已经在查询的START部分中绑定了标识符“referee”。

您的查询中不需要START裁判= ...因为CREATE UNIQUE会根据提供的属性找到它,或者创建它。