Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Presenting Neo4j
= Presenting Neo4j GraphGist =
This gist is to complement the http://blog.bruggen.com/[more elaborate blogpost] that I wrote how the http://www.prezi.com[prezi] presentation style actually massively resembles a graph. And how you could actually create a graph about http://neo4j.org[neo4j] to explain what graph databases are all about.
[source,cypher]
----
// create the nodes
create (n1{id:'1', name:'Neo4j', type:'Product', comments:''}),
(n2{id:'2', name:'Graph Database', type:'Category', comments:''}),
(n3{id:'3', name:'Graphs', type:'Math', comments:''}),
(n4{id:'4', name:'Sets', type:'Math', comments:''}),
(n5{id:'5', name:'Database', type:'System', comments:''}),
(n6{id:'6', name:'Documents', type:'Datamodel', comments:''}),
(n7{id:'7', name:'Key-Value pairs', type:'Datamodel', comments:''}),
(n8{id:'8', name:'Column Families', type:'Datamodel', comments:''}),
(n9{id:'9', name:'Not Only SQL', type:'Category', comments:''}),
(n10{id:'10', name:'RDBMS', type:'Category', comments:''}),
(n11{id:'11', name:'MySQL', type:'Product', comments:''}),
(n12{id:'12', name:'MS Access', type:'Product', comments:''}),
(n13{id:'13', name:'MS SQL Server', type:'Product', comments:''}),
(n14{id:'14', name:'Oracle', type:'Product', comments:''}),
(n15{id:'15', name:'IBM DB2', type:'Product', comments:''}),
(n16{id:'16', name:'PostgreSQL', type:'Product', comments:''}),
(n17{id:'17', name:'Use Case', type:'Category', comments:''}),
(n18{id:'18', name:'Recommendations', type:'UseCase', comments:''}),
(n19{id:'19', name:'Fraud Analysis and Detection', type:'UseCase', comments:''}),
(n20{id:'20', name:'Impact Analysis', type:'UseCase', comments:''}),
(n21{id:'21', name:'Route planning and path finding', type:'UseCase', comments:''}),
(n22{id:'22', name:'Social networks', type:'UseCase', comments:''}),
(n23{id:'23', name:'Access and Identity', type:'UseCase', comments:''}),
(n24{id:'24', name:'Master Data Management', type:'UseCase', comments:''}),
(n25{id:'25', name:'Industries', type:'Category', comments:''}),
(n26{id:'26', name:'Telecom', type:'Industry', comments:''}),
(n27{id:'27', name:'Financial Services', type:'Industry', comments:''}),
(n28{id:'28', name:'Media and Entertainment', type:'Industry', comments:''}),
(n29{id:'29', name:'Biotech, Pharma, Life Sciences', type:'Industry', comments:''}),
(n30{id:'30', name:'Gaming', type:'Industry', comments:''}),
(n31{id:'31', name:'Benefits', type:'Category', comments:''}),
(n32{id:'32', name:'Agility', type:'Benefit', comments:''}),
(n33{id:'33', name:'Ability', type:'Benefit', comments:''}),
(n34{id:'34', name:'Cost', type:'Benefit', comments:''}),
(n35{id:'35', name:'Performance', type:'Benefit', comments:''}),
(n36{id:'36', name:'Audiences', type:'Category', comments:''}),
(n37{id:'37', name:'Developers', type:'Audience', comments:''}),
(n38{id:'38', name:'Architects', type:'Audience', comments:''}),
(n39{id:'39', name:'Project Managers', type:'Audience', comments:''}),
(n40{id:'40', name:'CIO', type:'Audience', comments:''}),
(n41{id:'41', name:'Business Managers', type:'Audience', comments:''}),
(n42{id:'42', name:'General Public', type:'Audience', comments:''}),
(n43{id:'43', name:'Elevator Pitches', type:'Category', comments:''}),
(n44{id:'44', name:'Developers', type:'ElevatorPitch', comments:'A smart NOSQL database that uses a completely different datamodel (a property graph) to store data. Normalisation all of a sudden becomes cheap, and join-style operations go lightning fast. Use it for complex queries, recursive lookups and/or pathfinding operations - and you will never look back. And it is a fully transactional, ACID database that will take excellent care of your data, and will scale nicely as your application grows.'}),
(n45{id:'45', name:'Architects', type:'ElevatorPitch', comments:'Networked problems benefit from network-centric solutions.That is why you should be using a graph database for some of the business solutions that you are building: many datasets are densely connected, and both your technical staff (developers/sysadmins) and your business users will love the simplicity and elegance with which neo4j enables using these. Whether it is the simple Cypher query language or the intuitive graph visualisations, they all contribute to a better architectural fit for the project.'}),
(n46{id:'46', name:'Project Managers', type:'ElevatorPitch', comments:'Delivering an on-time, in-budget project means that you have to use the right tool for the job. That is why projects that are dealing with networked datasets benefit from network-centric solutions: they allow the technical staff (developers/sysadmins) to be more productive, and provide business users with a simpler, more responsive and elegant result. Next time you are doing projects involving recommendations, master data management, impact analysis or any of the other use cases, ask why people are not using neo4j - if they have not already done so themselves.'}),
(n47{id:'47', name:'CIO', type:'ElevatorPitch', comments:'Neo4j offers a smart new database architecture that complements existing relational systems for specific workloads: graph (or "network centric") queries. The graph database allows you to run these complex queries more efficiently, with less hardware and less time and effort spent on implementations. Overall, the Neo4j graph database will contribute to making the IT organisation more agile, cost-effective and business focused.'}),
(n48{id:'48', name:'Business Managers', type:'ElevatorPitch', comments:'Every IT system needs a place to store their data. But many systems have been using the wrong kind of technology to do so - and this has led to poor a poor business user experience. Whether it is a slow system, a late project, or a budget that has been overrun, many of these issues can just be avoided by using the right tool for the job. Graph Databases offer your IT users a better tool for specific, network-oriented problems. Do not let the default be yet another RDBMS - ask why not consider an alternative that is better fit for purpose.'}),
(n49{id:'49', name:'General Public', type:'ElevatorPitch', comments:'Computers need data - and that data needs to be stored and managed somewhere. Typically, that is what databases do. Your bank, your supermarket, your gas station - they all store data about the things you buy from them in databases. But not all data is the same - there are different types of data (files, pictures, transactions, documents, ...) and some data is very interesting to understand. That is why a specific type of database - we call it a graph database, after the math terminology that supports it - was created to understand patterns, relationships and connections between data better. Banks use it to detect fraud, supermarkets to recommend other products, and facebook uses it to suggest new friends. It is way cool.'}),
(n50{id:'50', name:'Technical Details', type:'Category', comments:''}),
(n51{id:'51', name:'Cypher', type:'TechnicalDetail', comments:'Declarative, Pattern Matching query languages that allows you to express graphs in ASCII-art, allowing you to formulate Ad-Hoc queries - just like you expect a database to behave.'}),
(n52{id:'52', name:'Scalable', type:'TechnicalDetail', comments:'Excellent scalability, comparable to RDBMSes. Master/Slave replication clusters for horizontal scaling'}),
(n53{id:'53', name:'ACID', type:'TechnicalDetail', comments:'Master is immediately consistent, slaves are eventually consistent'}),
(n54{id:'54', name:'Multi-purpose', type:'TechnicalDetail', comments:'Many graph systems are specific purpose (eg. social networking, genome analysis, ...) - but neo4j is designed to be generic so that it can be used for many purposes...'}),
(n55{id:'55', name:'Open source', type:'TechnicalDetail', comments:'All versions & editions of neo4j are open source - because we love it. The license (GPL or AGPL) varies - so you may actually be better of with a commercial license.'}),
(n56{id:'56', name:'Neo Technology', type:'Category', comments:''}),
(n57{id:'57', name:'Commercial Licensing', type:'Offering', comments:''}),
(n58{id:'58', name:'Enterprise Support', type:'Offering', comments:''}),
(n59{id:'59', name:'Product Consulting', type:'Offering', comments:''}),
(n60{id:'60', name:'www.neo4j.org', type:'Category', comments:''}),
// create the relationships
n1-[:IS_A]->n2,
n2-[:BASED_ON_THEORY_OF]->n3,
n3-[:PART_OF]->n9,
n6-[:PART_OF]->n9,
n7-[:PART_OF]->n9,
n8-[:PART_OF]->n9,
n2-[:STORES_DATA_IN_A]->n5,
n10-[:STORES_DATA_IN_A]->n5,
n10-[:BASED_ON_THEORY_OF]->n4,
n11-[:IS_A]->n10,
n12-[:IS_A]->n10,
n13-[:IS_A]->n10,
n14-[:IS_A]->n10,
n15-[:IS_A]->n10,
n16-[:IS_A]->n10,
n1-[:IS_GOOD_AT]->n17,
n18-[:IS_A]->n17,
n19-[:IS_A]->n17,
n20-[:IS_A]->n17,
n21-[:IS_A]->n17,
n22-[:IS_A]->n17,
n23-[:IS_A]->n17,
n24-[:IS_A]->n17,
n1-[:WORKS_FOR]->n25,
n26-[:IS_A]->n25,
n27-[:IS_A]->n25,
n28-[:IS_A]->n25,
n29-[:IS_A]->n25,
n30-[:IS_A]->n25,
n1-[:OFFERS]->n31,
n32-[:IS_A]->n31,
n33-[:IS_A]->n31,
n34-[:IS_A]->n31,
n35-[:IS_A]->n31,
n1-[:BENEFITS]->n36,
n37-[:IS_A]->n36,
n38-[:IS_A]->n36,
n39-[:IS_A]->n36,
n40-[:IS_A]->n36,
n41-[:IS_A]->n36,
n42-[:IS_A]->n36,
n36-[:TWO_MINUTE_EXPLANATIONS]->n43,
n44-[:IS_A]->n43,
n45-[:IS_A]->n43,
n46-[:IS_A]->n43,
n47-[:IS_A]->n43,
n48-[:IS_A]->n43,
n49-[:IS_A]->n43,
n37-[:TWO_MINUTE_EXPLANATIONS]->n44,
n38-[:TWO_MINUTE_EXPLANATIONS]->n45,
n39-[:TWO_MINUTE_EXPLANATIONS]->n46,
n40-[:TWO_MINUTE_EXPLANATIONS]->n47,
n41-[:TWO_MINUTE_EXPLANATIONS]->n48,
n42-[:TWO_MINUTE_EXPLANATIONS]->n49,
n1-[:HAS_SOME]->n50,
n51-[:IS_A]->n50,
n52-[:IS_A]->n50,
n53-[:IS_A]->n50,
n54-[:IS_A]->n50,
n55-[:IS_A]->n50,
n1-[:CREATED_AND_MAINTAINED_BY]->n56,
n56-[:OFFERS]->n57,
n56-[:OFFERS]->n58,
n56-[:OFFERS]->n59,
n1-[:HAS_WEBSITE]->n60;
----
The actual graph then looks like this:
//graph
To play some more, use the console below. Enjoy!
//console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.