- Write functions() in lower case, KEYWORDS in upper.
START
each keyword clause
ON
a new line.- Use either
camelCase
orsnake_case
for node identifiers but be consistent. - Relationship type names should use
UPPER_CASE_AND_UNDERSCORES
. - Label names should use
CamelCaseWithInitialCaps
. MATCH (clauses)-->(should)-->(always)-->(use)-->(parentheses)-->(around)-->(nodes)
- Backticks `cân éscape odd-ch@racter$ & keyw0rd$` but should be a code smell.
- Don't put
(extra) --> (whitespace) - [:IN] -> (patterns)
- Except for
(line)-->
(breaks)
- If you want to wrap patterns across multiple lines, break
(after)-->
(arrows)
but(not)
-->(before)
- Try to chain patterns together
(instead)-[:OF]->(repeating),
(repeating)-->(nodes)
(right)<-[:TO]-(left)<-[:FROM]-(patterns)<--(write)<-[:TO]-(try)
Last active
April 1, 2020 09:57
-
-
Save technige/9366313 to your computer and use it in GitHub Desktop.
The Zen of Cypher
Great point, I have updated to reflect that :-)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Neat :-)
I got one nitpick though: the always use parentheses around node identifiers should probably be extended with when matching. I fancied using parentheses on all node identifiers - for consistency mostly, but that doesn't work when SETing a label, e.g. MATCH (n:Labbel) SET (n:ProperLabel) will not work, the node identifier must not have parenthesis in that case. I'm wondering though whether it should be that way ...