Description Usage Arguments Details Value Examples
Write a data.frame of edges/relationships to Neo4j.
1 2 3 4 5 6 7 8 | load_edges_to_neo4j(
df.with.labels.as.colnames,
a.unique.poperty,
b.unique.poperty,
relationship_in_cypher,
neo.import.dir,
periodic_commit = "10000"
)
|
df.with.labels.as.colnames |
A data.frame of two columns, with node labels as column names. Eg. "Client". It's ok for both columns to have the same name if they are the same kind of node. If a column is unnamed, I ~think~ it will match a node of any label with the unique property value you define. |
relationship_in_cypher |
The relationship to create between the nodes in the first and second columns, written in Cypher code. Relationships can be directed or undirected, and they can be labeled or unlabeled. Cypher is not case-sensitive.
NOTE: Only one relationship label can be defined at a time. eg. if everyone in columns A and B have met and each pair likes the other, run the function once with "-:Has_Met-" and run it a second time with "-:Likes-" ~ I hope to add a column for edge weights or other variable properties in the next version. |
neo.import.dir |
The directory location of the Neo4j import folder. |
a.unique.property |
The name of a unique property for nodes in the first column. Eg. "Client_ID". Use the name of the unique property exactly as you defined it when you created the nodes. |
b.unique.property |
The name of a unique property for nodes in the second column. Eg. "Client_ID" |
This function allows you to write a data.frame of edges/relationships to connect nodes in Neo4j.
Note: The column names of the df must identify the label(s) for the type(s) of nodes you are connecting, but the contents of the columns are unique ID values.
For exammple, the first column might be named "Person" and the values in that column are the value you defined using Unique_ID_col when creating the nodes (See: ?load_df_to_neo4j).
The function writes a .csv file in your Neo4j database import directory, then loads the data to Neo4j. Once done, the .csv file is no longer needed, and it will be overwritten the next time the function is used.
1 2 3 4 5 6 7 | load_edges_to_neo4j(
df,
a.unique.property = "Customer_ID",
b.unique.property = "Item_SKU",
relationship_in_cypher = "-[:PURCHASED]->"
)
# eg. The df might be two columns named "Customer" and "Product" if those are your node labels
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.