As title states, I'm new to neo4j and cypher, but come from a python/SQL background. I have taken my data and gotten the data into the database as nodes and made a function that connects all those nodes via relationships that follow a "has_Column" relationship and am hoping to use this schema to find fraud. Fraud is already well defined in my database and the main thing I'm trying to accomplish is community detection using louvain, in hopes that I can find some high fraud communities and perhaps some fraud rings.
I've tried python and cypher solutions which both come up with different errors if someone knows what's wrong with either I'd be greatly appreciative. Python Solution:
g = gds.graph.project
(
'FirstSixGraph',
[
'App_ID', 'City', 'Email', 'Phone', 'State', 'Address', 'Monthly'
],
{
'has_City': {'orientation': 'UNDIRECTED'},
'has_Email': {'orientation': 'UNDIRECTED'},
'has_Phone': {'orientation': 'UNDIRECTED'},
'has_State': {'orientation': 'UNDIRECTED'},
'has_Address': {'orientation': 'UNDIRECTED'},
'has_Monthly': {'orientation': 'UNDIRECTED'},
},
{
}
)
This one is a bit rough it's a call that has the parameters graph_name, node_list, relationship list, and additional configs of which I have none. I've tried using unpacking this statement like the documentation says to here: https://neo4j.com/docs/graph-data-science-client/1.4/graph-object/. Unfortuneately that just results in an unpacking error, I don't know if that's a versioning issue or what but I have updated everything and checked with my boss and they have the same version with no issues using unpacking. I've also tried removing additional configs which still runs but similarly doesn't create a callable graph after the fact with the name FirstSixGraph. This causes an error that doesn't allow the louvain to run because it says the graph name doesn't exist. Secondly I tried to run this in cypher as a roundabout which is here:
CALL gds.graph.project(
'FirstSixGraph',
[
'App_ID', 'City', 'Email', 'Phone', 'State', 'Address', 'Monthly'
],
{
'has_City': {'orientation': 'UNDIRECTED'},
'has_Email': {'orientation': 'UNDIRECTED'},
'has_Phone': {'orientation': 'UNDIRECTED'},
'has_State': {'orientation': 'UNDIRECTED'},
'has_Address': {'orientation': 'UNDIRECTED'},
'has_Monthly': {'orientation': 'UNDIRECTED'},
},
{
}
)
This returns the error:
Invalid input '{': expected "+" or "-" (line 6, column 5 (offset: 141))
" {"
I'm much less certain about cypher syntax and the documentation from what I can find doesn't cover if dictionaries are allowed and if not what to replace them with. I know neo4j is built on Java so maybe my brain is just too used to python to know what needs to be changed. Thanks in advance for any help.
EDIT: Edited post to fix code blocks.