Tuesday, February 18, 2020

Neo4j Graph Database Basics 2020-2021

Neo4j models graphs - relationships (edges) of nodes. It is in contrast with Relational Database, traditional tabular database. SQL Joints are expensive, costly, and hard-to-learn (confusing for analysts). 

UI - Neo4j Browser

Neo4j Browser is the query workbench using JavaScript bolt under the hood. Bolt is a binary protocol, a fast one, Neo4j uses for connections. 

Data Modeling

First step of getting started with graph database is to model the data in a graph. It is important to model and store data as a graph. 

Neo4j uses a property graph model. 

Neo4j can store direction one way but can query either ways. There are four main elements: node, can be labeled, similar to SQL table name, can have key property value pairs. Property can go on node or labels. 


Data modeling can be done with a white board or using apjones Arrows App 


Neo4j cypher query executed in session get back cursor of records

Cypher is an open sourced graph database query language, a part of the open cypher project. Other graph databases use cypher too. Not just Neo4j

Cypher versus SQL Comparison


View Schema

Call apoc to view schema

CRUD with Cypher Neo4j

SELECT all nodes

SELECT all nodes with a specific label
MATCH (n:Label)

Match all relationships in neo4j graph

Neo4j create statement
CREATE(nodefirst:Label {propertname:"Property Name", propertyagain:99999})
CREATE (nodeagain)-[:REL_TO { roleproperty: ["List Item"]}]->(nodefirst)

Call - cypher keyword to call functions and procedures

Read more about user defined procedures source 11

You try write and customize your own procedure
Cypher styling and query guide source 12

Graph database can also be queried and modeled using ORMs. 


"Just in time for GraphConnect, Michael released version of the popular APOC library. This release has support for defining custom procedures and functions implemented in plain Cypher and then calling them like regular ones, as well as a new procedure for scraping web pages" - May 2020 

Use cases for Neo4j
Salmon researchers, salmon hatchling in northern atmosphere, knowledge graph
Neo4j for journalist
Panama paper is available as a sandbox dataset
Investigative journalist: panama paper paradise paper
Relationship model can be super insightful in data analysis and for relationship modeling, Neo4j is great.

Can even use graph for chemicals drug discovery

Use for recommendation collaborative filtering

Fraud prevention

Use graph when context matters. How did the data result happen?

Graphing interaction data is also very useful. Relationship data is important.

Neo4j lead data scientist Alicia Frame PhD talks works on graph algorithms

Learn Neo4j (Neo4j Tutorials)

Neo4j Sandbox Feature : Neo4j tutorials can be run in Neo4j Sandboxes

Use :play to launch Neo4j tutorials

Using the :play feature in Neo4j sandbox and sandbox datasets, you can give your cypher skill a try and get started with Neo4j. It is insightful, easy and a lot of fun.

You can create your own Neo4j Browser Guide (tutorial). 

Graph Academy

Neo4j 4.0

Advanced Neo4j Experts

You can become a Neo4j Ninja, Neo4j expert, and join the Neo4j Speaker Program. Neo4j investigative journalism program

Certification available

Neo4j Community and Neo4j Universe

"GraphXR is a browser-based visual analytics platform that delivers unprecedented speed, power, and fluidity to anyone working with connected, high-dimensional, and big data." GraphXR in its own words.

Become a super user
Become a Neo4j Ninja
Load CSV

GRANDSTACK - Hosting Neo4j Website

Neo4j Desktop : allows managing multiple projects databases
Neo4j Graph Apps: graph apps are applications that interact with Neo4j database through the desktop app. Graph apps are single page applications (SPAs) that are built with vanilla JavaScript or front end web development frameworks. 

Advanced Algorithms with Neo4j  | Advanced Graph Algorithms

Use call to launch Neo4j helper functions, stored procs, and algorithms

Page Rank

Neo4j NLP library

Graph Academy | Getting Certified
Certification exam 
Duration 1 hour 80 questions
Introduction to Neo4j Online Course and Tutorial
Duration 1 day
Course Outline
Introduction to Graph Databases
Introduction to Neo4j
Setting up your Development Environment Tutorial
Introduction to Cypher
Getting More out of Queries
Creating Nodes and Relationships
Getting More out of Neo4j

graphaware has plugin for tokenization
3rd party natural language processing platform for neo4j graphs

No comments:

Post a Comment

Machine Learning for Beginners Resources

Uniqtech guide to Machine Learning. This guide explains the difference between machine learning, traditional programming, machine learning w...