Posting this just as a help for others, as i did not find any article directly solving this issue: escaping stuff like dot, comma, slash, start, question mark, parenthesis, plus, single quote or double quote [ "[", "]", "(", ")", "?", "+", "*", ".", """, "'" ]
I mean, it's enough that the Cypher query builder is not that precise, APOC input parameters are too generic and examples need some rework, and also checking the closure of parenthesizes would need some improvement, but, when you need to add your query with already escaped characters as an APOC embedded sub-query, it's just frustrating.
So, for example, if you initially had to escape something in your initial query, like :
apoc.text.split(map['Tree Path'],'\\.') , and used
\ to escape
. only to find out it that this also needs escaping because the parameter is a REGEX (thank you for the REGEX but please do one with simple string) and
' for the attribute name, then, in your embedded sub-query you will need to: escape
\\' in your initial query (see otherwise) and escape the \ as
\\\\ (4 slashes, yes) in the sub-query, so that in the end it looks like
Otherwise:```Invalid input '.': expected '', ''', '"', 'b', 'f', 'n', 'r', 't', UTF16 or UTF32 (line 11, column 118 (offset: 425))
"case map['Tree Path'] when '(Root Code)' then -1 when map['Id'] then -2 else size(apoc.text.split(map['Tree Path'],'.')) end"
Disclaimer: posting images seems not to work,only the link is displayed ![image|690x153](upload://2SOu7g0rb18NF2yqw736TmPGiDx.png) ![image|690x228](upload://b8UteIyzxbZwv737T1i8IBqcQQX.png)