Description Usage Arguments Value Examples
Write edges among two or more types of nodes described in a data.frame to Neo4j.
1 2 3 4 5 6 7 8 9 10 11 12 | edgify_cols(
df,
a.col.name,
b.col.names,
a.unique.property = a.col.name,
b.unique.properties = "Name",
relationships_in_cypher = "--",
a.node.label = a.col.name,
b.node.labels = b.col.names,
neo.import.dir = neo.import.dir,
periodic_commit = "10000"
)
|
df |
A data.frame |
a.col.name |
col with unique ID for a |
b.col.names |
can be a character string or vector - cols with unique IDs for b |
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. |
relationships_in_cypher |
The relationships to create between the nodes, written in Cypher code. Relationships can be directed or undirected, and they can be labeled or unlabeled. Cypher is not case-sensitive.
|
a.node.label |
|
b.node.labels |
|
neo.import.dir |
The directory location of the Neo4j import folder. |
periodic_commit |
Default is "10000" rows in memory at a time. |
b.unique.property |
The name of a unique property for nodes in the second column. Eg. "Client_ID" |
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 8 9 10 11 12 | edgify_cols(
df = staff2,
a.col.name = "userPrincipalName",
b.col.names = c("Business_Unit", "Group", "Department", "City", "Office"), # plural
a.unique.property = a.col.name,
b.unique.properties = "Name", # pl
relationships_in_cypher = "-[:Works_In]->", # can be plural but defaults to unnamed relationship. If rels from a to all other are the same, enter it once.
a.node.label = "Person", # default
b.node.labels = b.col.names, # default, pl
neo.import.dir,
periodic_commit = "100000"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.