Skip to content

Instantly share code, notes, and snippets.

@timfong888
Last active August 29, 2015 14:03
Show Gist options
  • Save timfong888/abb71e934c6428a5412a to your computer and use it in GitHub Desktop.
Save timfong888/abb71e934c6428a5412a to your computer and use it in GitHub Desktop.

Allyforce Sample Model

This shows the complex relationships

Initial Data Model

  • Alliance Manager (am)

  • Sales Rep (rep)

  • Sales Organization (org)

  • Accounts (accounts)

  • Opportunities (oppty)

  • Relationships: :MANAGES → alliance

  • Relationships: :SELLS_TO → account

  • Relationships: :WORKS_FOR — sales organization

Initial Data Setup

CREATE

 (ACCOUNT1:account {name: 'Visa'}),
 (ACCOUNT2:account {name: 'Ebay'}),
 (ACCOUNT3:account {name: 'Chevron'}),
 (ACCOUNT4:account {name: 'Apple'}),
 (ACCOUNT5:account {name: 'Ross Stores'}),
 (ACCOUNT6:account {name: 'Safeway'}),

 (ORG1:org {name: 'Palo Alto Networks'}),
  (AM1:am {name:'Terry Ramos'}) - [:WORKS_FOR] -> (ORG1),

  (REP1:rep {name: 'Tony Bolander'}) - [:WORKS_FOR] -> (ORG1),
   (REP1) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT2),
   (REP1) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT4),

  (REP2:rep {name: 'Chris Welsh'}) - [:WORKS_FOR] -> (ORG1),
   (REP2) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT6),

  (REP3:rep {name: 'Richard Simmons'}) - [:WORKS_FOR] -> (ORG1),
   (REP3) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT5),

 (ORG2:org {name: 'Aruba Networks'}),
  (AM2:am {name:'Thenua Kittappa'}) - [:WORKS_FOR] -> (ORG2),

  (REP4:rep {name: 'Emmy Chuck'}) - [:WORKS_FOR] -> (ORG2),
   (REP4) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT1),
   (REP4) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT2),

  (REP5:rep {name: 'Nick Pavlovich'}) - [:WORKS_FOR] -> (ORG2),
   (REP5) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT3),
   (REP5) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT4),

  (REP6:rep {name: 'Dan McBreen'}) - [:WORKS_FOR] -> (ORG2),
   (REP6) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT5),
   (REP6) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT6),

 (ORG3:org {name: 'Blue Coat'}),
  (AM3:am {name:'John Tennant'}) - [:WORKS_FOR] -> (ORG3),

  (REP7:rep {name: 'Paul Tarkington'}) - [:WORKS_FOR] -> (ORG3),
   (REP7) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT5),
   (REP7) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT1),
  (REP8:rep {name: 'Kevin Powell'}) - [:WORKS_FOR] -> (ORG3),
   (REP8) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT3),
   (REP8) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT2),
  (REP9:rep {name: 'Michael Matteuci'}) - [:WORKS_FOR] -> (ORG3),
   (REP9) - [:SELLS_TO {type:'customer'}] -> (ACCOUNT6),
   (REP9) - [:SELLS_TO {type:'prospect'}] -> (ACCOUNT4),

 (AM1) - [:MANAGES] -> (AM2),
 (AM1) - [:MANAGES] -> (AM3),
 (AM2) - [:MANAGES] -> (AM1),
 (AM3) - [:MANAGES] -> (AM1)

RETURN *

Render as a graph

Console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment