SlideShare a Scribd company logo
Webinar
               Introduction to
            Spring Data Neo4j 2.0
     Michael Hunger, Neo Technology


Thursday, March 15, 12
Me & You ?


        ๏ Me: Michael Hunger, Neo Technology
                 • passionate software developer / Neo4j German Division
                 • Spring Data Neo4j Project Lead
                 • Neo4j Cloud Hosting
                 • michael.hunger@neotechnology.com / @mesirii
        ๏ You:
                 • Java & Spring !
                 • Enterprise ?
                 • Rich Domain ?
                 • NOSQL ?
Thursday, March 15, 12
About the Webinar


        ๏ Covers Spring Data Neo4j only
        ๏ too much content anyway
        ๏ so it will be just a whirlwind tour

        ๏ no detailed introductions to NOSQL and Neo4j in particular
        ๏ for those go to http://neo4j.org

        ๏ Q&A at the end
        ๏ all your questions will be answered in a follow up blog post,
                    don‘t hesitate to ask
Thursday, March 15, 12
What‘s up?




                         ๏ Spring Data overview
                         ๏ Networks are everywhere
                         ๏ Neo4j introduction
                         ๏ Spring Data Neo4j introduction



                                                            4

Thursday, March 15, 12

Recommended for you

NoSQL databases and managing big data
NoSQL databases and managing big dataNoSQL databases and managing big data
NoSQL databases and managing big data

An unprecedented amount of data is being created and is accessible. This presentation will instruct on using the new NoSQL technologies to make sense of all this data.

mongodbnosqlbig data
Semantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business IntelligenceSemantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business Intelligence

This document provides an introduction to semantic technologies and triplestores. It discusses the Semantic Web vision of making data on the web more accessible and linked. Key concepts covered include RDF, ontologies, OWL, SPARQL and Linked Data. It also introduces triplestores as RDF databases for storing and querying semantic data and compares their features to traditional databases.

sparqlsemantic webrdf
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational

This document compares relational and non-relational databases. It discusses how in 2003 the main databases were relational, but by 2010 non-relational databases grew popular in the "NoSQL movement". However, the document argues that there are no truly new database designs and that relational and non-relational databases can be combined. It advises to choose a database based on the specific problem and features needed rather than general classifications. The document provides examples of which types of databases fit certain data and access needs.

Spring Data




                         5

Thursday, March 15, 12
What is NOSQL?




Thursday, March 15, 12
What is NOSQL?

                  It’s not “No to SQL”




Thursday, March 15, 12
What is NOSQL?

                  It’s not “No to SQL”
                                         It’s not “Never SQL”




Thursday, March 15, 12

Recommended for you

"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,..."Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...

Webinar presentation delivered by Dr. Michael Stonebraker and Scott Jarr of VoltDB on December 11, 2012. www.voltdb.com The design decisions you make today will have a huge performance impact down the line. Until recently, when it came to databases, the choice was easy. Essentially, you had one option: the RDBMS. Today, there's a new universe of databases being thrown into production — and not always with the greatest success. How do you make the right choice for your next application? Database pioneer Dr. Michael Stonebraker and VoltDB co-founder Scott Jarr have some thoughts.

stonebrakerapplication developmentdatabases
Sharing data on the web (2013)
Sharing data on the web (2013)Sharing data on the web (2013)
Sharing data on the web (2013)

This document discusses the progression from sharing data on the web in documents to sharing linked open data on the semantic web. It begins by explaining how data in documents is difficult to access and use programmatically. It then outlines several steps to improve how data is shared, including making it machine-readable, using non-proprietary formats, adding semantic standards like RDF, linking data to other datasets, and generating websites to access the data. The goal is to share data in a way that is easy to access, use, and connect to other relevant data on the web.

rdflinked data
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...

Presentation from the Rittman Mead BI Forum 2015 masterclass, pt.2 of a two-part session that also covered creating the Discovery Lab. Goes through setting up Flume log + twitter feeds into CDH5 Hadoop using ODI12c Advanced Big Data Option, then looks at the use of OBIEE11g with Hive, Impala and Big Data SQL before finally using Oracle Big Data Discovery for faceted search and data mashup on-top of Hadoop

odioracle dwbig data appliance
What is NOSQL?

                  It’s not “No to SQL”
                                          It’s not “Never SQL”


                         It’s “Not       Only SQL”




Thursday, March 15, 12
What is NOSQL?

                  It’s not “No to SQL”
                                             It’s not “Never SQL”


                         It’s “Not       Only SQL”
                   NOSQL no-seek-wool n. Describes ongoing
                   trend where developers increasingly opt for
                   non-relational databases to help solve their
                   problems, in an effort to use the right tool for
                   the right job.



Thursday, March 15, 12
NOSQL categories

      We see four main categories in the NOSQL space:




Thursday, March 15, 12
NOSQL categories

      We see four main categories in the NOSQL space:

                Key-Value
                       •Redis
                       •Riak
                         •Voldemort




Thursday, March 15, 12

Recommended for you

Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)

Modelling Data in Neo4j, bidirectional relationships, qualifying relationships with properties vs. relationship types (performance comparison), Neo4j hardware sizing, Cypher vs. Java API

data modellinggraph databaseneo4j
Neo4j Makes Graphs Easy
Neo4j Makes Graphs EasyNeo4j Makes Graphs Easy
Neo4j Makes Graphs Easy

This document provides a 3-step process for modeling data as a graph using Neo4j: 1. Define the data and relationships 2. Load the data into Neo4j from CSV files 3. Query the data using the Cypher query language It includes examples of loading customer, product, order and other data from the Northwind sample database into a Neo4j graph and defining relationships between nodes. Queries are demonstrated to find employees and their managers and products supplied by different suppliers.

neo4jgraph databasenorthwind
Neo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in MalmöNeo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in Malmö

This document discusses using Neo4j-Spatial and OpenStreetMap to work with web map data. It provides an overview of Neo4j-Spatial's capabilities for spatial data including importing, querying, and exporting OpenStreetMap data. Examples are given of using Neo4j-Spatial to find locations near other points, perform routing queries on OSM data, and analyze contributions of individual OSM users.

neo4jmobilemap
NOSQL categories

      We see four main categories in the NOSQL space:

                                       Column-family/
                Key-Value
                                       BigTable
                       •Redis
                       •Riak                     •Cassandra
                         •Voldemort              •HBase




Thursday, March 15, 12
NOSQL categories

      We see four main categories in the NOSQL space:

                                       Column-family/
                Key-Value
                                       BigTable
                       •Redis
                       •Riak                     •Cassandra
                         •Voldemort              •HBase



               Document

                           •MongoDB
                           •CouchDB




Thursday, March 15, 12
NOSQL categories

      We see four main categories in the NOSQL space:

                                       Column-family/
                Key-Value
                                       BigTable
                       •Redis
                       •Riak                     •Cassandra
                         •Voldemort              •HBase



               Document                 Graph
                                                  •Neo4j
                           •MongoDB
                                                  •InfiniteGraph
                           •CouchDB
                                                  •OrientDB
                                                  •DEX


Thursday, March 15, 12
Scaling to size vs. Scaling to complexity

                         Size
                            Key-Value stores

                                         Bigtable clones
                                                       Document databases
                                                                            Graph databases




                                                                                      Complexity

                                                                                              8

Thursday, March 15, 12

Recommended for you

Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015

The world is a big place, and getting bigger all the time. In the last few decade the internet has been at the core of a massive explosion in the amount of data, and the complexity of data out there. The world of databases, and applications that use databases, has responded with some amazing new solutions from well known names like google, amazon and facebook, as well as some less well known, but equally important solutions. One of these comes from right here in Malmö. Neo4j is the leading "graph database", aimed at handling the new world of complex connected data. Neo4j especially well suited at dealing with relationships in data, like social networks and geographically connected data. Neo4j Spatial is a community supported library designed to help you model geographic data in Neo4j and build applications that make the most of location information in a connected way. In this talk we will introduce you to Neo4j, the concept of a "graph database", and why this approach is so well suited to the modern world. We will give you a taste of the various options available for building location aware data applications. And to end off, we will give you a sneak peek at some of the up-coming spatial features planned for future releases of Neo4j, which help make it even easier to model location data with high performance.

gis spatial data database neo4j maps
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import

Ready to leverage the power of a graph database to bring your application to the next level, but all the data is still stuck in a legacy relational database? Fortunately, Neo4j offers several ways to quickly and efficiently import relational data into a suitable graph model. It's as simple as exporting the subset of the data you want to import and ingest it either with an initial loader in seconds or minutes or apply Cypher's power to put your relational data transactionally in the right places of your graph model. In this webinar, Michael will also demonstrate a simple tool that can load relational data directly into Neo4j, automatically transforming it into a graph representation of your normalized entity-relationship model.

rdbmsimportscale
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...

The fundamental aspect of Vincent Van Gogh's artwork was his continuous research for colors. By modeling his journey as an artist in a graph database, we are able to make new inferences on different artists, cities, climates and other nodes that influenced the development of Vincent Van Gogh as an artist. Aside from the case of Van Gogh and his artwork, there remains unexpected connections in the world around us. This talk discusses the value of a graph databases for your own projects in revealing new insights from the connections inherent in your data.

codemotion amsterdam 2016
Scaling to size vs. Scaling to complexity

                         Size
                            Key-Value stores

                                         Bigtable clones
                                                       Document databases
                                                                            Graph databases

                                                                                     Billions of nodes
                                                                                     and relationships




                                                                                      Complexity

                                                                                              8

Thursday, March 15, 12
Scaling to size vs. Scaling to complexity

                         Size
                            Key-Value stores

                                         Bigtable clones
                                                       Document databases
                                                                            Graph databases

                                                                                     Billions of nodes
                                                                                     and relationships




                                               > 90% of use cases
                                                                                      Complexity

                                                                                              8

Thursday, March 15, 12
Why NOSQL now?
     We have observed four trends since the 90‘s:


       ๏ Trend 1: Size of data is growing
       ๏ Trend 2: Data is increasingly connected
       ๏ Trend 3: Data is increasingly semi-structured
       ๏ Trend 4: Change in architecture




Thursday, March 15, 12
What is Spring Data?


        ๏ VMWare/SpringSource initiative to give Spring developers easy
                    access to the emerging world of NOSQL, including:

                 • Non-relational databases
                 • Grails NOSQL support
                 • Cross-store persistence
                 • Object Persistence Mapping Infrastructure
                 • Generic Repository Infrastructure
                 • upcoming Spring Roo add-ons
                                                                        10

Thursday, March 15, 12

Recommended for you

GraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud PreventionGraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud Prevention

This document summarizes how several large companies, including Adidas, eBay, and Walmart, are using Neo4j graph databases to gain insights from their data. Adidas uses Neo4j to combine product and content data into a single searchable graph to personalize customer experiences. eBay uses Neo4j to optimize delivery routing as their previous system could not handle growth. Walmart uses Neo4j to provide personalized recommendations to customers on their website. The document then discusses how graph databases are better suited than relational databases for real-time, dynamic queries on connected data. It provides examples of using graph analysis to detect fraud, such as insurance scams and banking fraud rings.

neo4jgraphdayfraud
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases

Graph Database Management Systems provide an effective and efficient solution to data storage in current scenarios where data are more and more connected, graph models are widely used, and systems need to scale to large data sets. In this framework, the conversion of the persistent layer of an application from a relational to a graph data store can be convenient but it is usually an hard task for database administrators. In this paper we propose a methodology to convert a relational to a graph database by exploiting the schema and the constraints of the source. The approach supports the translation of conjunctive SQL queries over the source into graph traversal operations over the target. We provide experimental results that show the feasibility of our solution and the efficiency of query answering over the target database.

graph databasedata migrationgdbms
LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"

A look at Whitepages Pro and how our Lead Verify and Identity Check APIs can help lenders make fast, efficient, and effective lending decisions.

Spring Data projects
        ๏ Code is in SpringSource git repository:
                         • http://springsource.org/spring-data
                         • https://github.com/SpringSource/spring-data-*
        ๏ Includes:
                 • data-commons
                 • spring-data-graph-neo4j
                 • spring-data-{redis,riak}
                 • spring-data-mongo
                 • spring-data-jdbc
                 • spring-data-jpa
Thursday, March 15, 12
Spring Data Neo4j


        ๏ Focus on Spring Data Neo4j
        ๏ VMWare is collaborating with Neo Technology, the company behind
                   the Neo4j graph database.


        ๏ Improved programming model: Annotation-based
                   programming model for applications with rich domain models
        ๏ Cross-store persistence: Extend existing JPA application with
                   NOSQL persistence
        ๏ Spring Roo support: Add graph persistence with Roo add-on


Thursday, March 15, 12
Graphs are
      everywhere




                         13

Thursday, March 15, 12
Even in the Matrix
                   - everything is a graph

                         Google Image Search: „graph OR network“




                                                               14

Thursday, March 15, 12

Recommended for you

Neo4j Solutions - Master Data Management
Neo4j Solutions - Master Data ManagementNeo4j Solutions - Master Data Management
Neo4j Solutions - Master Data Management

During this Big Data Warehousing Meetup, we discussed how graph databases work, shared some real world use cases, and showed a live demo of the world’s leading graph database, Neo4J. Pitney Bowes demonstrated their new MDM product developed on a graph database. For more information, check out the other slides from this meetup or visit our website at www.casertaconcepts.com

big mdmcaserta conceptspitney bowes
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship ManagementBig MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management

This document provides an agenda and overview for the "Big MDM Part 2" meetup event. The agenda includes presentations on using graph databases for master data management (MDM) and relationship management. Speakers from Caserta Concepts, Neo Technology, and Pitney Bowes will discuss graph databases, MDM use cases, and modeling and managing data with graph databases. The meetup is sponsored by Caserta Concepts and hosted by Neo Technology. It will include networking, five presentations on graph databases and MDM topics, and a Q&A session.

graph databasesneo4jbig mdm
faradays law and its applications ppt
faradays law and its applications pptfaradays law and its applications ppt
faradays law and its applications ppt

1. Michael Faraday discovered electromagnetic induction in 1831 through experiments showing that a changing magnetic field can induce an electric current in a nearby conductor. 2. Faraday's law of induction states that the induced electromotive force (emf) in a conductor is equal to the rate of change of magnetic flux through the conductor. 3. This discovery established the basis for technologies such as electric generators, transformers, electric motors, and inductors which are crucial components of modern electric power systems and electronics.

Graphs Everywhere

        ๏ Relationships in
                 • Politics, Economics, History, Science,Transportation
        ๏ Biology, Chemistry, Physics, Sociology
                 • Body, Ecosphere, Reaction, Interactions
        ๏ Internet / IT
                 • Hardware, Software, Interaction
        ๏ Social Networks
                 • Family, Friends
                 • Work, Communities
                 • Neighbours, Cities, Society
Thursday, March 15, 12
                                                                          15
Good Relationships


        ๏ World is rich, messy and related data
        ๏ Relationships are as least as important as the things they connect
        ๏ Graphs = Whole > Sum of all parts
        ๏ Complex interactions
        ๏ Always changing, change of structures as well

        ๏ Graph => Relationships are part of the data
        ๏ RDBMS => Relationships part of the fixed schema

                                                                       16

Thursday, March 15, 12
Questions and Answers


        ๏ Complex Questions
        ๏ Answers lie between the lines (things)
        ๏ Locality of the information
        ๏ Global searches / operations very expensive
        ๏ Constant query time, regardless of data volume




                                                           17

Thursday, March 15, 12
Categories ?


        ๏ Categories == Classes, Trees ?
        ๏ What if more than one category fits?
        ๏ Tags
        ๏ Categories via relationships like „IS_A“
        ๏ Any number, easy to change
        ๏ „Virtual“ Relationships - Traversals
        ๏ Category dynamically derived from queries


                                                      18

Thursday, March 15, 12

Recommended for you

Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011

Spring Data Graph is an integration library for the open source graph database Neo4j and has been around for over a year, evolving from its infancy as brainchild of Rod Johnson and Emil Eifrem. It supports transparent AspectJ based POJO to Graph Mapping, a Neo4jTemplate API and extensive support for Spring Data Repositories. It can work with an embedded graph database or with the standalone Neo4j Server. The session starts with a short introduction to graph databases. Following that, the different approaches using Spring Data Graph are explored in the Cineasts.net web-app, a social movie database which is also the application of the tutorial in the Spring Data Graph Guidebook. The session will also cover creating a green-field project using the Spring Roo Addon for Spring Data Graph and deploying the App to CloudFoundry.

 
by jexp
graph databasenosqlneo4j
No Sql Movement
No Sql MovementNo Sql Movement
No Sql Movement

This document discusses trends driving the adoption of NoSQL databases, including increasing data size, connectivity of information, semi-structured data, and distributed application architectures. It describes four categories of NoSQL databases - aggregate-oriented, key-value stores, column family (BigTable), and document databases - and provides examples and comparisons of their pros and cons.

nosqldatabase
NOSQL Databases types and Uses
NOSQL Databases types and UsesNOSQL Databases types and Uses
NOSQL Databases types and Uses

The four categories of NoSQL databases When to Use NoSQL When NOT to use NoSQL Use cases NoSQL (Each Category)

use nosqlkey-values storescolumn family stores
Neo4j introduction


Thursday, March 15, 12
What is Neo4j?
                         data model




Thursday, March 15, 12
What is Neo4j?
                                    data model




                         A Graph Database




Thursday, March 15, 12
What is Neo4j?
                                    data model




                         A Graph Database




Thursday, March 15, 12

Recommended for you

NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)

My presentation from QCon London 2010. Gives a quick nosql overview, an introduction to Neo4j and one production examples.

graph databasenosqlneo4j
Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases

Why the innovation in the database market? This deck talks about why NoSQL databases are important, what they are, and then dives into MongoDB

mongodbdistributed computingnosql
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)

A quick overview of the NOSQL landscape followed by an intro to graph databases and Neo4j. Presented at Trifork's Geeknight in May 2010.

graph databasenosqldatabases
What is Neo4j?
                                    data model




                         A Graph Database




Thursday, March 15, 12
What is Neo4j?
                                           data model




                                A Graph Database




                         Node                           Node




Thursday, March 15, 12
What is Neo4j?
                                                     data model




                                A Graph Database




                                    Typed relationship
                         Node                                     Node




Thursday, March 15, 12
What is Neo4j?
                                                       data model




                                  A Graph Database




                           Node       Typed relationship
                                                                    Node
                         key: value      key: value




Thursday, March 15, 12

Recommended for you

Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL

158ltd.com gives a rapid introduction to NoSQL databases: where they came from, the nature of the data models they use, and the different way you have to think about consistency.

nosqlapache hadoopmongodb
Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et Introductions

The document outlines the agenda for a MongoDB conference in Paris. It introduces the presenters from 10gen and partner companies. The agenda includes introductions to NoSQL and MongoDB, technical overviews, customer and partner presentations, and a Q&A session. It also discusses how MongoDB provides an operational 'Big Data' solution and can help address the challenges of increasing data complexity, volume, and types that traditional RDBMS struggle with.

mongodbnosql
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage

NoSQL database is the first alternative to relational databases, with scalability, availability, and fault tolerance being key deciding factors.

nosqlbig datadatabase
For example




Thursday, March 15, 12
For example




                    name: Oliver




Thursday, March 15, 12
For example




                    name: Oliver   name: Michael




Thursday, March 15, 12
For example




                                   WORKS_WITH
                                   project: spring-data
                    name: Oliver                          name: Michael




Thursday, March 15, 12

Recommended for you

MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPal

Daniel Austin of PayPal presented on using MySQL Cluster to build a globally distributed database called YESQL. He discussed common myths about big data and NoSQL databases, including that big data always requires NoSQL and that the CAP theorem is simpler than it really is. Austin explained how MySQL Cluster was used to build YESQL to meet requirements like high availability, scalability and global replication within 1000ms. He reviewed the architecture involving tiling across AWS availability zones and lessons learned.

nosqlmysql clusterbig data
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks ass

Presentation about using Neo4j from Django presented at OSCON 2010, Portland OR. Sample code is available at: https://svn.neo4j.org/components/neo4j.py/trunk/src/examples/python/djangosites/blog/

neo4jpythondjango
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)

Presentation given at nosql east 2009 in Atlanta. Introduces the NOSQL space by offering a framework for categorization and discusses the benefits of graph databases. Oh, and also includes some tongue-in-cheek party poopers about sucky things in the NOSQL space.

graph databasenosqlgraph db
For example




                                         WORKS_WITH
                                         project: spring-data
                    name: Oliver                                name: Michael
                             EM
                              PL




                                                                   LIVES_IN
                                 OY
                                    E
                                   D_
                                    BY




                                                                city: Dresden
                               company: VMware                  country: DE




Thursday, March 15, 12
For example
                                                  name: Rod

                                                                      KN
                                           S                            OW
                                      OW                                     S
                                    KN



                                               WORKS_WITH
                                               project: spring-data
                    name: Oliver                                                 name: Michael
                             EM
                              PL




                                                                                    LIVES_IN
                                 OY
                                    E
                                   D_
                                    BY




                                                                                 city: Dresden
                               company: VMware                                   country: DE




Thursday, March 15, 12
For example
                                                  name: Rod

                                                                      KN
                                           S                            OW
                                      OW                                     S
                                    KN



                                               WORKS_WITH
                                               project: spring-data
                    name: Oliver                                                 name: Michael
                             EM
                              PL




                                                                                    LIVES_IN
                    S




                                 OY
                LIKE




                                    E
                                   D_
                                    BY




                                                                                 city: Dresden
     food: Chinese
                               company: VMware                                   country: DE




Thursday, March 15, 12
Facts about Neo4j

     •Written in Java
     •Embeddable or standalone Server
     •Schema-free - perfect for rich domains
     •Fully transactional (ACID)
     •Persistent to custom on-disk file structure
     •Traversal speeds of 1,000,000+ hops per second
     •Integrated indexing
     •Plenthora of language bindings
     •24/7 production since 2003



Thursday, March 15, 12

Recommended for you

Know what is NOSQL
Know what is NOSQL Know what is NOSQL
Know what is NOSQL

Understand the basics of nosql. Why nosql came into existence. What is the usage of nosql, why we should use nosql.

nosqlbig data
Why nosql?
Why nosql?Why nosql?
Why nosql?

This document discusses NoSQL databases and why they are used. It begins by defining NoSQL as "not only SQL" or "not SQL" databases that do not use a relational schema. The need for NoSQL databases arose in the early 2000s due to difficulties scaling MySQL databases for large amounts of data. NoSQL databases are classified based on their data model, consistency, and performance. They offer flexible data models including structured, unstructured, and semi-structured data. NoSQL databases focus on developer agility by being easy to use and integrate with modern frameworks. While they scale well horizontally, they generally lack ACID compliance and transaction support of relational databases.

nosql mongodb cassandara
Choosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot ApproachChoosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot Approach

This document summarizes a webinar presented by Leon Guzenda of Objectivity, Inc. on choosing the right big data tools. It discusses how current big data analytics use separate technologies that are not well-suited for relationship analytics. A polyglot approach is recommended using the appropriate technologies like object databases and graph databases to efficiently store, manage and query relationships in complex data. Objectivity provides the InfiniteGraph massively scalable graph database and Objectivity/DB object database for managing interconnected data and hidden relationships.

objectivitydataversitydataversity webinars
Show me some code, please

        GraphDatabaseService graphDb =
           new EmbeddedGraphDatabase(“var/neo4j”);

        Node david = graphDb.createNode();
        Node andreas = graphDb.createNode();

        david.setProperty(“name”, “David Montag”);
        andreas.setProperty(“name”, “Andreas Kollegger”);

        Relationship presentedWith = david.createRelationshipTo(
          andreas, PresentationTypes.PRESENTED_WITH);
        presentedWith.setProperty(“date”, System.currentTimeMillis());




Thursday, March 15, 12
Show me some code, please

        GraphDatabaseService graphDb =
           new EmbeddedGraphDatabase(“var/neo4j”);
        Transaction tx = graphDb.beginTx();
        try {
          Node david = graphDb.createNode();
          Node andreas = graphDb.createNode();

             david.setProperty(“name”, “David Montag”);
             andreas.setProperty(“name”, “Andreas Kollegger”);

          Relationship presentedWith = david.createRelationshipTo(
            andreas, PresentationTypes.PRESENTED_WITH);
          presentedWith.setProperty(“date”, System.currentTimeMillis());
          tx.success();
        } finally {
          tx.finish();
        }




Thursday, March 15, 12
Traversal framework




Thursday, March 15, 12
Traversal framework
     Example: a dependency graph




                         A




                             B
                                   D
           C




Thursday, March 15, 12

Recommended for you

Gilbane Boston 2011 big data
Gilbane Boston 2011 big dataGilbane Boston 2011 big data
Gilbane Boston 2011 big data

"Get Ready for Big Data" presentation from Gilbane Boston 2011; for more details, see http://gilbaneboston.com/conference_program.html#t2 and http://pbokelly.blogspot.com/2011/12/gilbane-boston-2011-big-data.html

xmlrdbmsnosql
Minnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with CassandraMinnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with Cassandra

NativeX (formerly W3i) recently transitioned a large portion of their backend infrastructure from MS SQL Server to Apache Cassandra. Today, its Cassandra cluster backs its mobile advertising network supporting over 10 million daily active users producing over 10,000 transactions per second with an average database request latency of under 2 milliseconds. Going from relational to noSQL required NativeX's engineers to re-train, re-tool and re-think the way it architects applications and infrastructure. Learn why Cassandra was selected as a replacement, what challenges were encountered along the way, and what architecture and infrastructure were involved in the implementation.

nativexcassandranosql
No sql databases
No sql databasesNo sql databases
No sql databases

This document provides an overview of NoSQL databases. It discusses how NoSQL databases were developed to handle the massive amounts of data and requests on the internet. It describes the different types of NoSQL databases and how they are useful for web applications and situations that don't require strict ACID properties. The document also covers some of the tradeoffs of NoSQL databases compared to relational databases and some of the challenges in using NoSQL databases.

sqlnosqldatabases
Traversal framework
     Example: a dependency graph

     Query: Find all dependencies of A, transitively



                         A




                             B
                                                       D
           C




Thursday, March 15, 12
Traversal framework
     Example: a dependency graph

     Query: Find all dependencies of A, transitively



                         A




                             B
                                                       D
           C




Thursday, March 15, 12
Traversal framework
     Example: a dependency graph

     Query: Find all dependencies of A, transitively



                         A




                             B
                                                       D
           C




Thursday, March 15, 12
Traversal framework
     Example: a dependency graph

     Query: Find all dependencies of A, transitively



                         A




                             B
                                                       D
           C




Thursday, March 15, 12

Recommended for you

Intro to NoSQL and MongoDB
 Intro to NoSQL and MongoDB Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDB

From A Morning with MongoDB - Milan on October 24, 2012.

mongodbnosql
Lunch & Learn Intro to Big Data
Lunch & Learn Intro to Big DataLunch & Learn Intro to Big Data
Lunch & Learn Intro to Big Data

On Friday, September 25th Devin Hopps lead us through a presentation on an Introduction to Big Data and how technology has evolved to harness the power of Big Data.

cayzen technologiescayzenbig data
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final

The document discusses how telecommunications companies can leverage graph databases to derive value from five key "graphs": the network graph, customer graph, call graph, master data graph, and help desk graph. It provides examples of how companies are using graph databases to improve network management, customer analytics, and other tasks. Reasons for adopting graph databases include faster querying of connected data, better matching of the data model to business domains, and improved maintainability. The presentation encourages attendees to connect at upcoming GraphConnect conferences to learn more.

Traversal framework
     Example: a dependency graph

     Query: Find all dependencies of A, transitively                  A




                                                                          B
                                                                              D
                                                                  C




         TraversalDescription desc = Traversal.description()
             .relationships(ExampleTypes.DEPENDS_ON, Direction.OUTGOING);

         Node a = ...;

         for (Node dependency : desc.traverse(a).nodes()) {
           print(dependency);
         }




Thursday, March 15, 12
So how do I find a node
    to traverse from?




                         ?




Thursday, March 15, 12
So how do I find a node
    to traverse from?

                                       g!
                                     in
                                ex
                           i nd
                    i ng
               us
         B y                                ?




Thursday, March 15, 12
So how do I find a node
    to traverse from?

                                       g!
                                     in
                                ex
                           i nd
                    i ng
               us
         B y                            name: David
                                                      ?




Thursday, March 15, 12

Recommended for you

The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final

The document discusses how telecommunications companies can leverage graph databases to derive value from five key "graphs": the network graph, customer graph, call graph, master data graph, and help desk graph. It provides examples of how companies are using graph databases to improve network management, customer analytics, and other use cases. Finally, it outlines the benefits that have driven telecommunications firms to adopt graph databases, including improved query performance, agile development, and an extensible data model.

New opportunities for connected data
New opportunities for connected dataNew opportunities for connected data
New opportunities for connected data

Today's complex data is not only big, but also semi-structured and densely connected. In this session we'll look at how size, structure and connectedness have converged to change the way we work with data. We'll then go on to look at some of the new opportunities for creating end-user value that have emerged in a world of connected data, illustrated with practical examples implemented using Neo4j, the world's leading graph database. Speaker: Ian Robinson, Director of Customer Success, Neo Technology Ian is an engineer at Neo Technology, currently working on research and development for future versions of the Neo4j graph database. Prior to joining the engineering team, Ian served as Neo's Director of Customer Success, managing training, professional services and support, and working with customers to design and develop graph database solutions. He is a co-author of 'Graph Databases' (O'Reilly) and 'REST in Practice' (O'Reilly), and a contributor to 'REST: From Research to Practice' (Springer) and 'Service Design Patterns' (Addison-Wesley). He presents at conferences worldwide on REST and the graph capabilities of Neo4j, and blogs at http://iansrobinson.com.

oreillyconnected datagraph database
0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals

This document provides an overview of Cypher Query Language by Michael Hunger. It begins by discussing why graphs and graph databases have become important with the rise of big data. It then shows some common graph structures like stars, diamonds and trees. The document emphasizes that graphs are a general purpose data structure and can be found everywhere, from social networks to biological systems.

So how do I find a node
    to traverse from?

                                       g!
                                     in
                                ex
                           i nd
                    i ng
               us
         B y                            name: David
                                                        ?
                                                      David




Thursday, March 15, 12
So how do I find a node
    to traverse from?

                                       g!    Andreas
                                     in
                                ex
                           i nd                                Michael

                    i ng
               us
         B y                            name: David
                                                         ?
                                                       David



                                        Ed

                                                               Allison




Thursday, March 15, 12
Cypher Query Language
        ๏ Declarative query language
                 • Describe what you want, not how
                 • Based on pattern matching
        ๏ Examples:
                START david=node:people(name=”David M”)   # index lookup
                MATCH david-[:knows]-friends-[:knows]-new_friends
                WHERE new_friends.age > 18
                RETURN new_friends

                START user=node(5, 15, 26, 28)   # node IDs
                MATCH user--friend
                RETURN user, COUNT(friend), SUM(friend.money)




                                                                           26

Thursday, March 15, 12
Beyond basics
        ๏ Traversal API / DSL
                 • Express powerful Graph Traversals succinctly
        ๏ Graph algorithm library
                 • Cheapest path (Dijkstra, A*)
                 • Shortest path
                 • Simple paths
                 • All paths
        ๏ REST API access to Neo4j Standalone Server
        ๏ High availability and online backups
                                                                  27

Thursday, March 15, 12

Recommended for you

0207 - Visualizing Your Graph
0207 - Visualizing Your Graph0207 - Visualizing Your Graph
0207 - Visualizing Your Graph

Learn to see graphs both conceptually and graphically. I’ll help you think of your domain as a graph, and help you visualize your graph one node at a time, in a sub-graph or all at once. See a pretty picture of your friends friendships, your nodes moving toward a cluster, and get lost in a 3D Graph in this session.

max de marzineo technologygraph database
Intro to graph world
Intro to graph worldIntro to graph world
Intro to graph world

1. The document introduces Neo4j, a graph database, and discusses why graphs and graph databases are important. 2. It explains that big data is on the rise and that graph databases are well-suited for modeling connected, heterogeneous data that is growing in volume and variety. 3. The document will cover why graphs are useful, what a graph database is, and how people use Neo4j in particular.

Premium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize GroupPremium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize Group

Urbanize Group launched Meadows which provides Plots for 3 & 4BHK premium Vilas. Book ecofriendly plots for premium Vilas on reasonable price. Visit our website for more info. https://bit.ly/3zkq8Qp

premium villa plots in bangalourbanize group
Spring Data Neo4j 2.0


Thursday, March 15, 12
Spring Framework Conveniences

        ๏ default enterprise development framework
        ๏ future Java Cloud stack
        ๏ POJO centric application design
        ๏ made AspectJ aspects socially acceptable (tx-config, @Configurable)
        ๏ Template programming model
        ๏ Inversion of Control / Dependency Injection
        ๏ Spring Java Config, configuration XML-namespaces
        ๏ lots of powerful libraries and library abstractions
        ๏ existing, well-known persistence framework for JDBC
        ๏ Spring Data project
Thursday, March 15, 12
Programming model overview

        ๏ SDN is the brain child of Rod Johnson and Emil Eifrém
                 • Wrote functional initial prototype
                 • Developed by Neo Technology and SpringSource teams
        ๏ Uses annotations to define graph entities
        ๏ Entity state backed by graph database
        ๏ Two modes of Object Graph Mapping
                 • POJO Graph Mapping
                 • seamless AspectJ backed Object Graph Mapping
        ๏ Spring Roo add-on available

Thursday, March 15, 12
Spring Data Neo4j features
        ๏ Annotation-based programming model
        ๏ Spring Data Commons Repository support
        ๏ Neo4j Query (Cypher, Gremlin) and Traversal support
                 • on dynamic fields and via repository methods
        ๏ Neo4j indexing support (includes fulltext and numeric range queries)
        ๏ Entity types stored in the graph database as well
        ๏ Dynamic type projection (duck typing)
        ๏ Cross-store support for partial JPA / graph entities
        ๏ Support for JSR-303 (bean validation)
        ๏ Support for the Neo4j Server (remote server and in server extension)
        ๏ Neo4jTemplate with exception translation, optional transaction management and
                    more
                                                                               31

Thursday, March 15, 12

Recommended for you

Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&ConsSowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons

Sowparnika Projects Launch -Sowparnika Euphoria, 8.5Acres, 3towers, 1B+G+14Floors, 1BHK, 2BHK,3BHK[540 - 1532]sqft, On State Highway 648, Whitefield, Bangalore

housieyproperty for salebuy property in bangalore
A Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdfA Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdf

Buying prime residential properties in London is a significant investment that requires careful planning, research, and consideration. This guide will walk you through the essential steps and tips to make a successful purchase in one of the world's most prestigious real estate markets. 1. Understanding the London Real Estate Market Before diving into the buying process, it's crucial to understand the dynamics of the London real estate market. London is known for its diverse neighborhoods, each offering unique characteristics, amenities, and property values. The market is influenced by factors such as economic conditions, political stability, and international demand. Key insights: Market Trends: Keep an eye on current market trends, including property price fluctuations, demand, and supply. Economic Factors: Consider the impact of economic indicators such as interest rates, inflation, and employment rates on the property market. Political Climate: Stay informed about political events and policies that might affect the real estate market, such as Brexit and changes in property taxes. 2. Identifying Prime Neighborhoods London is home to several prime neighborhoods that attract high-end buyers. Some of the most sought-after areas include: Kensington and Chelsea: Known for their elegant townhouses, garden squares, and proximity to cultural attractions. Mayfair: A prestigious area with luxury apartments, exclusive shops, and fine dining establishments. Belgravia: Renowned for its grand terraces, private gardens, and upscale living. Knightsbridge: Famous for its high-end retail stores, including Harrods, and luxurious residential properties. Hampstead: Offers a blend of village charm, green spaces, and stunning period homes. 3. Setting Your Budget and Financial Planning Buying prime real estate in London requires a substantial financial commitment. To ensure a smooth purchasing process, follow these steps: Determine Your Budget: Assess your financial situation and set a realistic budget for your property purchase. Consider additional costs such as stamp duty, legal fees, and renovation expenses. Financing Options: Explore various financing options, including mortgages, loans, and international financing if you are an overseas buyer. Currency Exchange: If you're an international buyer, consider the impact of currency exchange rates on your budget and plan accordingly. 4. Engaging a Professional Team Navigating the prime property market in London can be complex, so it's essential to have a team of professionals to guide you through the process: Real Estate Agent: Choose an experienced agent who specializes in prime residential properties in London. They can provide valuable insights, negotiate on your behalf, and help you find suitable properties. Solicitor/Conveyancer: Hire a solicitor or conveyancer to handle the legal aspects of the transaction, including contracts, searches, and property registration. Financial Advisor: Consult a financial advisor to

real estate agent in londonproperty finder servicerentend property
Camelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For SaleCamelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For Sale

Camelot Homes is upcoming project in New Chandigarh. The Project Price is starting from 99 lakhs. This is very cool opportunity for best investment.

propertyreal estateinvestment
Classic Neo4j domain class

          public class Actor {
              private final Node underlyingNode;

                 Actor( final Node node ) {
                     underlyingNode = node;
                 }

                 public Node getUnderlyingNode() {
                     return underlyingNode;
                 }

                 public final String getName() {
                     return (String) underlyingNode.getProperty( “name” );
                 }

                 public void setName( final String name ) {
                     underlyingNode.setProperty( “name”, name );
                 }
          }




Thursday, March 15, 12
Spring Data Neo4j domain class


       @NodeEntity
       public class Actor {
           @Indexed
           private String name;
       }




Thursday, March 15, 12
What about relationships
        @NodeEntity
        class Actor {
          ...

            public Iterable
                            <Movie> getMovi
              final List<Movi               es() {
                              e> movies = new
              for ( Relations                  LinkedList<Movi
                              hip rel : under                  e>();
                RelTypes.ACTS_I               lyingNode.getRe
                                N, Direction.OU               lationships(
                  movies.add( new               TGOING ) ) {
                                   Movie( rel.getE
                }
             return movies;
                                                   ndNode() ) );
                                                                     Old
           }
                                                              class)
           @RelatedTo(type="ACTS_ IN", elementClass = Movie.
                                     ;
           private Set<Movie> movies

            public Iterable<Movie> ge
                                      tMovies() {
                                                                       New
              return movies;
            }



Thursday, March 15, 12
Defining entity classes




Thursday, March 15, 12

Recommended for you

GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdfGUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf

Real estate

Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi PuneMenlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune

Menlo Professional Park by Menlo Realty is an exciting new commercial project coming up at Laxmi Chowk, Hinjewadi Phase 1, Pune. This development offers a variety of spaces for shops, showrooms, and offices, with unit sizes ranging from 163 to 1050 square feet. This flexibility ensures that businesses of all scales can find a suitable space within the development. The project is registered with MAHARERA under the registration number P52100055347, which guarantees adherence to all necessary regulations. Contact us - 8181817136

menlo professional parkprofessional park hinjewadimenlo professional park pune
How to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdfHow to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdf

Explore effective strategies for handling property maintenance, from routine upkeep to managing emergency repairs. Whether you're a seasoned landlord or new to property management, these tips will help you maintain your property efficiently and cost-effectively.

property managementproperty management company
Defining entity classes

    • @NodeEntity
        • Represents a node in the graph
        • Fields saved as properties on node
        • References stored as relationships between nodes
        • Instantiated using Java ‘new’ keyword, like any POJO
        • Also returned by lookup mechanisms
        • Type information stored in the graph




Thursday, March 15, 12
Defining entity classes




Thursday, March 15, 12
Defining entity classes

    • @RelationshipEntity
        • Represents a relationship in the graph
        • Fields saved as properties on relationship
        • Special fields for start- and end-nodes
        • Only returned by lookup methods




Thursday, March 15, 12
Fields in node entities (@NodeEntity)


       • Primitive types and strings are directly persisted
       • For all other types, Spring conversion support can be used
             • Enum and Date conversion is provided out-of-the-box
       • Transient fields not persisted
               @NodeEntity
               public class Actor {
                 private String name;
                 private int age;
                 private HairColor hairColor;
                 private transient String nickname;
               }



                                                                      37

Thursday, March 15, 12

Recommended for you

Unlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan PropertiesUnlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan Properties

Discover the benefits of off-plan properties in Dubai. Secure your dream home & potentially lower prices!

#dubairealestate#offplan#investment
Mortgage Broker in Waterloo, ontario.pptx
Mortgage Broker  in Waterloo, ontario.pptxMortgage Broker  in Waterloo, ontario.pptx
Mortgage Broker in Waterloo, ontario.pptx

Waterloo, Ontario, is a vibrant city known for its thriving technology sector, prestigious universities, and rich cultural scene. The city offers a blend of urban amenities and natural beauty, with numerous parks, trails, and recreational facilities. Waterloo's strong sense of community, best educational institutions, and dynamic economy make it an attractive place to live, work, and invest in real estate.

brokermortgage broker waterloomortgage
Brand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity PresentationBrand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity Presentation

This is a good example of how Brand Strategy, Brand Architecture and Brand Identity come together

brand strategybrand architecturebrand identity
Fields in node entities (@NodeEntity)
      • Fields of types that represent a node (@NodeEntity)




                                                              38

Thursday, March 15, 12
Fields in node entities (@NodeEntity)
      • Fields of types that represent a node (@NodeEntity)
         @NodeEntity
         public class Movie {}


         @NodeEntity
         public class Person {
           private Movie favoriteMovie;
         }




                                                              38

Thursday, March 15, 12
Fields in node entities (@NodeEntity)
      • Fields of types that represent a node (@NodeEntity)
         @NodeEntity
         public class Movie {}


         @NodeEntity
         public class Person {
           private Movie favoriteMovie;
         }

         @NodeEntity
         public class Movie {
           private Actor topActor;
         }


         @NodeEntity
         public class Actor {
           // Mirrors topActor in Movie
           @RelatedTo(type = ”topActor”, direction = Direction.INCOMING)
           private Movie wasTopActorIn;
         }
                                                                           38

Thursday, March 15, 12
Fields in node entities (@NodeEntity)
       • Fields of collections of node entities: @RelatedTo
            @NodeEntity
            public class Movie {}


            @NodeEntity
            public class Actor {
              @RelatedTo(type = “ACTS_IN”)
              private Set<Movie> movies;
            }




                                                              39

Thursday, March 15, 12

Recommended for you

Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...

Embrace opulence and sophistication at Godrej Yeshwanthpur, where luxury meets contemporary living in Bangalore. These impeccably designed 3 & 4BHK highrise residences redefine urban elegance with expansive layouts, panoramic city views, and unparalleled amenities. Nestled in the coveted Yeshwanthpur area, this address offers not just a home, but a lifestyle of utmost prestige and convenience. Discover the pinnacle of modern urban living at Godrej Yeshwanthpur, where every detail embodies excellence and grandeur.

godrej yeshwanthpur bangaloregodrej yeshwanthpur bengalurugodrej yeshwanthpur apartments
SVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property BroadcastSVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property Broadcast

The SVN® organization shares a portion of their new weekly listings via their SVN Live® Weekly Property Broadcast. Visit https://svn.com/svn-live/ if you would like to attend our weekly call, which we open up to the brokerage community.

cresvn
Titanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdfTitanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdf

In the heart of a bustling city, where dreams intertwine with the pulse of urban life, there stands a testament to strength, durability and prestige. This is the story of Signature Global Titanium SPR at Sector 71, Gurugram. Like the very essence of its namesake metal, it embodies robustness and resistance to the passage of time, promising a sanctuary of enduring quality and timeless elegance with 55+ amenities on offer that are curated around your everyday necessities.

signature global titanium spr
Fields in node entities (@NodeEntity)


        ๏ Fields of collections of relationship entities: @RelatedToVia
              @RelationshipEntity
              public class Role {
                @StartNode private Actor actor;
                @EndNode private Movie movie;
                private String roleName;
              }


              @NodeEntity
              public class Actor {
                @RelatedToVia(type = “ACTS_IN”)
                private Iterable<Role> roles;
              }



        ๏ Read only view of relationship entities                   40

Thursday, March 15, 12
Fields in relationship entities
     (@RelationshipEntity)
       • Primitive and convertible types work just the same


       • @StartNode and @EndNode provide access to the start and
                   end node entities for the relationship entity
             @RelationshipEntity
             public class Role {
               @StartNode private Actor actor;
               @EndNode private Movie movie;
               private String title;
             }




Thursday, March 15, 12
Indexing

    By annotating an entity field with @Indexed it becomes searchable:
           @NodeEntity
           public class Actor {
             @Indexed private String name;
             @Indexed private HairColor hairColor;




    It can then be looked up:
           GraphRepository<Actor> actorRepo =
               template.repositoryFor(Actor.class);
           Actor kevin =
               actorRepo.findByPropertyValue(“name”, “Kevin Bacon”);
           Iterable<Actor> allBlondActors =
               actorRepo.findAllByPropertyValue(“hairColor”, “blond”);




Thursday, March 15, 12
Indexing
         @NodeEntity
         public class Actor {
           @Indexed(type = FULLTEXT)
           private String name;


      ๏ Index name defaults to domain class name
      ๏ Index key defaults to field name
      ๏ Fulltext and spatial index types
      ๏ Repository query methods for any Lucene query, including ranges:
           Iterable<Actor> allKevinsOlderThan32 =
               actorRepo.findAllByQuery(“name:Kevin* AND age>32”);
           Iterable<Actor> youngActors =
               actorRepo.findAllByRange(“age”, 3, 18);




Thursday, March 15, 12

Recommended for you

Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2

Brochure Linden Tower của dự án Empire City Thủ Thiêm quận 2

empire citylinden residencelinden empire city
Ozak Duyu Gokturk - Istanbul - Listing Turkey
Ozak Duyu Gokturk - Istanbul -  Listing TurkeyOzak Duyu Gokturk - Istanbul -  Listing Turkey
Ozak Duyu Gokturk - Istanbul - Listing Turkey

Introducing Ozak Duyu Gokturk, an exceptional real estate project nestled in the heart of Istanbul. With its prime location and meticulously designed features, Özak Duyu offers a lifestyle of luxury and convenience, elevating the standards of modern living. Spanning across 11.891 square meters, this project seamlessly blends urban sophistication with natural beauty. Surrounded by lush greenery and serene landscapes, Özak Duyu provides residents with a tranquil retreat from the bustling city life. Comprising 5 blocks, Ozak Duyu Gokturk boasts a diverse range of residential units, catering to various lifestyles and preferences. From cozy studios to spacious multi-bedroom apartments, each unit is thoughtfully crafted to maximize comfort and functionality. Residents of Özak Duyu will find themselves immersed in a world of luxury with access to an impressive selection of amenities. Dive into relaxation with a refreshing swim in the outdoor pool, or break a sweat in the fully-equipped gym. Unwind in the sauna and steam room, or indulge in some gaming at the PlayStation Room. When hunger strikes, grab a bite at the on-site cafeteria before soaking up the sun in the designated sunbathing area. Take a leisurely stroll along the scenic walking paths, or engage in some friendly competition on the basketball court. Kids can frolic and play in the vibrant playground, while families gather and grill in the barbecue area. Ample green space provides the perfect backdrop for outdoor gatherings and picnics. With closed parking and storage facilities, convenience is at your fingertips, while 24/7 security ensures peace of mind. At Ozak Duyu Gokturk, every moment is enriched by an array of world-class amenities, promising an unparalleled living experience for all residents. Conveniently located just minutes away from Kemer Country Golf Club and Gokturk, Özak Duyu offers easy access to a myriad of shopping, dining, and entertainment options. Additionally, major transportation hubs and key business districts are within close proximity, ensuring seamless connectivity to the rest of the city. With its impeccable craftsmanship, modern design, and unparalleled amenities, Ozak Duyu Gokturk sets a new standard for luxury living in Istanbul. Whether you’re seeking a vibrant urban lifestyle or a peaceful sanctuary to call home, Özak Duyu has something for everyone. Don’t miss your chance to be a part of this extraordinary community – contact us today to learn more about available units and investment opportunities.

apartments for sale istanbulistanbul real estatereal estate istanbul
Listing Turkey - Vadistanbul-Katalog.pdf
Listing Turkey  - Vadistanbul-Katalog.pdfListing Turkey  - Vadistanbul-Katalog.pdf
Listing Turkey - Vadistanbul-Katalog.pdf

Vadistanbul Park: A Hub of Elegance and Convenience Vadistanbul Park is more than just a residential complex; it’s a vibrant community featuring 804 stylish homes, 120,000 m² of premium office space, 20,000 m² of luxurious residence units, and 22,000 m² of retail stores. The ample green spaces provide a tranquil escape, creating a perfect balance between urban living and natural beauty. Vadistanbul Terrace: Your Gateway to Comfort and Luxury The first stage of the Vadistanbul Project, Vadistanbul Terrace, spans a generous 250,000 m² area and was completed in just 17 months. This stage alone offers 1,111 exquisite housing units set on 51,000 m², providing residents with everything they need for a comfortable and fulfilling life. Whether you’re looking to relax or stay active, Vadistanbul Terrace has it all: Outdoor and Indoor Swimming Pools Tennis Courts Walking Tracks Saunas Basketball Courts Children’s Playgrounds Prime Location and Unmatched Accessibility Strategically located at the heart of Istanbul’s main connection points, Vadistanbul Terrace ensures fast and easy access to all parts of the city. The exclusive Havaray connection, unique to the Vadistanbul project, enhances connectivity and convenience for its residents. Diverse Living Options and Ample Parking Vadistanbul Terrace boasts 8 modern blocks offering a variety of apartment options, including 1+1, 2+1, 3+1, 4+1, and 5+1 duplex flats. Each unit is designed with contemporary aesthetics and functional layouts to cater to diverse lifestyle needs. Additionally, the complex provides a substantial parking capacity for 1,800 vehicles, ensuring hassle-free parking for all residents. Embrace the Vadistanbul Experience Experience a new standard of living at Vadistanbul, where urban sophistication meets natural tranquility. Whether you’re seeking a dynamic city life or a peaceful retreat, Vadistanbul offers the best of both worlds. Join the Vadistanbul community and discover a new way of living in the heart of Istanbul. For more information, visit ListingTurkey.com and find your perfect home at Vadistanbul today!

apartments for sale istanbulistanbul real estatereal estate istanbul
Traversal
     @NodeEntity
     public class Actor {
       @GraphTraversal(
          traversalBuilder = CoactorsTraversalDescriptionBuilder.class)
       private Iterable<Actor> coactors;
     }


     public class CoactorsTraversalDescriptionBuilder implements
         FieldTraversalDescriptionBuilder {
       public TraversalDescription build(...) {
         return Traversal.description()
             .evaluator(Evaluators.atDepth(2))
             .relationships(RelTypes.ACTS_IN);
       }
     }



      Example for dynamic field computation

                                                                          44

Thursday, March 15, 12
Cypher query language
     @NodeEntity
     public class Actor {
       @Query(“START actor=node({self}) ” +
              “MATCH actor-[:ACTS_IN]->movie<-[:ACTS_IN]-coactor ” +
              “RETURN coactor”)
       private Iterable<Actor> coactors;
     }




     @NodeEntity
     public class User {
       @Query(“START actor=node({self}) ” +
              “MATCH actor-[:ACTS_IN]->movie<-[:ACTS_IN]-coactor ” +
              “RETURN movie.title, coactor.name”)
       private List<Map<String, Object>> movieCoactorPairs;
     }




                                                                       45

Thursday, March 15, 12
POJO-Mapping
        ๏ Based on Spring-Data-Commons infrastructure
                 • Extract Mapping Meta Information
                 • Entity-Converter for Object-Graph-Mapping
                         ‣Type-resolution
                         ‣Entity construction
                         ‣Transfer properties
                         ‣Load Cache
                         ‣Load Policies + recurse for eagerly fetched relationships
                 • Neo4j-Template for Graph-Interaction
                                                                                  46

Thursday, March 15, 12
AspectJ
        ๏ Introduces interface to entities:
                 • NodeBacked into @NodeEntity classes
                 • RelationshipBacked into @RelationshipEntity classes
        ๏ NodeBacked introduces methods such as:
                 • relateTo
                 • findByQuery
                 • findAllByTraversal
                 • ...
        ๏ going to be pulled out in separate Active-Record-Mixin
                                                                         47

Thursday, March 15, 12

Recommended for you

Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024

In terms of expressway infrastructure, the term signifies an upgraded version of highways, designed to enforce restricted access at their entrances to prevent accidents and minimize delays for high-speed vehicles. This article intends to provide insights into the leading expressways in India highlighting their significance within the broader transport framework.

real estate
House for Buy in Madurai Find Your Perfect Home
House for Buy in Madurai  Find Your Perfect HomeHouse for Buy in Madurai  Find Your Perfect Home
House for Buy in Madurai Find Your Perfect Home

Welcome to House for Buy in Madurai, your premier destination for finding the ideal home in this vibrant city. Our extensive listings feature a variety of houses available for purchase, catering to different budgets and preferences. Whether you're looking for a cozy starter home, a spacious family residence, or a luxurious villa, we have the perfect options for you. Explore detailed property information, benefit from expert advice, and make informed decisions with ease. Experience the charm of living in Madurai, with its rich cultural heritage and modern conveniences. Let us guide you through a seamless home-buying process and help you find your dream house in Madurai. https://starhousing.org.in/

real estate
Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...

thesis on project management practice and challenges of construction project in ayat real state

practice and challenges of pro
AspectJ - Tooling
        ๏ IDE‘s
                 • latest versions of STS / Eclipse with current AJDT plugin
                 • IntelliJ IDEA 10.5 compile + run, some editor quirks
                         ‣full AspectJ support in IDEA 11


        ๏ Build Systems
                 • Maven
                 • Gradle
                 • Ant / Ivy
                 • ...
                                                                               48

Thursday, March 15, 12
AspectJ - NodeBacked.relateTo
     <T extends RelationshipBacked> T NodeBacked.relateTo(
         NodeBacked node,
         Class<T> relationshipEntityType,
         String relationshipType
     );


     usage:
     @NodeEntity
     public class Actor {
       public Role actsIn(Movie movie, String roleName) {
         Role role = relateTo(movie, Role.class, “ACTS_IN”);
         role.setName(roleName);
         return role;
       }
     }



                                                               49

Thursday, March 15, 12
Interface based Repositories
        ๏ based on Repository infrastructure in Spring Data Commons
        ๏ just define the interface and the namespace configuration
        ๏ provide out-of-the-box support for
                 • CRUD-Operations
                 • Index-Lookups
                 • Traversal-Execution
                 • Annotated Graph-Queries (Cypher, Gremlin)
                 • Derived Queries
                 • Spatial Queries
        ๏ extensible via custom methods with provided implementations
                                                                   50

Thursday, March 15, 12
Repositories
     interface MovieRepository extends GraphRepository<Movie> {
         Movie findById(String id);
         Page<Movie> findByTitle(String title, Pageable page);
     }


     <neo4j:repositories base-package=“com.example.repositories„/>


     @Controller
     public class MovieController {
       @Autowired MovieRepository moviesRepository;


         @RequestMapping(value = "/movies/{movieId}",...)
         public String show(Model model, @PathVariable String movieId) {
            Movie movie = moviesRepository.findByPropertyValue("id", movieId);
            Movie movie = moviesRepository.findById(movieId);
            model.addAttribute("movie", movie);
            return "/movies/show";
         }}
                                                                             51

Thursday, March 15, 12

Recommended for you

ZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing TurkeyZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing Turkey

Welcome to Zeytinkule Zeytinburnu, where luxury meets convenience along the picturesque Zeytinburnu coastline in Istanbul. Developed by MUKEL İnşaat, Zeytinkule offers a prestigious residential experience with its modern design, high-quality finishes, and a focus on comfort and security. Discover Your Dream Home: At Zeytinkule, residents can choose from spacious 2+1 and 3+1 apartments, each featuring closed kitchens and designed to maximize living space and functionality. Every unit offers breathtaking views of the sea, providing a serene backdrop to everyday life. Exceptional Living Experience: Enjoy exclusive amenities including a state-of-the-art gymnasium for fitness enthusiasts, smart home systems that enhance convenience and efficiency, and secure indoor parking. The project is meticulously designed to cater to the needs of discerning homeowners seeking luxury and peace of mind. Prime Location and Accessibility: Strategically located next to the Marmaray and Fişekhane, Zeytinkule ensures seamless connectivity to the rest of Istanbul. Residents can easily access the vibrant Zeytinburnu seaside within minutes, while major transportation arteries like the E-5 highway and Eurasia Tunnel are just a short drive away. Additionally, the proximity to Marmara Forum shopping mall offers abundant shopping and dining options. Flexible Payment Options: Zeytinkule offers flexible payment plans to suit various financial preferences, including cash options or a convenient 30-month installment plan in Turkish Lira. There are no title deed fees, making the purchasing process straightforward and cost-effective. Scheduled Delivery and Future Investment: Anticipated for completion in 2026, Zeytinkule represents not just a home but also a sound investment in Istanbul’s thriving real estate market. Whether you are looking to reside in a prestigious address or seeking a lucrative investment opportunity, Zeytinkule Zeytinburnu promises both luxury living and long-term value. Explore Zeytinkule Today: Contact us now to schedule a private viewing and experience firsthand the unmatched lifestyle and amenities offered at Zeytinkule. Our team is ready to assist you in securing your dream apartment in one of Istanbul’s most sought-after locations. https://listingturkey.com/property/zeytinkule-zeytinburnu/

zeytinkule zeytinburnuistanbul zeytinburnuapartments for sale istanbul
Repository-Query-Support
     interface MovieRepository extends GraphRepository<Movie> {


           @Query("start m=({movie}) match m-[ACTS_IN]-actor return actor")
           List<Actor> getActorsCypher(@Param("movie") Movie m);


           @Query("start movie =({0}) match (movie)<-[role:ACTS_IN]-(actor)
                   return actor.name, role.title")
           Iterable<Map<String,Object>> getCast(Movie m);


           @Query(value = "g.v(movie).out('ACTS_IN')", type = QueryType.Gremlin)
           Set<Person> getActorsGremlin(@Param("movie") Movie m);


           Page<Person> findByTitleAndActorsName(String title, String name,
                                                 Pageable page);
     }




                                                                              52

Thursday, March 15, 12
Neo4j-Template (I)

        ๏ well known Spring Template Pattern
        ๏ Resource / Transaction Management
        ๏ Convenience Methods
        ๏ Nodes and Entities handling & conversion
        ๏ Fluent Query Result Handling
        ๏ Works also via REST with Neo4j-Server
        ๏ Exception Translation



                                                     53

Thursday, March 15, 12
Neo4j-Template (II)
 template.lookup("node", "name", "David")
    .to(String.class, new PropertyContainerNameConverter()).single()


 template.traverse(node, traversal)
    .to(Integer.class,new ResultConverter<Path,Integer>() {
         public Integer convert(Path path, Class<String> type) {
             return path.length();
         }})


 template.query("start movie=(Movies,title, {m}) match movie-->actor return actor",
                map("m","Matrix")).to(Actor.class)


 template.execute("g.v(ref).outE", map("ref",0)).to(Relationship.class)




                                                                          54

Thursday, March 15, 12
REST-Client-Support
               <bean id="restGraphDatabaseService"
                     class="org.sf.data.neo4j.rest.SpringRestGraphDatabase">
                    <constructor-arg value="http://localhost:7473/db/data" />
               </bean>


               <datagraph:config graphDatabaseService="restGraphDatabaseService"/>




        ๏ drop-in replacement for the embedded GraphDatabase
        ๏ works transparently with POJO-Entity-Mapping and
              Neo4j-Template



                                                                                55

Thursday, March 15, 12

Recommended for you

REST-Server-Support
       public class HelloWorldInitializer extends SpringPluginInitializer {
           public HelloWorldInitializer() {
               super(new String[]{"spring/helloWorldServer-Context.xml"},
                     Pair.of("worldRepository", WorldRepository.class),
                     Pair.of("graphRepositoryFactory",
                                         GraphRepositoryFactory.class));
           }
       }




        ๏ integrate Spring Data Neo4j config with already running
              Graph-Database in Neo4j-Server
        ๏ expose Spring Beans as Jersey Injectables


                                                                              56

Thursday, March 15, 12
Cross-store persistence


Thursday, March 15, 12
A scenario...
     You have a traditional web app using JPA to persist data to a relational
       database




Thursday, March 15, 12
Option C: Introducing cross-store
    	

 persistence

        ๏ JPA data and NOSQL data can share a data model
        ๏ Could be the entire entity, or some fields of an entity
        ๏ We call this cross-store persistence
                 • One transaction managerdatabase the NOSQL database
                     with the JPA relational
                                             to coordinate


                 • AspectJ support to manage the NOSQL entities and fields



Thursday, March 15, 12

Recommended for you

The JPA data model
                                 Restaurant                           UserAccount
                         @Entity                       @Entity
                         public class Restaurant {     @Table(name = "user_account")
                             @Id @GeneratedValue       public class UserAccount {
                             private Long id;              @Id @GeneratedValue
                             private String name;          private Long id;
                             private String city;          private String userName;
                             private String state;         private String firstName;
                             private String zipCode;       private String lastName;
                                                           @Temporal(TemporalType.TIMESTAMP)
                                                           private Date birthDate;
                                                           @ManyToMany(cascade = CascadeType.ALL)
                                                           private Set<Restaurant> favorites;




Thursday, March 15, 12
Adding to the data model

                                   Restaurant                              UserAccount
                          @Entity                           @Entity
                          @NodeEntity(partial = true)       @Table(name = "user_account")
                          public class Restaurant {         @NodeEntity(partial = true)
                            @Id @GeneratedValue             public class UserAccount {
                            private Long id;                  @Id @GeneratedValue
                            private String name;              private Long id;
                            private String city;              private String userName;
                            private String state;             private String firstName;
                            private String zipCode;           private String lastName;
                                                              @Temporal(TemporalType.TIMESTAMP)
                                                              private Date birthDate;
                                                              @ManyToMany(cascade = CascadeType.ALL)
                                Recommendation                private Set<Restaurant> favorites;

                         @RelationshipEntity                  @GraphProperty
                         public class Recommendation {        String nickname;
                           @StartNode                         @RelatedTo(type = "friends",
                           private UserAccount user;               elementClass = UserAccount.class)
                           @EndNode                           Set<UserAccount> friends;
                           private Restaurant restaurant;     @RelatedToVia(type = "recommends",
                           private int stars;                      elementClass = Recommendation.class)
                           private String comment;            Iterable<Recommendation> recommendations;




Thursday, March 15, 12
Adding to the data model

                                   Restaurant                              UserAccount
                          @Entity                           @Entity
                          @NodeEntity(partial = true)       @Table(name = "user_account")
                          public class Restaurant {         @NodeEntity(partial = true)
                            @Id @GeneratedValue             public class UserAccount {
                            private Long id;                  @Id @GeneratedValue
                            private String name;              private Long id;
                            private String city;              private String userName;
                            private String state;             private String firstName;
                            private String zipCode;           private String lastName;
                                                              @Temporal(TemporalType.TIMESTAMP)
                                                              private Date birthDate;
                                                              @ManyToMany(cascade = CascadeType.ALL)
                                Recommendation                private Set<Restaurant> favorites;

                         @RelationshipEntity                  @GraphProperty
                         public class Recommendation {        String nickname;
                           @StartNode                         @RelatedTo(type = "friends",
                           private UserAccount user;               elementClass = UserAccount.class)
                           @EndNode                           Set<UserAccount> friends;
                           private Restaurant restaurant;     @RelatedToVia(type = "recommends",
                           private int stars;                      elementClass = Recommendation.class)
                           private String comment;            Iterable<Recommendation> recommendations;




Thursday, March 15, 12
Adding to the data model

                                   Restaurant                              UserAccount
                          @Entity                           @Entity
                          @NodeEntity(partial = true)       @Table(name = "user_account")
                          public class Restaurant {         @NodeEntity(partial = true)
                            @Id @GeneratedValue             public class UserAccount {
                            private Long id;                  @Id @GeneratedValue
                            private String name;              private Long id;
                            private String city;              private String userName;
                            private String state;             private String firstName;
                            private String zipCode;           private String lastName;
                                                              @Temporal(TemporalType.TIMESTAMP)
                                                              private Date birthDate;
                                                              @ManyToMany(cascade = CascadeType.ALL)
                                Recommendation                private Set<Restaurant> favorites;

                         @RelationshipEntity                  @GraphProperty
                         public class Recommendation {        String nickname;
                           @StartNode                         @RelatedTo(type = "friends",
                           private UserAccount user;               elementClass = UserAccount.class)
                           @EndNode                           Set<UserAccount> friends;
                           private Restaurant restaurant;     @RelatedToVia(type = "recommends",
                           private int stars;                      elementClass = Recommendation.class)
                           private String comment;            Iterable<Recommendation> recommendations;




Thursday, March 15, 12

Recommended for you

Adding to the data model

                                   Restaurant                              UserAccount
                          @Entity                           @Entity
                          @NodeEntity(partial = true)       @Table(name = "user_account")
                          public class Restaurant {         @NodeEntity(partial = true)
                            @Id @GeneratedValue             public class UserAccount {
                            private Long id;                  @Id @GeneratedValue
                            private String name;              private Long id;
                            private String city;              private String userName;
                            private String state;             private String firstName;
                            private String zipCode;           private String lastName;
                                                              @Temporal(TemporalType.TIMESTAMP)
                                                              private Date birthDate;
                                                              @ManyToMany(cascade = CascadeType.ALL)
                                Recommendation                private Set<Restaurant> favorites;

                         @RelationshipEntity                  @GraphProperty
                         public class Recommendation {        String nickname;
                           @StartNode                         @RelatedTo(type = "friends",
                           private UserAccount user;               elementClass = UserAccount.class)
                           @EndNode                           Set<UserAccount> friends;
                           private Restaurant restaurant;     @RelatedToVia(type = "recommends",
                           private int stars;                      elementClass = Recommendation.class)
                           private String comment;            Iterable<Recommendation> recommendations;




Thursday, March 15, 12
Adding to the data model

                                   Restaurant                              UserAccount
                          @Entity                           @Entity
                          @NodeEntity(partial = true)       @Table(name = "user_account")
                          public class Restaurant {         @NodeEntity(partial = true)
                            @Id @GeneratedValue             public class UserAccount {
                            private Long id;                  @Id @GeneratedValue
                            private String name;              private Long id;
                            private String city;              private String userName;
                            private String state;             private String firstName;
                            private String zipCode;           private String lastName;
                                                              @Temporal(TemporalType.TIMESTAMP)
                                                              private Date birthDate;
                                                              @ManyToMany(cascade = CascadeType.ALL)
                                Recommendation                private Set<Restaurant> favorites;

                         @RelationshipEntity                  @GraphProperty
                         public class Recommendation {        String nickname;
                           @StartNode                         @RelatedTo(type = "friends",
                           private UserAccount user;               elementClass = UserAccount.class)
                           @EndNode                           Set<UserAccount> friends;
                           private Restaurant restaurant;     @RelatedToVia(type = "recommends",
                           private int stars;                      elementClass = Recommendation.class)
                           private String comment;            Iterable<Recommendation> recommendations;




Thursday, March 15, 12
Spring Data Neo4j Roo add-on
       ๏ Roo adding support for non-JPA
                   persistence providers
       ๏ Spring Data Neo4j was the first
                   NOSQL persistence Roo
                   Add-On
       ๏ See the chapter on Spring Data
                   Neo4j in the latest O’Reilly
                   Roo book, Getting Started with
                   Roo.




                                                    62

Thursday, March 15, 12
Spring Data Neo4j Roo add-on

      roo> project --topLevelPackage org.neo4j.imdb
      roo> graph setup --provider NEO4J --databaseLocation target/imdb

      roo> graph entity --class ~.model.Movie
      roo> field string title
      roo> field number --fieldName year --type java.lang.Integer --permitReservedWords --primitive

      roo> graph entity --class ~.model.Actor
      roo> field string name

      roo> graph relationship --to Movie --from Actor --fieldName movies --type ACTS_IN
             --cardinality ONE_TO_MANY
      roo> graph relationship --via ~.model.Role --to Movie --from Actor --fieldName roles
             --type ACTS_IN --cardinality ONE_TO_MANY
      roo> graph relationship --from Movie --to Actor --type ACTS_IN --fieldName actors
             --direction INCOMING --cardinality MANY_TO_ONE
      roo> field string --fieldName title --class ~.model.Role

      roo> controller scaffold --class ~.web.ActorController --entity ~.model.Actor
      roo> controller scaffold --class ~.web.MovieController --entity ~.model.Movie



                                                                                             63

Thursday, March 15, 12

Recommended for you

Spring Data Neo4j Guidebook
                              “Good Relationships”
         “I’m excited about Spring Data Neo4j.... Spring Data Neo4j makes working
         with Neo4j amazingly easy, and therefore has the potential to make you
         more successful as a developer.”
                                                       Rod Johnson, founder of Spring
        ๏ Spring Data Neo4j comes with a great Guide Book, featuring:
                 • Forewords by Rod Johnson and Emil Eifrem
                 • An easy to read, narrative tutorial walkthrough for cineasts.net
                 • A comprehensive reference for all the details
                 • Check it out here: http://spring.neo4j.org/guide
                                                                              64

Thursday, March 15, 12
The end (and the beginning!)
        ๏ See the Spring Data Neo4j site for more info:
                    http://spring.neo4j.org
        ๏ Check out the developer notes at GitHub:
                    http://spring.neo4j.org/notes
        ๏ Again, don’t miss our fantastic e-book on Spring Data Neo4j:
                    http://spring.neo4j.org/guide
        ๏ Spring Data Forum at
                    http://spring.neo4j.org/discussions
        ๏ All about Neo4j:
                    http://neo4j.org
        ๏ Neo4j videos and webinars:
                    http://video.neo4j.org


Thursday, March 15, 12
Cineasts.net




      Check Out: http://spring.neo4j.org/tutorial
Thursday, March 15, 12

More Related Content

What's hot

SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, EgyptSQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
Chris Richardson
 
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDBBig Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
BigDataCloud
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
Ram kumar
 
NoSQL databases and managing big data
NoSQL databases and managing big dataNoSQL databases and managing big data
NoSQL databases and managing big data
Steven Francia
 
Semantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business IntelligenceSemantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business Intelligence
Marin Dimitrov
 
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational
PostgreSQL Experts, Inc.
 
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,..."Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
lisapaglia
 
Sharing data on the web (2013)
Sharing data on the web (2013)Sharing data on the web (2013)
Sharing data on the web (2013)
3 Round Stones
 
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Mark Rittman
 

What's hot (9)

SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, EgyptSQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
SQL? NoSQL? NewSQL?!? What’s a Java developer to do? - JDC2012 Cairo, Egypt
 
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDBBig Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
Big Data Cloud Meetup - Jan 29 2013 - Mike Stonebraker & Scott Jarr of VoltDB
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
NoSQL databases and managing big data
NoSQL databases and managing big dataNoSQL databases and managing big data
NoSQL databases and managing big data
 
Semantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business IntelligenceSemantic Technologies and Triplestores for Business Intelligence
Semantic Technologies and Triplestores for Business Intelligence
 
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational
 
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,..."Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
"Navigating the Database Universe" by Dr. Michael Stonebraker and Scott Jarr,...
 
Sharing data on the web (2013)
Sharing data on the web (2013)Sharing data on the web (2013)
Sharing data on the web (2013)
 
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
Delivering the Data Factory, Data Reservoir and a Scalable Oracle Big Data Ar...
 

Viewers also liked

Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
Michal Bachman
 
Neo4j Makes Graphs Easy
Neo4j Makes Graphs EasyNeo4j Makes Graphs Easy
Neo4j Makes Graphs Easy
Neo4j
 
Neo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in MalmöNeo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in Malmö
Craig Taverner
 
Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015
Craig Taverner
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import
Neo4j
 
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Codemotion
 
GraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud PreventionGraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud Prevention
Neo4j
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
Antonio Maccioni
 
LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"
Whitepages Pro
 
Neo4j Solutions - Master Data Management
Neo4j Solutions - Master Data ManagementNeo4j Solutions - Master Data Management
Neo4j Solutions - Master Data Management
Caserta
 
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship ManagementBig MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management
Caserta
 
faradays law and its applications ppt
faradays law and its applications pptfaradays law and its applications ppt
faradays law and its applications ppt
Indira Kundu
 

Viewers also liked (12)

Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)Modelling Data in Neo4j (plus a few tips)
Modelling Data in Neo4j (plus a few tips)
 
Neo4j Makes Graphs Easy
Neo4j Makes Graphs EasyNeo4j Makes Graphs Easy
Neo4j Makes Graphs Easy
 
Neo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in MalmöNeo4j Spatial at LocationDay 2013 in Malmö
Neo4j Spatial at LocationDay 2013 in Malmö
 
Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015Neo4j Spatial - FooCafe September 2015
Neo4j Spatial - FooCafe September 2015
 
Relational to Graph - Import
Relational to Graph - ImportRelational to Graph - Import
Relational to Graph - Import
 
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
Managing Connected Big Data in Art with Neo4j Graph Database - Lorenzo Speran...
 
GraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud PreventionGraphDay Stockholm - Fraud Prevention
GraphDay Stockholm - Fraud Prevention
 
Converting Relational to Graph Databases
Converting Relational to Graph DatabasesConverting Relational to Graph Databases
Converting Relational to Graph Databases
 
LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"LEND360: "Identity Data for the Customer Lifecycle"
LEND360: "Identity Data for the Customer Lifecycle"
 
Neo4j Solutions - Master Data Management
Neo4j Solutions - Master Data ManagementNeo4j Solutions - Master Data Management
Neo4j Solutions - Master Data Management
 
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship ManagementBig MDM Part 2: Using a Graph Database for MDM and Relationship Management
Big MDM Part 2: Using a Graph Database for MDM and Relationship Management
 
faradays law and its applications ppt
faradays law and its applications pptfaradays law and its applications ppt
faradays law and its applications ppt
 

Similar to 3/15 - Intro to Spring Data Neo4j

Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011
jexp
 
No Sql Movement
No Sql MovementNo Sql Movement
No Sql Movement
Ajit Koti
 
NOSQL Databases types and Uses
NOSQL Databases types and UsesNOSQL Databases types and Uses
NOSQL Databases types and Uses
Suvradeep Rudra
 
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
Emil Eifrem
 
Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases
William LaForest
 
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
Emil Eifrem
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
Dimitar Danailov
 
Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et Introductions
MongoDB
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
Bethmi Gunasekara
 
MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPal
MySQL Brasil
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks ass
Tobias Lindaaker
 
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
Emil Eifrem
 
Know what is NOSQL
Know what is NOSQL Know what is NOSQL
Know what is NOSQL
Prasoon Sharma
 
Why nosql?
Why nosql?Why nosql?
Choosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot ApproachChoosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot Approach
DATAVERSITY
 
Gilbane Boston 2011 big data
Gilbane Boston 2011 big dataGilbane Boston 2011 big data
Gilbane Boston 2011 big data
Peter O'Kelly
 
Minnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with CassandraMinnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with Cassandra
Jeff Bollinger
 
No sql databases
No sql databasesNo sql databases
No sql databases
Vamshi Vangapally
 
Intro to NoSQL and MongoDB
 Intro to NoSQL and MongoDB Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
MongoDB
 
Lunch & Learn Intro to Big Data
Lunch & Learn Intro to Big DataLunch & Learn Intro to Big Data
Lunch & Learn Intro to Big Data
Melissa Hornbostel
 

Similar to 3/15 - Intro to Spring Data Neo4j (20)

Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011Spring Data Neo4j Intro SpringOne 2011
Spring Data Neo4j Intro SpringOne 2011
 
No Sql Movement
No Sql MovementNo Sql Movement
No Sql Movement
 
NOSQL Databases types and Uses
NOSQL Databases types and UsesNOSQL Databases types and Uses
NOSQL Databases types and Uses
 
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
NOSQL Overview, Neo4j Intro And Production Example (QCon London 2010)
 
Anti-social Databases
Anti-social DatabasesAnti-social Databases
Anti-social Databases
 
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
NOSQL overview and intro to graph databases with Neo4j (Geeknight May 2010)
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Morning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et IntroductionsMorning with MongoDB Paris 2012 - Accueil et Introductions
Morning with MongoDB Paris 2012 - Accueil et Introductions
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 
MySQL Cluster no PayPal
MySQL Cluster no PayPalMySQL Cluster no PayPal
MySQL Cluster no PayPal
 
Django and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks assDjango and Neo4j - Domain modeling that kicks ass
Django and Neo4j - Domain modeling that kicks ass
 
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
 
Know what is NOSQL
Know what is NOSQL Know what is NOSQL
Know what is NOSQL
 
Why nosql?
Why nosql?Why nosql?
Why nosql?
 
Choosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot ApproachChoosing the Right Big Data Tools for the Job - A Polyglot Approach
Choosing the Right Big Data Tools for the Job - A Polyglot Approach
 
Gilbane Boston 2011 big data
Gilbane Boston 2011 big dataGilbane Boston 2011 big data
Gilbane Boston 2011 big data
 
Minnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with CassandraMinnebar 2013 - Scaling with Cassandra
Minnebar 2013 - Scaling with Cassandra
 
No sql databases
No sql databasesNo sql databases
No sql databases
 
Intro to NoSQL and MongoDB
 Intro to NoSQL and MongoDB Intro to NoSQL and MongoDB
Intro to NoSQL and MongoDB
 
Lunch & Learn Intro to Big Data
Lunch & Learn Intro to Big DataLunch & Learn Intro to Big Data
Lunch & Learn Intro to Big Data
 

More from Neo4j

The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
Neo4j
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
Neo4j
 
New opportunities for connected data
New opportunities for connected dataNew opportunities for connected data
New opportunities for connected data
Neo4j
 
0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals
Neo4j
 
0207 - Visualizing Your Graph
0207 - Visualizing Your Graph0207 - Visualizing Your Graph
0207 - Visualizing Your Graph
Neo4j
 
Intro to graph world
Intro to graph worldIntro to graph world
Intro to graph world
Neo4j
 

More from Neo4j (6)

The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
 
The five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar finalThe five graphs of telecommunications may 22 2013 webinar final
The five graphs of telecommunications may 22 2013 webinar final
 
New opportunities for connected data
New opportunities for connected dataNew opportunities for connected data
New opportunities for connected data
 
0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals0221 Cypher for SQL Professionals
0221 Cypher for SQL Professionals
 
0207 - Visualizing Your Graph
0207 - Visualizing Your Graph0207 - Visualizing Your Graph
0207 - Visualizing Your Graph
 
Intro to graph world
Intro to graph worldIntro to graph world
Intro to graph world
 

Recently uploaded

Premium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize GroupPremium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize Group
Urbanize Group
 
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&ConsSowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Housiey
 
A Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdfA Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdf
brithomescouk
 
Camelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For SaleCamelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For Sale
Shri Lakshmi Realtech
 
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdfGUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
ProexportColombia1
 
Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi PuneMenlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune
shubhamkale709080
 
How to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdfHow to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdf
MichaelJacobs140
 
Unlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan PropertiesUnlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan Properties
Home Station
 
Mortgage Broker in Waterloo, ontario.pptx
Mortgage Broker  in Waterloo, ontario.pptxMortgage Broker  in Waterloo, ontario.pptx
Mortgage Broker in Waterloo, ontario.pptx
maxmortages23
 
Brand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity PresentationBrand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity Presentation
Rajesh Math
 
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
JagadishKR1
 
SVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property BroadcastSVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property Broadcast
SVN International Corp.
 
Titanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdfTitanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdf
Signature Global
 
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Viet House
 
Ozak Duyu Gokturk - Istanbul - Listing Turkey
Ozak Duyu Gokturk - Istanbul -  Listing TurkeyOzak Duyu Gokturk - Istanbul -  Listing Turkey
Ozak Duyu Gokturk - Istanbul - Listing Turkey
Listing Turkey
 
Listing Turkey - Vadistanbul-Katalog.pdf
Listing Turkey  - Vadistanbul-Katalog.pdfListing Turkey  - Vadistanbul-Katalog.pdf
Listing Turkey - Vadistanbul-Katalog.pdf
Listing Turkey
 
Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024
akashbhartiseo
 
House for Buy in Madurai Find Your Perfect Home
House for Buy in Madurai  Find Your Perfect HomeHouse for Buy in Madurai  Find Your Perfect Home
House for Buy in Madurai Find Your Perfect Home
duraidhivya275
 
Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...
belete20
 
ZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing TurkeyZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing Turkey
Listing Turkey
 

Recently uploaded (20)

Premium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize GroupPremium Villa Plots In Bangalore | Urbanize Group
Premium Villa Plots In Bangalore | Urbanize Group
 
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&ConsSowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
Sowparnika Euphoria Whitefield - Virtual Tour, Pricing, Pros&Cons
 
A Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdfA Guide to Buying Prime Residential Properties in London.pdf
A Guide to Buying Prime Residential Properties in London.pdf
 
Camelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For SaleCamelot Homes in New Chandigarh For Sale
Camelot Homes in New Chandigarh For Sale
 
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdfGUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
GUIA_LEGAL_CHAPTER-11_REAL STATE PROPERTY .pdf
 
Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi PuneMenlo Professional Park by Menlo Realty LLP Hinjewadi Pune
Menlo Professional Park by Menlo Realty LLP Hinjewadi Pune
 
How to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdfHow to Handle Property Maintenance in Property Management.pdf
How to Handle Property Maintenance in Property Management.pdf
 
Unlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan PropertiesUnlock Dubai's Growth: Invest in Off-Plan Properties
Unlock Dubai's Growth: Invest in Off-Plan Properties
 
Mortgage Broker in Waterloo, ontario.pptx
Mortgage Broker  in Waterloo, ontario.pptxMortgage Broker  in Waterloo, ontario.pptx
Mortgage Broker in Waterloo, ontario.pptx
 
Brand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity PresentationBrand Strategy <> Brand Architecture <> Brand Identity Presentation
Brand Strategy <> Brand Architecture <> Brand Identity Presentation
 
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
Godrej Yeshwanthpur - Luxuriate in Urban Splendor With Exquisite Highrise Res...
 
SVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property BroadcastSVN Live 7.8.24 Weekly Property Broadcast
SVN Live 7.8.24 Weekly Property Broadcast
 
Titanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdfTitanium SPR Final Brochure 20.May.24.pdf
Titanium SPR Final Brochure 20.May.24.pdf
 
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
Brochure Linden Tower dự án Empire City Thủ Thiêm quận 2
 
Ozak Duyu Gokturk - Istanbul - Listing Turkey
Ozak Duyu Gokturk - Istanbul -  Listing TurkeyOzak Duyu Gokturk - Istanbul -  Listing Turkey
Ozak Duyu Gokturk - Istanbul - Listing Turkey
 
Listing Turkey - Vadistanbul-Katalog.pdf
Listing Turkey  - Vadistanbul-Katalog.pdfListing Turkey  - Vadistanbul-Katalog.pdf
Listing Turkey - Vadistanbul-Katalog.pdf
 
Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024Top 10 Expressways in India updated 2024
Top 10 Expressways in India updated 2024
 
House for Buy in Madurai Find Your Perfect Home
House for Buy in Madurai  Find Your Perfect HomeHouse for Buy in Madurai  Find Your Perfect Home
House for Buy in Madurai Find Your Perfect Home
 
Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...Assessment of Project Management Practices and Challenges in Construction Pro...
Assessment of Project Management Practices and Challenges in Construction Pro...
 
ZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing TurkeyZeytinKule Zeytinburnu Katalog Listing Turkey
ZeytinKule Zeytinburnu Katalog Listing Turkey
 

3/15 - Intro to Spring Data Neo4j

  • 1. Webinar Introduction to Spring Data Neo4j 2.0 Michael Hunger, Neo Technology Thursday, March 15, 12
  • 2. Me & You ? ๏ Me: Michael Hunger, Neo Technology • passionate software developer / Neo4j German Division • Spring Data Neo4j Project Lead • Neo4j Cloud Hosting • michael.hunger@neotechnology.com / @mesirii ๏ You: • Java & Spring ! • Enterprise ? • Rich Domain ? • NOSQL ? Thursday, March 15, 12
  • 3. About the Webinar ๏ Covers Spring Data Neo4j only ๏ too much content anyway ๏ so it will be just a whirlwind tour ๏ no detailed introductions to NOSQL and Neo4j in particular ๏ for those go to http://neo4j.org ๏ Q&A at the end ๏ all your questions will be answered in a follow up blog post, don‘t hesitate to ask Thursday, March 15, 12
  • 4. What‘s up? ๏ Spring Data overview ๏ Networks are everywhere ๏ Neo4j introduction ๏ Spring Data Neo4j introduction 4 Thursday, March 15, 12
  • 5. Spring Data 5 Thursday, March 15, 12
  • 7. What is NOSQL? It’s not “No to SQL” Thursday, March 15, 12
  • 8. What is NOSQL? It’s not “No to SQL” It’s not “Never SQL” Thursday, March 15, 12
  • 9. What is NOSQL? It’s not “No to SQL” It’s not “Never SQL” It’s “Not Only SQL” Thursday, March 15, 12
  • 10. What is NOSQL? It’s not “No to SQL” It’s not “Never SQL” It’s “Not Only SQL” NOSQL no-seek-wool n. Describes ongoing trend where developers increasingly opt for non-relational databases to help solve their problems, in an effort to use the right tool for the right job. Thursday, March 15, 12
  • 11. NOSQL categories We see four main categories in the NOSQL space: Thursday, March 15, 12
  • 12. NOSQL categories We see four main categories in the NOSQL space: Key-Value •Redis •Riak •Voldemort Thursday, March 15, 12
  • 13. NOSQL categories We see four main categories in the NOSQL space: Column-family/ Key-Value BigTable •Redis •Riak •Cassandra •Voldemort •HBase Thursday, March 15, 12
  • 14. NOSQL categories We see four main categories in the NOSQL space: Column-family/ Key-Value BigTable •Redis •Riak •Cassandra •Voldemort •HBase Document •MongoDB •CouchDB Thursday, March 15, 12
  • 15. NOSQL categories We see four main categories in the NOSQL space: Column-family/ Key-Value BigTable •Redis •Riak •Cassandra •Voldemort •HBase Document Graph •Neo4j •MongoDB •InfiniteGraph •CouchDB •OrientDB •DEX Thursday, March 15, 12
  • 16. Scaling to size vs. Scaling to complexity Size Key-Value stores Bigtable clones Document databases Graph databases Complexity 8 Thursday, March 15, 12
  • 17. Scaling to size vs. Scaling to complexity Size Key-Value stores Bigtable clones Document databases Graph databases Billions of nodes and relationships Complexity 8 Thursday, March 15, 12
  • 18. Scaling to size vs. Scaling to complexity Size Key-Value stores Bigtable clones Document databases Graph databases Billions of nodes and relationships > 90% of use cases Complexity 8 Thursday, March 15, 12
  • 19. Why NOSQL now? We have observed four trends since the 90‘s: ๏ Trend 1: Size of data is growing ๏ Trend 2: Data is increasingly connected ๏ Trend 3: Data is increasingly semi-structured ๏ Trend 4: Change in architecture Thursday, March 15, 12
  • 20. What is Spring Data? ๏ VMWare/SpringSource initiative to give Spring developers easy access to the emerging world of NOSQL, including: • Non-relational databases • Grails NOSQL support • Cross-store persistence • Object Persistence Mapping Infrastructure • Generic Repository Infrastructure • upcoming Spring Roo add-ons 10 Thursday, March 15, 12
  • 21. Spring Data projects ๏ Code is in SpringSource git repository: • http://springsource.org/spring-data • https://github.com/SpringSource/spring-data-* ๏ Includes: • data-commons • spring-data-graph-neo4j • spring-data-{redis,riak} • spring-data-mongo • spring-data-jdbc • spring-data-jpa Thursday, March 15, 12
  • 22. Spring Data Neo4j ๏ Focus on Spring Data Neo4j ๏ VMWare is collaborating with Neo Technology, the company behind the Neo4j graph database. ๏ Improved programming model: Annotation-based programming model for applications with rich domain models ๏ Cross-store persistence: Extend existing JPA application with NOSQL persistence ๏ Spring Roo support: Add graph persistence with Roo add-on Thursday, March 15, 12
  • 23. Graphs are everywhere 13 Thursday, March 15, 12
  • 24. Even in the Matrix - everything is a graph Google Image Search: „graph OR network“ 14 Thursday, March 15, 12
  • 25. Graphs Everywhere ๏ Relationships in • Politics, Economics, History, Science,Transportation ๏ Biology, Chemistry, Physics, Sociology • Body, Ecosphere, Reaction, Interactions ๏ Internet / IT • Hardware, Software, Interaction ๏ Social Networks • Family, Friends • Work, Communities • Neighbours, Cities, Society Thursday, March 15, 12 15
  • 26. Good Relationships ๏ World is rich, messy and related data ๏ Relationships are as least as important as the things they connect ๏ Graphs = Whole > Sum of all parts ๏ Complex interactions ๏ Always changing, change of structures as well ๏ Graph => Relationships are part of the data ๏ RDBMS => Relationships part of the fixed schema 16 Thursday, March 15, 12
  • 27. Questions and Answers ๏ Complex Questions ๏ Answers lie between the lines (things) ๏ Locality of the information ๏ Global searches / operations very expensive ๏ Constant query time, regardless of data volume 17 Thursday, March 15, 12
  • 28. Categories ? ๏ Categories == Classes, Trees ? ๏ What if more than one category fits? ๏ Tags ๏ Categories via relationships like „IS_A“ ๏ Any number, easy to change ๏ „Virtual“ Relationships - Traversals ๏ Category dynamically derived from queries 18 Thursday, March 15, 12
  • 30. What is Neo4j? data model Thursday, March 15, 12
  • 31. What is Neo4j? data model A Graph Database Thursday, March 15, 12
  • 32. What is Neo4j? data model A Graph Database Thursday, March 15, 12
  • 33. What is Neo4j? data model A Graph Database Thursday, March 15, 12
  • 34. What is Neo4j? data model A Graph Database Node Node Thursday, March 15, 12
  • 35. What is Neo4j? data model A Graph Database Typed relationship Node Node Thursday, March 15, 12
  • 36. What is Neo4j? data model A Graph Database Node Typed relationship Node key: value key: value Thursday, March 15, 12
  • 38. For example name: Oliver Thursday, March 15, 12
  • 39. For example name: Oliver name: Michael Thursday, March 15, 12
  • 40. For example WORKS_WITH project: spring-data name: Oliver name: Michael Thursday, March 15, 12
  • 41. For example WORKS_WITH project: spring-data name: Oliver name: Michael EM PL LIVES_IN OY E D_ BY city: Dresden company: VMware country: DE Thursday, March 15, 12
  • 42. For example name: Rod KN S OW OW S KN WORKS_WITH project: spring-data name: Oliver name: Michael EM PL LIVES_IN OY E D_ BY city: Dresden company: VMware country: DE Thursday, March 15, 12
  • 43. For example name: Rod KN S OW OW S KN WORKS_WITH project: spring-data name: Oliver name: Michael EM PL LIVES_IN S OY LIKE E D_ BY city: Dresden food: Chinese company: VMware country: DE Thursday, March 15, 12
  • 44. Facts about Neo4j •Written in Java •Embeddable or standalone Server •Schema-free - perfect for rich domains •Fully transactional (ACID) •Persistent to custom on-disk file structure •Traversal speeds of 1,000,000+ hops per second •Integrated indexing •Plenthora of language bindings •24/7 production since 2003 Thursday, March 15, 12
  • 45. Show me some code, please GraphDatabaseService graphDb = new EmbeddedGraphDatabase(“var/neo4j”); Node david = graphDb.createNode(); Node andreas = graphDb.createNode(); david.setProperty(“name”, “David Montag”); andreas.setProperty(“name”, “Andreas Kollegger”); Relationship presentedWith = david.createRelationshipTo( andreas, PresentationTypes.PRESENTED_WITH); presentedWith.setProperty(“date”, System.currentTimeMillis()); Thursday, March 15, 12
  • 46. Show me some code, please GraphDatabaseService graphDb = new EmbeddedGraphDatabase(“var/neo4j”); Transaction tx = graphDb.beginTx(); try { Node david = graphDb.createNode(); Node andreas = graphDb.createNode(); david.setProperty(“name”, “David Montag”); andreas.setProperty(“name”, “Andreas Kollegger”); Relationship presentedWith = david.createRelationshipTo( andreas, PresentationTypes.PRESENTED_WITH); presentedWith.setProperty(“date”, System.currentTimeMillis()); tx.success(); } finally { tx.finish(); } Thursday, March 15, 12
  • 48. Traversal framework Example: a dependency graph A B D C Thursday, March 15, 12
  • 49. Traversal framework Example: a dependency graph Query: Find all dependencies of A, transitively A B D C Thursday, March 15, 12
  • 50. Traversal framework Example: a dependency graph Query: Find all dependencies of A, transitively A B D C Thursday, March 15, 12
  • 51. Traversal framework Example: a dependency graph Query: Find all dependencies of A, transitively A B D C Thursday, March 15, 12
  • 52. Traversal framework Example: a dependency graph Query: Find all dependencies of A, transitively A B D C Thursday, March 15, 12
  • 53. Traversal framework Example: a dependency graph Query: Find all dependencies of A, transitively A B D C TraversalDescription desc = Traversal.description() .relationships(ExampleTypes.DEPENDS_ON, Direction.OUTGOING); Node a = ...; for (Node dependency : desc.traverse(a).nodes()) { print(dependency); } Thursday, March 15, 12
  • 54. So how do I find a node to traverse from? ? Thursday, March 15, 12
  • 55. So how do I find a node to traverse from? g! in ex i nd i ng us B y ? Thursday, March 15, 12
  • 56. So how do I find a node to traverse from? g! in ex i nd i ng us B y name: David ? Thursday, March 15, 12
  • 57. So how do I find a node to traverse from? g! in ex i nd i ng us B y name: David ? David Thursday, March 15, 12
  • 58. So how do I find a node to traverse from? g! Andreas in ex i nd Michael i ng us B y name: David ? David Ed Allison Thursday, March 15, 12
  • 59. Cypher Query Language ๏ Declarative query language • Describe what you want, not how • Based on pattern matching ๏ Examples: START david=node:people(name=”David M”) # index lookup MATCH david-[:knows]-friends-[:knows]-new_friends WHERE new_friends.age > 18 RETURN new_friends START user=node(5, 15, 26, 28) # node IDs MATCH user--friend RETURN user, COUNT(friend), SUM(friend.money) 26 Thursday, March 15, 12
  • 60. Beyond basics ๏ Traversal API / DSL • Express powerful Graph Traversals succinctly ๏ Graph algorithm library • Cheapest path (Dijkstra, A*) • Shortest path • Simple paths • All paths ๏ REST API access to Neo4j Standalone Server ๏ High availability and online backups 27 Thursday, March 15, 12
  • 61. Spring Data Neo4j 2.0 Thursday, March 15, 12
  • 62. Spring Framework Conveniences ๏ default enterprise development framework ๏ future Java Cloud stack ๏ POJO centric application design ๏ made AspectJ aspects socially acceptable (tx-config, @Configurable) ๏ Template programming model ๏ Inversion of Control / Dependency Injection ๏ Spring Java Config, configuration XML-namespaces ๏ lots of powerful libraries and library abstractions ๏ existing, well-known persistence framework for JDBC ๏ Spring Data project Thursday, March 15, 12
  • 63. Programming model overview ๏ SDN is the brain child of Rod Johnson and Emil Eifrém • Wrote functional initial prototype • Developed by Neo Technology and SpringSource teams ๏ Uses annotations to define graph entities ๏ Entity state backed by graph database ๏ Two modes of Object Graph Mapping • POJO Graph Mapping • seamless AspectJ backed Object Graph Mapping ๏ Spring Roo add-on available Thursday, March 15, 12
  • 64. Spring Data Neo4j features ๏ Annotation-based programming model ๏ Spring Data Commons Repository support ๏ Neo4j Query (Cypher, Gremlin) and Traversal support • on dynamic fields and via repository methods ๏ Neo4j indexing support (includes fulltext and numeric range queries) ๏ Entity types stored in the graph database as well ๏ Dynamic type projection (duck typing) ๏ Cross-store support for partial JPA / graph entities ๏ Support for JSR-303 (bean validation) ๏ Support for the Neo4j Server (remote server and in server extension) ๏ Neo4jTemplate with exception translation, optional transaction management and more 31 Thursday, March 15, 12
  • 65. Classic Neo4j domain class public class Actor { private final Node underlyingNode; Actor( final Node node ) { underlyingNode = node; } public Node getUnderlyingNode() { return underlyingNode; } public final String getName() { return (String) underlyingNode.getProperty( “name” ); } public void setName( final String name ) { underlyingNode.setProperty( “name”, name ); } } Thursday, March 15, 12
  • 66. Spring Data Neo4j domain class @NodeEntity public class Actor { @Indexed private String name; } Thursday, March 15, 12
  • 67. What about relationships @NodeEntity class Actor { ... public Iterable <Movie> getMovi final List<Movi es() { e> movies = new for ( Relations LinkedList<Movi hip rel : under e>(); RelTypes.ACTS_I lyingNode.getRe N, Direction.OU lationships( movies.add( new TGOING ) ) { Movie( rel.getE } return movies; ndNode() ) ); Old } class) @RelatedTo(type="ACTS_ IN", elementClass = Movie. ; private Set<Movie> movies public Iterable<Movie> ge tMovies() { New return movies; } Thursday, March 15, 12
  • 69. Defining entity classes • @NodeEntity • Represents a node in the graph • Fields saved as properties on node • References stored as relationships between nodes • Instantiated using Java ‘new’ keyword, like any POJO • Also returned by lookup mechanisms • Type information stored in the graph Thursday, March 15, 12
  • 71. Defining entity classes • @RelationshipEntity • Represents a relationship in the graph • Fields saved as properties on relationship • Special fields for start- and end-nodes • Only returned by lookup methods Thursday, March 15, 12
  • 72. Fields in node entities (@NodeEntity) • Primitive types and strings are directly persisted • For all other types, Spring conversion support can be used • Enum and Date conversion is provided out-of-the-box • Transient fields not persisted @NodeEntity public class Actor { private String name; private int age; private HairColor hairColor; private transient String nickname; } 37 Thursday, March 15, 12
  • 73. Fields in node entities (@NodeEntity) • Fields of types that represent a node (@NodeEntity) 38 Thursday, March 15, 12
  • 74. Fields in node entities (@NodeEntity) • Fields of types that represent a node (@NodeEntity) @NodeEntity public class Movie {} @NodeEntity public class Person { private Movie favoriteMovie; } 38 Thursday, March 15, 12
  • 75. Fields in node entities (@NodeEntity) • Fields of types that represent a node (@NodeEntity) @NodeEntity public class Movie {} @NodeEntity public class Person { private Movie favoriteMovie; } @NodeEntity public class Movie { private Actor topActor; } @NodeEntity public class Actor { // Mirrors topActor in Movie @RelatedTo(type = ”topActor”, direction = Direction.INCOMING) private Movie wasTopActorIn; } 38 Thursday, March 15, 12
  • 76. Fields in node entities (@NodeEntity) • Fields of collections of node entities: @RelatedTo @NodeEntity public class Movie {} @NodeEntity public class Actor { @RelatedTo(type = “ACTS_IN”) private Set<Movie> movies; } 39 Thursday, March 15, 12
  • 77. Fields in node entities (@NodeEntity) ๏ Fields of collections of relationship entities: @RelatedToVia @RelationshipEntity public class Role { @StartNode private Actor actor; @EndNode private Movie movie; private String roleName; } @NodeEntity public class Actor { @RelatedToVia(type = “ACTS_IN”) private Iterable<Role> roles; } ๏ Read only view of relationship entities 40 Thursday, March 15, 12
  • 78. Fields in relationship entities (@RelationshipEntity) • Primitive and convertible types work just the same • @StartNode and @EndNode provide access to the start and end node entities for the relationship entity @RelationshipEntity public class Role { @StartNode private Actor actor; @EndNode private Movie movie; private String title; } Thursday, March 15, 12
  • 79. Indexing By annotating an entity field with @Indexed it becomes searchable: @NodeEntity public class Actor { @Indexed private String name; @Indexed private HairColor hairColor; It can then be looked up: GraphRepository<Actor> actorRepo = template.repositoryFor(Actor.class); Actor kevin = actorRepo.findByPropertyValue(“name”, “Kevin Bacon”); Iterable<Actor> allBlondActors = actorRepo.findAllByPropertyValue(“hairColor”, “blond”); Thursday, March 15, 12
  • 80. Indexing @NodeEntity public class Actor { @Indexed(type = FULLTEXT) private String name; ๏ Index name defaults to domain class name ๏ Index key defaults to field name ๏ Fulltext and spatial index types ๏ Repository query methods for any Lucene query, including ranges: Iterable<Actor> allKevinsOlderThan32 = actorRepo.findAllByQuery(“name:Kevin* AND age>32”); Iterable<Actor> youngActors = actorRepo.findAllByRange(“age”, 3, 18); Thursday, March 15, 12
  • 81. Traversal @NodeEntity public class Actor { @GraphTraversal( traversalBuilder = CoactorsTraversalDescriptionBuilder.class) private Iterable<Actor> coactors; } public class CoactorsTraversalDescriptionBuilder implements FieldTraversalDescriptionBuilder { public TraversalDescription build(...) { return Traversal.description() .evaluator(Evaluators.atDepth(2)) .relationships(RelTypes.ACTS_IN); } } Example for dynamic field computation 44 Thursday, March 15, 12
  • 82. Cypher query language @NodeEntity public class Actor { @Query(“START actor=node({self}) ” + “MATCH actor-[:ACTS_IN]->movie<-[:ACTS_IN]-coactor ” + “RETURN coactor”) private Iterable<Actor> coactors; } @NodeEntity public class User { @Query(“START actor=node({self}) ” + “MATCH actor-[:ACTS_IN]->movie<-[:ACTS_IN]-coactor ” + “RETURN movie.title, coactor.name”) private List<Map<String, Object>> movieCoactorPairs; } 45 Thursday, March 15, 12
  • 83. POJO-Mapping ๏ Based on Spring-Data-Commons infrastructure • Extract Mapping Meta Information • Entity-Converter for Object-Graph-Mapping ‣Type-resolution ‣Entity construction ‣Transfer properties ‣Load Cache ‣Load Policies + recurse for eagerly fetched relationships • Neo4j-Template for Graph-Interaction 46 Thursday, March 15, 12
  • 84. AspectJ ๏ Introduces interface to entities: • NodeBacked into @NodeEntity classes • RelationshipBacked into @RelationshipEntity classes ๏ NodeBacked introduces methods such as: • relateTo • findByQuery • findAllByTraversal • ... ๏ going to be pulled out in separate Active-Record-Mixin 47 Thursday, March 15, 12
  • 85. AspectJ - Tooling ๏ IDE‘s • latest versions of STS / Eclipse with current AJDT plugin • IntelliJ IDEA 10.5 compile + run, some editor quirks ‣full AspectJ support in IDEA 11 ๏ Build Systems • Maven • Gradle • Ant / Ivy • ... 48 Thursday, March 15, 12
  • 86. AspectJ - NodeBacked.relateTo <T extends RelationshipBacked> T NodeBacked.relateTo( NodeBacked node, Class<T> relationshipEntityType, String relationshipType ); usage: @NodeEntity public class Actor { public Role actsIn(Movie movie, String roleName) { Role role = relateTo(movie, Role.class, “ACTS_IN”); role.setName(roleName); return role; } } 49 Thursday, March 15, 12
  • 87. Interface based Repositories ๏ based on Repository infrastructure in Spring Data Commons ๏ just define the interface and the namespace configuration ๏ provide out-of-the-box support for • CRUD-Operations • Index-Lookups • Traversal-Execution • Annotated Graph-Queries (Cypher, Gremlin) • Derived Queries • Spatial Queries ๏ extensible via custom methods with provided implementations 50 Thursday, March 15, 12
  • 88. Repositories interface MovieRepository extends GraphRepository<Movie> { Movie findById(String id); Page<Movie> findByTitle(String title, Pageable page); } <neo4j:repositories base-package=“com.example.repositories„/> @Controller public class MovieController { @Autowired MovieRepository moviesRepository; @RequestMapping(value = "/movies/{movieId}",...) public String show(Model model, @PathVariable String movieId) { Movie movie = moviesRepository.findByPropertyValue("id", movieId); Movie movie = moviesRepository.findById(movieId); model.addAttribute("movie", movie); return "/movies/show"; }} 51 Thursday, March 15, 12
  • 89. Repository-Query-Support interface MovieRepository extends GraphRepository<Movie> { @Query("start m=({movie}) match m-[ACTS_IN]-actor return actor") List<Actor> getActorsCypher(@Param("movie") Movie m); @Query("start movie =({0}) match (movie)<-[role:ACTS_IN]-(actor) return actor.name, role.title") Iterable<Map<String,Object>> getCast(Movie m); @Query(value = "g.v(movie).out('ACTS_IN')", type = QueryType.Gremlin) Set<Person> getActorsGremlin(@Param("movie") Movie m); Page<Person> findByTitleAndActorsName(String title, String name, Pageable page); } 52 Thursday, March 15, 12
  • 90. Neo4j-Template (I) ๏ well known Spring Template Pattern ๏ Resource / Transaction Management ๏ Convenience Methods ๏ Nodes and Entities handling & conversion ๏ Fluent Query Result Handling ๏ Works also via REST with Neo4j-Server ๏ Exception Translation 53 Thursday, March 15, 12
  • 91. Neo4j-Template (II) template.lookup("node", "name", "David") .to(String.class, new PropertyContainerNameConverter()).single() template.traverse(node, traversal) .to(Integer.class,new ResultConverter<Path,Integer>() { public Integer convert(Path path, Class<String> type) { return path.length(); }}) template.query("start movie=(Movies,title, {m}) match movie-->actor return actor", map("m","Matrix")).to(Actor.class) template.execute("g.v(ref).outE", map("ref",0)).to(Relationship.class) 54 Thursday, March 15, 12
  • 92. REST-Client-Support <bean id="restGraphDatabaseService" class="org.sf.data.neo4j.rest.SpringRestGraphDatabase"> <constructor-arg value="http://localhost:7473/db/data" /> </bean> <datagraph:config graphDatabaseService="restGraphDatabaseService"/> ๏ drop-in replacement for the embedded GraphDatabase ๏ works transparently with POJO-Entity-Mapping and Neo4j-Template 55 Thursday, March 15, 12
  • 93. REST-Server-Support public class HelloWorldInitializer extends SpringPluginInitializer { public HelloWorldInitializer() { super(new String[]{"spring/helloWorldServer-Context.xml"}, Pair.of("worldRepository", WorldRepository.class), Pair.of("graphRepositoryFactory", GraphRepositoryFactory.class)); } } ๏ integrate Spring Data Neo4j config with already running Graph-Database in Neo4j-Server ๏ expose Spring Beans as Jersey Injectables 56 Thursday, March 15, 12
  • 95. A scenario... You have a traditional web app using JPA to persist data to a relational database Thursday, March 15, 12
  • 96. Option C: Introducing cross-store persistence ๏ JPA data and NOSQL data can share a data model ๏ Could be the entire entity, or some fields of an entity ๏ We call this cross-store persistence • One transaction managerdatabase the NOSQL database with the JPA relational to coordinate • AspectJ support to manage the NOSQL entities and fields Thursday, March 15, 12
  • 97. The JPA data model Restaurant UserAccount @Entity @Entity public class Restaurant { @Table(name = "user_account") @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) private Set<Restaurant> favorites; Thursday, March 15, 12
  • 98. Adding to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Thursday, March 15, 12
  • 99. Adding to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Thursday, March 15, 12
  • 100. Adding to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Thursday, March 15, 12
  • 101. Adding to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Thursday, March 15, 12
  • 102. Adding to the data model Restaurant UserAccount @Entity @Entity @NodeEntity(partial = true) @Table(name = "user_account") public class Restaurant { @NodeEntity(partial = true) @Id @GeneratedValue public class UserAccount { private Long id; @Id @GeneratedValue private String name; private Long id; private String city; private String userName; private String state; private String firstName; private String zipCode; private String lastName; @Temporal(TemporalType.TIMESTAMP) private Date birthDate; @ManyToMany(cascade = CascadeType.ALL) Recommendation private Set<Restaurant> favorites; @RelationshipEntity @GraphProperty public class Recommendation { String nickname; @StartNode @RelatedTo(type = "friends", private UserAccount user; elementClass = UserAccount.class) @EndNode Set<UserAccount> friends; private Restaurant restaurant; @RelatedToVia(type = "recommends", private int stars; elementClass = Recommendation.class) private String comment; Iterable<Recommendation> recommendations; Thursday, March 15, 12
  • 103. Spring Data Neo4j Roo add-on ๏ Roo adding support for non-JPA persistence providers ๏ Spring Data Neo4j was the first NOSQL persistence Roo Add-On ๏ See the chapter on Spring Data Neo4j in the latest O’Reilly Roo book, Getting Started with Roo. 62 Thursday, March 15, 12
  • 104. Spring Data Neo4j Roo add-on roo> project --topLevelPackage org.neo4j.imdb roo> graph setup --provider NEO4J --databaseLocation target/imdb roo> graph entity --class ~.model.Movie roo> field string title roo> field number --fieldName year --type java.lang.Integer --permitReservedWords --primitive roo> graph entity --class ~.model.Actor roo> field string name roo> graph relationship --to Movie --from Actor --fieldName movies --type ACTS_IN --cardinality ONE_TO_MANY roo> graph relationship --via ~.model.Role --to Movie --from Actor --fieldName roles --type ACTS_IN --cardinality ONE_TO_MANY roo> graph relationship --from Movie --to Actor --type ACTS_IN --fieldName actors --direction INCOMING --cardinality MANY_TO_ONE roo> field string --fieldName title --class ~.model.Role roo> controller scaffold --class ~.web.ActorController --entity ~.model.Actor roo> controller scaffold --class ~.web.MovieController --entity ~.model.Movie 63 Thursday, March 15, 12
  • 105. Spring Data Neo4j Guidebook “Good Relationships” “I’m excited about Spring Data Neo4j.... Spring Data Neo4j makes working with Neo4j amazingly easy, and therefore has the potential to make you more successful as a developer.” Rod Johnson, founder of Spring ๏ Spring Data Neo4j comes with a great Guide Book, featuring: • Forewords by Rod Johnson and Emil Eifrem • An easy to read, narrative tutorial walkthrough for cineasts.net • A comprehensive reference for all the details • Check it out here: http://spring.neo4j.org/guide 64 Thursday, March 15, 12
  • 106. The end (and the beginning!) ๏ See the Spring Data Neo4j site for more info: http://spring.neo4j.org ๏ Check out the developer notes at GitHub: http://spring.neo4j.org/notes ๏ Again, don’t miss our fantastic e-book on Spring Data Neo4j: http://spring.neo4j.org/guide ๏ Spring Data Forum at http://spring.neo4j.org/discussions ๏ All about Neo4j: http://neo4j.org ๏ Neo4j videos and webinars: http://video.neo4j.org Thursday, March 15, 12
  • 107. Cineasts.net Check Out: http://spring.neo4j.org/tutorial Thursday, March 15, 12