我正在使用 Neo4j 1.8.RC1,并尝试为我的图中的节点生成聚类系数。
我有以下代码,据我所知,它可以在 Linux 系统上运行,但不能在我的 Windows 机器上运行:
Map<String, Object> params = new HashMap<String, Object>();
String query;
String typeString;
if (type == <some type>) {
typeString = "TYPE1";
}
else {
typeString = "TYPE2";
}
params.put("myid", userid);
query = "start a=node(*) match (a)-[:"+ typeString +"]-(b) WITH a, count(distinct b) as n "
+ "match (a)-[:" + typeString + "]-()-[r:"+ typeString+"]-()-[:"+typeString+"]-(a) where a.thisId! = {myid} return n, count(distinct r) as relcount";
ExecutionEngine engine = new ExecutionEngine(graphDb);
ExecutionResult result = engine.execute(query, params);
当我尝试访问结果时,我得到
Exception in thread "main" java.lang.RuntimeException: org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named myid
我已经通过并验证了它的存在。这是怎么回事?