SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
Neo4j
And TelCo goodness
                 Some usecases


                                 #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”
Agenda
 The NoSQL landscape
 Neo4j intro
 Examples for TelCos
   CDR
   Routing
   Social graphs
   Master Data Management
   Spatial and LBS
   Network topology analysis
   Neo4j and Android
Neo4j?
 Most widely deployed graph db in the world
   ACID, persistent, embedded/server
   Robust: 24/7 production since 2003
   Mature: lots of production deployments
   Scalable: High Availability, Master failover
   Community: ecosystem of tools, bindings, frameworks
   Product: OSGi, Spatial, RDF, languages

 Available under AGPLv3 and as commercial product
   But the f rst one is free! For ALL use-cases.
           i
 Links
   http://neo4j.org
   http://lists.neo4j.org
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|...}
Spatial and social data
                                                                        name = ...

                          name = “The Tavern”
                          lat = 1295238237
name = “Omni Hotel”
                          long = 234823492                                                42
lat = 3492848
long = 283823423                              length = 7 miles                     AD
                                                                              RO
                  ROAD                         ROAD                             ROO
     1                                 7                            3              OAD


                  RO
                                                                                            13
                     AD                               name = ...
                                       ROAD
                                                      lat, long = ...
                                                                                         name = “Swedland”
                                                                                         lat = 23410349
      length = 3 miles                                                                   long = 2342348852
                                 2

                          name = ...
Financial data – fraud detection
                                                                                name = ...

                                name = “The Tavern”
                                lat = 1295238237
                                long = 234823492                                                        42
name = “Mr Godfather”                                                                             AW
karma = veeeery-low
                                                                                            HDR
cash = more-than-you                                      amount = $1000
                                                                                          IT
                                                                                      W
                  OWNS                                    TRANSFER                        WIT
     1                                       7                              3                 HDR
                                                                                                  AW

                                                                                                           13

                                                 S FE R
                  DE                                             name = “Emil”
                     P   OS                                      cash = always-too-li'l
                           IT                TRAN
                                                                                                       title = “ATM @ Wall St”
                                                                                                       id = 230918484233
       amount = $1000                                                                                  cash_left = 384204
                                       2

                                name = ...
CDR analysis
                                                                               name = flat_business

                                     name = “Bob”
                                     lat = 1295238237
                                     long = 234823492                                             N    42
                                                                                                LA
name = “Mr Godfather”
karma = veeeery-low                                                                       _   P
cash = more-than-you                                     time = 2min                   TA
                                                                                     DA
                  CALLED                                  CALLED                         CAL
     1                                          7                          3                L   ED

                     CA
                                                                                                         13
                        L                                       name = “Emil”
                            LE
                                                     Y
                                 D                              cash = always-too-li'l
                                                FAMIL
                                                                                                      Name= customer_support

       time =13min
                                            2

                                     name = Alice
Call Data Records (CDR)
  Forming a graph
  Location based
  Possible uses:
    Find clusters (better plans)
    Build social connections
    Find influencers
Routing
Routing with Neo4j and A*
Routing
Connecting and Splitting


 Routing
Social graphs

 Recommendations
 Location based
 services
 Influencers
 Shortest path
Recommendations and big graphs
 Global heuristics
   Page rank
 Local recommendations
    Shortest paths
    Hammock functions
    Random walks
    Dijkstra, A*, Shooting star etc
Grammar based Random Walks




     Pic from gremlin.tinkerpop.com / Marko Rodriguez
Impact, Dependency Analysis
Master Data Management
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.
Current challenges in Spatial
  Domain and Spatial interconnections
  Unstructured domain data
  Routing
  Topology handling
  No good OSS full GIS stack
Multiple indexes - GIS
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
Web exposure of Spatial Data

 Davide Savazzi
 Geotools & GeoServer
 Routing
 uDig
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
Network Topology analysis

 Analytics of network coverage and frequencies
   Cell towers
   Drive data
   Infrastructure
 Analytics
   Spatial signal strength
   Antenna placement and azimuth
   Frequency planning
   Network differences over time
   Reporting and charting
Neo4j and Android
  Small footprint
  Running almost unmodified
  Interesting scenarios
     Semantic homescreen
     Connected devices
     Local caches
     Disconnected databases
Connected devices



                                 Emil

Emils PC
                                                             Marcus



                                         Leigh
                         Johan


  “Link all pictures that any of my friends has taken of me into
                      my PicturesOfMe folder and update this every hour”
Interesting scenarios
  Semantic homescreen
  Connected devices
  Local caches
  Disconnected databases
How ego are you? (aka other impls?)
  Franz’ Alle groGraph (http://agraph.franz.com)
     Proprietary, Lisp, RDF-oriented but real graphdb
  Sones graphDB        (http://sones.com)

     .NET, Deutsche Telekom VC backed
  Twitter's Floc kDB     (http://github.com/twitter/flockdb)

     Twitter's (graph) database for large and shallow graphs
  Google Pre ge l (http://bit.ly/dP9IP)
     We are oh-so-secret
  Objectivity's Infnite Graph (http://infinitegraph.com)
     New, closed OODB with Graph Layer on top
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

Contenu connexe

Plus 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
 
Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Peter 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
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtPeter Neubauer
 

Plus 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
 
Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.Neo4j Spatial - GIS for the rest of us.
Neo4j Spatial - GIS for the rest of us.
 
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.
 
Neo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurtNeo4j spatial-nosql-frankfurt
Neo4j spatial-nosql-frankfurt
 

Dernier

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Dernier (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

2010 09-neo4j-deutsche-telekom

  • 1. Neo4j And TelCo goodness Some usecases #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. Agenda The NoSQL landscape Neo4j intro Examples for TelCos CDR Routing Social graphs Master Data Management Spatial and LBS Network topology analysis Neo4j and Android
  • 5. Neo4j? Most widely deployed graph db in the world ACID, persistent, embedded/server Robust: 24/7 production since 2003 Mature: lots of production deployments Scalable: High Availability, Master failover Community: ecosystem of tools, bindings, frameworks Product: OSGi, Spatial, RDF, languages Available under AGPLv3 and as commercial product But the f rst one is free! For ALL use-cases. i Links http://neo4j.org http://lists.neo4j.org
  • 6. Neo4j – Nodes, Relationships, Properties Nodes have different properties Matrix characters: People vs. Programs Build structure as you go Who loves Neo?
  • 7. 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
  • 8. 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();
  • 9. 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" ) ); }
  • 10. 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|...}
  • 11. Spatial and social data name = ... name = “The Tavern” lat = 1295238237 name = “Omni Hotel” long = 234823492 42 lat = 3492848 long = 283823423 length = 7 miles AD RO ROAD ROAD ROO 1 7 3 OAD RO 13 AD name = ... ROAD lat, long = ... name = “Swedland” lat = 23410349 length = 3 miles long = 2342348852 2 name = ...
  • 12. Financial data – fraud detection name = ... name = “The Tavern” lat = 1295238237 long = 234823492 42 name = “Mr Godfather” AW karma = veeeery-low HDR cash = more-than-you amount = $1000 IT W OWNS TRANSFER WIT 1 7 3 HDR AW 13 S FE R DE name = “Emil” P OS cash = always-too-li'l IT TRAN title = “ATM @ Wall St” id = 230918484233 amount = $1000 cash_left = 384204 2 name = ...
  • 13. CDR analysis name = flat_business name = “Bob” lat = 1295238237 long = 234823492 N 42 LA name = “Mr Godfather” karma = veeeery-low _ P cash = more-than-you time = 2min TA DA CALLED CALLED CAL 1 7 3 L ED CA 13 L name = “Emil” LE Y D cash = always-too-li'l FAMIL Name= customer_support time =13min 2 name = Alice
  • 14. Call Data Records (CDR) Forming a graph Location based Possible uses: Find clusters (better plans) Build social connections Find influencers
  • 19. Social graphs Recommendations Location based services Influencers Shortest path
  • 20. Recommendations and big graphs Global heuristics Page rank Local recommendations Shortest paths Hammock functions Random walks Dijkstra, A*, Shooting star etc
  • 21. Grammar based Random Walks Pic from gremlin.tinkerpop.com / Marko Rodriguez
  • 24. 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.
  • 25. Current challenges in Spatial Domain and Spatial interconnections Unstructured domain data Routing Topology handling No good OSS full GIS stack
  • 28. 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)
  • 31. Web exposure of Spatial Data Davide Savazzi Geotools & GeoServer Routing uDig
  • 32. GSoC 2010 - uDig
  • 33. Neo4j dynamic layers Geometry Layer1 Encoder Dynamic Query Layer2 Dynamic Styles Layer3 Dynamic Meta-Inf Connected domain data Neo4j Spatial GIS and Spatial stacks
  • 34. OpenStreetMap Dynamic OSM Laye rs Inde x (RTre e )
  • 36. Network Topology analysis Analytics of network coverage and frequencies Cell towers Drive data Infrastructure Analytics Spatial signal strength Antenna placement and azimuth Frequency planning Network differences over time Reporting and charting
  • 37. Neo4j and Android Small footprint Running almost unmodified Interesting scenarios Semantic homescreen Connected devices Local caches Disconnected databases
  • 38. Connected devices Emil Emils PC Marcus Leigh Johan “Link all pictures that any of my friends has taken of me into my PicturesOfMe folder and update this every hour”
  • 39. Interesting scenarios Semantic homescreen Connected devices Local caches Disconnected databases
  • 40. How ego are you? (aka other impls?) Franz’ Alle groGraph (http://agraph.franz.com) Proprietary, Lisp, RDF-oriented but real graphdb Sones graphDB (http://sones.com) .NET, Deutsche Telekom VC backed Twitter's Floc kDB (http://github.com/twitter/flockdb) Twitter's (graph) database for large and shallow graphs Google Pre ge l (http://bit.ly/dP9IP) We are oh-so-secret Objectivity's Infnite Graph (http://infinitegraph.com) New, closed OODB with Graph Layer on top
  • 41. 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/
  • 42. Questions? Image credit: lost again! Sorry :(