cypher structure

Dataset

Create an account on Neo4j Aura

Getting started with Neo4j in Docker

Creating the Docker Compose Files

Create a docker-compose.yml file and copy the following snippet into it:

yaml
services:
  neo4j:
    container_name: neo4j
    image: neo4j:latest
    ports:
      - 7474:7474
      - 7687:7687
    environment:
      - NEO4J_AUTH=neo4j/${NEO4J_PASSWORD}
      - NEO4J_apoc_export_file_enabled=true
      - NEO4J_apoc_import_file_enabled=true
      - NEO4J_apoc_import_file_use__neo4j__config=true
      - NEO4J_PLUGINS=["apoc", "graph-data-science"]
    volumes:
      - ./neo4j_db/data:/data
      - ./neo4j_db/logs:/logs
      - ./neo4j_db/import:/var/lib/neo4j/import
      - ./neo4j_db/plugins:/plugins

Load dataset

cypher
LOAD CSV WITH HEADERS
FROM 'https://raw.githubusercontent.com/MidnightSkyUniverse/udemyNeo4j/master/data/titles_and_skills.csv'
AS row
RETURN row.Title, row.Skills
LIMIT 15;
Neo4j Knowledge Graph

Working with docker-compose

bash
sudo
docker-compose -f docker-compose.yml exec neo4j /bin/sh

neo4j-client

Ubuntu

text
$ sudo add-apt-repository ppa:cleishm/neo4j$ sudo apt-get update$ sudo apt-get install neo4j-client
libneo4j-client-dev

Download UI

text
chmod a+x neo4j-desktop-1.6.0-x86_64.AppImage./neo4j-desktop-1.6.0-x86_64.AppImage
Neo4j Knowledge Graph

Create Constraints

sql
CREATE CONSTRAINT skillUniqueIF NOT EXISTSFOR (s:Skill)REQUIRE s.name IS UNIQUE;
CREATE CONSTRAINT
titleUniqueIF NOT EXISTSFOR (t:Title)REQUIRE t.name IS UNIQUE;
SHOW ALL CONSTRAINTS;
Neo4j Knowledge Graph

Create ‘Title’ nodes

cypher
LOAD CSV WITH HEADERS
FROM 'https://raw.githubusercontent.com/MidnightSkyUniverse/udemyNeo4j/master/data/titles_and_skills.csv'
AS row
MERGE (t:Title {name: row.Title});
Neo4j Knowledge Graph

Match Title

cypher
MATCH (n:Title) RETURN n LIMIT 25
Neo4j Knowledge Graph

Create ‘Skill’ nodes

cypher
LOAD CSV WITH HEADERS
FROM 'https://raw.githubusercontent.com/MidnightSkyUniverse/udemyNeo4j/master/data/skills_details.csv'
AS row
MERGE (s:Skill {name: row.Skill})
SET
    s.id = row.ID,
    s.description = row.Description,
    s.category = row.Category;

https://raw.githubusercontent.com/MidnightSkyUniverse/udemyNeo4j/master/data/skills_details.csv

Neo4j Knowledge Graph

Your Business — On AutoPilot with DDImedia AI Assistant
(Join Our Waitlist)

Visit us at DataDrivenInvestor.com

Join our creator ecosystem here.

DDI Official Telegram Channel: https://t.me/+tafUp6ecEys4YjQ1

Follow us on LinkedIn, Twitter, YouTube, and Facebook.