Coder Social home page Coder Social logo

spring-boot-neo4j-example-1's Introduction

Spring Boot with SpringData Neo4J

Users rate different movies (like IMDB). Hence Users will have RATED relationship on Movies.

Version used

  • Spring Boot - 1.5.14.RELEASE
  • Neo4J Bolt Driver - 2.1.1

REST endpoint

  • /rest/neo4j/user - returns all users and their relationships (movies)

Neo4J

  • Docker command to bring up Neo4J server
docker run --publish=7474:7474 --publish=7687:7687 neo4j:3.0
  • Neo4J Browser URL
http://localhost:7474/browser

Cypher Queries for Neo4J

  • Creation of Movie and User nodes:
CREATE (Inception:Movie {title: 'Inception', director: 'Christopher Nolan'})
CREATE (DarkKnight:Movie {title: 'The Dark Knight', director: 'Christopher Nolan'})
CREATE (Peter:User {name: 'Peter N', age: 30})
CREATE (Sam:User {name: 'Sam Sheldon', age: 20})
CREATE (Ryan:User {name: 'Ryan A', age: 35})

CREATE
(Inception)-[:RATED {rating: 9}]->(Peter),
(Inception)-[:RATED {rating: 8}]->(Sam),
(DarkKnight)-[:RATED {rating: 9}]->(Sam),
(DarkKnight)-[:RATED {rating: 8}]->(Peter)

;
  • Adding new relationship
MATCH (DarkKnight:Movie {title: 'The Dark Knight'}), (Ryan:User)
CREATE
(DarkKnight)-[:RATED {rating: 8}]->(Ryan)
;

spring-boot-neo4j-example-1's People

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.