1
votes

I am trying to run a simple cypher query with neo4j 3.0.3 through the shell. My query is as follows:

MATCH p=(me)<-[:contains*1..10000]-(end) RETURN p;

When I try to run this query I get the following error:

WARNING: Invalid input '=': expected an identifier character, node labels, a property map, a relationship pattern, ',', USING, WHERE, LOAD CSV, START, MATCH, UNWIND, MERGE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH, CALL, RETURN, UNION, ';' or end of input (line 1, column 8 (offset: 7)) "MATCH p=(me)<-[:contains*1..10000]-(end) RETURN p" ^

When I run the same query by telling the shell to please use version 2.3 of cypher everything is fine:

CYPHER 2.3 MATCH p=(me)<-[:contains*1..10000]-(end) WHERE id(me)=51 AND ALL(x in nodes(p) WHERE x.rtype <> 'unknown') AND NOT (end)<-[:contains]-(:res) AND end.rtype='project' RETURN p;

When I remove the assignment of the path to variable p as for example in the following query:o

MATCH (me)<-[:contains*1..10000]-(end) RETURN me;

This query executes just fine.

I have read the cypher manual and find tons of examples that use match clauses assigning paths to variables just like in my code.

Any clues what I'm doing wrong?

1
I can't reproduce the error. Did you edit the line to prepend CYPHER 2.3 or did you type it again? Are you sure you did not manage to type a different character looking like "="? - Frank Pavageau
@FrankPavageau : See my answer below. It was actually a maven dependency problem. Thank you for investigating this. - Valentin

1 Answers

0
votes

Turns out this was actually a problem with the project setup. I am using neo4j in a large project managed by maven. The setup was such that an older version of parboiled was overriding the version used by neo4j 3. This older version was unable to parse these queries successfully.