SlideShare a Scribd company logo
Persistent Graphs in
                   Python with Neo4j

                                 twitter: @thobe / #neo4j
       Tobias Ivarsson           email: tobias@neotechnology.com
                                 web: http://www.neo4j.org/
       Hacker @ Neo Technology   web: http://www.thobe.org/

Sunday, February 21, 2010
We all know the
                                                                                relational model.
           Attendees                                                            It has been predominant
                                                                                for a long time.
           username              fullname       registration    tutorials   payment


          guido             Guido van Rossum   null            yes          0

          thobe             Tobias Ivarsson    2009-12-12      no           300

          joe               John Doe           2010-02-05      yes          700

                   ...               ...              ...            ...             ...




                                                                                       2

Sunday, February 21, 2010
Attendees
                                                                                                        The relational model has
                            username         fullname        registration    tutorials     payment      a few problems, such as:
                                                                                                        •poor support for sparse
                                                                                                        data
                                                                                                        •modifying the data
                            guido       Guido van Rossum    null            yes           0             model is almost
                                                                                                        exclusively done through
                                                                                                        adding tables
                            thobe       Tobias Ivarsson     2009-12-12      no            300

                            joe         John Doe            2010-02-05      yes           700

                                  ...            ...                 ...           ...          ...

                            Location
                            username        latitude         longitude            title       publish


                            thobe       55°36'47.70"N     12°58'34.50"E     Malmö         yes

                                                                            San
                            joe         37°49'36.00"N     122°25'22.00"W                  no
                                                                            Francisco

                                  ...          ...                 ...             ...          ...

                                                                                                              3

Sunday, February 21, 2010
Attendees                                                                      Sessions
             username            fullname        registration    tutorials     payment      id       title time room ...

                                                                                            ...        ...        ...   ...        ...
            guido           Guido van Rossum    null            yes           0
                                                                                            ...        ...        ...   ...        ...
            thobe           Tobias Ivarsson     2009-12-12      no            300
                                                                                            Session attendance
            joe             John Doe            2010-02-05      yes           700                 session               user

                  ...                ...                 ...           ...          ...             ...                  ...

             Location                                                                               ...                  ...
             username           latitude         longitude            title       publish

                                                                                            More complication...
            thobe           55°36'47.70"N     12°58'34.50"E     Malmö         yes                   ...                  ...
                                                                                                      ...                  ...
     After a while, modeling                                                                             ...                  ...
     complex relationships                                                                                 ...                  ...
     leads to complicated
                                                                                                    ......               ......
                                                                San                                      ......
     schemasjoe            37°49'36.00"N      122°25'22.00"W                  no                                              ......
                                                                Francisco                           ......               ......
                                                                                                         ......               ......
                  ...              ...                 ...             ...          ...

                                                                                                                          4

Sunday, February 21, 2010

Recommended for you

Introdução ao neo4j
Introdução ao neo4jIntrodução ao neo4j
Introdução ao neo4j

Este documento introduz o banco de dados orientado a grafos Neo4j. Explica que os bancos de dados orientados a grafos representam dados e esquemas como grafos, tornando consultas como menor caminho mais simples. Também descreve os principais conceitos do Neo4j como nós, rótulos, relacionamentos e propriedades e demonstra exemplos básicos de consultas Cypher e integração com C#.

neo4jgraphgraphdatabase
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...

This document discusses polyglot persistence with Neo4j and provides tools and integrations for combining Neo4j with other databases. It introduces the Neo4j Doc Manager for syncing documents from MongoDB to Neo4j, the official Neo4j Docker image, and the Neo4j Cassandra Data Import Tool. It also discusses Neo4j 3.0 features like Bolt, stored procedures, and drivers.

neo4jgraphconnectgraphconnect europe 2016
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.

Compelling location-based services require more than simple “what’s near me?” operations. The Open Street Map dataset is a perfect example of a rich geographically-based wiki that can be used for much more than map rendering. With the newly released Neo4j Spatial, any data can be adapted to complex queries with geographic components like “Select all streets in the Municipality of NYC where at least 2 of my friends are walking right now”. The talk will demonstrate the important benefits of modeling geodata in a graph, the main components needed to expose data to geo stacks like map servers, and explain how the Open Street Map dataset is modeled in Neo4j. I’ll show how using Neo4j unlocks the full potential of the OSM data far beyond just rendering maps. There will also be some cool examples of Neo4j Spatial, from Telecomms network planning, Web-based AJAX GIS systems, topology editing and routing to REST and Web Feature Service endpoints, all in a single stack. This is Location-based Services on steroids!

graph databasegraphdbnosql
A number of companies
                            have realized that the
                            relational model is
                            insufficient and are
                            working on alternative
                            database solutions.



                                    5

Sunday, February 21, 2010
Most focus on scaling to large numbers



                                           192.168.0.15   192.168.0.16




                                                                         192.168.0.21
                            192.168.0.14




                                                                                        6

Sunday, February 21, 2010
Graph Databases focuses on structure of data




                                                 7

Sunday, February 21, 2010
Positioning w.r.t. other NOSQL DBs
                      Size
                            Key/Value stores

                                               Bigtable clones

                                                                 Document databases

                                                                                      Graph databases




                                                                                                Complexity

                                                                                                        8

Sunday, February 21, 2010

Recommended for you

Banco de dados de grafos
Banco de dados de grafosBanco de dados de grafos
Banco de dados de grafos

O documento discute bancos de dados de grafos, que armazenam dados em vértices e arestas ao invés de tabelas. Ele explica que os bancos de dados de grafos são do tipo noSQL e index-free. Também fornece exemplos de uso de bancos de grafos e lista alguns produtos populares de bancos de grafos no mercado.

OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionality

This presentation gives an overview on OrientDB and Neo4j. It also compares some specific querys, their speed and the overall functionality of both databases. The querys might not be optimized in both cases. At least they have the same outcome and are both written as querys. For sure in Neo4j you should do this in Java code. But that is way harder to write, so this presentation is more like a direkt comparision instead of really getting the best results. Also it's done with real data and at the end round about 200 GB of data.

orientdbneo4jcomparison
NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview

The document provides an overview of different NoSQL database types, including key-value stores, document databases, column-oriented databases, graph databases, and caches. It discusses examples of databases for each type and common use cases. The document also covers querying graph databases, polyglot persistence using multiple database types, and concludes with when each database type is best suited and when not to use a NoSQL database.

nosqljavaone 2013
Positioning w.r.t. other NOSQL DBs
                      Size
                            Key/Value stores

                                               Bigtable clones

                                                                 Document databases

                                                                                      Graph databases
                                                                                                  Billions of nodes
                                                                                                  and relationships




                                                     > 90% of use cases

                                                                                                Complexity

                                                                                                         8

Sunday, February 21, 2010
What is Neo4j?
        ๏ Neo4j is a Graph Database
                 • Non-relational (“#nosql”), transactional (ACID), embedded
                 • Data is stored as a Graph / Network
                       ‣Nodes and relationships with properties
                       ‣“Property Graph” or “edge-labeled multidigraph”
        ๏ Neo4j is Open Source / Free (as in speech) Software
                 • AGPLv3
                                                                          Prices are available at
                                                                          http://neotechnology.com/



                 • Commercial (“dual license”) license available
                                                                          Contact us if you have
                                                                          questions and/or special
                                                                          license needs (e.g. if you
                                                                          want an evaluation license)

                       ‣Free (as in beer) for “small” installations
                       ‣Inexpensive (as in startup-friendly) when you grow           9

Sunday, February 21, 2010
More about Neo4j
        ๏ Neo4j is stable
                 • In 24/7 operation since 2003
        ๏ Neo4j is in active development
                 • Neo Technology got VC funding October 2009
        ๏ Neo4j delivers high performance graph operations
                 • traverses 1’000’000+ relationships / second
                     on commodity hardware




                                                                 10

Sunday, February 21, 2010
The Neo4j Graph data model
        ๏ Nodes are connected to one another through relationships
        ๏ A Relationship is a connection between two nodes
                 • Relationships have types
                 • Relationships have a direction
                 • Relationships are traversed equally fast in either direction
        ๏ Properties are mappings from a string key to a primitive value
                 • Both Nodes and Relationships have properties
                 • Primitive values are any of these (or an array of these):
                       ‣String
                       ‣Numbers: float, double, integers (1-8 byte)             11

Sunday, February 21, 2010

Recommended for you

Building Applications with a Graph Database
Building Applications with a Graph DatabaseBuilding Applications with a Graph Database
Building Applications with a Graph Database

Presented at JavaOne 2013, Tuesday September 24. "Data Modeling Patterns" co-created with Ian Robinson. "Pitfalls and Anti-Patterns" created by Ian Robinson.

graph databaseneo4jjavaone 2013
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools

This document provides an overview of tools available in the Java Development Kit (JDK) that allow for powerful introspection and manipulation of the Java Virtual Machine (JVM) and running applications. It discusses the java.lang.instrument API for injecting Java agents, the Java Debugging Interface (JDI) for debugging, the JVM Tool Interface (JVMTI) for heap and frame introspection, and examples of using these tools to build interactive debuggers, inject code at runtime, and test concurrency. Code samples and links to further resources are also provided.

jvmgeekout 2013java
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals

The document provides an overview of the internal workings of Neo4j. It describes how the graph data is stored on disk as linked lists of fixed size records and how two levels of caching work - a low-level filesystem cache and a high-level object cache that stores node and relationship data in a structure optimized for traversals. It also explains how traversals are implemented using relationship expanders and evaluators to iteratively expand paths through the graph, and how Cypher builds on this but uses graph pattern matching rather than the full traversal system.

transactionsdatabasesneo4j
The Neo4j Graph data model
                                                                       name: “Mary”
                                                        LOVES
                   name: “James”                                       age: 35
                   age: 32                   LIVES WITH
                   twitter: “@spam”                   LOVES



                                      OWNS
                             property type: “car”             DRIVES



                                                      brand: “Volvo”
                                                      model: “V70”



                                                                                12

Sunday, February 21, 2010
Graphs are all around us
                            A                        B           C             D           ...
                  1                 17                  3.14          3   17.79333333333

                  2                 42               10.11           14            30.33

                  3              316                    6.66          1          2104.56

                  4                 32                  9.11     592      0.492432432432

                  5         Even if this spread sheet looks
                            like it could be a fit for a RDBMS
                                                                          2153.175765766
                            it isn’t:
                            •RDBMSes have problems with
                 ...        extending indefinitely on both
                            rows and collumns
                            •Formulas and data
                            dependencies would quickly lead
                            to heavy join operations

                                                                                           13

Sunday, February 21, 2010
Graphs are all around us
                            A      B      C         D            ...
                  1         17    3.14     3    = A1 * B1 / C1

                  2         42    10.11   14    = A2 * B2 / C2

                  3         316   6.66     1    = A3 * B3 / C3

                  4         32    9.11    592   = A4 * B4 / C4

                  5                             = SUM(D2:D5)

                 ...

                                                                 14

Sunday, February 21, 2010
Graphs are all around us
                            A      B      C         D            ...
                  1         17    3.14     3    = A1 * B1 / C1

                  2         42    10.11   14    = A2 * B2 / C2

                  3         316   6.66     1    = A3 * B3 / C3

                  4         32    9.11    592   = A4 * B4 / C4

                  5                             = SUM(D2:D5)

                 ...

                                                                 14

Sunday, February 21, 2010

Recommended for you

Choosing the right NOSQL database
Choosing the right NOSQL databaseChoosing the right NOSQL database
Choosing the right NOSQL database

This document discusses different NoSQL database technologies for various application requirements. It describes graph databases like Neo4j, document databases like MongoDB, and column family databases like Cassandra. It then provides examples of using each for a blog system, Twitter clone, and social network. Graph databases are well-suited for the social network due to focusing on entity relationships. Document databases work well for the blog by embedding comments in blog posts. A column family database is a good fit for the Twitter clone to handle high write loads through denormalization across column families.

javaone 2010nosqljava
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming

The document discusses models for concurrent programming. It summarizes common misconceptions about threads and concurrency, and outlines some of the core abstractions and tools available in Java for writing concurrent programs, including threads, monitors, volatile variables, java.util.concurrent classes like ConcurrentHashMap, and java.util.concurrent.locks classes like ReentrantLock. It also discusses some models not currently supported in Java like parallel arrays, transactional memory, actors, and Clojure's approach to concurrency using immutable data structures, refs, and atoms.

concurrencyjavajavaone 2011
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4j

Graph databases are well suited for complex, interconnected data. Neo4j is a graph database that represents data as nodes connected by relationships. It allows for complex queries and traversals of graph structures. Unlike relational databases, graph databases can directly model real world networks and relationships without needing to flatten the data.

nosqleugraph databasenosql
Graphs are all around us                              If we add external data
                                                             sources the problem
                                                             becomes even more
                                                             interesting...




                            17    3.14     3    = A1 * B1 / C1

                            42    10.11   14    = A2 * B2 / C2

                            316   6.66     1    = A3 * B3 / C3

                            32    9.11    592   = A4 * B4 / C4

                                                = SUM(D2:D5)




                                                                     15

Sunday, February 21, 2010
Graphs are all around us                              If we add external data
                                                             sources the problem
                                                             becomes even more
                                                             interesting...




                            17    3.14     3    = A1 * B1 / C1

                            42    10.11   14    = A2 * B2 / C2

                            316   6.66     1    = A3 * B3 / C3

                            32    9.11    592   = A4 * B4 / C4

                                                = SUM(D2:D5)




                                                                     15

Sunday, February 21, 2010
Graphs are whiteboard friendly




                                        16

Sunday, February 21, 2010
Graphs are whiteboard friendly


                                        *
                                1
                                            *
                            *       1




                            *                   1
                                    *

                                1
                                        *



                                                    16

Sunday, February 21, 2010

Recommended for you

A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM

This document summarizes Tobias Ivarsson's work on developing a new "Advanced Compiler" for Jython. It provides an overview of the compiler project, performance figures comparing Jython and CPython on benchmark tests, discusses mismatches between Python and the JVM, and how performance is being improved. The new compiler adds analysis and intermediate representation steps to better represent Python code on the JVM. Benchmark results show initial Jython performance lagging CPython but improving with JIT warmup and continued compiler optimizations.

jythonpyconpython
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM

This document summarizes Tobias Ivarsson's presentation on the "Advanced Compiler" project for Jython. It discusses performance benchmarks that show Jython is currently slower than CPython. It also analyzes mismatches between Python and the JVM, such as late binding, call frames, and exception handling. However, it argues the new compiler provides an enabling platform for optimizations like call frame analysis, inline caching of builtins, and exception handler restructuring to improve performance. It concludes the project is not just about compilation but moving Jython forward to better leverage future JVMs.

jythonpyconpython
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages

Presentation from JavaOne 2009 on how Dynamic languages can be better suited for writing concurrent applications.

scalajrubyclojure
Graphs are whiteboard friendly

                                   thobe



                                              Joe project blog


                                             Wardrobe Strength


                            Hello Joe

                            Modularizing Jython

                               Neo4j performance analysis

                                                                 16

Sunday, February 21, 2010
Query Languages
        ๏ Traversal API
        ๏ Sparql - “SQL for linked data”
               SELECT ?person WHERE {
                   ?person neo4j:KNOWS ?friend .
                   ?friend neo4j:KNOWS ?foe .
                   ?foe neo4j:name “Larry Ellison” .
               }

        ๏ Gremlin - “perl for graphs”
               ./outE[@label='KNOWS']/inV[@age > 30]/@name




                                                             17

Sunday, February 21, 2010
Python integration for Neo4j
        ๏ Mapping of the core Neo4j API for Python
                 • Making it feel “Pythonic”
        ๏ Available from the Neo4j repository (and soon from PyPI)
                 • http://components.neo4j.org/neo4j.py
                       ‣svn co http://svn.neo4j.org/components/neo4j.py/trunk neo4j-python
        ๏ Works with both Jython and CPython
                 • The threading of Jython is a plus with an embedded db...
        ๏ Comes with Django empowering batteries included
                 • Could have support for other frameworks in the future
                                                                                     18

Sunday, February 21, 2010
Simple interaction
       import neo4j
       graphdb = neo4j.GraphDatabase(“var/neo”)

       with graphdb.transaction:
          james = graphdb.node(name=“James”, age=32, twitter=“@spam”)
          mary = graphdb.node(name=“Mary”, age=35)
          the_car = graphdb.node(brand=“Volvo”, model=“V70”)

               james.LOVES( mary )
               mary.LOVES( james )
               james.LIVES_WITH( mary )
               james.OWNS( the_car, property_type=“car” )   Creates the graph we saw
                                                            in the first example.
               mary.DRIVES( the_car )




                                                                            19

Sunday, February 21, 2010

Recommended for you

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems

Stream processing is a crucial component of modern data infrastructure, but constructing an efficient and scalable stream processing system can be challenging. Decoupling compute and storage architecture has emerged as an effective solution to these challenges, but it can introduce high latency issues, especially when dealing with complex continuous queries that necessitate managing extra-large internal states. In this talk, we focus on addressing the high latency issues associated with S3 storage in stream processing systems that employ a decoupled compute and storage architecture. We delve into the root causes of latency in this context and explore various techniques to minimize the impact of S3 latency on stream processing performance. Our proposed approach is to implement a tiered storage mechanism that leverages a blend of high-performance and low-cost storage tiers to reduce data movement between the compute and storage layers while maintaining efficient processing. Throughout the talk, we will present experimental results that demonstrate the effectiveness of our approach in mitigating the impact of S3 latency on stream processing. By the end of the talk, attendees will have gained insights into how to optimize their stream processing systems for reduced latency and improved cost-efficiency.

What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024

This is a powerpoint that features Microsoft Teams Devices and everything that is new including updates to its software and devices for May 2024

microsoft teamsmicrosoft
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]
          order = neo4j.BREDTH_FIRST
          stop = neo4j.STOP_AT_END_OF_GRAPH
          returnable = neo4j.RETURN_ALL_BUT_START_NODE

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]
          order = neo4j.BREDTH_FIRST
          stop = neo4j.STOP_AT_END_OF_GRAPH
          returnable = neo4j.RETURN_ALL_BUT_START_NODE

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]               Morpheus (@ depth=1)
          order = neo4j.BREDTH_FIRST
          stop = neo4j.STOP_AT_END_OF_GRAPH
          returnable = neo4j.RETURN_ALL_BUT_START_NODE

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]               Morpheus (@ depth=1)
          order = neo4j.BREDTH_FIRST                     Trinity (@ depth=1)
          stop = neo4j.STOP_AT_END_OF_GRAPH
          returnable = neo4j.RETURN_ALL_BUT_START_NODE

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010

Recommended for you

TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In

Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk. What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year? Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year. This webinar will review: - Key changes to privacy regulations in 2024 - Key themes in privacy and data governance in 2024 - How to maximize your privacy program in the second half of 2024

data privacyprivacy complianceai
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]               Morpheus (@ depth=1)
          order = neo4j.BREDTH_FIRST                     Trinity (@ depth=1)
          stop = neo4j.STOP_AT_END_OF_GRAPH
                                                         Cypher (@ depth=2)
          returnable = neo4j.RETURN_ALL_BUT_START_NODE

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]               Morpheus (@ depth=1)
          order = neo4j.BREDTH_FIRST                     Trinity (@ depth=1)
          stop = neo4j.STOP_AT_END_OF_GRAPH
                                                         Cypher (@ depth=2)
          returnable = neo4j.RETURN_ALL_BUT_START_NODE
                                                                                           Agent Smith (@ depth=3)

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Graph traversals                                                                         name: “The Architect”
                                                  disclosure: “public”
       name: “Thomas Anderson”
       age: 29                                                            name: “Cypher”
                                                                          last name: “Reagan”
                               KNOWS name: “Morpheus”
                         KNOWS                                  KNOWS
                                     rank: “Captain”                                                  CODED BY
                   LOVES             occupation: “Total badass”                          KNOWS
                                         KNOWS
                       name: “Trinity”                            disclosure: “secret”
                                                                                            name: “Agent Smith”
                                                                                            version: “1.0b”
          since: “meeting the oracle”            since: “a year before the movie”
                                                                                            language: “C++”
                                                 cooperates on: “The Nebuchadnezzar”
       import neo4j
       class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j
          types = [ neo4j.Outgoing.KNOWS ]               Morpheus (@ depth=1)
          order = neo4j.BREDTH_FIRST                     Trinity (@ depth=1)
          stop = neo4j.STOP_AT_END_OF_GRAPH
                                                         Cypher (@ depth=2)
          returnable = neo4j.RETURN_ALL_BUT_START_NODE
                                                                                           Agent Smith (@ depth=3)

       for friend_node in Friends(mr_anderson):
          print “%s (@ depth=%s)” % ( friend_node[“name”],
             friend_node.depth )                                                                         20

Sunday, February 21, 2010
Batteries for Django
       from neo4j.model import django_model as models

       class Movie(models.NodeModel):
          title = models.Property(indexed=True)
          year = models.Property()
          href = property(lambda self: ('/movie/%s/' %
             (self.node.id,)))
          def __unicode__(self):
              return self.title

       class Actor(models.NodeModel):
          name = models.Property(indexed=True)
          href = property(lambda self: ('/actor/%s/' %
             (self.node.id,)))
          def __unicode__(self):
              return self.name

       # etc. ...

                                                         21

Sunday, February 21, 2010

Recommended for you

The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing

Invited Remote Lecture to SC21 The International Conference for High Performance Computing, Networking, Storage, and Analysis St. Louis, Missouri November 18, 2021

distributed supercomputerdistributed machine learning
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation

Manual Method of Product Research | Helium10 | MBS RETRIEVER

product researchhelium10 | mbs retriever
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx

Your comprehensive guide to RPA in healthcare for 2024. Explore the benefits, use cases, and emerging trends of robotic process automation. Understand the challenges and prepare for the future of healthcare automation

rpa in healthcarerpa in healthcare usarpa in healthcare industry
“My ORM already does this”
        ๏ ORMs and model evolution is a hard problem
                 • virtually unsupported in Django
        ๏ SQL is a “compatible” across many RDBMSs
                 • data is still locked in
        ๏ Each ORM maps object models differently
                 • Moving to another ORM == legacy schema support
                       ‣except your legacy schema is strange auto-generated
        ๏ Object/Graph Mapping is always done the same
                 • allows you to keep your data through application changes
                 • or share data between multiple implementations             22

Sunday, February 21, 2010
What your ORM doesn’t do
        ๏ Drop down to underlying graph model
                 • Traversals
                 • Graph algorithms
                 • Shortest path(s)
                 • etc.



                                                23

Sunday, February 21, 2010
Buzzword summary                                                         http://neo4j.org/



                                     SPARQL
               AGPLv3
                                                  Open Source
                                                                        ACID
                             Object mapping                                    Shortest path
                                                     NOSQL
                            startup friendly
                                                                 whiteboard friendly
                Traversal
                                                  Query language
                               Embedded
                                                                     Beer

                                               Software Transactional Memory
            polyglot persistence
                                                             Free Software
                                 Scaling to complexity
                                                                                       24

Sunday, February 21, 2010
http://neotechnology.com

Sunday, February 21, 2010

Recommended for you

20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses

CIO Council Cal Poly Humboldt September 22, 2023

national research platformdistributed supercomputerdistributed systems
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf

Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).

solar storms

More Related Content

Viewers also liked

Sistemas de recomendações e neo4J na cloud computing
Sistemas de recomendações e neo4J na cloud computingSistemas de recomendações e neo4J na cloud computing
Sistemas de recomendações e neo4J na cloud computing
Priscila Mayumi
 
No sql std
No sql stdNo sql std
No sql std
Arthur Azevedo
 
Neo4j - Rede de relacionamentos baseada em grafos
Neo4j - Rede de relacionamentos baseada em grafosNeo4j - Rede de relacionamentos baseada em grafos
Neo4j - Rede de relacionamentos baseada em grafos
Evandro Venancio
 
Introdução ao neo4j
Introdução ao neo4jIntrodução ao neo4j
Introdução ao neo4j
Jhonathan de Souza Soares
 
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
Neo4j
 
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
 
Banco de dados de grafos
Banco de dados de grafosBanco de dados de grafos
Banco de dados de grafos
Priscila Mayumi
 
OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionality
Curtis Mosters
 

Viewers also liked (8)

Sistemas de recomendações e neo4J na cloud computing
Sistemas de recomendações e neo4J na cloud computingSistemas de recomendações e neo4J na cloud computing
Sistemas de recomendações e neo4J na cloud computing
 
No sql std
No sql stdNo sql std
No sql std
 
Neo4j - Rede de relacionamentos baseada em grafos
Neo4j - Rede de relacionamentos baseada em grafosNeo4j - Rede de relacionamentos baseada em grafos
Neo4j - Rede de relacionamentos baseada em grafos
 
Introdução ao neo4j
Introdução ao neo4jIntrodução ao neo4j
Introdução ao neo4j
 
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
GraphConnect Europe 2016 - NoSQL Polyglot Persistence: Tools and Integrations...
 
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.
 
Banco de dados de grafos
Banco de dados de grafosBanco de dados de grafos
Banco de dados de grafos
 
OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionality
 

More from Tobias Lindaaker

NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
Tobias Lindaaker
 
Building Applications with a Graph Database
Building Applications with a Graph DatabaseBuilding Applications with a Graph Database
Building Applications with a Graph Database
Tobias Lindaaker
 
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools
Tobias Lindaaker
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
Tobias Lindaaker
 
Choosing the right NOSQL database
Choosing the right NOSQL databaseChoosing the right NOSQL database
Choosing the right NOSQL database
Tobias Lindaaker
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
Tobias Lindaaker
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4j
Tobias Lindaaker
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
Tobias Lindaaker
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
Tobias Lindaaker
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
Tobias Lindaaker
 

More from Tobias Lindaaker (10)

NOSQL Overview
NOSQL OverviewNOSQL Overview
NOSQL Overview
 
Building Applications with a Graph Database
Building Applications with a Graph DatabaseBuilding Applications with a Graph Database
Building Applications with a Graph Database
 
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
 
Choosing the right NOSQL database
Choosing the right NOSQL databaseChoosing the right NOSQL database
Choosing the right NOSQL database
 
[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming[JavaOne 2011] Models for Concurrent Programming
[JavaOne 2011] Models for Concurrent Programming
 
NOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4jNOSQLEU - Graph Databases and Neo4j
NOSQLEU - Graph Databases and Neo4j
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
 
A Better Python for the JVM
A Better Python for the JVMA Better Python for the JVM
A Better Python for the JVM
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 

Recently uploaded

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
KAMAL CHOUDHARY
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 

Recently uploaded (20)

Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Recent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS InfrastructureRecent Advancements in the NIST-JARVIS Infrastructure
Recent Advancements in the NIST-JARVIS Infrastructure
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 

Persistent graphs in Python with Neo4j

  • 1. Persistent Graphs in Python with Neo4j twitter: @thobe / #neo4j Tobias Ivarsson email: tobias@neotechnology.com web: http://www.neo4j.org/ Hacker @ Neo Technology web: http://www.thobe.org/ Sunday, February 21, 2010
  • 2. We all know the relational model. Attendees It has been predominant for a long time. username fullname registration tutorials payment guido Guido van Rossum null yes 0 thobe Tobias Ivarsson 2009-12-12 no 300 joe John Doe 2010-02-05 yes 700 ... ... ... ... ... 2 Sunday, February 21, 2010
  • 3. Attendees The relational model has username fullname registration tutorials payment a few problems, such as: •poor support for sparse data •modifying the data guido Guido van Rossum null yes 0 model is almost exclusively done through adding tables thobe Tobias Ivarsson 2009-12-12 no 300 joe John Doe 2010-02-05 yes 700 ... ... ... ... ... Location username latitude longitude title publish thobe 55°36'47.70"N 12°58'34.50"E Malmö yes San joe 37°49'36.00"N 122°25'22.00"W no Francisco ... ... ... ... ... 3 Sunday, February 21, 2010
  • 4. Attendees Sessions username fullname registration tutorials payment id title time room ... ... ... ... ... ... guido Guido van Rossum null yes 0 ... ... ... ... ... thobe Tobias Ivarsson 2009-12-12 no 300 Session attendance joe John Doe 2010-02-05 yes 700 session user ... ... ... ... ... ... ... Location ... ... username latitude longitude title publish More complication... thobe 55°36'47.70"N 12°58'34.50"E Malmö yes ... ... ... ... After a while, modeling ... ... complex relationships ... ... leads to complicated ...... ...... San ...... schemasjoe 37°49'36.00"N 122°25'22.00"W no ...... Francisco ...... ...... ...... ...... ... ... ... ... ... 4 Sunday, February 21, 2010
  • 5. A number of companies have realized that the relational model is insufficient and are working on alternative database solutions. 5 Sunday, February 21, 2010
  • 6. Most focus on scaling to large numbers 192.168.0.15 192.168.0.16 192.168.0.21 192.168.0.14 6 Sunday, February 21, 2010
  • 7. Graph Databases focuses on structure of data 7 Sunday, February 21, 2010
  • 8. Positioning w.r.t. other NOSQL DBs Size Key/Value stores Bigtable clones Document databases Graph databases Complexity 8 Sunday, February 21, 2010
  • 9. Positioning w.r.t. other NOSQL DBs Size Key/Value stores Bigtable clones Document databases Graph databases Billions of nodes and relationships > 90% of use cases Complexity 8 Sunday, February 21, 2010
  • 10. What is Neo4j? ๏ Neo4j is a Graph Database • Non-relational (“#nosql”), transactional (ACID), embedded • Data is stored as a Graph / Network ‣Nodes and relationships with properties ‣“Property Graph” or “edge-labeled multidigraph” ๏ Neo4j is Open Source / Free (as in speech) Software • AGPLv3 Prices are available at http://neotechnology.com/ • Commercial (“dual license”) license available Contact us if you have questions and/or special license needs (e.g. if you want an evaluation license) ‣Free (as in beer) for “small” installations ‣Inexpensive (as in startup-friendly) when you grow 9 Sunday, February 21, 2010
  • 11. More about Neo4j ๏ Neo4j is stable • In 24/7 operation since 2003 ๏ Neo4j is in active development • Neo Technology got VC funding October 2009 ๏ Neo4j delivers high performance graph operations • traverses 1’000’000+ relationships / second on commodity hardware 10 Sunday, February 21, 2010
  • 12. The Neo4j Graph data model ๏ Nodes are connected to one another through relationships ๏ A Relationship is a connection between two nodes • Relationships have types • Relationships have a direction • Relationships are traversed equally fast in either direction ๏ Properties are mappings from a string key to a primitive value • Both Nodes and Relationships have properties • Primitive values are any of these (or an array of these): ‣String ‣Numbers: float, double, integers (1-8 byte) 11 Sunday, February 21, 2010
  • 13. The Neo4j Graph data model name: “Mary” LOVES name: “James” age: 35 age: 32 LIVES WITH twitter: “@spam” LOVES OWNS property type: “car” DRIVES brand: “Volvo” model: “V70” 12 Sunday, February 21, 2010
  • 14. Graphs are all around us A B C D ... 1 17 3.14 3 17.79333333333 2 42 10.11 14 30.33 3 316 6.66 1 2104.56 4 32 9.11 592 0.492432432432 5 Even if this spread sheet looks like it could be a fit for a RDBMS 2153.175765766 it isn’t: •RDBMSes have problems with ... extending indefinitely on both rows and collumns •Formulas and data dependencies would quickly lead to heavy join operations 13 Sunday, February 21, 2010
  • 15. Graphs are all around us A B C D ... 1 17 3.14 3 = A1 * B1 / C1 2 42 10.11 14 = A2 * B2 / C2 3 316 6.66 1 = A3 * B3 / C3 4 32 9.11 592 = A4 * B4 / C4 5 = SUM(D2:D5) ... 14 Sunday, February 21, 2010
  • 16. Graphs are all around us A B C D ... 1 17 3.14 3 = A1 * B1 / C1 2 42 10.11 14 = A2 * B2 / C2 3 316 6.66 1 = A3 * B3 / C3 4 32 9.11 592 = A4 * B4 / C4 5 = SUM(D2:D5) ... 14 Sunday, February 21, 2010
  • 17. Graphs are all around us If we add external data sources the problem becomes even more interesting... 17 3.14 3 = A1 * B1 / C1 42 10.11 14 = A2 * B2 / C2 316 6.66 1 = A3 * B3 / C3 32 9.11 592 = A4 * B4 / C4 = SUM(D2:D5) 15 Sunday, February 21, 2010
  • 18. Graphs are all around us If we add external data sources the problem becomes even more interesting... 17 3.14 3 = A1 * B1 / C1 42 10.11 14 = A2 * B2 / C2 316 6.66 1 = A3 * B3 / C3 32 9.11 592 = A4 * B4 / C4 = SUM(D2:D5) 15 Sunday, February 21, 2010
  • 19. Graphs are whiteboard friendly 16 Sunday, February 21, 2010
  • 20. Graphs are whiteboard friendly * 1 * * 1 * 1 * 1 * 16 Sunday, February 21, 2010
  • 21. Graphs are whiteboard friendly thobe Joe project blog Wardrobe Strength Hello Joe Modularizing Jython Neo4j performance analysis 16 Sunday, February 21, 2010
  • 22. Query Languages ๏ Traversal API ๏ Sparql - “SQL for linked data” SELECT ?person WHERE { ?person neo4j:KNOWS ?friend . ?friend neo4j:KNOWS ?foe . ?foe neo4j:name “Larry Ellison” . } ๏ Gremlin - “perl for graphs” ./outE[@label='KNOWS']/inV[@age > 30]/@name 17 Sunday, February 21, 2010
  • 23. Python integration for Neo4j ๏ Mapping of the core Neo4j API for Python • Making it feel “Pythonic” ๏ Available from the Neo4j repository (and soon from PyPI) • http://components.neo4j.org/neo4j.py ‣svn co http://svn.neo4j.org/components/neo4j.py/trunk neo4j-python ๏ Works with both Jython and CPython • The threading of Jython is a plus with an embedded db... ๏ Comes with Django empowering batteries included • Could have support for other frameworks in the future 18 Sunday, February 21, 2010
  • 24. Simple interaction import neo4j graphdb = neo4j.GraphDatabase(“var/neo”) with graphdb.transaction: james = graphdb.node(name=“James”, age=32, twitter=“@spam”) mary = graphdb.node(name=“Mary”, age=35) the_car = graphdb.node(brand=“Volvo”, model=“V70”) james.LOVES( mary ) mary.LOVES( james ) james.LIVES_WITH( mary ) james.OWNS( the_car, property_type=“car” ) Creates the graph we saw in the first example. mary.DRIVES( the_car ) 19 Sunday, February 21, 2010
  • 25. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] order = neo4j.BREDTH_FIRST stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 26. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] order = neo4j.BREDTH_FIRST stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 27. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] Morpheus (@ depth=1) order = neo4j.BREDTH_FIRST stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 28. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] Morpheus (@ depth=1) order = neo4j.BREDTH_FIRST Trinity (@ depth=1) stop = neo4j.STOP_AT_END_OF_GRAPH returnable = neo4j.RETURN_ALL_BUT_START_NODE for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 29. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] Morpheus (@ depth=1) order = neo4j.BREDTH_FIRST Trinity (@ depth=1) stop = neo4j.STOP_AT_END_OF_GRAPH Cypher (@ depth=2) returnable = neo4j.RETURN_ALL_BUT_START_NODE for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 30. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] Morpheus (@ depth=1) order = neo4j.BREDTH_FIRST Trinity (@ depth=1) stop = neo4j.STOP_AT_END_OF_GRAPH Cypher (@ depth=2) returnable = neo4j.RETURN_ALL_BUT_START_NODE Agent Smith (@ depth=3) for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 31. Graph traversals name: “The Architect” disclosure: “public” name: “Thomas Anderson” age: 29 name: “Cypher” last name: “Reagan” KNOWS name: “Morpheus” KNOWS KNOWS rank: “Captain” CODED BY LOVES occupation: “Total badass” KNOWS KNOWS name: “Trinity” disclosure: “secret” name: “Agent Smith” version: “1.0b” since: “meeting the oracle” since: “a year before the movie” language: “C++” cooperates on: “The Nebuchadnezzar” import neo4j class Friends(neo4j.Traversal): # Traversals ! queries in Neo4j types = [ neo4j.Outgoing.KNOWS ] Morpheus (@ depth=1) order = neo4j.BREDTH_FIRST Trinity (@ depth=1) stop = neo4j.STOP_AT_END_OF_GRAPH Cypher (@ depth=2) returnable = neo4j.RETURN_ALL_BUT_START_NODE Agent Smith (@ depth=3) for friend_node in Friends(mr_anderson): print “%s (@ depth=%s)” % ( friend_node[“name”], friend_node.depth ) 20 Sunday, February 21, 2010
  • 32. Batteries for Django from neo4j.model import django_model as models class Movie(models.NodeModel): title = models.Property(indexed=True) year = models.Property() href = property(lambda self: ('/movie/%s/' % (self.node.id,))) def __unicode__(self): return self.title class Actor(models.NodeModel): name = models.Property(indexed=True) href = property(lambda self: ('/actor/%s/' % (self.node.id,))) def __unicode__(self): return self.name # etc. ... 21 Sunday, February 21, 2010
  • 33. “My ORM already does this” ๏ ORMs and model evolution is a hard problem • virtually unsupported in Django ๏ SQL is a “compatible” across many RDBMSs • data is still locked in ๏ Each ORM maps object models differently • Moving to another ORM == legacy schema support ‣except your legacy schema is strange auto-generated ๏ Object/Graph Mapping is always done the same • allows you to keep your data through application changes • or share data between multiple implementations 22 Sunday, February 21, 2010
  • 34. What your ORM doesn’t do ๏ Drop down to underlying graph model • Traversals • Graph algorithms • Shortest path(s) • etc. 23 Sunday, February 21, 2010
  • 35. Buzzword summary http://neo4j.org/ SPARQL AGPLv3 Open Source ACID Object mapping Shortest path NOSQL startup friendly whiteboard friendly Traversal Query language Embedded Beer Software Transactional Memory polyglot persistence Free Software Scaling to complexity 24 Sunday, February 21, 2010