SlideShare a Scribd company logo
1 of 42
Download to read offline
`whoami`
@fbiville @LateraIThoughts
:WORKS_FOR
:IS_REACHABLE
{on:“Twitter”}
:IS_REACHABLE
{on:“Twitter”}
:LOVES :IS_PARTNER_WITH
Calendar
Conference
October / http://tinyurl.com/soft-shake-neo4j
Training
http://www.lateral-thoughts.com/formation-neo4j
BBL : just ping me!
http://www.brownbaglunch.fr/baggers.html#Florent_Biville
On one side: graph databases!
Flock DB
On one side: graph databases!
Flock DB
VERY
DYNAM
IC
LANDSCAPE
On the other side: the enterprise
On the other side: the enterprise
LIVE
LONG
AND
PROSPER
The Enterprise Architecture
● Entities
● DAO
● Service
● Controllers
The Enterprise Architecture
● Entities
● DAO
● Service
● Controllers
?
featuring an Oh Real Monster!
Object-Relational Mapping
Applies only to Relational DBMS
Lowest common denominator
80% easy
20% … painful
Java and ORMs
Java Persistence API
JSR 220 - JSR 317
Main implementors
● EclipseLink
● Apache OpenJPA
● Hibernate
@Entity
@Table(name = "channels")
public class Channel {
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", nullable = false)
private long id;
@Column(name = "title", nullable = false,
unique = true)
private String title = "";
@Column(name = "description", nullable =
false)
private String description = "";
// [...]
}
Java and ORMs
Java Persistence API
JSR 220 - JSR 317
Main implementors
● EclipseLink
● Apache OpenJPA
● Hibernate
@Repository
public class CastRepository implements /.../ {
@PersistenceContext
private EntityManager entityManager;
@Override
@Transactional
public void delete(final Cast cast) {
entityManager.remove(cast);
}
@Override
@Transactional(readOnly = true)
public Cast findById(final long id) {
checkArgument(id >= 0);
return entityManager.find(Cast.class, id);
}
}
Java and ORMs: the good parts
Familiar programming model
● @Transactional [SPRING]
● @Entity, @Table...
● @Repository [SPRING]
Java and ORMs: the bad parts
Defines its own universe
see JPA entity lifecycle ;-(
Relation-Objects = 2 <> paradigms!
1+n query problem
inheritance strategies
SQL knowledge needed -> abstraction leak
What model REALLY is relational? :)
Why does Neo4J kick ass? cuz...
Graph = generic Data Structure
...and powerful ;-)
Natural fit with objects
Frictionless mapping!
Mapping with Neo4J?!
BUT No predefined schema
Labeled nodes can be very <>
Same with relationships
Schema-optionality = a problem?
see the awesome GraphGist challenge!
Schema-optionality = a problem?
Typical apps do not handle
gazillion of entities
More like a finite number
Let’s map then!
First approach: Hibernate OGM
Reuses Hibernate Core
Supports simple JP-QL queries
Support for Neo4J is a WIP
Let’s map then!
First approach: Hibernate OGM
Reuses Hibernate Core
Supports simple JP-QL queries
Support for Neo4J is a WIP
Lowest Common Denominator
Let’s map then!
Second approach: Tinkerpop Frames
Multi-graph DB support (Blueprints interface)
REST support with Tinkerpop REXSTER
Querying with Gremlin
Let’s map then!
Third approach: Spring Data Neo4J
Spring / Spring Data philosophy
Templates
Entities, “magic” repositories, @Transactional
Cypher support
Multi-store support
Spring Data
History ~2010
Rod Johnson,
(was) VMWare
Emil Eifrem,
Neo Technology
Spring Data
Familiar model for Spring apps
Thin common layer
Embraces diversity MongoDB
Redis
Neo4J
ElasticSearch…
Current version 2.3.1.RELEASE
vanilla Neo4J “repositories”
@Repository
public class BranchRepository {
private final GraphDatabaseService graphDB;
public Relationship createBranch(Node project,
Node commit,
Map<String,?> properties) {
try (Transaction tx = graphDB.beginTx()) {
Relationship relationship = project.createRelationshipTo(
commit,
DynamicRelationshipType.name("HAS_BRANCH")
);
for (Entry<String,?> entry:properties.entrySet()) {
relationship.setProperty(entry.getKey(), entry.getValue());
}
tx.success();
return relationship;
}
}
vanilla Neo4J “repositories”
@Repository
public class BranchRepository {
private final GraphDatabaseService graphDB;
public Relationship createBranch(Node project,
Node commit,
Map<String,?> properties) {
try (Transaction tx = graphDB.beginTx()) {
Relationship relationship = project.createRelationshipTo(
commit,
DynamicRelationshipType.name("HAS_BRANCH")
);
for (Entry<String,?> entry:properties.entrySet()) {
relationship.setProperty(entry.getKey(), entry.getValue());
}
tx.success();
return relationship;
}
}
vanilla Neo4J “repositories”
@Repository
public class BranchRepository {
private final GraphDatabaseService graphDB;
public Relationship createBranch(Node project,
Node commit,
Map<String,?> properties) {
try (Transaction tx = graphDB.beginTx()) {
Relationship relationship = project.createRelationshipTo(
commit,
DynamicRelationshipType.name("HAS_BRANCH")
);
for (Entry<String,?> entry:properties.entrySet()) {
relationship.setProperty(entry.getKey(), entry.getValue());
}
tx.success();
return relationship;
}
}
Spring Data Neo4J repositories
public interface BranchRepository
extends GraphRepository<Branch> {
}
Spring Data Neo4J repositories
What’s behind GraphRepository
Spring Data Commons - Repository
Marker interface, automatic discovery
Spring Data Commons - CRUDRepository
Create/Read/Update/Delete “boilerplate” operations
Spring Data Commons - PagingAndSortingRepository
Pagination/sorting facilities
Spring Data Neo4J - IndexRepository
Abstracts Neo4J Lucene capabilities
Spring Data Neo4J - TraversalRepository
Encapsulate Neo4J traversals
Spring Data Neo4J repositories
Write less, do more
public interface BranchRepository extends GraphRepository<Branch> {
Iterable<Branch> findByNameLike(String name);
@Query("MATCH (project:PROJECT)-[b:HAS_BRANCH]->(commit:COMMIT)
RETURN b")
Page<Branch> lookMaIveGotPages();
Branch findByNameAndCommitIdentifierLike(String name, String
commit);
}
Spring Data Neo4J repositories
Cypher DSL via CypherDSLRepository
Execute query = start(lookup("company", "Company", "name", param("name"))).
match(path().from("company").in("WORKS_AT").to("person")).
returns(identifier("person"));
Page<Person> result = repo.query(
query , map("name","Neo4j"), new PageRequest(1,10)
);
Spring Data Neo4J entities
Nodes
@NodeEntity
public class Person {
@GraphId
private Long id;
@Indexed(indexName="people-search", type=FULLTEXT)
private String name;
@RelatedTo(type="OWNS", enforceTargetType=true)
private Car car;
@RelatedToVia(type="FRIEND_OF", direction=Direction.INCOMING)
private Iterable<Friendship> friendships;
@GraphTraversal(traversal = PeopleTraversalBuilder.class,
elementClass = Person.class, params = "persons")
private Iterable<Person> people;
}
Spring Data Neo4J entities
Relationships
@RelationshipEntity(type="FRIEND_OF")
public class Friendship {
@StartNode
private Person person;
@EndNode
private Dog humansBestFriend;
@GraphProperty /* optional here ;-) */
private Date since;
/**
* moaaaaar properties
*/
}
Spring Data Neo4J
template
Pre-shaved yaks!
public class PersonRepositoryImpl extends CustomPersonRepository {
@Autowired /* [SPRING ANNOTATION] */
private Neo4jTemplate template;
public Iterable<Person> findAllByNameCustom(String name) {
Index<Node> personFulltextIndex =
template.getIndex("people-search", Person.class);
personFulltextIndex.query("name", format("*%s*", name));
// [...]
}
}
and moaaar: createNode, projectTo...
And so much more...
Geospatial queries
Cross-store support
Dynamic relationships
“Advanced” mapping
<dependency>
<groupId>org.springframework.
data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
And so much more...
Geospatial queries
Cross-store support
QueryDSL integration
“Advanced” mapping
<dependency>
<groupId>org.springframework.
data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
Going further
Experiment
http://projects.spring.io/spring-data-neo4j/
Discuss
https://groups.google.com/forum/#!forum/neo4jfr
Share
http://www.meetup.com/graphdb-france/
Calendar
Conference
October / http://tinyurl.com/soft-shake-neo4j
Training
http://www.lateral-thoughts.com/formation-neo4j
BBL : just ping me!
http://www.brownbaglunch.fr/baggers.html#Florent_Biville
?
A general introduction to Spring Data / Neo4J

More Related Content

What's hot

Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use Case
Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use CaseApache Spark GraphX & GraphFrame Synthetic ID Fraud Use Case
Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use CaseMo Patel
 
Congressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4jCongressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4jWilliam Lyon
 
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jNeo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jGraphAware
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph SchemaJoshua Shinavier
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...GreeceJS
 
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015William Lyon
 
GraphX: Graph analytics for insights about developer communities
GraphX: Graph analytics for insights about developer communitiesGraphX: Graph analytics for insights about developer communities
GraphX: Graph analytics for insights about developer communitiesPaco Nathan
 
Interpreting Relational Schema to Graphs
Interpreting Relational Schema to GraphsInterpreting Relational Schema to Graphs
Interpreting Relational Schema to GraphsNeo4j
 
Signals from outer space
Signals from outer spaceSignals from outer space
Signals from outer spaceGraphAware
 
Why is JSON-LD Important to Businesses - Franz Inc
Why is JSON-LD Important to Businesses - Franz IncWhy is JSON-LD Important to Businesses - Franz Inc
Why is JSON-LD Important to Businesses - Franz IncFranz Inc. - AllegroGraph
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionJasonRafeMiller
 
Extending Spark Graph for the Enterprise with Morpheus and Neo4j
Extending Spark Graph for the Enterprise with Morpheus and Neo4jExtending Spark Graph for the Enterprise with Morpheus and Neo4j
Extending Spark Graph for the Enterprise with Morpheus and Neo4jDatabricks
 
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...Martin Junghanns
 
Apache Spark GraphX highlights.
Apache Spark GraphX highlights. Apache Spark GraphX highlights.
Apache Spark GraphX highlights. Doug Needham
 
OrientDB & Node.js Overview - JS.Everywhere() KW
OrientDB & Node.js Overview - JS.Everywhere() KWOrientDB & Node.js Overview - JS.Everywhere() KW
OrientDB & Node.js Overview - JS.Everywhere() KWgmccarvell
 
OrientDB: Unlock the Value of Document Data Relationships
OrientDB: Unlock the Value of Document Data RelationshipsOrientDB: Unlock the Value of Document Data Relationships
OrientDB: Unlock the Value of Document Data RelationshipsFabrizio Fortino
 
A Deep Dive Implementing xAPI in Learning Games
A Deep Dive Implementing xAPI in Learning GamesA Deep Dive Implementing xAPI in Learning Games
A Deep Dive Implementing xAPI in Learning GamesGBLxAPI
 
Graphs are everywhere! Distributed graph computing with Spark GraphX
Graphs are everywhere! Distributed graph computing with Spark GraphXGraphs are everywhere! Distributed graph computing with Spark GraphX
Graphs are everywhere! Distributed graph computing with Spark GraphXAndrea Iacono
 
Large Scale Graph Analytics with RDF and LPG Parallel Processing
Large Scale Graph Analytics with RDF and LPG Parallel ProcessingLarge Scale Graph Analytics with RDF and LPG Parallel Processing
Large Scale Graph Analytics with RDF and LPG Parallel ProcessingCambridge Semantics
 

What's hot (20)

Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use Case
Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use CaseApache Spark GraphX & GraphFrame Synthetic ID Fraud Use Case
Apache Spark GraphX & GraphFrame Synthetic ID Fraud Use Case
 
Congressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4jCongressional PageRank: Graph Analytics of US Congress With Neo4j
Congressional PageRank: Graph Analytics of US Congress With Neo4j
 
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4jNeo4j-Databridge: Enterprise-scale ETL for Neo4j
Neo4j-Databridge: Enterprise-scale ETL for Neo4j
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph Schema
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
 
Power of Polyglot Search
Power of Polyglot SearchPower of Polyglot Search
Power of Polyglot Search
 
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015
Neo4j + MongoDB. Neo4j Doc Manager for Mongo Connector - GraphConnect SF 2015
 
GraphX: Graph analytics for insights about developer communities
GraphX: Graph analytics for insights about developer communitiesGraphX: Graph analytics for insights about developer communities
GraphX: Graph analytics for insights about developer communities
 
Interpreting Relational Schema to Graphs
Interpreting Relational Schema to GraphsInterpreting Relational Schema to Graphs
Interpreting Relational Schema to Graphs
 
Signals from outer space
Signals from outer spaceSignals from outer space
Signals from outer space
 
Why is JSON-LD Important to Businesses - Franz Inc
Why is JSON-LD Important to Businesses - Franz IncWhy is JSON-LD Important to Businesses - Franz Inc
Why is JSON-LD Important to Businesses - Franz Inc
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
 
Extending Spark Graph for the Enterprise with Morpheus and Neo4j
Extending Spark Graph for the Enterprise with Morpheus and Neo4jExtending Spark Graph for the Enterprise with Morpheus and Neo4j
Extending Spark Graph for the Enterprise with Morpheus and Neo4j
 
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...
Gradoop: Scalable Graph Analytics with Apache Flink @ Flink & Neo4j Meetup Be...
 
Apache Spark GraphX highlights.
Apache Spark GraphX highlights. Apache Spark GraphX highlights.
Apache Spark GraphX highlights.
 
OrientDB & Node.js Overview - JS.Everywhere() KW
OrientDB & Node.js Overview - JS.Everywhere() KWOrientDB & Node.js Overview - JS.Everywhere() KW
OrientDB & Node.js Overview - JS.Everywhere() KW
 
OrientDB: Unlock the Value of Document Data Relationships
OrientDB: Unlock the Value of Document Data RelationshipsOrientDB: Unlock the Value of Document Data Relationships
OrientDB: Unlock the Value of Document Data Relationships
 
A Deep Dive Implementing xAPI in Learning Games
A Deep Dive Implementing xAPI in Learning GamesA Deep Dive Implementing xAPI in Learning Games
A Deep Dive Implementing xAPI in Learning Games
 
Graphs are everywhere! Distributed graph computing with Spark GraphX
Graphs are everywhere! Distributed graph computing with Spark GraphXGraphs are everywhere! Distributed graph computing with Spark GraphX
Graphs are everywhere! Distributed graph computing with Spark GraphX
 
Large Scale Graph Analytics with RDF and LPG Parallel Processing
Large Scale Graph Analytics with RDF and LPG Parallel ProcessingLarge Scale Graph Analytics with RDF and LPG Parallel Processing
Large Scale Graph Analytics with RDF and LPG Parallel Processing
 

Viewers also liked

Hands on Neo4J - Duchess France/Zenexity - 25/09/2013
Hands on Neo4J - Duchess France/Zenexity - 25/09/2013Hands on Neo4J - Duchess France/Zenexity - 25/09/2013
Hands on Neo4J - Duchess France/Zenexity - 25/09/2013Florent Biville
 
Soft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4JSoft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4JFlorent Biville
 
DevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4JDevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4JFlorent Biville
 
Why Neo4J is awesome in 5 slides
Why Neo4J is awesome in 5 slidesWhy Neo4J is awesome in 5 slides
Why Neo4J is awesome in 5 slidesFlorent Biville
 
[FR] Introduction à Spring Data Neo4j 3.x
[FR] Introduction à Spring Data Neo4j 3.x[FR] Introduction à Spring Data Neo4j 3.x
[FR] Introduction à Spring Data Neo4j 3.xFlorent Biville
 
Titan and Cassandra at WellAware
Titan and Cassandra at WellAwareTitan and Cassandra at WellAware
Titan and Cassandra at WellAwaretwilmes
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklNeo4j
 
(R)évolutionnez vos bases de données avec Liquibase
(R)évolutionnez vos bases de données avec Liquibase(R)évolutionnez vos bases de données avec Liquibase
(R)évolutionnez vos bases de données avec LiquibaseFlorent Biville
 

Viewers also liked (10)

Hands on Neo4J - Duchess France/Zenexity - 25/09/2013
Hands on Neo4J - Duchess France/Zenexity - 25/09/2013Hands on Neo4J - Duchess France/Zenexity - 25/09/2013
Hands on Neo4J - Duchess France/Zenexity - 25/09/2013
 
Soft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4JSoft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4J
 
DevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4JDevFest Istanbul - a free guided tour of Neo4J
DevFest Istanbul - a free guided tour of Neo4J
 
Why Neo4J is awesome in 5 slides
Why Neo4J is awesome in 5 slidesWhy Neo4J is awesome in 5 slides
Why Neo4J is awesome in 5 slides
 
[FR] Introduction à Spring Data Neo4j 3.x
[FR] Introduction à Spring Data Neo4j 3.x[FR] Introduction à Spring Data Neo4j 3.x
[FR] Introduction à Spring Data Neo4j 3.x
 
Titan and Cassandra at WellAware
Titan and Cassandra at WellAwareTitan and Cassandra at WellAware
Titan and Cassandra at WellAware
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quickl
 
Recolytic
RecolyticRecolytic
Recolytic
 
Liquibase en action
Liquibase en actionLiquibase en action
Liquibase en action
 
(R)évolutionnez vos bases de données avec Liquibase
(R)évolutionnez vos bases de données avec Liquibase(R)évolutionnez vos bases de données avec Liquibase
(R)évolutionnez vos bases de données avec Liquibase
 

Similar to A general introduction to Spring Data / Neo4J

MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data
MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open DataMuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data
MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data21Style
 
Presenting Your Digital Research
Presenting Your Digital ResearchPresenting Your Digital Research
Presenting Your Digital ResearchShawn Day
 
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)Jeff Magnusson
 
Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)Stefan Urbanek
 
Polyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4jPolyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4jCorie Pollock
 
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...Benjamin Nussbaum
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j
 
2017-01-08-scaling tribalknowledge
2017-01-08-scaling tribalknowledge2017-01-08-scaling tribalknowledge
2017-01-08-scaling tribalknowledgeChristopher Williams
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Demi Ben-Ari
 
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Codemotion
 
Sem tech 2011 v8
Sem tech 2011 v8Sem tech 2011 v8
Sem tech 2011 v8dallemang
 
The Perfect Fit: Scalable Graph for Big Data
The Perfect Fit: Scalable Graph for Big DataThe Perfect Fit: Scalable Graph for Big Data
The Perfect Fit: Scalable Graph for Big DataInside Analysis
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsMike Broberg
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowKaxil Naik
 
Nodes2020 | Graph of enterprise_metadata | NEO4J Conference
Nodes2020 | Graph of enterprise_metadata | NEO4J ConferenceNodes2020 | Graph of enterprise_metadata | NEO4J Conference
Nodes2020 | Graph of enterprise_metadata | NEO4J ConferenceDeepak Chandramouli
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programmingEric Polerecky
 
How Graph Databases used in Police Department?
How Graph Databases used in Police Department?How Graph Databases used in Police Department?
How Graph Databases used in Police Department?Samet KILICTAS
 
aRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RaRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RGraphRM
 

Similar to A general introduction to Spring Data / Neo4J (20)

MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data
MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open DataMuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data
MuseoTorino, first italian project using a GraphDB, RDFa, Linked Open Data
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
Presenting Your Digital Research
Presenting Your Digital ResearchPresenting Your Digital Research
Presenting Your Digital Research
 
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)
Watching Pigs Fly with the Netflix Hadoop Toolkit (Hadoop Summit 2013)
 
Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)Python business intelligence (PyData 2012 talk)
Python business intelligence (PyData 2012 talk)
 
Polyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4jPolyglot Persistence with MongoDB and Neo4j
Polyglot Persistence with MongoDB and Neo4j
 
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...
Knowledge Graphs - Journey to the Connected Enterprise - Data Strategy and An...
 
Neo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform OverviewNeo4j Database and Graph Platform Overview
Neo4j Database and Graph Platform Overview
 
2017-01-08-scaling tribalknowledge
2017-01-08-scaling tribalknowledge2017-01-08-scaling tribalknowledge
2017-01-08-scaling tribalknowledge
 
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
Monitoring Big Data Systems Done "The Simple Way" - Codemotion Milan 2017 - D...
 
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
Demi Ben-Ari - Monitoring Big Data Systems Done "The Simple Way" - Codemotion...
 
Sem tech 2011 v8
Sem tech 2011 v8Sem tech 2011 v8
Sem tech 2011 v8
 
The Perfect Fit: Scalable Graph for Big Data
The Perfect Fit: Scalable Graph for Big DataThe Perfect Fit: Scalable Graph for Big Data
The Perfect Fit: Scalable Graph for Big Data
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Ontologies & linked open data
Ontologies & linked open dataOntologies & linked open data
Ontologies & linked open data
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
 
Nodes2020 | Graph of enterprise_metadata | NEO4J Conference
Nodes2020 | Graph of enterprise_metadata | NEO4J ConferenceNodes2020 | Graph of enterprise_metadata | NEO4J Conference
Nodes2020 | Graph of enterprise_metadata | NEO4J Conference
 
Real world functional reactive programming
Real world functional reactive programmingReal world functional reactive programming
Real world functional reactive programming
 
How Graph Databases used in Police Department?
How Graph Databases used in Police Department?How Graph Databases used in Police Department?
How Graph Databases used in Police Department?
 
aRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con RaRangodb, un package per l'utilizzo di ArangoDB con R
aRangodb, un package per l'utilizzo di ArangoDB con R
 

Recently uploaded

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Recently uploaded (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

A general introduction to Spring Data / Neo4J

  • 1.
  • 4. On one side: graph databases! Flock DB
  • 5. On one side: graph databases! Flock DB VERY DYNAM IC LANDSCAPE
  • 6. On the other side: the enterprise
  • 7. On the other side: the enterprise LIVE LONG AND PROSPER
  • 8. The Enterprise Architecture ● Entities ● DAO ● Service ● Controllers
  • 9. The Enterprise Architecture ● Entities ● DAO ● Service ● Controllers ?
  • 10. featuring an Oh Real Monster!
  • 11. Object-Relational Mapping Applies only to Relational DBMS Lowest common denominator 80% easy 20% … painful
  • 12. Java and ORMs Java Persistence API JSR 220 - JSR 317 Main implementors ● EclipseLink ● Apache OpenJPA ● Hibernate @Entity @Table(name = "channels") public class Channel { @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", nullable = false) private long id; @Column(name = "title", nullable = false, unique = true) private String title = ""; @Column(name = "description", nullable = false) private String description = ""; // [...] }
  • 13. Java and ORMs Java Persistence API JSR 220 - JSR 317 Main implementors ● EclipseLink ● Apache OpenJPA ● Hibernate @Repository public class CastRepository implements /.../ { @PersistenceContext private EntityManager entityManager; @Override @Transactional public void delete(final Cast cast) { entityManager.remove(cast); } @Override @Transactional(readOnly = true) public Cast findById(final long id) { checkArgument(id >= 0); return entityManager.find(Cast.class, id); } }
  • 14. Java and ORMs: the good parts Familiar programming model ● @Transactional [SPRING] ● @Entity, @Table... ● @Repository [SPRING]
  • 15. Java and ORMs: the bad parts Defines its own universe see JPA entity lifecycle ;-( Relation-Objects = 2 <> paradigms! 1+n query problem inheritance strategies SQL knowledge needed -> abstraction leak
  • 16. What model REALLY is relational? :)
  • 17. Why does Neo4J kick ass? cuz... Graph = generic Data Structure ...and powerful ;-) Natural fit with objects Frictionless mapping!
  • 18. Mapping with Neo4J?! BUT No predefined schema Labeled nodes can be very <> Same with relationships
  • 19. Schema-optionality = a problem? see the awesome GraphGist challenge!
  • 20. Schema-optionality = a problem? Typical apps do not handle gazillion of entities More like a finite number
  • 21. Let’s map then! First approach: Hibernate OGM Reuses Hibernate Core Supports simple JP-QL queries Support for Neo4J is a WIP
  • 22. Let’s map then! First approach: Hibernate OGM Reuses Hibernate Core Supports simple JP-QL queries Support for Neo4J is a WIP Lowest Common Denominator
  • 23. Let’s map then! Second approach: Tinkerpop Frames Multi-graph DB support (Blueprints interface) REST support with Tinkerpop REXSTER Querying with Gremlin
  • 24. Let’s map then! Third approach: Spring Data Neo4J Spring / Spring Data philosophy Templates Entities, “magic” repositories, @Transactional Cypher support Multi-store support
  • 25. Spring Data History ~2010 Rod Johnson, (was) VMWare Emil Eifrem, Neo Technology
  • 26. Spring Data Familiar model for Spring apps Thin common layer Embraces diversity MongoDB Redis Neo4J ElasticSearch… Current version 2.3.1.RELEASE
  • 27. vanilla Neo4J “repositories” @Repository public class BranchRepository { private final GraphDatabaseService graphDB; public Relationship createBranch(Node project, Node commit, Map<String,?> properties) { try (Transaction tx = graphDB.beginTx()) { Relationship relationship = project.createRelationshipTo( commit, DynamicRelationshipType.name("HAS_BRANCH") ); for (Entry<String,?> entry:properties.entrySet()) { relationship.setProperty(entry.getKey(), entry.getValue()); } tx.success(); return relationship; } }
  • 28. vanilla Neo4J “repositories” @Repository public class BranchRepository { private final GraphDatabaseService graphDB; public Relationship createBranch(Node project, Node commit, Map<String,?> properties) { try (Transaction tx = graphDB.beginTx()) { Relationship relationship = project.createRelationshipTo( commit, DynamicRelationshipType.name("HAS_BRANCH") ); for (Entry<String,?> entry:properties.entrySet()) { relationship.setProperty(entry.getKey(), entry.getValue()); } tx.success(); return relationship; } }
  • 29. vanilla Neo4J “repositories” @Repository public class BranchRepository { private final GraphDatabaseService graphDB; public Relationship createBranch(Node project, Node commit, Map<String,?> properties) { try (Transaction tx = graphDB.beginTx()) { Relationship relationship = project.createRelationshipTo( commit, DynamicRelationshipType.name("HAS_BRANCH") ); for (Entry<String,?> entry:properties.entrySet()) { relationship.setProperty(entry.getKey(), entry.getValue()); } tx.success(); return relationship; } }
  • 30. Spring Data Neo4J repositories public interface BranchRepository extends GraphRepository<Branch> { }
  • 31. Spring Data Neo4J repositories What’s behind GraphRepository Spring Data Commons - Repository Marker interface, automatic discovery Spring Data Commons - CRUDRepository Create/Read/Update/Delete “boilerplate” operations Spring Data Commons - PagingAndSortingRepository Pagination/sorting facilities Spring Data Neo4J - IndexRepository Abstracts Neo4J Lucene capabilities Spring Data Neo4J - TraversalRepository Encapsulate Neo4J traversals
  • 32. Spring Data Neo4J repositories Write less, do more public interface BranchRepository extends GraphRepository<Branch> { Iterable<Branch> findByNameLike(String name); @Query("MATCH (project:PROJECT)-[b:HAS_BRANCH]->(commit:COMMIT) RETURN b") Page<Branch> lookMaIveGotPages(); Branch findByNameAndCommitIdentifierLike(String name, String commit); }
  • 33. Spring Data Neo4J repositories Cypher DSL via CypherDSLRepository Execute query = start(lookup("company", "Company", "name", param("name"))). match(path().from("company").in("WORKS_AT").to("person")). returns(identifier("person")); Page<Person> result = repo.query( query , map("name","Neo4j"), new PageRequest(1,10) );
  • 34. Spring Data Neo4J entities Nodes @NodeEntity public class Person { @GraphId private Long id; @Indexed(indexName="people-search", type=FULLTEXT) private String name; @RelatedTo(type="OWNS", enforceTargetType=true) private Car car; @RelatedToVia(type="FRIEND_OF", direction=Direction.INCOMING) private Iterable<Friendship> friendships; @GraphTraversal(traversal = PeopleTraversalBuilder.class, elementClass = Person.class, params = "persons") private Iterable<Person> people; }
  • 35. Spring Data Neo4J entities Relationships @RelationshipEntity(type="FRIEND_OF") public class Friendship { @StartNode private Person person; @EndNode private Dog humansBestFriend; @GraphProperty /* optional here ;-) */ private Date since; /** * moaaaaar properties */ }
  • 36. Spring Data Neo4J template Pre-shaved yaks! public class PersonRepositoryImpl extends CustomPersonRepository { @Autowired /* [SPRING ANNOTATION] */ private Neo4jTemplate template; public Iterable<Person> findAllByNameCustom(String name) { Index<Node> personFulltextIndex = template.getIndex("people-search", Person.class); personFulltextIndex.query("name", format("*%s*", name)); // [...] } } and moaaar: createNode, projectTo...
  • 37. And so much more... Geospatial queries Cross-store support Dynamic relationships “Advanced” mapping <dependency> <groupId>org.springframework. data</groupId> <artifactId>spring-data-neo4j</artifactId> <version>2.3.1.RELEASE</version> </dependency>
  • 38. And so much more... Geospatial queries Cross-store support QueryDSL integration “Advanced” mapping <dependency> <groupId>org.springframework. data</groupId> <artifactId>spring-data-neo4j</artifactId> <version>2.3.1.RELEASE</version> </dependency>
  • 41. ?