- 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.
This is a Neo4J GraphGist where I discover how to model pedigrees in Neo, and various Cypher queries to explore the data.
The data used is from a public available online pedigree of cats. I have stripped of all the names and registration data for simplicity. From a large dataset, I have extracted all the cats belonging to the very small breeds, giving a total of about 600 cats instead of 200K.
The following picture shows a sketch of my general data-model. The arrows between cats could also have been illustrated as "recursive" arrows back to the same cat node-type, but I think that this visualisation better describes the DAG (Directed Acyclical Graph) property of a pedigree/family tree.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage neo.sh [-h host:port] [-u user:pass] [cmd] | |
# end cypher statements with semicolon | |
# terminate read loop with ^d or return | |
HOST="localhost:7474" | |
if [ "$1" == "-h" ]; then | |
shift; HOST="$1";shift; | |
fi | |
AUTH="" |