graph database prototyping made easy with graphgen

26
GRAPHGEN GraphDB Prototyping made easy #FOSDEM 31-01-2015 graphgen.neoxygen.io

Upload: christophe-willemsen

Post on 12-Apr-2017

997 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Graph Database Prototyping made easy with Graphgen

GRAPHGENGraphDB Prototyping made easy

#FOSDEM31-01-2015

graphgen.neoxygen.io

Page 2: Graph Database Prototyping made easy with Graphgen

#whoami

Christophe WillemsenSoftware Engineer

Neo4j Consultant

World’s #1Neo4j consultancy

@graph_awaregraphaware.com

@ikwattro

Page 3: Graph Database Prototyping made easy with Graphgen

WHY GRAPHGEN ?QUICK OVERVIEW ABOUT THE NEO4J NATIVE TOOLS

TO BUILD A GRAPH

Page 4: Graph Database Prototyping made easy with Graphgen

BY HANDCREATE (n:Person {firstname: ‘Roger’, lastname:’Laguadec’})

100XFor 100 nodes and you need to be really inventive

for the node properties

Page 5: Graph Database Prototyping made easy with Graphgen

A LOOPFOREACH ( i in range(0,99) | CREATE (n:Person

{id:i} ) )Not non-developer friendly and no properties except the id

Page 6: Graph Database Prototyping made easy with Graphgen

LOAD CSVUSING 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 !

Page 7: Graph Database Prototyping made easy with Graphgen

GRAPH MODEL DECISIONS

Page 8: Graph Database Prototyping made easy with Graphgen

GRAPH MODEL DECISIONS

Page 9: Graph Database Prototyping made easy with Graphgen

WITH GRAPHGEN THEN ?(p:Person {firstname: firstName, lastname:

lastName} *100)(p)-[:KNOWS *n..n]->(p)

100 NODES

REAL VALUES

Many 2 ManyRelationships

At 80%

Page 10: Graph Database Prototyping made easy with Graphgen

DEMO 1

Page 11: Graph Database Prototyping made easy with Graphgen

NODES SYNTAXBASED OFF THE AMAZING CYPHER QUERY LANGUAGE!

(p:Person {firstname: firstName} *100 )

identifierlabel

Node property key

Sample dateprovider type amount

Page 12: Graph Database Prototyping made easy with Graphgen

RELATIONSHIPS SYNTAXBASEE SUR LE LANGAGE CYPHER !

-[:KNOWS {since: unixTime} *n..n ]->

type

Relationship propertykey

Sample dataProvider type cardinality

Page 13: Graph Database Prototyping made easy with Graphgen

PROPERTY PARAMETERSE.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

Page 14: Graph Database Prototyping made easy with Graphgen

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

Page 15: Graph Database Prototyping made easy with Graphgen

DEMO 2

Page 16: Graph Database Prototyping made easy with Graphgen

GRAPHGEN CAN DO BETTER

Page 17: Graph Database Prototyping made easy with Graphgen

NODE MODELSWRITING 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 )

Page 18: Graph Database Prototyping made easy with Graphgen

NODE MODELSTHIS IS BETTER AND PEOPLE SAY WOW:

(user:#User:#Person *100)

# = Node model activation

Page 19: Graph Database Prototyping made easy with Graphgen

NODE MODELS

• #Person• #User• #Tweet• #File• #HashTag• #BlogPost• #Company• … and soon you’ll be able to create your own models in

the Graphgen UI

Page 20: Graph Database Prototyping made easy with Graphgen

TIPS & TRICKS

Page 21: Graph Database Prototyping made easy with Graphgen

TIP 1Fixed Value

SOLUTION: randomElement with 1 element

(p:Person:Administrator {group: {randomElement:[‘’ADMIN’’]}} *20)

Page 22: Graph Database Prototyping made easy with Graphgen

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

Page 23: Graph Database Prototyping made easy with Graphgen

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)

Page 24: Graph Database Prototyping made easy with Graphgen

SOON IN GRAPHGEN

• User Dashboard • Define your own models• Define cardinalities percentage • Define indexed and unique constraints• Public API• More export formats

Page 25: Graph Database Prototyping made easy with Graphgen

QUESTIONS ?

Page 26: Graph Database Prototyping made easy with Graphgen

THANK YOU Graphgen : http://graphgen.neoxygen.io

PHP components for Neo4j : https://github.com/neoxygen

Follow me : @ikwattro