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.
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. A LOOP
FOREACH ( i in range(0,99) | CREATE (n:Person {id:i} ) )
Not non-developer friendly and no properties except the id
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 !
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. RELATIONSHIPS SYNTAX
BASEE SUR LE LANGAGE CYPHER !
-[:KNOWS {since: unixTime} *n..n ]->
type
Relationship property
key
Sample data
Provider type cardinality
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. 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
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. NODE MODELS
THIS IS BETTER AND PEOPLE SAY WOW:
(user:#User:#Person *100)
# = Node model activation
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
21. TIP 1
Fixed Value
SOLUTION: randomElement with 1 element
(p:Person:Administrator {group: {randomElement:[‘’ADMIN’’]}} *20)
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. 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. SOON IN GRAPHGEN
• User Dashboard
• Define your own models
• Define cardinalities percentage
• Define indexed and unique constraints
• Public API
• More export formats