考慮下面的代碼:的Java Neo4j的暗號查詢結果unsupportedException當節點(*)使用副節點(1,2,3 ......)
public class Foo
{
public void go(String relationship)
{
RestGraphDatabase rest = new RestGraphDatabase(
prop.getProperty("address"), prop.getProperty("username"),
prop.getProperty("password"));
ExecutionEngine engine = new ExecutionEngine(rest,
StringLogger.SYSTEM);
ExecutionResult result = engine
.execute("start n=node(7,8,9) match(n)-[" + relationship
+ "]->(x) return n,x,caution");
scala.collection.Iterator<Node> nodes = result.columnAs("n");
}
}
上述工作,讓我來迭代然而我的列:
public class Foo
{
public void go(String relationship)
{
RestGraphDatabase rest = new RestGraphDatabase(
prop.getProperty("address"), prop.getProperty("username"),
prop.getProperty("password"));
ExecutionEngine engine = new ExecutionEngine(rest,
StringLogger.SYSTEM);
ExecutionResult result = engine
.execute("start n=node(*) match(n)-[" + relationship
+ "]->(x) return n,x,caution");
scala.collection.Iterator<Node> nodes = result.columnAs("n");
}
}
結果在迭代器拋出不受支持的異常。是node(*)
上市出來的值不是語法糖?我node(*)
如果不是如何可以遍歷呢?
堆棧:
2013年2月18日03:13:22.227 + 0000 INFO [org.neo4j]:啓動N =節點(*) 匹配(n)的 - [注意] - >( x)的回報N,X,警告列表(N,X,慎用)
異常在線程 「主」 java.lang.UnsupportedOperationException在 org.neo4j.rest.graphdb.AbstractRemoteDatabase.getNodeManager(AbstractRemoteDatabase.java:136 ) 在 org.neo4j.rest.graphdb.RestGraphDatabase.getNodeManager(RestGraphDatabase.java:33) 在 個org.neo4j.tooling.GlobalGraphOperations。(GlobalGraphOperations.java:39) 在 org.neo4j.tooling.GlobalGraphOperations.at(GlobalGraphOperations.java:51) 在 org.neo4j.cypher.internal.executionplan.builders。 GraphGlobalStartBuilder $$ anonfun $ createStartPipe $ 1.適用(GraphGlobalStartBuilder.scala:51) 在 org.neo4j.cypher.internal.executionplan.builders.GraphGlobalStartBuilder $$ anonfun $ createStartPipe $ 1.適用(GraphGlobalStartBuilder.scala:51) 在 org.neo4j.cypher.internal.pipes.StartPipe $$ anonfun $ createResults $ 1.apply(StartPipe.scala:36) at org.neo4j.cypher.internal.pipes.StartPipe $$ anonfun $ createResults $ 1.apply(StartPipe .scala:35) at scala.col lection.Iterator $$匿名$ 13.hasNext(Iterator.scala:371)在 scala.collection.Iterator $$不久$ 13.hasNext(Iterator.scala:371)在 scala.collection.Iterator $$不久$ 11.hasNext( Iterator.scala:327)at scala.collection.Iterator $$ anon $ 11.hasNext(Iterator.scala:327)at org.neo4j.cypher.internal.ClosingIterator $$ anonfun $ hasNext $ 1.apply $ mcZ $ sp( ClosingIterator.scala:36) 在 org.neo4j.cypher.internal.ClosingIterator $$ anonfun $ hasNext $ 1.適用(ClosingIterator.scala:35) 在 org.neo4j.cypher.internal.ClosingIterator $$ anonfun $ hasNext $ 1.apply(ClosingIterator.scala:35) at org.neo4j.cypher.internal.ClosingIterator.failIfThrows(ClosingIterator.scala:87) at org.neo4j.cypher.internal.ClosingIterator.hasNext(ClosingIterator.scala:35) 在 org.neo4j.cypher.PipeExecutionResult.hasNext(PipeExecutionResult.scala:139) 在scala.collection.Iterator $$匿名$ 11上。 hasNext(Iterator.scala:327)在 scala.collection.Iterator $ class.isEmpty(Iterator.scala:256)在 scala.collection.AbstractIterator.isEmpty(Iterator.scala:1156)
一個tstorms說,從來沒有在我們身邊一個RestGraphDatabase一個ExecutionEngine,使用RestCypherQueryEngine或RestAPIFacade.query()。 – 2013-02-20 07:13:35