|
//Import BeerAdvocate |
|
//On my Macbook the queries take about 38secs/iteration |
|
//so 38*15 = approx 570secs = 9.5mins - APPROXIMATELY |
|
|
|
|
|
//put all the indexes in place |
|
create index on :Beer(name); |
|
|
|
create index on :Style(name); |
|
create index on :Brewery(id); |
|
create index on :Profile(name); |
|
|
|
create constraint on (b:Beer) assert b.id is unique; |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba1.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba1.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba1.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba1.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add an Anonymous profile |
|
merge (p:Profile {name:"Anonymous"}); |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba1.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
// generate the META-graph |
|
// run this after the FIRST iteration of the queries above |
|
// DO NOT run after the last iteration - it would be very slow and not add anything! |
|
|
|
MATCH (a)-[r]->(b) |
|
WITH labels(a) AS a_labels,type(r) AS rel_type,labels(b) AS b_labels |
|
UNWIND a_labels as l |
|
UNWIND b_labels as l2 |
|
MERGE (a:Meta_Node {name:l}) |
|
MERGE (b:Meta_Node {name:l2}) |
|
MERGE (a)-[:META_RELATIONSHIP {name:rel_type}]->(b) |
|
RETURN distinct l as first_node, rel_type as connected_by, l2 as second_node |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba2.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba2.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba2.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba2.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba2.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba3.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba3.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba3.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba3.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
|
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba3.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba4.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba4.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba4.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba4.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba4.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba5.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba5.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba5.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba5.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba5.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba6.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba6.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba6.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba6.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba6.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba7.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba7.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba7.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba7.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba7.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba8.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba8.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba8.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba8.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba8.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba9.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba9.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba9.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba9.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba9.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba10.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba10.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba10.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba10.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba10.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba11.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba11.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba11.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba11.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba11.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba12.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba12.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba12.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba12.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba12.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba13.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba13.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba13.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba13.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba13.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba14.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba14.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba14.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba14.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba14.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
|
|
//import beers, breweries, styles WITH ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba15.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is not null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
// takes 14s |
|
|
|
//import beers, breweries, styles WITHOUT ABV |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba15.csv" as csv fieldterminator ';' |
|
with csv where csv.beer_ABV is null |
|
merge (b:Beer {id: toInt(csv.beer_beerId)}) ON CREATE SET b.name=csv.beer_name, b.ABV=csv.beer_ABV |
|
merge (s:Style {name: csv.beer_style}) |
|
merge (br:Brewery {id: toInt(csv.beer_brewerId)}) |
|
merge (b)-[:HAS_STYLE]->(s) |
|
merge (b)<-[:BREWS]-(br); |
|
|
|
//add the reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba15.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
merge (p:Profile {name: csv.review_profileName}); |
|
// takes 16s |
|
|
|
//the query below is NO LONGER PROBLEMATIC |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba15.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is not null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |
|
// takes 13s |
|
|
|
//add the anonymous reviews |
|
using periodic commit |
|
load csv with headers from "file:/Users/rvanbruggen/Dropbox/Neo Technology/Demo/BEER/BeerAdvocate/real/ba15.csv" as csv fieldterminator ';' |
|
with csv where csv.review_profileName is null |
|
create (r:Review {taste: toFloat(csv.review_taste), appearance: toFloat(csv.review_appearance), text: csv.review_text, time: toInt(csv.review_time), aroma: toFloat(csv.review_aroma), palate: toFloat(csv.review_palate), overall: toFloat(csv.review_overall)}) |
|
with r,csv |
|
match (b:Beer {name: csv.beer_name}) |
|
match (p:Profile {name: csv.review_profileName}) |
|
create (p)-[:CREATES_REVIEW]->(r) |
|
create (r)-[:REVIEW_COVERS]->(b); |