有没有什么具体的方法可以在 eclipse 中为 neo4j 编写限制子句?
Is there any specific way to write limit clause in eclipse for neo4j?
我在 neo4j eclipse 实现中遇到以下问题:
1。我在使用限制函数时出错
Code:
String rows = "";
try ( Transaction ignored = graphDb.beginTx();
Result result = graphDb.execute( "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5" ) )
{
while ( result.hasNext() )
{
Map<String,Object> row = result.next();
for ( Entry<String,Object> column : row.entrySet() )
{
rows += column.getKey() + ": " + column.getValue() + "; ";
}
rows += "\n";
}
}
System.out.println(""+rows);
}
Output:
Exception in thread "main" org.neo4j.graphdb.QueryExecutionException: Invalid input '5': expected whitespace, comment, node labels, MapLiteral, a parameter, a relationship pattern, '(', '.', '[', "=~", IN, IS, '^', '*', '/', '%', '+', '-', '<', '>', "<=", ">=", '=', "<>", "!=", AND, XOR, OR, AS, ',', ORDER, SKIP, LIMIT, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, RETURN, UNION, ';' or end of input (line 1, column 97 (offset: 96)) "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5"
- 在没有 limit 子句的情况下执行上述查询也需要 50 分钟。那么如何提高执行速度呢?
limits
前不能有逗号,试试
match(pr:Provider)-[t:TREATS]->(p:Problem)
return pr.prdes as Name, t.pprcount as Visits limit 5
相反。
由于这是一个没有定义起点的全局查询,因此其执行时间当然取决于您的数据大小。
我在 neo4j eclipse 实现中遇到以下问题:
1。我在使用限制函数时出错
Code:
String rows = "";
try ( Transaction ignored = graphDb.beginTx();
Result result = graphDb.execute( "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5" ) )
{
while ( result.hasNext() )
{
Map<String,Object> row = result.next();
for ( Entry<String,Object> column : row.entrySet() )
{
rows += column.getKey() + ": " + column.getValue() + "; ";
}
rows += "\n";
}
}
System.out.println(""+rows);
}
Output:
Exception in thread "main" org.neo4j.graphdb.QueryExecutionException: Invalid input '5': expected whitespace, comment, node labels, MapLiteral, a parameter, a relationship pattern, '(', '.', '[', "=~", IN, IS, '^', '*', '/', '%', '+', '-', '<', '>', "<=", ">=", '=', "<>", "!=", AND, XOR, OR, AS, ',', ORDER, SKIP, LIMIT, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, RETURN, UNION, ';' or end of input (line 1, column 97 (offset: 96)) "match(pr:Provider)-[t:TREATS]->(p:Problem) return pr.prdes as Name, t.pprcount as Visits, limit 5"
- 在没有 limit 子句的情况下执行上述查询也需要 50 分钟。那么如何提高执行速度呢?
limits
前不能有逗号,试试
match(pr:Provider)-[t:TREATS]->(p:Problem)
return pr.prdes as Name, t.pprcount as Visits limit 5
相反。
由于这是一个没有定义起点的全局查询,因此其执行时间当然取决于您的数据大小。