Code Monkey home page Code Monkey logo

hanryu's Introduction

Based on neo4j:4.2.0

Quickstart

  1. Build the image and start the neo4j container

    export TAG=`date +"%Y%m%d%H%M"`
    export PW= #insert password here
    export NEO4J_AUTH=neo4j/$PW
    docker build --no-cache --build-arg NEO4J_AUTH -t hanryu/tracker:$TAG .
    rm -R $(pwd)/data/{databases,dbms,transactions}
    docker run -p7474:7474 -p7687:7687 -v $(pwd)/import:/import -v $(pwd)/data:/data \
    -e NEO4J_AUTH=$NEO4J_AUTH --user=$(id -u):$(id -g) hanryu/tracker:$TAG &
    unset NEO4J_AUTH

    Run ctrl + C or docker stop $(docker ps | grep hanryu | cut -d" " -f1) to stop the container.

    If you've previously created the database i.e. in $(pwd)/data, remember to remove the subdirectories when changing passwords. The database will otherwise expect the password you used the first time you set it up.

Step-by-step

  1. Start the neo4j container

    export PW= #insert password here
    docker run -p7474:7474 -p7687:7687 -v $(pwd)/data:/import -e NEO4J_AUTH=neo4j/$PW neo4j

    See How-To: Run Neo4j in Docker

  2. Go to http://localhost:7474/browser/ on your favourite browser

  3. Load data and display (see cypher script)

    LOAD CSV WITH HEADERS FROM 'file:///Cast.csv' AS row
    UNWIND split(row.Role, ' / ') AS name
    MERGE (role:Role {title: row.Title
    ,                 role:  name
    ,                 actor: row.Actor
    })
    WITH role, row
    MATCH (title:Title {title: row.Title})
    MATCH (actor:Actor {actor: row.Actor})
    // Create relationships between actors, roles and titles
    MERGE (actor)-[:AS]->(role)
    MERGE (role)-[:IN]->(title)
      ON CREATE SET role.Role = row.Role;
    
    // Display
    MATCH p = ()-[]-()-[]-()
    RETURN p
      LIMIT 750
    
    // up to 6 deg of separation
    match p=(:Actor {Actor: 'Park Hyung-sik'})-[*1..6]-(:Title) return p

References

stackoverflow docker-neo4j

hanryu's People

Contributors

ellaqezi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.