1
votes

This is quite a general question but to make it more understandable I'll give it a bit of context.

In neo4j I have a series of words (nodes) that are associated with one another. I want to specify a list of nodes and the Cypher query return a list of any relationships between those nodes.

The nodes specified in the list are all guaranteed to have at least one relationship to another node specified in the list.

I created a query to do this and in certain circumstances it works fine - http://console.neo4j.org/?id=s30cbm

Unfortunately, when I add the words 'bark' and 'dog' to the list I get an 'unexpected traversal state encountered' error message. I presume this is because the database cursor has got to the fruit node and then there's no relationship between that and bark, even though there is a relationship from tree to bark. http://console.neo4j.org/?id=258d6g

I'm obviously doing the query slightly wrong and any advice would be appreciated on how I can rectify this.

1
must be some sort of a bug. appears between nodes 2 and 6. simpler statement: START n=node(6), m=node(2) MATCH n-[r]-m RETURN n. do you get the same error on server instance or in the web console only?ulkas
Yep, the same thing happens on both the console and server instance (different data but very similar and produces the same error). For now I'm thinking of using "START n=node(1,2,3,4,5,6,7) MATCH n-[r]-(m) RETURN n, r, m" which will return all relationships (in both directions for all the listed nodes, and then filtering them on the client using if(n<m) and if((n is in list) && (m is in list))RichW
This looks like a bug, have created github.com/neo4j/neo4j/issues/387 to keep track of it. Thank you!Peter Neubauer
Thanks, I'll keep an eye on this one. Hopefully once it's fixed it'll be much more efficient than my workaround!RichW

1 Answers

0
votes

This works in the latest console (your second link), btw, so it looks like they fixed it. Looks like it should be working in 1.9-M04+.