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

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

on

  • 1,110 views

In this talk David will summarize business and technical use cases and introduce Kaiso. He will give a basic overview of how to use it, along with some examples of how one might use it to model ...

In this talk David will summarize business and technical use cases and introduce Kaiso. He will give a basic overview of how to use it, along with some examples of how one might use it to model complex class hierarchies. This will include some interactive code demonstrations. David will explore the main design goals of the project, the current state of the project, and take a look at what’s ahead on Kaiso’s roadmap.

Statistics

Views

Total Views
1,110
Slideshare-icon Views on SlideShare
1,074
Embed Views
36

Actions

Likes
2
Downloads
18
Comments
1

3 Embeds 36

http://neo4j.com 28
http://lanyrd.com 7
http://www.feedspot.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Hi there... nice work. Is there any reason why you did not base your work e.g. on RDF+RDFS+OWL?

    Cheers
    Achim
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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

    • 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.