Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Neo4J telling me there is no spoon?

Tags:

neo4j

cypher

I am using Neo4J to represent texts; in the simplest case a text is a sequence of words joined by the relationship LEMMA_TEXT.

I am trying to find the Nth word after a known word, with a query that looks something like this.

MATCH (anchor)-[:LEMMA_TEXT*32]->(word)  WHERE id(anchor) = 3275  RETURN word 

In one particular case, if I increase the path length to 33, I get this error:

Neo.DatabaseError.Statement.ExecutionFailure: There is no spoon. 

And yet the following query returns the correct result.

MATCH (anchor)-[:LEMMA_TEXT*32]->(word)-[:LEMMA_TEXT]->(next)  WHERE id(anchor) = 3275  RETURN next 

which demonstrates that the node I want exists and is reachable.

Where is the section of the manual that tells me how to bend the spoon with my mind? More importantly, what does this actually mean?!

like image 761
tla Avatar asked May 27 '15 20:05

tla


People also ask

WHERE null Neo4j?

In Neo4j, since there is no table schema or equivalent to restrict possible properties, non-existence and null are equivalent for node and relationship properties. That is, there really is no such thing as a property with a null value; null indicates that the property doesn't exist at all.

How does Neo4j handle null values?

Testing any value against null , either with the = operator or with the <> operator, always evaluates to null . Therefore, use the special equality operators IS NULL or IS NOT NULL instead (see :syntax/operators/index. adoc#cypher-comparison).


1 Answers

If anything breaks at number like 33, it means that there was a restriction upto 32, why 32? 2^5.

It's not trivial that most of the restrictions are in a factor of 2, MongoDB document size cannot be more than 16 MB, on a collection there could be maximum index, no more than 64. etc.

why it works as 32 and then next, because till 32 it can achieve in one operation and for last one it can see the next one as another operation. But it cannot go for 33 in one operation.

Most of these restrictions are basically sanity check though and not really technical boundary.

As for why it is almost always a factor of 2, I want someone else to answer or in other words I don't know.

like image 140
Rahul Kumar Avatar answered Sep 29 '22 11:09

Rahul Kumar