MATCH (a:t-code {id:'8d994a8861c6ca6bf0d0dede5c862bd3'})
MATCH (b:connections {id:'03817a80b08e323fb66b80e5ccc2f0d4'})
CALL apoc.merge.relationship(a, 'uses', {}, {}, b)
YIELD rel
RETURN rel;
It reports an error in 'a:t-code'. In practical graph, this support is desirable. I just want to confirm whether this is not supported, or I did something wrong. Similarly, the node type could contain characters, like '/'.
though the Neo4j version has not been provided, v5 states
The - (dash) and . (dot) characters are not legal in Cypher variables.
Names with a - in them must be enclosed within backticks. For example,
CREATE DATABASE `main-db` is a valid database name. Database names
are the only identifier for which dots do not need to be escaped. For
example main.db is a valid database name. However, this behavior
is deprecated due to the difficulty of determining if a dot is part
of the database name or a delimiter for a database alias in
a composite database.
Because I can't expect what label strings (open information extraction) may contain those special characters, so when creating those cyphers, it's good to consistently use backtick to enclose any node label. Does that make sense?
My commonsense view says you should sanitize any external content that you are using to create labels. Otherwise, you are exposed to injection attacks.