SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Kaiso	
  -­‐	
  an	
  object	
  persistence	
  framework	
  for	
  
Python	
  and	
  Neo4j
David	
  Szo>en

onefinestay	
  

!
!
!

@szo;en	
  
github.com/davidszo;en
1

©	
  Lifealike	
  Limited,	
  2013.
Overview
• About	
  onefinestay	
  
• We	
  care	
  about	
  homes	
  
• How	
  we	
  track	
  our	
  homes	
  using	
  Neo4j	
  
• Kaiso	
  demo

2

©	
  Lifealike	
  Limited,	
  2013.
onefinestay	
  -­‐	
  the	
  unhotel	
  
3

©	
  Lifealike	
  Limited,	
  2013.
onefinestay	
  -­‐	
  the	
  unhotel
• Guests	
  live	
  like	
  a	
  local	
  
– but	
  with	
  services	
  and	
  ameniNes	
  of	
  a	
  hotel	
  
!

• Members	
  with	
  disNncNve	
  homes	
  earn

hassle-­‐free	
  income	
  
!

• From	
  just	
  a	
  handful	
  of	
  homes	
  in	
  2010	
  to

over	
  1000	
  homes	
  in	
  4	
  ciNes	
  in	
  2013
4

©	
  Lifealike	
  Limited,	
  2013.
How	
  do	
  we	
  do	
  it?
• Provision:	
  Home	
   	
  Unhotel	
  
– Clean	
  
– Pack	
  away	
  certain	
  items	
  
• Make	
  wardrobe	
  space	
  

• Deprovision:	
  Unhotel	
   	
  Home	
  
– Clean	
  
– Put	
  everything	
  back
5

©	
  Lifealike	
  Limited,	
  2013.
We	
  care	
  about	
  our	
  homes.	
  A	
  lot.
• Every	
  home	
  is	
  different	
  
• We	
  require	
  inNmate	
  knowledge	
  
!

• For	
  guests:	
  “I	
  can’t	
  walk	
  up	
  stairs”,	
  “Where	
  is	
  the	
  iron?”	
  
• For	
  members:	
  “Please	
  put	
  my	
  fragile	
  vase	
  away	
  before	
  
the	
  guests	
  arrive”	
  
• For	
  us:	
  “How	
  much	
  bed	
  linen	
  do	
  I	
  need	
  to	
  take	
  to	
  this	
  
home	
  for	
  this	
  booking?”
6

©	
  Lifealike	
  Limited,	
  2013.
Previous	
  system
• Custom	
  storage	
  soluNon	
  
• Dates	
  back	
  to	
  when	
  we	
  were	
  much	
  smaller	
  
• Problems:	
  
– Siloed	
  
– Hard	
  to	
  query	
   	
  denormalised	
  copies

7

©	
  Lifealike	
  Limited,	
  2013.
New	
  system
• Want	
  to	
  model	
  our	
  homes	
  
– both	
  layout	
  and	
  contents	
  
!

• Need	
  flexibility	
  
– Our	
  needs	
  are	
  likely	
  to	
  grow	
  and	
  change	
  
!

• Track	
  not	
  only	
  objects,	
  but	
  their	
  classes	
  
– Ideally	
  treat	
  the	
  taxonomy	
  itself	
  as	
  data
8

©	
  Lifealike	
  Limited,	
  2013.
Enter	
  Neo4j
• Handle	
  complex	
  data	
  structures	
  
!

• Ensure	
  extensibility	
  for	
  future	
  needs	
  
!

• Easy	
  to	
  create	
  powerful	
  queries	
  
!

• Makes	
  for	
  a	
  nice	
  conceptual	
  model	
  of	
  our	
  data
9

©	
  Lifealike	
  Limited,	
  2013.
Flexibility	
  requirements
• We	
  want	
  to	
  associate	
  informaNon	
  with	
  classes	
  
as	
  well	
  as	
  objects	
  
– This	
  dishwasher	
  is	
  of	
  make	
  Electropool	
  
– (All)	
  appliances	
  need	
  PAT	
  tesNng	
  
!

• Unlike	
  convenNonal	
  object	
  mappers,	
  the	
  
taxonomy/class	
  hierarchy	
  needs	
  to	
  be	
  editable	
  
by	
  users,	
  and	
  so	
  should	
  be	
  part	
  of	
  the	
  data
10

©	
  Lifealike	
  Limited,	
  2013.
Kaiso	
  -­‐	
  an	
  object	
  persistence	
  framework
# (import some stuff)!

!

class Animal(Entity):!
id = Uuid(unique=True)!
name = String()!
friend_of = Outgoing(FriendOf)!

!

class Carnivore(Animal): pass!
class Herbivore(Animal): pass!

!

class Penguin(Herbivore):!
favourite_ice_cream = String()!

!

class Lion(Carnivore):!
n_siblings = Integer()!
11

©	
  Lifealike	
  Limited,	
  2013.
Kaiso:	
  Create	
  some	
  instances
# import types, connect to db!

!

manager = Manager("http://localhost:7474/db/data/")!

!

manager.save(Lion)!
manager.save(Penguin)!

!

# create some instances!
fred = Penguin(name="Fred")!
tom = Lion(name="Tom")!

!

relation = FriendOf(fred, tom)!

!

manager.save(fred)!
manager.save(tom)!
manager.save(relation)
12

©	
  Lifealike	
  Limited,	
  2013.
Instances	
  are	
  saved	
  in	
  the	
  graph...

FRIENDOF

[6]	
  Penguin:	
  Fred

13

[7]	
  Lion:	
  Tom

©	
  Lifealike	
  Limited,	
  2013.
...	
  and	
  so	
  is	
  the	
  class	
  hierarchy
[1]	
  Type:	
  Animal
ISA

ISA

[4]	
  Type:	
  Herbivore

[2]	
  Type:	
  Carnivore

ISA

ISA

[3]	
  Type:	
  Lion

[5]	
  Type:	
  Penguin

INSTANCEOF

INSTANCEOF
FRIENDOF

[6]	
  Penguin:	
  Fred
14

[7]	
  Lion:	
  Tom

©	
  Lifealike	
  Limited,	
  2013.
Kaiso:	
  Queries	
  based	
  on	
  the	
  type	
  hierarchy
START!
Herbivore=node:persistabletype(id="Herbivore"),!
Carnivore=node:persistabletype(id="Carnivore")!

!

MATCH!
Carnivore <-[:ISA*]-()<-[:INSTANCEOF]-(carnivore),!
Herbivore <-[:ISA*]-()<-[:INSTANCEOF]-(herbivore),!

!
!

(herbivore)-[:FRIENDOF]->(carnivore)!

RETURN!
"The herbivore",!
herbivore.name,!
“is a friend of the carnivore",!
carnivore.name;!

!

=> +--------------------------------------------------------------------+!
=> | "The herbivore" | "Fred" | "is a friend of the carnivore" | “Tom" |
=> +--------------------------------------------------------------------+
15

©	
  Lifealike	
  Limited,	
  2013.
Thank	
  you
QuesNons?	
  
!
!

Kaiso	
  
github.com/onefinestay/kaiso	
  
!
github.com/davidszo;en	
  
@davidszo;en
16

©	
  Lifealike	
  Limited,	
  2013.

Contenu connexe

Similaire à Kaiso: Modeling Complex Class Hierarchies with Neo4j - David Szotten @ GraphConnect London 2013

[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...Jessica Tai
 
Connecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondConnecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondDon Day
 
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J..."Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...Jeremy Jarvis
 
Building reusable components with generics and protocols
Building reusable components with generics and protocolsBuilding reusable components with generics and protocols
Building reusable components with generics and protocolsDonny Wals
 
Intro to iOS: Object Oriented Programming and Objective-C
Intro to iOS: Object Oriented Programming and Objective-CIntro to iOS: Object Oriented Programming and Objective-C
Intro to iOS: Object Oriented Programming and Objective-CAndrew Rohn
 
Entity API in Drupal 8 (Drupal Tech Talk October 2014)
Entity API in Drupal 8 (Drupal Tech Talk October 2014)Entity API in Drupal 8 (Drupal Tech Talk October 2014)
Entity API in Drupal 8 (Drupal Tech Talk October 2014)Bart Feenstra
 
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...Marion Kelt
 
Surviving a Hackathon and Beyond
Surviving a Hackathon and BeyondSurviving a Hackathon and Beyond
Surviving a Hackathon and Beyondimoneytech
 
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Mozaic Works
 
Social dev camp_2011
Social dev camp_2011Social dev camp_2011
Social dev camp_2011Craig Ulliott
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
Make Your Content Nimble - Sem Tech UK
Make Your Content Nimble - Sem Tech UKMake Your Content Nimble - Sem Tech UK
Make Your Content Nimble - Sem Tech UKRachel Lovinger
 
Think like a storage architect, in four questions
Think like a storage architect, in four questionsThink like a storage architect, in four questions
Think like a storage architect, in four questionsCheryl Hung
 
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017AWS Chicago
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...Severalnines
 
Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptxUmerUmer25
 
Capstone digital HI presentation
Capstone digital HI presentationCapstone digital HI presentation
Capstone digital HI presentationEric Fitzgerald
 
Neo4j Graph Data Modeling
Neo4j Graph Data ModelingNeo4j Graph Data Modeling
Neo4j Graph Data ModelingKenny Bastani
 
SMIRK presentation from ECIL2014
SMIRK presentation from ECIL2014SMIRK presentation from ECIL2014
SMIRK presentation from ECIL2014Marion Kelt
 

Similaire à Kaiso: Modeling Complex Class Hierarchies with Neo4j - David Szotten @ GraphConnect London 2013 (20)

[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
[Annotated] QConSF 2018: Airbnb's Great Migration - From Monolith to Service-...
 
Connecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and BeyondConnecting Intelligent Content with Micropublishing and Beyond
Connecting Intelligent Content with Micropublishing and Beyond
 
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J..."Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...
"Building a Resilient Cloud Infrastructure. From Scratch." - Cloud East, 28 J...
 
Building reusable components with generics and protocols
Building reusable components with generics and protocolsBuilding reusable components with generics and protocols
Building reusable components with generics and protocols
 
Intro to iOS: Object Oriented Programming and Objective-C
Intro to iOS: Object Oriented Programming and Objective-CIntro to iOS: Object Oriented Programming and Objective-C
Intro to iOS: Object Oriented Programming and Objective-C
 
Entity API in Drupal 8 (Drupal Tech Talk October 2014)
Entity API in Drupal 8 (Drupal Tech Talk October 2014)Entity API in Drupal 8 (Drupal Tech Talk October 2014)
Entity API in Drupal 8 (Drupal Tech Talk October 2014)
 
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...
SMIRK, developing a mobile SMILE - presentation to IFLA Information Literacy ...
 
Asist mit 2012
Asist mit 2012Asist mit 2012
Asist mit 2012
 
Surviving a Hackathon and Beyond
Surviving a Hackathon and BeyondSurviving a Hackathon and Beyond
Surviving a Hackathon and Beyond
 
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
Aki Salmi - Refactoring legacy code: a true story @ I T.A.K.E. Unconference 2...
 
Social dev camp_2011
Social dev camp_2011Social dev camp_2011
Social dev camp_2011
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Make Your Content Nimble - Sem Tech UK
Make Your Content Nimble - Sem Tech UKMake Your Content Nimble - Sem Tech UK
Make Your Content Nimble - Sem Tech UK
 
Think like a storage architect, in four questions
Think like a storage architect, in four questionsThink like a storage architect, in four questions
Think like a storage architect, in four questions
 
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017
Jeremy Engle's slides from Redshift / Big Data meetup on July 13, 2017
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Intro to oop.pptx
Intro to oop.pptxIntro to oop.pptx
Intro to oop.pptx
 
Capstone digital HI presentation
Capstone digital HI presentationCapstone digital HI presentation
Capstone digital HI presentation
 
Neo4j Graph Data Modeling
Neo4j Graph Data ModelingNeo4j Graph Data Modeling
Neo4j Graph Data Modeling
 
SMIRK presentation from ECIL2014
SMIRK presentation from ECIL2014SMIRK presentation from ECIL2014
SMIRK presentation from ECIL2014
 

Plus de Neo4j

QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansNeo4j
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
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
 
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...Neo4j
 
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafosBBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafosNeo4j
 
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...Neo4j
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Neo4j
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)Neo4j
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j
 
Enabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsEnabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsNeo4j
 
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdfNeo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdfNeo4j
 
Neo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with GraphNeo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with GraphNeo4j
 
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...Neo4j
 
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AI
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AIDeloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AI
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AINeo4j
 

Plus de Neo4j (20)

QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
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
 
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
 
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafosBBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
 
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
 
Enabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsEnabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge Graphs
 
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdfNeo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
 
Neo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with GraphNeo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with Graph
 
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
 
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AI
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AIDeloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AI
Deloitte & Red Cross: Talk to your data with Knowledge-enriched Generative AI
 

Dernier

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Dernier (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Kaiso: Modeling Complex Class Hierarchies with Neo4j - David Szotten @ GraphConnect London 2013

  • 1. Kaiso  -­‐  an  object  persistence  framework  for   Python  and  Neo4j David  Szo>en
 onefinestay   ! ! ! @szo;en   github.com/davidszo;en 1 ©  Lifealike  Limited,  2013.
  • 2. Overview • About  onefinestay   • We  care  about  homes   • How  we  track  our  homes  using  Neo4j   • Kaiso  demo 2 ©  Lifealike  Limited,  2013.
  • 3. onefinestay  -­‐  the  unhotel   3 ©  Lifealike  Limited,  2013.
  • 4. onefinestay  -­‐  the  unhotel • Guests  live  like  a  local   – but  with  services  and  ameniNes  of  a  hotel   ! • Members  with  disNncNve  homes  earn
 hassle-­‐free  income   ! • From  just  a  handful  of  homes  in  2010  to
 over  1000  homes  in  4  ciNes  in  2013 4 ©  Lifealike  Limited,  2013.
  • 5. How  do  we  do  it? • Provision:  Home    Unhotel   – Clean   – Pack  away  certain  items   • Make  wardrobe  space   • Deprovision:  Unhotel    Home   – Clean   – Put  everything  back 5 ©  Lifealike  Limited,  2013.
  • 6. We  care  about  our  homes.  A  lot. • Every  home  is  different   • We  require  inNmate  knowledge   ! • For  guests:  “I  can’t  walk  up  stairs”,  “Where  is  the  iron?”   • For  members:  “Please  put  my  fragile  vase  away  before   the  guests  arrive”   • For  us:  “How  much  bed  linen  do  I  need  to  take  to  this   home  for  this  booking?” 6 ©  Lifealike  Limited,  2013.
  • 7. Previous  system • Custom  storage  soluNon   • Dates  back  to  when  we  were  much  smaller   • Problems:   – Siloed   – Hard  to  query    denormalised  copies 7 ©  Lifealike  Limited,  2013.
  • 8. New  system • Want  to  model  our  homes   – both  layout  and  contents   ! • Need  flexibility   – Our  needs  are  likely  to  grow  and  change   ! • Track  not  only  objects,  but  their  classes   – Ideally  treat  the  taxonomy  itself  as  data 8 ©  Lifealike  Limited,  2013.
  • 9. Enter  Neo4j • Handle  complex  data  structures   ! • Ensure  extensibility  for  future  needs   ! • Easy  to  create  powerful  queries   ! • Makes  for  a  nice  conceptual  model  of  our  data 9 ©  Lifealike  Limited,  2013.
  • 10. Flexibility  requirements • We  want  to  associate  informaNon  with  classes   as  well  as  objects   – This  dishwasher  is  of  make  Electropool   – (All)  appliances  need  PAT  tesNng   ! • Unlike  convenNonal  object  mappers,  the   taxonomy/class  hierarchy  needs  to  be  editable   by  users,  and  so  should  be  part  of  the  data 10 ©  Lifealike  Limited,  2013.
  • 11. Kaiso  -­‐  an  object  persistence  framework # (import some stuff)! ! class Animal(Entity):! id = Uuid(unique=True)! name = String()! friend_of = Outgoing(FriendOf)! ! class Carnivore(Animal): pass! class Herbivore(Animal): pass! ! class Penguin(Herbivore):! favourite_ice_cream = String()! ! class Lion(Carnivore):! n_siblings = Integer()! 11 ©  Lifealike  Limited,  2013.
  • 12. Kaiso:  Create  some  instances # import types, connect to db! ! manager = Manager("http://localhost:7474/db/data/")! ! manager.save(Lion)! manager.save(Penguin)! ! # create some instances! fred = Penguin(name="Fred")! tom = Lion(name="Tom")! ! relation = FriendOf(fred, tom)! ! manager.save(fred)! manager.save(tom)! manager.save(relation) 12 ©  Lifealike  Limited,  2013.
  • 13. Instances  are  saved  in  the  graph... FRIENDOF [6]  Penguin:  Fred 13 [7]  Lion:  Tom ©  Lifealike  Limited,  2013.
  • 14. ...  and  so  is  the  class  hierarchy [1]  Type:  Animal ISA ISA [4]  Type:  Herbivore [2]  Type:  Carnivore ISA ISA [3]  Type:  Lion [5]  Type:  Penguin INSTANCEOF INSTANCEOF FRIENDOF [6]  Penguin:  Fred 14 [7]  Lion:  Tom ©  Lifealike  Limited,  2013.
  • 15. Kaiso:  Queries  based  on  the  type  hierarchy START! Herbivore=node:persistabletype(id="Herbivore"),! Carnivore=node:persistabletype(id="Carnivore")! ! MATCH! Carnivore <-[:ISA*]-()<-[:INSTANCEOF]-(carnivore),! Herbivore <-[:ISA*]-()<-[:INSTANCEOF]-(herbivore),! ! ! (herbivore)-[:FRIENDOF]->(carnivore)! RETURN! "The herbivore",! herbivore.name,! “is a friend of the carnivore",! carnivore.name;! ! => +--------------------------------------------------------------------+! => | "The herbivore" | "Fred" | "is a friend of the carnivore" | “Tom" | => +--------------------------------------------------------------------+ 15 ©  Lifealike  Limited,  2013.
  • 16. Thank  you QuesNons?   ! ! Kaiso   github.com/onefinestay/kaiso   ! github.com/davidszo;en   @davidszo;en 16 ©  Lifealike  Limited,  2013.