Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What is this hipster graph thingy?

Miha Rekar
November 06, 2015

What is this hipster graph thingy?

Talk I gave at Rails Remote Conf: https://railsremoteconf.com/

Source code used for the demo: https://github.com/mrfoto/neo4hub/

More info:
- Neo4j official page: http://neo4j.com/
- Neo4j meets Ruby: http://www.neo4j-ruby.org/
- Neo4jrb documentation: http://neo4jrb.readthedocs.org/en/latest/
- Free Online Training provided by Neo4j: http://neo4j.com/graphacademy/online-course/

Miha Rekar

November 06, 2015
Tweet

More Decks by Miha Rekar

Other Decks in Programming

Transcript

  1. NEO4J • NoSQL • open-source • Java/Scala • the most

    popular graph DB • full DB characteristics (ACID compliance, scalable clustering, fail-over, high-availability, live backups, and comprehensive monitoring)
  2. GETTING STARTED • brew install neo4j • neo4j start •

    gem 'neo4j' • http://localhost:7474/
  3. CYPHER • SQL-like • ASCII-ish SELECT firstname FROM person WHERE

    person.nickname= 'The Dude' MATCH p:person WHERE p.nickname= 'The Dude' RETURN p.firstname
  4. CYPHER • SQL-like • ASCII-ish SELECT firstname FROM person WHERE

    person.nickname= 'The Dude' MATCH p:person WHERE p.nickname= 'The Dude' RETURN p.firstname FROM person JOIN team ON person.teamid = team.id WHERE person.nickname= 'The Dude' AND team.sport = 'Bowling' MATCH (p:person)-[:in]->(t:team) WHERE p.nickname= 'The Dude' AND t.sport = 'Bowling' RETURN p.firstname, t.name
  5. CYPHER • SQL-like • ASCII-ish SELECT firstname FROM person WHERE

    person.nickname= 'The Dude' MATCH p:person WHERE p.nickname= 'The Dude' RETURN p.firstname FROM person JOIN team ON person.teamid = team.id WHERE person.nickname= 'The Dude' AND team.sport = 'Bowling' MATCH (p:person)-[:in]->(t:team) WHERE p.nickname= 'The Dude' AND t.sport = 'Bowling' RETURN p.firstname, t.name MATCH (p:person)-[*]-(p2:person) WHERE p.nickname= 'The Dude' RETURN p.firstname, p2.firstname MATCH (p:person{nickname: 'The Dude'})-[*]-(p2:person) RETURN p.firstname, p2.firstname
  6. Q&A