SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
Neo4j
                 Spatial
                 GIS for the rest of us


                                          #neo4j
Peter Neubauer                            @peterneubauer
                                          peter@neotechnology.com
Neo Technology
NOSQL data models
            Key-value stores
Data size




                          Bigtable clones


                                            Document
                                            databases


                                                           Graph databases




                                                        Data complexity
The Neo4j model: Property Graph
 Core abstractions:
                                              name = “Emil”

   Nodes
                                              age = 29
                                              sex = “yes”


   Relationships between nodes
   Properties on both                     1                         2



                         type = KNOWS
                         time = 4 years                       3

                                                                  type = car
                                                                  vendor = “SAAB”
                                                                  model = “95 Aero”
Neo4j – Nodes, Relationships, Properties




 Nodes have different properties
   Matrix characters: People vs. Programs
 Build structure as you go
    Who loves Neo?
Building a node space
GraphDatabaseService graphDb = ... // Get factory


// Create Thomas 'Neo' Anderson
Node mrAnderson = graphDb.createNode();
mrAnderson.setProperty( "name", "Thomas Anderson" );
mrAnderson.setProperty( "age", 29 );

// Create Morpheus
Node morpheus = graphDb.createNode();
morpheus.setProperty( "name", "Morpheus" );
morpheus.setProperty( "rank", "Captain" );
morpheus.setProperty( "occupation", "Total bad ass" );

// Create a relationship representing that they know each other
mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS );
// ...create Trinity, Cypher, Agent Smith, Architect similarly
Building a node space
GraphDatabaseService graphDb = ... // Get factory
Transaction tx = graphdb.beginTx();

// Create Thomas 'Neo' Anderson
Node mrAnderson = graphDb.createNode();
mrAnderson.setProperty( "name", "Thomas Anderson" );
mrAnderson.setProperty( "age", 29 );

// Create Morpheus
Node morpheus = graphDb.createNode();
morpheus.setProperty( "name", "Morpheus" );
morpheus.setProperty( "rank", "Captain" );
morpheus.setProperty( "occupation", "Total bad ass" );

// Create a relationship representing that they know each other
mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS );
// ...create Trinity, Cypher, Agent Smith, Architect similarly
tx.commit();
Code (2): Traversing a node space
// Instantiate a traverser that returns Mr Anderson's friends
Traverser friendsTraverser = mrAnderson.traverse(
   Traverser.Order.BREADTH_FIRST,
   StopEvaluator.END_OF_GRAPH,
   ReturnableEvaluator.ALL_BUT_START_NODE,
   RelTypes.KNOWS,
   Direction.OUTGOING );

// Traverse the node space and print out the result
System.out.println( "Mr Anderson's friends:" );
for ( Node friend : friendsTraverser )
{
   System.out.printf( "At depth %d => %s%n",
       friendsTraverser.currentPosition().getDepth(),
       friend.getProperty( "name" ) );
}
Ruby
gem install neo4j

require ”rubygems”
require 'neo4j'

class Person
  include Neo4j::NodeMixin
  property :name, :age, :occupation
  index :name
  has_n :friends
end

Neo4j::Transactoin.run do
  neo = Person.new :name=>'Neo', :age=>29
  morpheus = Person.new :name=>'Morpheus', :occupation=>'badass'
  neo.friends << morpheus
end

neo.friends.each {|p|...}
Routing
Social graphs
Impact, Dependency Analysis
Master Data Management
Why Spatial?
  Complex data
    Multiple indexing (domain, Spatial, temporal)
  Location entering many domains
  GIS going mainstream, topologies explode
  No good systems out there
  Proprietary stacks rule (ESRI, Oracle)
  Open Government Data
  Shapefiles suck.
Persistence backends in GIS
  Shapefiles
  PostGIS
  MySQL
  Oracle Spatial
  ESRI
  GeoCouch
  Cassandra (?)
  Neo4j Spatial
Current challenges in Spatial
  Domain and Spatial interconnections
  Unstructured domain data
  Routing
  Topology handling
  No good OSS full GIS stack
The Neo4j Spatial stack
     OpenLayers                       PHP
                        AJAX
       WMS              Editing        JS
       WMF                             C#
                                                      Rails
                                            Spring   Django
                                             Roo




     GeoServer uDig    GeoMaya      REST    Java     Scripting


                  GeoTools

                    Neo4j Spatial


                              Neo4j
OpenStreetMap
The OpenStreetMap dataset
 Wiki for Spatial info
 Freely available data
 Very unstructured, free tagging
   Points, Ways, Relations, Tags, Changesets
 Changes can be pushed back
   Used for other purposes
 Great coverage in interesting places (towns, disasters etc)
OpenStreetMap
OpenStreetMap
GSoC 2010

 Davide Savazzi
 Geotools & GeoServer
 Routing
 uDig
Connecting and Splitting

  Layer1                   Layer1


  Layer2                   Layer2


  Layer3                   Layer3




 Why have layers at all?
    Simpler renderers
    Historical
    Data sources
GSoC 2010 - Routing
Connecting and Splitting


 Routing




 OSM Dynamic Layers
GSoC 2010 - uDig
Neo4j dynamic layers

                         Geometry                     Layer1
                         Encoder
                          Dynamic
                           Query                      Layer2

                          Dynamic
                           Styles
                                                      Layer3
                          Dynamic
                          Meta-Inf


Connected domain data   Neo4j Spatial   GIS and Spatial stacks
OpenStreetMap




Dynamic                 OSM
 Laye rs




     Inde x (RTre e )
Dynamic Layers
Dynamic Layers
Dynamic Layers
Future
  Complex spatial mapping and analytics made easy
  Editing
    Fine Grained Geotools Feature Editing
    OSM Editor
  OSM
    Caching sub-graphs (desktop & mobile)
    More Dynamic Layers & Shapefile export
  Topology
    Persist all topological results in graph
  Benchmarking & Performance
     Improved indexing
     Composite index
API References
 Wiki, Code, API references
   http://wiki.neo4j.org/content/Neo4j_Spatial
   http://github.com/neo4j/neo4j-spatial
   http://components.neo4j.org/neo4j-spatial
   Mailing list: neo4j@lists.neo4j.org
   http://neo4j.org/community/list/
Questions?




             Image credit: lost again! Sorry :(
http://neotechnology.com

Mais conteúdo relacionado

Mais procurados

Map box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersMap box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersJody Garnett
 
OSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tablesOSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tableshholzgra
 
Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...GeoSolutions
 
One GeoNode, many GeoNodes
One GeoNode, many GeoNodesOne GeoNode, many GeoNodes
One GeoNode, many GeoNodesGeoSolutions
 
Managing GeoData with PostGIS @ KhmelnytskyiPy #1
Managing GeoData with PostGIS @ KhmelnytskyiPy #1Managing GeoData with PostGIS @ KhmelnytskyiPy #1
Managing GeoData with PostGIS @ KhmelnytskyiPy #1Volodymyr Gamula
 
Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...GeoSolutions
 
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...Shaun Lewis
 
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...GeoSolutions
 
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...OCTO Technology
 
Data Challenges with 3D Computer Vision
Data Challenges with 3D Computer VisionData Challenges with 3D Computer Vision
Data Challenges with 3D Computer VisionMartin Scholl
 
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...GeoSolutions
 
OL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers mapsOL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers mapsAndreas Hocevar
 
Drupal mapping
Drupal mappingDrupal mapping
Drupal mappingLev Tsypin
 

Mais procurados (16)

Map box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersMap box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayers
 
OSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tablesOSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tables
 
Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...
 
One GeoNode, many GeoNodes
One GeoNode, many GeoNodesOne GeoNode, many GeoNodes
One GeoNode, many GeoNodes
 
Managing GeoData with PostGIS @ KhmelnytskyiPy #1
Managing GeoData with PostGIS @ KhmelnytskyiPy #1Managing GeoData with PostGIS @ KhmelnytskyiPy #1
Managing GeoData with PostGIS @ KhmelnytskyiPy #1
 
Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...Serving earth observation data with GeoServer: addressing real world requirem...
Serving earth observation data with GeoServer: addressing real world requirem...
 
OpenLayer's basics
OpenLayer's basicsOpenLayer's basics
OpenLayer's basics
 
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...
Processing Landsat 8 Multi-Spectral Images with GRASS Tools & the potential o...
 
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer And GeoTools: Achievements, Issues And Future Develo...
 
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
Petit Déjeuner Datastax 14-04-15 Courbo Spark : exemple de Machine Learning s...
 
Data Challenges with 3D Computer Vision
Data Challenges with 3D Computer VisionData Challenges with 3D Computer Vision
Data Challenges with 3D Computer Vision
 
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
Raster Data In GeoServer and GeoTools: Achievements, Issues And Future Develo...
 
Os Racicot
Os RacicotOs Racicot
Os Racicot
 
OL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers mapsOL3-Cesium: 3D for OpenLayers maps
OL3-Cesium: 3D for OpenLayers maps
 
ENTER 2004
ENTER 2004ENTER 2004
ENTER 2004
 
Drupal mapping
Drupal mappingDrupal mapping
Drupal mapping
 

Semelhante a Neo4j spatial-nosql-frankfurt

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
 
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
 
Neo4j - The Benefits of Graph Databases (OSCON 2009)
Neo4j - The Benefits of Graph Databases (OSCON 2009)Neo4j - The Benefits of Graph Databases (OSCON 2009)
Neo4j - The Benefits of Graph Databases (OSCON 2009)Emil Eifrem
 
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
 
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
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklNeo4j
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingNesreen K. Ahmed
 
Collaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringCollaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringWaqas Nawaz
 
Training di Base Neo4j
Training di Base Neo4jTraining di Base Neo4j
Training di Base Neo4jNeo4j
 
RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018Simeon Fitch
 
RasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine LearningRasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine LearningAstraea, Inc.
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 OverviewDavid Chou
 
Graph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemGraph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemMarco Parenzan
 
What's New in ArcGIS 10.1 Data Interoperability Extension
What's New in ArcGIS 10.1 Data Interoperability ExtensionWhat's New in ArcGIS 10.1 Data Interoperability Extension
What's New in ArcGIS 10.1 Data Interoperability ExtensionSafe Software
 
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 20072009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007Marc Smith
 

Semelhante a Neo4j spatial-nosql-frankfurt (20)

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ö
 
Eifrem neo4j
Eifrem neo4jEifrem neo4j
Eifrem neo4j
 
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)
 
Neo4j - The Benefits of Graph Databases (OSCON 2009)
Neo4j - The Benefits of Graph Databases (OSCON 2009)Neo4j - The Benefits of Graph Databases (OSCON 2009)
Neo4j - The Benefits of Graph Databases (OSCON 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)
A NOSQL Overview And The Benefits Of Graph Databases (nosql east 2009)
 
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)
 
Osm improvements
Osm improvementsOsm improvements
Osm improvements
 
Neo4j Nosqllive
Neo4j NosqlliveNeo4j Nosqllive
Neo4j Nosqllive
 
Combine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quicklCombine Spring Data Neo4j and Spring Boot to quickl
Combine Spring Data Neo4j and Spring Boot to quickl
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Collaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph ClusteringCollaborative Similarity Measure for Intra-Graph Clustering
Collaborative Similarity Measure for Intra-Graph Clustering
 
Training di Base Neo4j
Training di Base Neo4jTraining di Base Neo4j
Training di Base Neo4j
 
No Sql
No SqlNo Sql
No Sql
 
RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018RasterFrames - FOSS4G NA 2018
RasterFrames - FOSS4G NA 2018
 
RasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine LearningRasterFrames: Enabling Global-Scale Geospatial Machine Learning
RasterFrames: Enabling Global-Scale Geospatial Machine Learning
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
Graph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft EcosystemGraph Databases in the Microsoft Ecosystem
Graph Databases in the Microsoft Ecosystem
 
What's New in ArcGIS 10.1 Data Interoperability Extension
What's New in ArcGIS 10.1 Data Interoperability ExtensionWhat's New in ArcGIS 10.1 Data Interoperability Extension
What's New in ArcGIS 10.1 Data Interoperability Extension
 
Neo4 jv2 english
Neo4 jv2 englishNeo4 jv2 english
Neo4 jv2 english
 
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 20072009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007
2009 - Node XL v.84+ - Social Media Network Visualization Tools For Excel 2007
 

Mais de Peter Neubauer

2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at ParisomaPeter Neubauer
 
2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to heroPeter Neubauer
 
Test driven documentation
Test driven documentationTest driven documentation
Test driven documentationPeter Neubauer
 
Neo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverNeo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverPeter Neubauer
 
From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.Peter Neubauer
 
Tips for building communitites with limited resources
Tips for building communitites with limited resourcesTips for building communitites with limited resources
Tips for building communitites with limited resourcesPeter Neubauer
 
Intro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsIntro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsPeter Neubauer
 
Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Peter Neubauer
 
GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.Peter Neubauer
 
2010 09-neo4j-deutsche-telekom
2010 09-neo4j-deutsche-telekom2010 09-neo4j-deutsche-telekom
2010 09-neo4j-deutsche-telekomPeter Neubauer
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesPeter Neubauer
 

Mais de Peter Neubauer (13)

Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
 
2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma2012 09 GDG San Francisco Hackday at Parisoma
2012 09 GDG San Francisco Hackday at Parisoma
 
2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero2012 09 SF Data Mining zero to hero
2012 09 SF Data Mining zero to hero
 
Test driven documentation
Test driven documentationTest driven documentation
Test driven documentation
 
Neo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouverNeo4j at @PolyglotVancouver
Neo4j at @PolyglotVancouver
 
From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.From Zero to Hero - Neo4j and Cypher.
From Zero to Hero - Neo4j and Cypher.
 
Tips for building communitites with limited resources
Tips for building communitites with limited resourcesTips for building communitites with limited resources
Tips for building communitites with limited resources
 
Intro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphsIntro to Neo4j or why insurances should love graphs
Intro to Neo4j or why insurances should love graphs
 
2011 11-öredev
2011 11-öredev2011 11-öredev
2011 11-öredev
 
Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!Geekout Tallinn - Neo4j for the rescue!
Geekout Tallinn - Neo4j for the rescue!
 
GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.GDM 2011 - Neo4j and real world apps.
GDM 2011 - Neo4j and real world apps.
 
2010 09-neo4j-deutsche-telekom
2010 09-neo4j-deutsche-telekom2010 09-neo4j-deutsche-telekom
2010 09-neo4j-deutsche-telekom
 
Neo4j - 5 cool graph examples
Neo4j - 5 cool graph examplesNeo4j - 5 cool graph examples
Neo4j - 5 cool graph examples
 

Neo4j spatial-nosql-frankfurt

  • 1. Neo4j Spatial GIS for the rest of us #neo4j Peter Neubauer @peterneubauer peter@neotechnology.com Neo Technology
  • 2. NOSQL data models Key-value stores Data size Bigtable clones Document databases Graph databases Data complexity
  • 3. The Neo4j model: Property Graph Core abstractions: name = “Emil” Nodes age = 29 sex = “yes” Relationships between nodes Properties on both 1 2 type = KNOWS time = 4 years 3 type = car vendor = “SAAB” model = “95 Aero”
  • 4. Neo4j – Nodes, Relationships, Properties Nodes have different properties Matrix characters: People vs. Programs Build structure as you go Who loves Neo?
  • 5. Building a node space GraphDatabaseService graphDb = ... // Get factory // Create Thomas 'Neo' Anderson Node mrAnderson = graphDb.createNode(); mrAnderson.setProperty( "name", "Thomas Anderson" ); mrAnderson.setProperty( "age", 29 ); // Create Morpheus Node morpheus = graphDb.createNode(); morpheus.setProperty( "name", "Morpheus" ); morpheus.setProperty( "rank", "Captain" ); morpheus.setProperty( "occupation", "Total bad ass" ); // Create a relationship representing that they know each other mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS ); // ...create Trinity, Cypher, Agent Smith, Architect similarly
  • 6. Building a node space GraphDatabaseService graphDb = ... // Get factory Transaction tx = graphdb.beginTx(); // Create Thomas 'Neo' Anderson Node mrAnderson = graphDb.createNode(); mrAnderson.setProperty( "name", "Thomas Anderson" ); mrAnderson.setProperty( "age", 29 ); // Create Morpheus Node morpheus = graphDb.createNode(); morpheus.setProperty( "name", "Morpheus" ); morpheus.setProperty( "rank", "Captain" ); morpheus.setProperty( "occupation", "Total bad ass" ); // Create a relationship representing that they know each other mrAnderson.createRelationshipTo( morpheus, RelTypes.KNOWS ); // ...create Trinity, Cypher, Agent Smith, Architect similarly tx.commit();
  • 7. Code (2): Traversing a node space // Instantiate a traverser that returns Mr Anderson's friends Traverser friendsTraverser = mrAnderson.traverse( Traverser.Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_START_NODE, RelTypes.KNOWS, Direction.OUTGOING ); // Traverse the node space and print out the result System.out.println( "Mr Anderson's friends:" ); for ( Node friend : friendsTraverser ) { System.out.printf( "At depth %d => %s%n", friendsTraverser.currentPosition().getDepth(), friend.getProperty( "name" ) ); }
  • 8. Ruby gem install neo4j require ”rubygems” require 'neo4j' class Person include Neo4j::NodeMixin property :name, :age, :occupation index :name has_n :friends end Neo4j::Transactoin.run do neo = Person.new :name=>'Neo', :age=>29 morpheus = Person.new :name=>'Morpheus', :occupation=>'badass' neo.friends << morpheus end neo.friends.each {|p|...}
  • 13. Why Spatial? Complex data Multiple indexing (domain, Spatial, temporal) Location entering many domains GIS going mainstream, topologies explode No good systems out there Proprietary stacks rule (ESRI, Oracle) Open Government Data Shapefiles suck.
  • 14. Persistence backends in GIS Shapefiles PostGIS MySQL Oracle Spatial ESRI GeoCouch Cassandra (?) Neo4j Spatial
  • 15. Current challenges in Spatial Domain and Spatial interconnections Unstructured domain data Routing Topology handling No good OSS full GIS stack
  • 16. The Neo4j Spatial stack OpenLayers PHP AJAX WMS Editing JS WMF C# Rails Spring Django Roo GeoServer uDig GeoMaya REST Java Scripting GeoTools Neo4j Spatial Neo4j
  • 18. The OpenStreetMap dataset Wiki for Spatial info Freely available data Very unstructured, free tagging Points, Ways, Relations, Tags, Changesets Changes can be pushed back Used for other purposes Great coverage in interesting places (towns, disasters etc)
  • 21. GSoC 2010 Davide Savazzi Geotools & GeoServer Routing uDig
  • 22. Connecting and Splitting Layer1 Layer1 Layer2 Layer2 Layer3 Layer3 Why have layers at all? Simpler renderers Historical Data sources
  • 23. GSoC 2010 - Routing
  • 24. Connecting and Splitting Routing OSM Dynamic Layers
  • 25. GSoC 2010 - uDig
  • 26. Neo4j dynamic layers Geometry Layer1 Encoder Dynamic Query Layer2 Dynamic Styles Layer3 Dynamic Meta-Inf Connected domain data Neo4j Spatial GIS and Spatial stacks
  • 27. OpenStreetMap Dynamic OSM Laye rs Inde x (RTre e )
  • 31. Future Complex spatial mapping and analytics made easy Editing Fine Grained Geotools Feature Editing OSM Editor OSM Caching sub-graphs (desktop & mobile) More Dynamic Layers & Shapefile export Topology Persist all topological results in graph Benchmarking & Performance Improved indexing Composite index
  • 32. API References Wiki, Code, API references http://wiki.neo4j.org/content/Neo4j_Spatial http://github.com/neo4j/neo4j-spatial http://components.neo4j.org/neo4j-spatial Mailing list: neo4j@lists.neo4j.org http://neo4j.org/community/list/
  • 33. Questions? Image credit: lost again! Sorry :(

Notas do Editor

  1. The current success and popularity of NoSQL data models has been driven by the internet, and the associated explosion in the volume and interconnectedness of data.
  2. EE
  3. This example does highlight a few things about semi-structured data, schema-less databases and even opens the conversation for some discussions on performance (implicit indexes through local search, etc.)
  4. Lightweight and embedded: single jar of ~500k [demo]
  5. Fully transactional: ie complete ACID, supports JTA/JTS, 2PC, deadlock detection, transaction recovery and all the rest [demo]
  6. Lightweight and embedded: single jar of ~500k [demo]
  7. • includes high performance graph algorithms • routes with live changing data • integrates easily with any domain graph
  8. • traverses millions of friends per second • maps directly to friend-of-a-friend • quickly performs deep recommendations
  9. • explores what-if failures • reveals root cause • determines actual operating cost
  10. • can handle billions of ad-hoc relationships • traverses millions of nodes per second • maps directly to your MDM domain
  11. Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  12. Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  13. Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene
  14. Storage: plugable – dataset, layer, encoder Search: Indexing is currently an R-Tree, but it is possible to plug in any custom mechanism conforming to the interface. Multi-dimensional index Spatial indices (quad-tree, R-tree, kn-tree, SFCs) Composite indices and dynamic indices Lucene