2. github.com/maxdemarzi
About 200 public repositories
Max De Marzi
Neo4j Field Engineer
About
Me !
01
02
03
04
maxdemarzi.com
@maxdemarzi
About 175 blog posts
3. • Relational Databases (quick version)
• Graph Databases (quick version)
• The most important Slide about Neo4j you will ever see
• Neo4j Desktop
• Setup
• Introduction to Cypher
• The Movies Dataset
• Questions
Agenda
5. Orders
OrderItemsOrderItems PK index
{Order_num, Item_num}
<m
<f5
>c11
<d112
Order_num=e1234567
<e4
>e120 Products
Products PK index
{product_num}
Manufacturer
Retailer
SQL Joins – using Primary Indexes
6 IO’s traversing the index
(plus a few if leaf is >1 page)
(do 6 times – 1 for each row)
7 IO’s traversing the index
(plus a few if leaf is >1 page)
5 IO’s traversing the index
(plus a few if leaf is >1 page)
(do 6 times – 1 for each row)
5 IO’s traversing the index
(plus a few if leaf is >1 page)
(do 6 times – 1 for each row)1 outer row + 7 index + 6 inner rows + 6(6 index + 1 row) + 6(5 index + 1 row) + 6(5 index + 1) row = 128 IO’s
7. 7
Native Storage and Processing
Neo4j disk and
memory structures
link data directly,
allowing
millions graph
traversals per
second per core.
Graph data and
paths between data
do not have to be
pre-defined before
they can be used.
8. Property Graph Model Components
Nodes
• Relate nodes by type and direction
• Can have Properties
• Can have Labels
• Can have Properties
name:”Dan”
born: May 29, 1970
twitter:”@dan”
name:”Ann”
born: Dec 5, 1975
Since:
Jan 10, 2011
brand: “Volvo”
model: “V70”
Car
LOVES
LIVES_WITH
D
RIVES
Person
O
W
NS
Relationships
Person
14. Neo4j Desktop: UI for developers & DB management
Supports “plugins”
• Neo4j official plugins
• Neo4j labs plugins
• 3rd party plugins
✓ Will ship with free Bloom plugin for use with local databases
managed by desktop only
Allows you to manage local databases
• Create, stop, start, manage
• Add apoc, procedures, etc.
• See log files, configuration, etc.
Allows you to connect to remote databases
• You can’t manage – but you can open browser
Supports organization via “projects”
15. Managing Databases
Only for local databases (on desktop)
Quick access to
• Logs
• (Configuration) Settings
• Plugins
• Upgrade
• Administration
Also quick access to file locations
• Database parent directory
• …or one of several common subdirectories
✓ Import (for copying csv’s for loading)
✓ Plugins
✓ Logs
✓ Configuration
16. Finding logs
Displays neo4j.log
Clicking on neo4j.log link…
• Takes you to the log directory
Fast access to
• Debug log
• Query log
• (Neo4j log)
• Security log
17. (Configuration) Settings
Modifies neo4j.conf
• Not an online operation
• Makes changes and the reboots system
For dynamic configurations:
• Use browser
• Cypher procs
✓ Call dbms.listConfig(<text pattern>)
✓ Call dbms.setConfigValue
18. Plugins
Fast way to install Neo4j plugins
What it does
• Gets correct version of plugins for Neo4j version
• Installs .jar file in ./plugins folder
• Modifies config file
• Restarts database
Note: After any upgrade
• Check – if it says install – install them (upgraded ones)
• You may need to delete the OLD jar first
✓ “Open Folder” ! Plugins
✓ Delete apoc*.jar
• If you don’t, server will fail on boot
✓ Due to duplicate jar files
19. Upgrade
Automates update process
Process
• Downloads version selected if not in repository
• Installs the version
• Copies data from old version to new version
• Performs upgrade
If it fails….
• Since it did a copy….not a problem
• Simply points back to original version
20. Administration
Only function is to set database password
• I always use “swordfish”
Alternate method for resetting password
• ./bin/neo4j-admin set-initial-password
21. How to get more plugins
Click on Graph Applications tab
• Click on “Discover more graph apps” link
It will launch install.graphapp.io
Pick and install
Recommended:
• Halin ! monitoring
• Query log analyzer ! analyzing query.log
• DB Analyzer ! space/disk/database monitoring
• Cloud Tool ! managing cloud instances of Neo4j
22. Notifications
Lets you know…
• If upgrades are available for any applications
• If upgrades are available for desktop overall
23. License keys
License keys
• Select “Add software key”
• Copy/paste link
• Only manages license keys for local database instances
managed by Neo4j desktop
24. Neo4j Browser
In reality
• Light weight web/javascript application
Purpose
• Cypher coding
• Quick/small visualizations
• Exporting result sets
Limitations – only one at a time
Available via your favorite web browser
• Same bolt protocol & UI
• Easy way to bypass the above limitation
https://www.youtube.com/watch?v=oHo-lQ79zf0&feature=youtu.be
25. Cypher vs. Client commands
Client commands are prefaced with “:”
• :exit
• :use <database>
• :params
• :auto
• …etc….
These are not cypher
• They are instructions to the client utility tool
✓ Neo4j Browser, cypher-shell, ….
• Which ones are supported depend on which utility and which
versions
The “:use” command
• When issued, it disconnects/reconnects with new database
name
26. Recommendation of things to do immediately
Enable multi-statement query editor
• Or scripts with more than one query will fail
✓ ….those create constraint scripts with ;’s
Clean initial command of :play start
• ….annoying…..
If performance is an issue
• De-select “Connect result nodes”
✓ In case you wondered…
✓ After every query executes, the browser executes a separate query
for each node to find any connections between them that the
query didn’t explicitly expose
✓ With any complicated result set – this can slow things considerably
• You can also reduce the result set size
✓ …or increase if exporting
27. Node Labels/Relationship Types
Displays a list of…
• Node labels
• Relationship types
• Properties
Runs a quick query
• Returns the first 25 values it finds
✓ Not necessarily in any order and not necessarily the same ones
each time…
• Be careful with relationship types
✓ Uses a label scan….so may not be fast…might be a few seconds to
return
28. Saved Scripts
Lets you save frequent queries
• …as typical
You can organize in folders
• Better than trying to find the needle in haystack
You can export to a zip archive
• Good to do before any upgrades to desktop!
No import capability
• Not sure where they are saved normally
• Workaround is to ….
✓ Export to zip
✓ Unzip to individual cypher queries
✓ Copy paste into browser and resave
29. Documentation
Quick access to links for Neo4j documentation
• Links – not local – opens web browser
List of browser commands
Access to online resources
• GraphGists
• Developer site
30. Query Editor in Browser
Careful!!!
• <ENTER> executes the query
✓ Source of a lot of syntax errors
✓ Wish this was configurable
• <Shift><ENTER> for CR/LF in editor
• <ESCAPE> full screen editor mode
Controls
• Star ! favorites
✓ If using a favorite query, it changes to a pencil to signify editing the
query
• Eraser ! clears query editor
• Play ! executes query
31. Query Execution
If running for a long time
• X will try to cancel…
• ….but if it is the layout taking time (very often) the only way to
kill is to quit the browser and reopen
Controls
• Download ! Export
• Pin ! pins to top
✓ Useful with db.schema.visualization
✓ Also useful with outputs using as literals for next queries
• Full screen mode
• Collapse ! used with query plan output
• Re-run ! reruns the query reusing same output window
✓ One side effect is that it immediately scrolls to top of browser
unless you change setting
• X/Close ! Closes window; attempts to abort query and
close window if still running in database
✓ If you want to analyze query for slowness click on query text first
to reload into browser before hitting X
32. Query Results
Graph
• A rudimentary graph depiction of the results
• Can be customized (colors, sizes, captions, etc.)
Table
• Displays output in tabular form
• If return is a node or relationship, a JSON map will be
displayed
Text
• Pure ascii text in JSON map format
• Display width is configurable
Code
• Query text
• Summary of query impact/write operations
• Response: JSON structure of results
33. Working with Neo4j Customer Success Team
Slow query?
Execute with EXPLAIN or PROFILE
• EXPLAIN ! query plan only without execution
✓ Estimates only
• PROFILE ! query plan & stats after execution
• Adds “Plan” tab to results
Sending
• Expand all
• Export to JSON
✓ For quick access to stats values, etc.
• Export to SVG
✓ Graphic representation that can be emailed
Collapse/Expand
• Collapses, expands query tree as desired
34. Who ya gonna call??
Sales
• Overall account management
✓ Can help coordinate with anyone needed
• Has pre-sales engineer for technical assistance
• Can coordinate with consulting for short term engagements
✓ Or facilitate with partner for long term projects
Pre-sales
• Assists with pre-sales and some post-sales activity
• Can come on site (if allowed and no covid-19)
• Short (1 week or less) POC’s, demo’s, how-to’s
• Has lots of accounts (many 10’s) – “interrupt driven”
Customer Success
• Best practices, architecture, review data modeling
• Help with cluster setup, configuration, architecture
• They don’t fix bugs – they can help you open a case though
• They mainly help you when stumped with implementation
problems
✓ Help with query tuning/diagnosing performance issues
✓ Help diagnose problems you are having
Engineering
Sales
Pre-Sales Engineer
(aka Field Engineer)
Professional Services
Customer Success
Engineer
(aka Field Engineer)
Customer Success Manager
Support Engineer
Developer Relations
Neo4j Community
https://community.neo4j.com
Community Edition Enterprise Edition
Enhancementrequests
Questions, Defects
Enhancement requests
Assigns
Coordinates
Short technical
Knowledge Base
Articles
Points you to…
36. Create a new empty database instance
Start Neo4j Desktop
Create a new empty database
• Create a local graph
• Change the database name to whatever you want
• Enter a password you will remember
• Optional: Select the version
✓ Note that if you pick a version other than the one downloaded with
desktop, desktop will need to download the specified version –
which can take a while
• Press “Create”….
37. Starting the database server
Press Start
• Spawns JVM (neo4j is native java)
Database goes through recovery
• Reads config file
• Opens database files
• Plays back any missing transactions from log
• Loads plugins
• Etc. ….
Started….
Open it
50. What is Cypher?
Declarative query language
• Focuses on what, not how to retrieve
• E.g. optimizer figures out best approach
Uses CLAUSE keywords such as
• MATCH, WHERE, CREATE, UNWIND, WITH, MERGE, …
Is a dataflow/pipelined language
• Results of each clause in a statement flow into next as
materialized
Multi-statement batches supported
• Each statement terminated with “;” (semi-colon)
Runs in the database for the graph
• Each database has its own query engine
• As of 4.0, no cross-db queries (due to the above)
Graph Model ! Cypher
• Nodes ! nodes or node labels (depending on context)
• Edges ! relationship types
Foundation for ISO standard query language
• For graph databases
MATCH <pattern> [, <pattern> [, …]]
[WHERE [NOT] <expression> <op> <expression>
[[AND | OR | XOR] [NOT] …]
[OPTIONAL MATCH [WHERE …]]
[WITH [DISTINCT]
[WHERE]
[ORDER BY]
[LIMIT]]
[MATCH […]]
[CALL [YIELDING]]
RETURN [DISTINCT]
[ORDER BY … [ASC|DESC]]
[[SKIP] LIMIT]
[UNION [ALL]]
…
51. What is Cypher? (cont)
Similar to other declarative languages
• SQL like syntax….sort of
✓ MATCH ! FROM + JOIN
✓ WHERE ! WHERE
✓ RETURN ! SELECT
✓ CREATE ! atomic insert
✓ MERGE ! upsert/merge
✓ DELETE ! delete
Supports expressions, functions, procedures
• Including CASE expressions
• Large set of pre-defined functions/procedures
• User Defined Functions (UDF) or custom stored procedures
can be developed in Java
✓ Support for direct API’s into graph structure vs. sending cypher for
interpretation
CREATE
[WITH MATCH …]
MATCH
[WHERE]
[MERGE
[ON MATCH SET]
[ON CREATE SET]]
[SET | REMOVE]
[[DETACH] DELETE]
[MERGE …]
[WITH]
[MATCH …]
52. 52
Cypher is ASCII Art
In graph model
• Nodes are circles with labels
✓ nouns, objects, stuff
✓ In neo4j, the standard is to use “WordCaps” capitalization
✓ A “node” is a specific instance of a label
• Relationship types are arrows with types
✓ verbs, association
✓ In neo4j, the standard is to use “ALL_CAPS” capitalization
✓ A “relationship” is a specific instance of a relationship type
• Properties are attributes of either label or relationship type
✓ In neo4j, the standard is to use “camelCase” capitalization
Cypher ASCII art (MATCH clause)
• ( ) – [ ] -> ( )
• (label)-[relationship_type]->(label)
ASCII art meets Schema
• Cypher uses “labels” to identify the node/relationship type
being referenced if not referring to a node/relationship from
an earlier clause
• (:label)-[:rel_label]->(:label)
(:AccountHolder)-[:HAS_ACCOUNT]->(:Account)
(:Account)-[:WITHDRAWALS]->(:Transaction)
53. Cypher is ASCII Art
A
B C
LIKESLIKES
LIKES
(A)-[:LIKES]->(B),(A)-[:LIKES]->(C),(B)-[:LIKES]->(C)
(A)-[:LIKES]->(B)-[:LIKES]->(C)<-[:LIKES]-(A)
54. Neo4j is a NoSQL/Schema-less/ “Schema-optional” DBMS
• A loose schema can be created using a combination of constraints & indices
✓ E.g. You can enforce that certain properties exist (not null) and are unique, but you cannot enforce a datatype nor a relationship
Classic schema components supported
• Unique constraints
• Node key constraints (aka “Primary Key”) – multi-column
• Indexes (multiple-column) – but only on node properties
• Exists constraints (aka “not null column”)
Labels, Relationship Types, Property & Variable Names are Strings
• Must begin with a letter (1stbase ! no; Base1 ! yes)
• Cannot contain symbols – except underscore (@myvar ! no; my_var ! yes)
• Can contain numbers
• Can be really really really long (64k)
• Exception: references to parameters begin with $
• Weird values/spaces can be escaped with backticks (`this is a valid name`)
✓ Equivalent to the “double quotes” in SQL
Properties can be one of the supported datatypes
Cypher & Schemas
55. Unique Constraint & Node Key
Unique Constraint
• Only supports a single column
• Useful for Nodes properties that are “identities” (username, email
address, product number, serial number, etc)
✓ Creates an index automatically
Node Key Constraint
• Essentially, the primary key
✓ Specifies the columns (one or more) that comprise the unique attributes to
identify a node
• Except more than one allowed (alternate keys)
• Essentially a unique + exist constraint
✓ Creates an index the same as a unique constraint does
Constraint Admin
• Recreating (same columns) simply updates existing one
✓ No need to do if exists() DROP CONSTRAINT in scripts
• Recreating with different columns creates a second node key
• Call db.constraints to see list
// 3.5 Syntax
CREATE CONSTRAINT ON ( city:City ) ASSERT
(city.cityName, city.stateCode, city.countryCode) IS NODE KEY;
DROP CONSTRAINT ON ( city:City ) ASSERT
(city.cityName, city.stateCode, city.countryCode) IS NODE KEY;
// 4.0 Syntax
CREATE CONSTRAINT City_key ON ( city:City ) ASSERT
(city.cityName, city.stateCode, city.countryCode) IS NODE KEY;
DROP CONSTRAINT City_key;
// See all constraints
CALL db.constraints
// Unique Constraint
CREATE CONSTRAINT ON ( acct:DepositAccount ) ASSERT
(acct.accountNumber) IS UNIQUE;
56. Exists Constraints
Exists Property Constraint
• Equivalent to NOT NULL in SQL for column attribute
• Attempting to create a node without a value for this property
or removing this property fails
Both Nodes & Relationship Exists Property
• On a node, enforces that the property exists (and has a value)
• Same thing for a relationship
• No way to enforce that a relationship exists
✓ E.g. no equivalent to an Fkey!Pkey enforcement
✓ That’s because both nodes have to exist before the relationship can
be created (chicken & egg problem)
// 3.5 Syntax
// 4.0 Syntax …is similar to previous examples
CREATE CONSTRAINT ON (acct:DepositAccount) ASSERT
EXISTS(acct.balance);
CREATE CONSTRAINT ON ()-[er:ENTITY_RESOLUTION]-() ASSERT
EXISTS(er.confidenceFactor);
DROP CONSTRAINT ON (acct:DepositAccount) ASSERT
EXISTS(acct.balance);
DROP CONSTRAINT ON ()-[er:ENTITY_RESOLUTION]-() ASSERT
EXISTS(er.confidenceFactor);
// This works
CREATE CONSTRAINT ON (acct:DepositAccount) ASSERT
EXISTS(acct.balance);
// This or anything like it doesn’t work – strictly exists()
CREATE CONSTRAINT ON (acct:DepositAccount) ASSERT
EXISTS(toFloat(acct.balance));
57. Indices (Normal Indexes)
Indexes
• Created on a LABEL with properties
✓ Be careful with multiple labels
• Supports multiple columns
• Builds a standard B-Tree
• Equivalent to Non-Unique Indexes in SQL
Index for performance
• Only used if LABEL is referenced in MATCH/MERGE/DELETE/
CREATE clauses
✓ When using multiple labels, mention both the desired label and
ultimate parent node label
✓ Examples of this later
• Used for all the usual predicates
✓ equality check: n.prop = value
✓ list membership check: n.prop IN list
✓ existence check: exists(n.prop)
✓ range search: n.prop > value
✓ prefix search: STARTS WITH
✓ suffix search*: ENDS WITH
✓ substring search*: CONTAINS
*Note: effectively both of these do index leaf scans vs. B-tree traversal
Index Notes
• No equivalent to “Clustered” Indexing
• CALL db.indexes to see indices
// 3.5 Syntax
// accountName property for ALL account holders is indexed
CREATE INDEX ON :AccountHolder(accountName);
// businessName property is only indexed for BusinessCustomer
// labeled account holders (sparse indexing?)
CREATE INDEX ON :BusinessCustomer(businessName);
// lastName & firstName properties are only indexed for Customer
// labeled account holders (sparse indexing?)
CREATE INDEX ON :Customer(lastName,firstName);
DROP INDEX ON :AccountHolder(accountName);
DROP INDEX ON :BusinessCustomer(businessName);
DROP INDEX ON :Customer(lastName,firstName);
// See all indices
CALL db.indexes
// 4.0 Syntax
CREATE INDEX AcctName_idx FOR (acct:AccountHolder) ON (acct.accountName);
CREATE INDEX BusName_idx FOR (bc:BusinessCustomer) ON (bc.businessName);
CREATE INDEX CustName_idx FOR (cust:Customer)
ON (cust.lastName,cust.firstName);
DROP INDEX AcctName_idx;
DROP INDEX BusName_idx;
DROP INDEX CustName_idx;
58. Indices (Node Key, Unique Constraints & Index)
Critical for finding starting point(s)
• While it is true we don’t need indices for traversals, we do
need them for unique enforcement as well as anchor points
An index on :Account.accountHolderID is not need – just
traverse from :AccountHolder instead
Critical for using MERGE statements
• MERGE statements without Indexes must Scan all nodes of a
particular label
59. Text Indexing
Full Text Indexes
• Can span more than one node
• Can have multiple properties
• Supports different languages, etc.
• Maintained automatically
• Only index available for Relationships
✓ But effectively only good for near equality matches as range,
etc. won’t work correctly due to lexical sequencing vs. numeric,
etc.
When to use
• When storing paragraphs of text to search (e.g. knowledge
graphs)
• Finding relationships based on String datatype property
values
Can be used with Linkurious
• Scales better than included ElasticSearch
• Supports Linkurious clustering better – and allows virtual
clusters
• Used for AlternateNodeID’s for retrieving visualizations
saved to disk when DB id’s change (e.g. if rebuilding
database each night)
• Allows full query integration
Usage Procedure Description
Create full-text node
index
db.index.fulltext.createNodeIndex Create a node fulltext index for the given labels and properties.
The optional 'config' map parameter can be used to supply
settings to the index. Supported settings are 'analyzer', for
specifying what analyzer to use when indexing and querying.
Use the db.index.fulltext.listAvailableAnalyzers procedure to
see what options are available. And 'eventually_consistent'
which can be set to 'true' to make this index eventually
consistent, such that updates from committing transactions are
applied in a background thread.
Create full-text
relationship index
db.index.fulltext.createRelationshipIndex Create a relationship fulltext index for the given relationship
types and properties. The optional 'config' map parameter can
be used to supply settings to the index. Supported settings are
'analyzer', for specifying what analyzer to use when indexing
and querying. Use
the db.index.fulltext.listAvailableAnalyzers procedure to see
what options are available. And 'eventually_consistent' which
can be set to 'true' to make this index eventually consistent,
such that updates from committing transactions are applied in a
background thread.
List available analyzers db.index.fulltext.listAvailableAnalyzers List the available analyzers that the full-text indexes can be
configured with.
Use full-text node
index
db.index.fulltext.queryNodes Query the given full-text index. Returns the matching nodes
and their Lucene query score, ordered by score.
Use full-text
relationship index
db.index.fulltext.queryRelationships Query the given full-text index. Returns the matching
relationships and their Lucene query score, ordered by score.
Drop full-text index db.index.fulltext.drop Drop the specified index.
Eventually consistent
indexes
db.index.fulltext.awaitEventuallyConsisten
tIndexRefresh
Wait for the updates from recently committed transactions to be
applied to any eventually-consistent full-text indexes.
60. Node/Relationship properties
• Do not have to have the same datatype for the same property name on different object
CREATE (:Person {name: “Jeff Tallman”, ssn: “123-45-6789”, born: date(“1900-01-01”)}) // born is a date
CREATE (:Person {name: “Julius Ceasar”, born: “12 July 100 BC”, died: “15 March 44 BC”}) // born/died are strings
CREATE (:Person {name: “Leonhard Euler”, born: date(“1707-04-15”), died: date(“1783-09-18”) }) // born/died are dates
• Two objects do not need to have the same property list
CREATE (:Customer {lastName: “Tallman”, firstName: “Jeff”})
CREATE (:Customer {businessName: “Neo4j”})
• Allows a lot of flexibility, but can cause queries to fail/break
If a property doesn’t exist, the value is considered to be NULL
MATCH (p:Person) WHERE p.name=“Your Name”
RETURN p.name, p.born, p.died //returns NULL for “died”
A unique constraint only constrains nodes where the property exists!!
• Therefore a unique constraint can be created on Person.ssn even though Julius Ceasar and
Leonhard Euler both lack the “ssn” property
Schema-less/Schema Optional & Properties
61. Storage Types
• Very basic java types
✓ Number subtypes Integer and Float
✓ String
✓ Boolean
✓ The spatial type Point
✓ Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration
• The default type is String – you will need to cast to other types when loading
✓ toInteger(), toFloat(), date(), datetime()
• Storing of arrays/lists of basic types allowed, but no maps (JSON)
Structural (Dynamic) Types
• ‘Dynamic’ types can be used in cypher (e.g. variables), but not stored natively
✓ Nodes, Relationships, Paths
✓ Maps (e.g. JSON)
✓ Lists/arrays of more than one homogeneous type
Missing datatypes
• Use a “String” or use an Array of Bytes
Cypher Schema: Datatypes
62. Working with date parts
• Use dot notation
• E.g. myDate.month, myDate.day, ….
Date math
• First, compute duration (e.g. duration.inDays(date1,date2))
✓ E.g. WITH duration.inDays(account.dueDate,account.paymentDate) as myDuration
• Then use dot notation much like with dates
✓ E.g. myDuration.days > 30
• Other things that work
✓ Date comparisons ! date1 [<|>|=|<=|+>] date2
This is also true of any “structure” datatype in Cypher
• Node.property, Relationship.property
• Map.property
Date Datatypes in Cypher
64. Create a new database (graph) (1)
Launch browser
• You will automatically be connected to the “default” database
– which by default is “neo4j”
Enter “:use system”
• Don’t forget the colon
✓ This tells the browser it is a client command vs. cypher to send to
the server
• This will switch your connection to system database
New databases can only be created in the
system database
• Along with a few other commands that are restricted to
system database environment
• If you forget, Neo4j will tell you
65. Create a new database (graph) (2)
Enter “create database movies”
If it succeeds…you will still be in system db
Connect to “movies” database
• Type “:use movies” (note colon)
…or…
• Select the metadata menu (database icon)
• Select movies from drop down
Prompt should read “movies”
66. Load the Movies data (1)
Use the command
• :play movies
Pin the result pane
Press “NEXT” Button (>)
67. Load the Movies data (2)
Click on the code block
• Copies queries to editor
View cypher
• Click in editor
• Hit ESCAPE key
• Scroll around a bit and look at the cypher
✓ We will discuss the CREATE verbs later
• Hit ESCAPE to exit full screen editor
NOTE:
• There is only 1 semi-colon (line 508)
• Yes – this IS one big Cypher statement
✓ Not multiple statements …..ONE statement
✓ Hundreds of clauses – one statement
✓ One statement ! it has to be one transaction
68. Load the Movies data (3)
Execute the cypher
• Creates 171 nodes of 2 LABELS
• Creates 253 relationships in 6 relationship types
View results
• Default is graph mode due to RETURN statement
• Select table button
• Select text button
• Re-select graph button
69. Style the results (1)
Go full screen mode
• This can be done in normal pane mode as well
Select the Person label at top left
• Notice the bottom edge is now a style guide with colors, sizes
and caption properties
Select a new color
Repeat for Movies
70. Style the results (2)
Select the DIRECTED relationship type
Select a new width for line
• Not too wide
Select a new color for line
…this is visualization in most primitive form
• …but it does provide fast visual acuity for looking at results
when in graph form
Press expand icon to reshrink pane
73. Simple MATCH statements
Go to next page
Select & execute each statement
• One at a time
NOTE: 3rd (& 4th) query results are tabular
• Any query that returns a “node” defaults to graph mode
• Any query that doesn’t return a node, but rather a list of
properties defaults to tabular mode