neo4j/community — Issue #54: Cypher queries with where clauses using relationship identifiers and variable length relationships is not working
Author: gorbachev
Created: 2011-10-10 17:18:43+00:00
State: open

This query works:

start n = node:idx(key = 'value') match (n)-[r:KNOWS]->() where r.anotherKey = 'value2' return count(*)

This query does not work:

start n = node:idx(key = 'value') match (n)-[r:KNOWS*1..2]->() where r.anotherKey = 'value2' return count(*)

Here's the top of the stack trace:

java.util.NoSuchElementException: key not found: r
at scala.collection.MapLike$class.default(MapLike.scala:224)
at scala.collection.immutable.Map$Map3.default(Map.scala:143)
at scala.collection.MapLike$class.apply(MapLike.scala:135)
at scala.collection.immutable.Map$Map3.apply(Map.scala:143)
at org.neo4j.cypher.commands.PropertyValue.apply(Value.scala:103)
at org.neo4j.cypher.commands.PropertyValue.apply(Value.scala:99)
at org.neo4j.cypher.commands.ComparableClause.isMatch(ComparableClause.scala:29)
at org.neo4j.cypher.pipes.FilterPipe$$anonfun$foreach$1.apply(FilterPipe.scala:31)
at org.neo4j.cypher.pipes.FilterPipe$$anonfun$foreach$1.apply(FilterPipe.scala:30)
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:213)
at org.neo4j.cypher.pipes.MatchPipe$$anonfun$foreach$1$$anonfun$apply$1.apply(MatchPipe.scala:37)
at org.neo4j.cypher.pipes.MatchPipe$$anonfun$foreach$1$$anonfun$apply$1.apply(MatchPipe.scala:37)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at org.neo4j.cypher.pipes.MatchPipe$$anonfun$foreach$1.apply(MatchPipe.scala:37)
at org.neo4j.cypher.pipes.MatchPipe$$anonfun$foreach$1.apply(MatchPipe.scala:36)
at org.neo4j.cypher.pipes.StartPipe$$anonfun$foreach$1$$anonfun$apply$1.apply(StartPipe.scala:36)
at org.neo4j.cypher.pipes.StartPipe$$anonfun$foreach$1$$anonfun$apply$1.apply(StartPipe.scala:35)
at scala.collection.Iterator$class.foreach(Iterator.scala:652)
at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
at scala.collection.JavaConversions$JIterableWrapper.foreach(JavaConversions.scala:587)
at org.neo4j.cypher.pipes.StartPipe$$anonfun$foreach$1.apply(StartPipe.scala:35)
at org.neo4j.cypher.pipes.StartPipe$$anonfun$foreach$1.apply(StartPipe.scala:34)
at org.neo4j.cypher.pipes.ParameterPipe.foreach(ParameterPipe.scala:27)
at org.neo4j.cypher.pipes.StartPipe.foreach(StartPipe.scala:34)
at org.neo4j.cypher.pipes.MatchPipe.foreach(MatchPipe.scala:36)
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:212)
at org.neo4j.cypher.pipes.Pipe.filter(Pipe.scala:31)
at org.neo4j.cypher.pipes.FilterPipe.foreach(FilterPipe.scala:30)
at org.neo4j.cypher.pipes.TransformPipe.foreach(TransformPipe.scala:38)
at org.neo4j.cypher.pipes.AggregationPipe.foreach(AggregationPipe.scala:36)
at org.neo4j.cypher.pipes.ColumnFilterPipe.foreach(ColumnFilterPipe.scala:34)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
at org.neo4j.cypher.pipes.Pipe.map(Pipe.scala:31)
at org.neo4j.cypher.ExecutionResult$class.javaIterator(ExecutionResult.scala:43)
at org.neo4j.cypher.ExecutionEngine$$anon$1.javaIterator(ExecutionEngine.scala:119)
at org.neo4j.cypher.javacompat.ExecutionResult.iterator(ExecutionResult.java:51)
at org.springframework.data.neo4j.conversion.QueryResultBuilder$1.single(QueryResultBuilder.java:65)
at org.springframework.data.neo4j.support.query.CypherQueryExecutor.queryForObject(CypherQueryExecutor.java:47)
at org.springframework.data.neo4j.repository.GraphRepositoryFactory$CypherGraphRepositoryQuery.dispatchQuery(GraphRepositoryFactory.java:274)
at org.springframework.data.neo4j.repository.GraphRepositoryFactory$GraphRepositoryQuery.execute(GraphRepositoryFactory.java:321)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:343)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

using the 1.5-SNAPSHOT downloaded with Maven:

#Mon Oct 10 14:48:02 CEST 2011
version=1.5-SNAPSHOT
groupId=org.neo4j
artifactId=neo4j