I am trying to create a geohash graph with level 5 of zoom from an existing one with level 7. i tried this code :
FROM GRAPH mergedGraph
MATCH (from)-[via]->(to)
CASE WHEN substring(from.geohash,0,5)=substring(to.geohash,0,5)
THEN
CONSTRUCT
CREATE (h:HashNode{geohash:substring(from.geohash,0,5)})-[COPY OF via]->(h)
ELSE
CONSTRUCT create (:HashNode{geohash:substring(from.geohash,0,5)})-[COPY OF via]->(:HashNode{geohash:substring(to.geohash,0,5)})
END
RETURN GRAPH
however it dosen't seem true in cypher ,i get an exception :
Caused by: org.opencypher.v9_0.util.SyntaxException: Invalid input 'S': expected 'l/L' (line 4, column 4 (offset: 57))
In english words i want : if the start node and the end node share the same geohash substring then create one node with the relationship that point back to it:
else create two nodes :
NB: The project i am working at is CYPHER FOR APACHE SPARK