Create your own awesome maps

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account?
Log In

Neo4j by Mind Map: Neo4j
0.0 stars - 0 reviews range from 0 to 5

Neo4j

Introduction

NOSQL Categories

KeyValue store, Amazon Dynamo db, Redis

Column table, HBase, Cassandra

Document, MongoDB, CouchDB

Graph databases, Neo4j, AllegroGraph, Sones

Scalability and complexity

Characteristics

Full Acid transactionsServer with REST APIstable in prod since 2003

When to use

more connected - graphtall and connected - key value

Why Graph databases

Use cases

Recommendations Social computing Web analytics Location data MDM Web of things

Performance

Difference with RDBMS

relationship part of data whereas it is part of schema in rdbms

Terms

Nodes Relationship between nodes Properties / attributes (nodes/relationship)

Nodes

Relationship

Property

Path

Overview

What is Neo4j

Graph db

Node connected by relationship

key value pairs on nodes and relationships

written in Java

schema free

Fully transactional (ACID)

integrated indexing

lot of language bindings - java, scala etc.,

Cypher Query language

describe what you want, not how

based on pattern matching

Traversal API/ DSL

Graph algorithm library, Cheapest path, Shortest path

Server

Embeddable or standalone server

Operations

Creating new nodes

Setting attributes

Setting relationship between nodes

Traversal

Spring data neo4j

Advantages of apring

POJO centric app design

IOC / dependency injection

transaction management

Template programming model

Annotation based

Lots of powerful and easy to use libraries

Spring data project

Features

Tags

@NodeEntity, Represents a node, Fields saved as properties on node

@RelationshipEntity, represents a relationship, fields are saved as properties on relationsip, special fields for start and end nodes

@Indexed, Becomes searchable

@Query

neo4jtemplate

steps

Getting started

Setup, Maven entries, <dependencies> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-neo4j</artifactId> <version>1.0.0.RELEASE</version> </dependency> </dependencies> <repositories> <repository> <id>spring-maven-snapshot</id> <snapshots><enabled>true</enabled></snapshots> <name>Springframework Maven MILESTONE Repository</name> <url>http://maven.springframework.org/milestone</url> </repository> </repositories>, Hook aspectJ into maven plugin, <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.0</version> <configuration> <outxml>true</outxml> <aspectLibraries> <aspectLibrary> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </aspectLibrary> <aspectLibrary> <groupId>org.springframework.data</groupId> <artifactId>spring-data-neo4j</artifactId> </aspectLibrary> </aspectLibraries> <source>1.6</source> <target>1.6</target> </configuration> <executions> <execution> <goals> <goal>compile</goal> <goal>test-compile</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.11.RELEASE</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjtools</artifactId> <version>1.6.11.RELEASE</version> </dependency> </dependencies> </plugin>, Spring configuration, <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:datagraph="http://www.springframework.org/schema/data/graph" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/data/graph http://www.springframework.org/schema/data/graph/datagraph-1.0.xsd "> <context:annotation-config/> <datagraph:config storeDirectory="target/config-test"/> </beans>

Creating entities, @NodeEntity public class World { @Indexed private String name; @Indexed( indexName = "moons" ) private int moons; @RelatedTo( type = "REACHABLE_BY_ROCKET", direction = Direction.BOTH, elementClass = World.class ) private Set<World> reachableByRocket; public World() {} public World(String name, int moons) { this.name = name; this.moons = moons; } public String getName() { return name; } public int getMoons() { return moons; } public void addRocketRouteTo( World otherWorld ) { reachableByRocket.add( otherWorld ); } public boolean canBeReachedFrom( World otherWorld ) { return reachableByRocket.contains( otherWorld ); } }

Resources

https://github.com/SpringSource/spring-data-neo4j

Maven entries

org.springframework.data spring-data-neo4j 2.1.0.RELEASE

Spring context entries

xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"xsi:schemaLocation="... http://www.springframework.org/schema/data/neo4jhttp://www.springframework.org/schema/data/neo4j/spring-neo4j.xsd">......

Source

NodeEntity

Server

download

install & start

config

Getting started

Installing neo4j

Download neo4j from this site: http://www.neo4j.org/download

Start neo4j

Run neo4j_root/bin/neo4j.bat

Web admin page

http://localhost:7474/webadmin/

NeoEclipse

Is a eclipse editor for neo4j

What can you do using this, Create a connection, Load db, Create node/relationship, Cypher query editor

Cypher