i have 5 nodes > DF1 with property (name1,value1,category1,class1),
DF2 with property (name2,value2,category2,class2),
Issue with property (issue_sev,issue_sev_value),
Risk with property (risk_sev,risk_sev_value),
Recomondation with property (reco_category,reco_sev,reco_sev_val,reco
_class,reco_type) csv file
df1 is connected to df2 with relationship1
df2 -> issuw with relationship2
issue->risk with relationship3
risk->recomondation with relationship4
Relationship_1 Df2 Name_2 Value_2 Category_2 Class_2 they have empty cells
as you can see df2 has empty cells, so df1 will directly connected to issue with relationship_2 and the problem is i cant make relationship with empty cells . Could someone help to solve this mess thanks in advance.
i tried this query but couldnt get to required o/p.
load csv with headers from "file:///test_1.csv" as row
call{
with row
with row where row.Df1 is not null
merge(n1:Data:row.Df1{Name:row.Name_1,Value:row.Value_1,Category:row.Category_1,class:row.Class_1})
}
call{
with row
with row where row.Df2 is not null
merge(n2:Data:row.Df2{Name:row.Name_2,Value:row.Value_2,Category:row.Category_2,class:row.Class_2})
}
call{
with row
with row where row.Issue is not null
with row where row.Issue_Sevirity_Value is not null
merge(n3:row.issue{issue:row.Issue_Sevirity,isseVal:row.Issue_Sevirity_Value})
}
call{
with row
with row where row.RiskEntity is not null
merge(n4:risk:row.Risk{risk:row.Risk_Severity, riskSev:row.Risk_Severity_Value})
}
call{
with row
with row where row.Recommendation is not null
merge(n5:reco:row.Recommendation{reco:row.Reco_Category,recoSev:row.Reco_Severity,recVal:row.Reco_severity_value,recClass:row.Reco_Class})
}
call{
with row
with row where row.Df1 is not null and row.Df2 is not null
match(n1:Data:row.Df1{Name:row.Name_1,Value:row.Value_1,Category:row.Category_1,class:row.Class_1},(n2:Data:row.Df2{Name:row.Name_2,Value:row.Value_2,Category:row.Category_2,class:row.Class_2})
CALL apoc.create.relationship(n1, row.Relationship_1,{}, n2) yield rel
return rel
}
return rel
error -Invalid input '.': expected ")", "WHERE", "{" or a parameter (line 5, column 22 (offset: 135))
" merge(n1:Data:row.Df1{Name:row.Name_1,Value:row.Value_1,Category:row.Category_1,class:row.Class_1})"
load csv with headers from "file:///test_1.csv" as row
call{
with row
with row where row.Df1 is not null
merge(n1:Person{Data:row.Df1,Name:row.Name_1,Value:row.Value_1,Category:row.Category_1,class:row.Class_1})
}
call{
with row
with row where row.Df2 is not null
merge(n2:Person{Data:row.Df2,Name:row.Name_2,Value:row.Value_2,Category:row.Category_2,class:row.Class_2})
}
call{
with row
with row where row.Issue is not null
with row where row.Issue_Sevirity_Value is not null
merge(n3:person{Data:row.Issue,issue:row.Issue_Sevirity,isseVal:row.Issue_Sevirity_Value})
}
call{
with row
with row where row.RiskEntity is not null
merge(n4:person{Data:row.Risk_Entity,risk:row.Risk_Severity, riskSev:row.Risk_Severity_Value})
}
call{
with row
with row where row.Recommendation is not null
merge(n5:person{Data:row.Recommendation,reco:row.Reco_Category,recoSev:row.Reco_Severity,recVal:row.Reco_severity_value,recClass:row.Reco_Class})
}
call{
with row
with row where row.Df1 is not null and row.Df2 is not null
match(n1:Person{Data:row.Df1,Name:row.Name_1,Value:row.Value_1,Category:row.Category_1,class:row.Class_1}), (n2{Data:row.Df1,Name:row.Name_2,Value:row.Value_2,Category:row.Category_2,class:row.Class_2})
CALL apoc.create.relationship(n1, row.Relationship_1,{}, n2) yield rel
return rel
}
return rel
couldnt get required o/p, by the way i'm stuck here could you please make it right?
Check your query as I find some issues especially the row.column name. The column names are not matching with the csv file headers. Also, some row values have blank spaces and these needs to be taken care of. These are my findings so far and will try to update more tomorrow.