4. Why I live where I live...
https://nl.wikipedia.org/wiki/Lijst_van_Belgische_bieren
5. Automatically put it into a Gsheet
https://docs.google.com/spreadsheets/d/1FwWxlgnOhOtrUELIzLupDFW7euqXfeh8x3BeiEY_sbI/edit#gid=0
6. Download the Gsheet as a .csv
CSV export of the automatically generated sheet
7. Import
//Import the beergraph
load csv with headers from
"https://docs.google.com/spreadsheets/d/1FwWxlgnOhOtrUELIzLup
DFW7euqXfeh8x3BeiEY_sbI/export?format=csv&id=1FwWxlgnOhOtrUEL
IzLupDFW7euqXfeh8x3BeiEY_sbI&gid=0" as csv
with csv
where csv.BeerType is not null
merge (b:BeerType {name: csv.BeerType})
with csv
where csv.BeerBrand is not null
merge (b:BeerBrand {name: csv.BeerBrand})
with csv
where csv.Brewery is not null
merge (b:Brewery {name: csv.Brewery})
with csv
where csv.AlcoholPercentage is not null
merge (b:AlcoholPercentage {value:
tofloat(replace(replace(csv.AlcoholPercentage,'%',''),',','.'
))})
with csv
match (ap:AlcoholPercentage {value:
tofloat(replace(replace(csv.AlcoholPercentage,'%',''),',','.'
))}),
(br:Brewery {name: csv.Brewery}),
(bb:BeerBrand {name: csv.BeerBrand}),
(bt:BeerType {name: csv.BeerType})
merge (bb)-[:HAS_ALCOHOLPERCENTAGE]->(ap)
merge (bb)-[:IS_A]->(bt)
merge (bb)<-[:BREWS]-(br);
//create the in-graph index
MATCH (ap:AlcoholPercentage)
WITH ap
ORDER BY ap.value ASC
WITH collect(ap) as sorted_ap
FOREACH(i in RANGE(0, size(sorted_ap)-2) |
FOREACH(sorted_ap1 in [sorted_ap[i]] |
FOREACH(sorted_ap2 in [sorted_ap[i+1]] |
MERGE (sorted_ap1)-[:PRECEDES]->(sorted_ap2))));
11. So let's explore… with BEER
• Adding a new db to an existing server
• Setting up the db
• Importing the data into that db
• Doing some queries
• Switching between databases
12. So let's protect our children from the
BIG BAD BEER
• Adding a "childreader" user
• Adding a "childreaderrole"
• Assigning privileges to the childreaderrole
• Not allowed to read AlcoholPercentages
• Not allowed to traverse AlcoholPercentages
• Explore the data, and the results
13. More info
My Blog
• Securing my Beergraph with Neo4j 4.0
• Securing a sample fraud graph with Neo4j 4.0
• Experimenting with Conflicting access privileges in Neo4j 4.0
The Awesome Neo4j Docs
• Chapter 5. Manage databases - The Neo4j Operations Manual v4.0
• 10.3. Fine-grained access control - Chapter 10. Authentication and
authorization
• Refcard 4.0