Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Graph Database Prototyping made easy with Graphgen

6,312 views

Published on

Graphgen aims at helping people prototyping a graph database, by providing a visual tool that ease the generation of nodes and relationships with a Cypher DSL.

Many people struggle with not only creating a good graph model of their domain but also with creating sensible example data to test hypotheses or use-cases.

Graphgen aims at helping people with no time but a good enough understanding of their domain model, by providing a visual dsl for data model generation which borrows heavily on Neo4j Cypher graph query language.

The ascii art allows even non-technical users to write and read model descriptions/configurations as concise as plain english but formal enough to be parseable. The underlying generator combines the DSL inputs (structure, cardinalities and amount-ranges) and combines them with a comprehensive fake data generation library to create real-world-like datasets of medium/arbitrary size and complexity.

Users can create their own models combining the basic building blocks of the dsl and share their data-descriptions with others with a simple link.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Graph Database Prototyping made easy with Graphgen

  1. 1. GRAPHGENGraphDB Prototyping made easy #FOSDEM 31-01-2015 graphgen.neoxygen.io
  2. 2. #whoami Christophe Willemsen Software Engineer Neo4j Consultant @graph_aware graphaware.com
  3. 3. WHY GRAPHGEN ? QUICK OVERVIEW ABOUT THE NEO4J NATIVE TOOLS TO BUILD A GRAPH
  4. 4. BY HAND CREATE (n:Person {firstname: ‘Roger’, lastname:’Laguadec’}) 100X For 100 nodes and you need to be really inventive for the node properties
  5. 5. A LOOP FOREACH ( i in range(0,99) | CREATE (n:Person {id:i} ) ) Not non-developer friendly and no properties except the id
  6. 6. LOAD CSV USING PERIODIC COMMIT 1000 LOAD CSV WITH HEADERS FROM FILE ‘file:///Users/me/docs/import.csv’ AS line MERGE (n:Person {firstname: line.firstname} ) You need initial data !
  7. 7. GRAPH MODEL DECISIONS
  8. 8. GRAPH MODEL DECISIONS
  9. 9. WITH GRAPHGEN THEN ? (p:Person {firstname: firstName, lastname: lastName} *100) (p)-[:KNOWS *n..n]->(p)
  10. 10. DEMO 1
  11. 11. NODES SYNTAX BASED OFF THE AMAZING CYPHER QUERY LANGUAGE! (p:Person {firstname: firstName} *100 ) identifier label Node property key Sample date provider type amount
  12. 12. RELATIONSHIPS SYNTAX BASEE SUR LE LANGAGE CYPHER ! -[:KNOWS {since: unixTime} *n..n ]-> type Relationship property key Sample data Provider type cardinality
  13. 13. PROPERTY PARAMETERS E.g.: I want 100 person nodes with a name and a birth date, the birth date Should be realistic so that people are adults and not already in retirement. (p:Personne {nom: fullName, ddn: { dateTimeBetween: [‘’-65 years’’, ‘’-18 years’’]}} *100) YAML inline
  14. 14. Sample data providers • word • sentence • dateTime • dateTimeBetween • text • unixTime • randomDigit • numberBetween • company • firstName, lastName • country • city • address • latitude, longitude • url • username • password • creditCardNumber • ip • userAgent • uuid • ean13 • fileExtension • hashTag • …… et plein d’autres
  15. 15. DEMO 2
  16. 16. GRAPHGEN CAN DO BETTER
  17. 17. NODE MODELS WRITING THIS: (user:User:Person { _id: uuid, login: userName, password: password, email: email, prenom: firstName, nom: lastName, ddn: { dateTimeBetween: [‘’-50 years’’, ‘’-18 years’’]}} *100) IS LONG TO WRITE AND REPETITIVE IF YOU USE GRAPHGEN A LOT ( which is good in fact )
  18. 18. NODE MODELS THIS IS BETTER AND PEOPLE SAY WOW: (user:#User:#Person *100) # = Node model activation
  19. 19. NODE MODELS • #Person • #User • #Tweet • #File • #HashTag • #BlogPost • #Company • … and soon you’ll be able to create your own models in the Graphgen UI
  20. 20. TIPS & TRICKS
  21. 21. TIP 1 Fixed Value SOLUTION: randomElement with 1 element (p:Person:Administrator {group: {randomElement:[‘’ADMIN’’]}} *20)
  22. 22. GRAPHGEN THE GOOD POINTS • BASED ON CYPHER SPEC (NO NEW SYNTAX TO LEARN) • FOR EVERYBODY • PROPERTY VALUES GENERATION • IMMEDIATE VISUALISATION FEEDBACK • IMPORT WHAT YOU SEE IN YOUR DATABASE • EXPORT
  23. 23. NOT SO BAD GRAPHGEN THE BAD POINTS • YOUNG PROJECT WORKED ON IN FREE TIME (10 OCTOBER) • ADAPT TO 75% OF GRAPH MODELING POSSIBILITIES • LIMITED TO 1000 NODES IN THE WEBAPP (DUE TO THE VIZ) AND NO LIMIT IN THE CLI VERSION (well your memory could be the limit)
  24. 24. SOON IN GRAPHGEN • User Dashboard • Define your own models • Define cardinalities percentage • Define indexed and unique constraints • Public API • More export formats
  25. 25. QUESTIONS ?
  26. 26. THANK YOU  Graphgen : http://graphgen.neoxygen.io PHP components for Neo4j : https://github.com/neoxygen Follow me : @ikwattro

×